Online Maps  v3
OnlineMapsDrawingElement Class Reference

Class implements the basic functionality of drawing on the map. More...

Inheritance diagram for OnlineMapsDrawingElement:
IOnlineMapsInteractiveElement OnlineMapsDrawingLine OnlineMapsDrawingPoly OnlineMapsDrawingRect

Public Member Functions

virtual void DestroyInstance ()
 Destroys the instance of the drawing element. More...
 
void Dispose ()
 Dispose drawing element. More...
 
virtual void Draw (Color32[] buffer, Vector2 bufferPosition, int bufferWidth, int bufferHeight, float zoom, bool invertY=false)
 Draw element on the map. More...
 
virtual void DrawOnTileset (OnlineMapsTileSetControl control, int index)
 Draws element on a specified TilesetControl. More...
 
virtual bool HitTest (Vector2 positionLngLat, int zoom)
 Determines if the drawing element at the specified coordinates. More...
 
virtual bool Validate ()
 Validate drawing element. More...
 

Static Public Member Functions

static void MarkChanged ()
 It marks the elements changed.
It is used for the Drawing API as an overlay. More...
 

Public Attributes

Action< OnlineMapsDrawingElementOnClick
 Events that occur when user click on the drawing element. More...
 
Action< OnlineMapsDrawingElementOnDoubleClick
 Events that occur when user double click on the drawing element. More...
 
Action< OnlineMapsDrawingElementOnDrawTooltip
 Event caused to draw tooltip. More...
 
Action< OnlineMapsDrawingElement, Renderer > OnInitMesh
 Event that occur when tileset initializes a mesh. More...
 
Action< OnlineMapsDrawingElementOnLongPress
 Events that occur when user long press on the drawing element. More...
 
Action< OnlineMapsDrawingElementOnPress
 Events that occur when user press on the drawing element. More...
 
Action< OnlineMapsDrawingElementOnRelease
 Events that occur when user release on the drawing element. More...
 
bool checkMapBoundaries = true
 Need to check the map boundaries?
It allows you to make drawing element, which are active outside the map.
More...
 
OnlineMapsRange range
 Zoom range, in which the drawing element will be displayed. More...
 
string tooltip
 Tooltip that is displayed when user hover on the drawing element. More...
 
float yOffset = 0
 The local Y position for the GameObject on Tileset. More...
 

Static Public Attributes

static Action< OnlineMapsDrawingElementOnElementDrawTooltip
 Default event caused to draw tooltip. More...
 

Properties

object? this[string key] [get, set]
 Gets or sets custom data by key. More...
 
virtual bool active [get, set]
 Gets or sets the active state of the drawing element GameObject. More...
 
abstract bool createBackgroundMaterial [get]
 Creates a background material for the drawing element. More...
 
Dictionary< string, object > customFields [get]
 Gets custom fields. More...
 
virtual OnlineMapsVector2d center [get]
 Center point of the drawing element. More...
 
virtual string defaultName [get]
 Default name of the drawing element. More...
 
OnlineMapsElevationManagerBase elevationManager [get]
 Gets the elevation manager. More...
 
bool hasElevation [get]
 Checks if the elevation is used. More...
 
GameObject instance [get]
 Instance of the drawing element. More...
 
IOnlineMapsInteractiveElementManager? manager [get, set]
 Reference to DrawingElementManager. More...
 
string name [get, set]
 Gets or sets the name of the drawing element. More...
 
int renderQueueOffset [get, set]
 Gets or sets the render queue offset. More...
 
virtual bool splitToPieces [get]
 Should the drawing element be split into pieces? More...
 
virtual bool visible [get, set]
 Gets or sets the visibility of the drawing element. More...
 

Detailed Description

Class implements the basic functionality of drawing on the map.

Member Function Documentation

◆ DestroyInstance()

virtual void OnlineMapsDrawingElement.DestroyInstance ( )
virtual

Destroys the instance of the drawing element.

Implements IOnlineMapsInteractiveElement.

◆ Dispose()

void OnlineMapsDrawingElement.Dispose ( )

Dispose drawing element.

Implements IOnlineMapsInteractiveElement.

◆ Draw()

virtual void OnlineMapsDrawingElement.Draw ( Color32[]  buffer,
Vector2  bufferPosition,
int  bufferWidth,
int  bufferHeight,
float  zoom,
bool  invertY = false 
)
virtual

Draw element on the map.

Parameters
bufferBackbuffer
bufferPositionBackbuffer position
bufferWidthBackbuffer width
bufferHeightBackbuffer height
zoomZoom of the map
invertYInvert Y direction

