Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsMarker Class Reference

2D marker class. More...

Inheritance diagram for OnlineMapsMarker:
OnlineMapsMarkerBase IOnlineMapsInteractiveElement

Public Member Functions

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

Public Attributes

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

Properties

Color32[] colors [get]
 Gets the marker colors.
 
override bool enabled [set]
 Gets or sets marker enabled.
 
int height [get]
 Gets the marker height.
 
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.
 
float rotation [get, set]
 Gets or sets the rotation of the marker (0-1).
 
float rotationDegree [get, set]
 Gets or sets the rotation of the marker in degree (0-360)
 
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.
 
Texture2D texture [get, set]
 Texture marker.
Texture format: ARGB32.
Must enable "Read / Write enabled".
After changing the texture you need to call OnlineMapsMarker.Init.
 
int width [get]
 Gets the marker width.
 
- Properties inherited from OnlineMapsMarkerBase
Dictionary< string, object > customFields [get]
 Get customFields dictionary.
 
virtual bool enabled [get, set]
 Gets or sets marker enabled.
 
bool isDraggable [get, set]
 Makes the marker draggable or un draggable.
 
IOnlineMapsInteractiveElementManager manager [get, set]
 Reference to Marker Manager.
 
Vector2 position [get, set]
 Marker coordinates.
 
virtual float scale [get, set]
 Scale of marker.
 
virtual bool inMapView [get]
 Checks to display marker in current map view.
 
object this[string key] [get, set]
 Get or set a value in the customFields dictionary by key.
 

Additional Inherited Members

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

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.

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.

◆ 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.

◆ width

int OnlineMapsMarker.width
get

Gets the marker width.

The width.