Online Maps  v3
OnlineMapsMarker Class Reference

2D marker class. More...

Inheritance diagram for OnlineMapsMarker:
OnlineMapsMarkerBase IOnlineMapsInteractiveElement

Public Member Functions

OnlineMapsVector2i GetAlignedPosition (OnlineMapsVector2i pos)
 Gets aligned position. More...
 
OnlineMapsVector2i GetAlignedPosition (int px, int py)
 Gets aligned position. More...
 
OnlineMapsVector2i GetAlignOffset ()
 Gets aligned offset (in pixels). More...
 
bool HitTest (Vector2 coordinates, int zoom)
 Determines if the marker at the specified coordinates. More...
 
void Init (int? width=null, int? height=null)
 Initializes this marker. More...
 
override void LookToCoordinates (OnlineMapsVector2d coordinates)
 Turns the marker in the direction specified coordinates More...
 
- Public Member Functions inherited from OnlineMapsMarkerBase
virtual void Dispose ()
 Disposes marker More...
 
Get< T > (string key)
 Gets the value from the customFields dictionary by key. More...
 
void GetPosition (out double lng, out double lat)
 Gets location of marker. More...
 
void GetTilePosition (out double px, out double py)
 Get tile position of the marker More...
 
void GetTilePosition (out double px, out double py, int zoom)
 Get tile position of the marker More...
 
void GetTilePosition (int zoom, out double px, out double py)
 Get tile position of the marker More...
 
bool InMapView ()
 Checks if the marker is in the current map view More...
 
void LookToCoordinates (double longitude, double latitude)
 Turns the marker in the direction specified coordinates More...
 
void SetPosition (double lng, double lat)
 Set location of marker More...
 
void SetDraggable (bool value=true)
 Makes the marker draggable or un draggable More...
 
virtual void Update ()
 Update of marker instance. More...
 
virtual void Update (double tlx, double tly, double brx, double bry, int zoom)
 Method that called when need update marker. More...
 

Public Attributes

OnlineMapsAlign align = OnlineMapsAlign.Bottom
 Marker texture align. More...
 
bool locked
 Specifies to OnlineMapsBuffer that the marker is available for drawing.
Please do not use. More...
 
Rect markerColliderRect = new Rect(-0.5f, -0.5f, 1, 1)
 Relative area of activity of the marker. More...
 
- Public Attributes inherited from OnlineMapsMarkerBase
Action< OnlineMapsMarkerBaseOnClick
 Events that occur when user click on the marker. More...
 
Action< OnlineMapsMarkerBaseOnDoubleClick
 Events that occur when user double click on the marker. More...
 
Action< OnlineMapsMarkerBaseOnDrag
 Events that occur when user drag the marker. More...
 
Action< OnlineMapsMarkerBaseOnDrawTooltip
 Event caused to draw tooltip. More...
 
Action< OnlineMapsMarkerBaseOnEnabledChange
 Event occurs when the marker enabled change. More...
 
Action< OnlineMapsMarkerBaseOnInitComplete
 Event occurs when the marker is initialized. More...
 
Action< OnlineMapsMarkerBaseOnLongPress
 Events that occur when user long press on the marker. More...
 
Action< OnlineMapsMarkerBaseOnPress
 Events that occur when user press on the marker. More...
 
Action< OnlineMapsMarkerBaseOnPositionChanged
 Event that occurs when the marker position changed. More...
 
Action< OnlineMapsMarkerBaseOnRelease
 Events that occur when user release on the marker. More...
 
Action< OnlineMapsMarkerBaseOnRollOut
 Events that occur when user roll out marker. More...
 
Action< OnlineMapsMarkerBaseOnRollOver
 Events that occur when user roll over marker. More...
 
string label = ""
 Marker label. More...
 
OnlineMapsRange range
 Zoom range, in which the marker will be displayed. More...
 
List< string > tags
 List of tags. More...
 

Properties

Color32[] colors [get]
 Gets the marker colors. More...
 
override bool enabled [set]
 Gets or sets marker enabled. More...
 
int height [get]
 Gets the marker height. More...
 
Rect realScreenRect [get]
 Area of ​​the screen, which is a marker after map will be redrawed. Note: When used as a source display Texture or Tileset, is not returned the correct value. More...
 
float rotation [get, set]
 Gets or sets the rotation of the marker (0-1). More...
 
float rotationDegree [get, set]
 Gets or sets the rotation of the marker in degree (0-360) More...
 
Rect screenRect [get]
 Area of ​​the screen, which is a marker at the current map display. Note: When used as a source display Texture or Tileset, is not returned the correct value. More...
 