Reimplemented in OnlineMapsDrawingRect, OnlineMapsDrawingPoly, and OnlineMapsDrawingLine.

◆ DrawOnTileset()

virtual void OnlineMapsDrawingElement.DrawOnTileset ( OnlineMapsTileSetControl  control,
int  index 
)
virtual

Draws element on a specified TilesetControl.

Parameters
controlReference to tileset control.
indexIndex of drawing element

Reimplemented in OnlineMapsDrawingRect, OnlineMapsDrawingPoly, and OnlineMapsDrawingLine.

◆ HitTest()

virtual bool OnlineMapsDrawingElement.HitTest ( Vector2  positionLngLat,
int  zoom 
)
virtual

Determines if the drawing element at the specified coordinates.

Parameters
positionLngLatPosition.
zoomThe zoom.
Returns
True if the drawing element in position, false if not.

Reimplemented in OnlineMapsDrawingRect, OnlineMapsDrawingPoly, and OnlineMapsDrawingLine.

◆ MarkChanged()

static void OnlineMapsDrawingElement.MarkChanged ( )
static

It marks the elements changed.
It is used for the Drawing API as an overlay.

◆ Validate()

virtual bool OnlineMapsDrawingElement.Validate ( )
virtual

Validate drawing element.

Returns
The result of validation.

Reimplemented in OnlineMapsDrawingRect, OnlineMapsDrawingPoly, and OnlineMapsDrawingLine.

Member Data Documentation

◆ checkMapBoundaries

bool OnlineMapsDrawingElement.checkMapBoundaries = true

Need to check the map boundaries?
It allows you to make drawing element, which are active outside the map.

◆ OnClick

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnClick

Events that occur when user click on the drawing element.

◆ OnDoubleClick

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnDoubleClick

Events that occur when user double click on the drawing element.

◆ OnDrawTooltip

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnDrawTooltip

Event caused to draw tooltip.

◆ OnElementDrawTooltip

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnElementDrawTooltip
static

Default event caused to draw tooltip.

◆ OnInitMesh

Action<OnlineMapsDrawingElement, Renderer> OnlineMapsDrawingElement.OnInitMesh

Event that occur when tileset initializes a mesh.

◆ OnLongPress

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnLongPress

Events that occur when user long press on the drawing element.

◆ OnPress

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnPress

Events that occur when user press on the drawing element.

◆ OnRelease

Action<OnlineMapsDrawingElement> OnlineMapsDrawingElement.OnRelease

Events that occur when user release on the drawing element.

◆ range

OnlineMapsRange OnlineMapsDrawingElement.range

Zoom range, in which the drawing element will be displayed.

◆ tooltip

string OnlineMapsDrawingElement.tooltip

Tooltip that is displayed when user hover on the drawing element.

◆ yOffset

float OnlineMapsDrawingElement.yOffset = 0

The local Y position for the GameObject on Tileset.

Property Documentation

◆ active

virtual bool OnlineMapsDrawingElement.active
getsetprotected

Gets or sets the active state of the drawing element GameObject.

◆ center

virtual OnlineMapsVector2d OnlineMapsDrawingElement.center
get

Center point of the drawing element.

◆ createBackgroundMaterial

abstract bool OnlineMapsDrawingElement.createBackgroundMaterial
getprotected

Creates a background material for the drawing element.

◆ customFields

Dictionary<string, object> OnlineMapsDrawingElement.customFields
get

Gets custom fields.

◆ defaultName

virtual string OnlineMapsDrawingElement.defaultName
getprotected

Default name of the drawing element.

◆ elevationManager

OnlineMapsElevationManagerBase OnlineMapsDrawingElement.elevationManager
getprotected

Gets the elevation manager.

◆ hasElevation

bool OnlineMapsDrawingElement.hasElevation
getprotected

Checks if the elevation is used.

◆ instance

GameObject OnlineMapsDrawingElement.instance
get

Instance of the drawing element.

◆ manager

IOnlineMapsInteractiveElementManager? OnlineMapsDrawingElement.manager
getset

Reference to DrawingElementManager.

◆ name

string OnlineMapsDrawingElement.name
getset

Gets or sets the name of the drawing element.

◆ renderQueueOffset

int OnlineMapsDrawingElement.renderQueueOffset
getset

Gets or sets the render queue offset.

◆ splitToPieces

virtual bool OnlineMapsDrawingElement.splitToPieces
getprotected

Should the drawing element be split into pieces?

◆ this[string key]

object? OnlineMapsDrawingElement.this[string key]
getset

Gets or sets custom data by key.

Parameters
keyKey

◆ visible

virtual bool OnlineMapsDrawingElement.visible
getset

Gets or sets the visibility of the drawing element.