Texture2D texture [get, set]
 Texture marker.
Texture format: ARGB32.
Must enable "Read / Write enabled".
After changing the texture you need to call OnlineMapsMarker.Init. More...
 
int width [get]
 Gets the marker width. More...
 
- Properties inherited from OnlineMapsMarkerBase
Dictionary< string, object > customFields [get]
 Get customFields dictionary. More...
 
virtual bool enabled [get, set]
 Gets or sets marker enabled. More...
 
bool isDraggable [get, set]
 Makes the marker draggable or un draggable More...
 
IOnlineMapsInteractiveElementManager? manager [get, set]
 Reference to Marker Manager More...
 
Vector2 position [get, set]
 Marker coordinates. More...
 
virtual float scale [get, set]
 Scale of marker. More...
 
virtual bool inMapView [get]
 Checks to display marker in current map view. More...
 
object? this[string key] [get, set]
 Get or set a value in the customFields dictionary by key. More...
 

Additional Inherited Members

- Static Public Attributes inherited from OnlineMapsMarkerBase
static Action< OnlineMapsMarkerBaseOnMarkerDrawTooltip
 Default event caused to draw tooltip. More...
 

Detailed Description

2D marker class.

Member Function Documentation

◆ GetAlignedPosition() [1/2]

OnlineMapsVector2i OnlineMapsMarker.GetAlignedPosition ( int  px,
int  py 
)

Gets aligned position.

Parameters
pxBuffer position X
pyBuffer position Y
Returns
The aligned buffer position.

◆ GetAlignedPosition() [2/2]

OnlineMapsVector2i OnlineMapsMarker.GetAlignedPosition ( OnlineMapsVector2i  pos)

Gets aligned position.

Parameters
posBuffer position.
Returns
The aligned buffer position.

◆ GetAlignOffset()

OnlineMapsVector2i OnlineMapsMarker.GetAlignOffset ( )

Gets aligned offset (in pixels).

Returns
Aligned offset.

◆ HitTest()

bool OnlineMapsMarker.HitTest ( Vector2  coordinates,
int  zoom 
)

Determines if the marker at the specified coordinates.

Parameters
coordinatesCoordinate (X - Longitude, Y - Latitude).
zoomThe zoom.
Returns
True if the marker in position, false if not.

◆ Init()

void OnlineMapsMarker.Init ( int?  width = null,
int?  height = null 
)

Initializes this marker.

Parameters
widthWidth of the marker texture.
heightHeight of the marker texture.

◆ LookToCoordinates()

override void OnlineMapsMarker.LookToCoordinates ( OnlineMapsVector2d  coordinates)
virtual

Turns the marker in the direction specified coordinates

Parameters
coordinatesThe coordinates

Reimplemented from OnlineMapsMarkerBase.

Member Data Documentation

◆ align

OnlineMapsAlign OnlineMapsMarker.align = OnlineMapsAlign.Bottom

Marker texture align.

◆ locked

bool OnlineMapsMarker.locked

Specifies to OnlineMapsBuffer that the marker is available for drawing.
Please do not use.

◆ markerColliderRect

Rect OnlineMapsMarker.markerColliderRect = new Rect(-0.5f, -0.5f, 1, 1)

Relative area of activity of the marker.

Property Documentation

◆ colors

Color32 [] OnlineMapsMarker.colors
get

Gets the marker colors.

The colors.

◆ enabled

override bool OnlineMapsMarker.enabled
set

Gets or sets marker enabled.

true if enabled, false if not.

◆ height

int OnlineMapsMarker.height
get

Gets the marker height.

The height.

◆ realScreenRect

Rect OnlineMapsMarker.realScreenRect
get

Area of ​​the screen, which is a marker after map will be redrawed. Note: When used as a source display Texture or Tileset, is not returned the correct value.

Marker rectangle.

◆ rotation

float OnlineMapsMarker.rotation
getset

Gets or sets the rotation of the marker (0-1).

The rotation.

◆ rotationDegree

float OnlineMapsMarker.rotationDegree
getset

Gets or sets the rotation of the marker in degree (0-360)

◆ screenRect

Rect OnlineMapsMarker.screenRect
get

Area of ​​the screen, which is a marker at the current map display. Note: When used as a source display Texture or Tileset, is not returned the correct value.

Marker rectangle.

◆ texture

Texture2D OnlineMapsMarker.texture
getset

Texture marker.
Texture format: ARGB32.
Must enable "Read / Write enabled".
After changing the texture you need to call OnlineMapsMarker.Init.

◆ width

int OnlineMapsMarker.width
get

Gets the marker width.

The width.