Online Maps  v3
OnlineMapsDrawingRect Class Reference

Class that draws a rectangle on the map. More...

Inheritance diagram for OnlineMapsDrawingRect:
OnlineMapsDrawingElement IOnlineMapsInteractiveElement

Public Member Functions

 OnlineMapsDrawingRect (double x, double y, double width, double height)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (OnlineMapsVector2d position, OnlineMapsVector2d size)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (Rect rect)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (double x, double y, double width, double height, Color borderColor)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (OnlineMapsVector2d position, OnlineMapsVector2d size, Color borderColor)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (Rect rect, Color borderColor)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (double x, double y, double width, double height, Color borderColor, float borderWidth)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (OnlineMapsVector2d position, OnlineMapsVector2d size, Color borderColor, float borderWidth)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (Rect rect, Color borderColor, float borderWidth)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (double x, double y, double width, double height, Color borderColor, float borderWidth, Color backgroundColor)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (OnlineMapsVector2d position, OnlineMapsVector2d size, Color borderColor, float borderWidth, Color backgroundColor)
 Creates a new rectangle. More...
 
 OnlineMapsDrawingRect (Rect rect, Color borderColor, float borderWidth, Color backgroundColor)
 Creates a new rectangle. More...
 
override void Draw (Color32[] buffer, Vector2 bufferPosition, int bufferWidth, int bufferHeight, float zoom, bool invertY=false)
 Draw element on the map. More...
 
override void DrawOnTileset (OnlineMapsTileSetControl control, int index)
 Draws element on a specified TilesetControl. More...
 
override bool HitTest (Vector2 positionLngLat, int zoom)
 Determines if the drawing element at the specified coordinates. More...
 
override bool Validate ()
 Validate drawing element. More...
 
- Public Member Functions inherited from OnlineMapsDrawingElement
virtual void DestroyInstance ()
 Destroys the instance of the drawing element. More...
 
void Dispose ()
 Dispose drawing element. More...
 

Properties

override OnlineMapsVector2d center [get]
 Center point of the rectangle. More...
 
Color backgroundColor [get, set]
 Background color of the rectangle. More...
 
Texture2D backgroundTexture [get, set]
 Background texture of the rectangle. Currently works only for Tileset. For this to work correctly, also set backgroundColor. More...
 
Color borderColor [get, set]
 Border color of the rectangle. More...
 
float borderWidth [get, set]
 Border width of the rectangle. More...
 
double width [get, set]
 Gets or sets the width of the rectangle. Geographic coordinates. More...
 
double height [get, set]
 Gets or sets the height of the rectangle. Geographic coordinates. More...
 
double x [get, set]
 Gets or sets the x position of the rectangle. Geographic coordinates. More...
 
double y [get, set]
 Gets or sets the y position of the rectangle. Geographic coordinates. More...
 
OnlineMapsVector2d topLeft [get, set]
 Coordinates of top-left corner. More...
 
OnlineMapsVector2d topRight [get, set]
 Coordinates of top-right corner. More...
 
OnlineMapsVector2d bottomLeft [get, set]
 Coordinates of bottom-left corner. More...
 
OnlineMapsVector2d bottomRight [get, set]
 Coordinates of bottom-right corner. More...
 
- Properties inherited from OnlineMapsDrawingElement
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from OnlineMapsDrawingElement
static void MarkChanged ()
 It marks the elements changed.
It is used for the Drawing API as an overlay. More...
 
- Public Attributes inherited from OnlineMapsDrawingElement
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 inherited from OnlineMapsDrawingElement
static Action< OnlineMapsDrawingElementOnElementDrawTooltip
 Default event caused to draw tooltip. More...
 

Detailed Description

Class that draws a rectangle on the map.

Constructor & Destructor Documentation

◆ OnlineMapsDrawingRect() [1/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( double  x,
double  y,
double  width,
double  height 
)

Creates a new rectangle.

Parameters
xPosition X. Geographic coordinates.
yPosition Y. Geographic coordinates.
widthWidth. Geographic coordinates.
heightHeight. Geographic coordinates.

◆ OnlineMapsDrawingRect() [2/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( OnlineMapsVector2d  position,
OnlineMapsVector2d  size 
)

Creates a new rectangle.

Parameters
positionThe position of the rectangle. Geographic coordinates.
sizeThe size of the rectangle. Geographic coordinates.

◆ OnlineMapsDrawingRect() [3/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( Rect  rect)

Creates a new rectangle.

Parameters
rectRectangle. Geographic coordinates.

◆ OnlineMapsDrawingRect() [4/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( double  x,
double  y,
double  width,
double  height,
Color  borderColor 
)

Creates a new rectangle.

Parameters
xPosition X. Geographic coordinates.
yPosition Y. Geographic coordinates.
widthWidth. Geographic coordinates.
heightHeight. Geographic coordinates.
borderColorBorder color.

◆ OnlineMapsDrawingRect() [5/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( OnlineMapsVector2d  position,
OnlineMapsVector2d  size,
Color  borderColor 
)

Creates a new rectangle.

Parameters
positionThe position of the rectangle. Geographic coordinates.
sizeThe size of the rectangle. Geographic coordinates.
borderColorBorder color.

◆ OnlineMapsDrawingRect() [6/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( Rect  rect,
Color  borderColor 
)

Creates a new rectangle.

Parameters
rectRectangle. Geographic coordinates.
borderColorBorder color.

◆ OnlineMapsDrawingRect() [7/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( double  x,
double  y,
double  width,
double  height,
Color  borderColor,
float  borderWidth 
)

Creates a new rectangle.

Parameters
xPosition X. Geographic coordinates.
yPosition Y. Geographic coordinates.
widthWidth. Geographic coordinates.
heightHeight. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.

◆ OnlineMapsDrawingRect() [8/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( OnlineMapsVector2d  position,
OnlineMapsVector2d  size,
Color  borderColor,
float  borderWidth 
)

Creates a new rectangle.

Parameters
positionThe position of the rectangle. Geographic coordinates.
sizeThe size of the rectangle. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.

◆ OnlineMapsDrawingRect() [9/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( Rect  rect,
Color  borderColor,
float  borderWidth 
)

Creates a new rectangle.

Parameters
rectRectangle. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.

◆ OnlineMapsDrawingRect() [10/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( double  x,
double  y,
double  width,
double  height,
Color  borderColor,
float  borderWidth,
Color  backgroundColor 
)

Creates a new rectangle.

Parameters
xPosition X. Geographic coordinates.
yPosition Y. Geographic coordinates.
widthWidth. Geographic coordinates.
heightHeight. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.
backgroundColorBackground color.

◆ OnlineMapsDrawingRect() [11/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( OnlineMapsVector2d  position,
OnlineMapsVector2d  size,
Color  borderColor,
float  borderWidth,
Color  backgroundColor 
)

Creates a new rectangle.

Parameters
positionThe position of the rectangle. Geographic coordinates.
sizeThe size of the rectangle. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.
backgroundColorBackground color.

◆ OnlineMapsDrawingRect() [12/12]

OnlineMapsDrawingRect.OnlineMapsDrawingRect ( Rect  rect,
Color  borderColor,
float  borderWidth,
Color  backgroundColor 
)

Creates a new rectangle.

Parameters
rectRectangle. Geographic coordinates.
borderColorBorder color.
borderWidthBorder width.
backgroundColorBackground color.

Member Function Documentation

◆ Draw()

override void OnlineMapsDrawingRect.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 from OnlineMapsDrawingElement.

◆ DrawOnTileset()

override void OnlineMapsDrawingRect.DrawOnTileset ( OnlineMapsTileSetControl  control,
int  index 
)
virtual

Draws element on a specified TilesetControl.

Parameters
controlReference to tileset control.
indexIndex of drawing element

Reimplemented from OnlineMapsDrawingElement.

◆ HitTest()

override bool OnlineMapsDrawingRect.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 from OnlineMapsDrawingElement.

◆ Validate()

override bool OnlineMapsDrawingRect.Validate ( )
virtual

Validate drawing element.

Returns
The result of validation.

Reimplemented from OnlineMapsDrawingElement.

Property Documentation

◆ backgroundColor

Color OnlineMapsDrawingRect.backgroundColor
getset

Background color of the rectangle.

◆ backgroundTexture

Texture2D OnlineMapsDrawingRect.backgroundTexture
getset

Background texture of the rectangle. Currently works only for Tileset. For this to work correctly, also set backgroundColor.

◆ borderColor

Color OnlineMapsDrawingRect.borderColor
getset

Border color of the rectangle.

◆ borderWidth

float OnlineMapsDrawingRect.borderWidth
getset

Border width of the rectangle.

◆ bottomLeft

OnlineMapsVector2d OnlineMapsDrawingRect.bottomLeft
getset

Coordinates of bottom-left corner.

◆ bottomRight

OnlineMapsVector2d OnlineMapsDrawingRect.bottomRight
getset

Coordinates of bottom-right corner.

◆ center

override OnlineMapsVector2d OnlineMapsDrawingRect.center
get

Center point of the rectangle.

◆ height

double OnlineMapsDrawingRect.height
getset

Gets or sets the height of the rectangle. Geographic coordinates.

◆ topLeft

OnlineMapsVector2d OnlineMapsDrawingRect.topLeft
getset

Coordinates of top-left corner.

◆ topRight

OnlineMapsVector2d OnlineMapsDrawingRect.topRight
getset

Coordinates of top-right corner.

◆ width

double OnlineMapsDrawingRect.width
getset

Gets or sets the width of the rectangle. Geographic coordinates.

◆ x

double OnlineMapsDrawingRect.x
getset

Gets or sets the x position of the rectangle. Geographic coordinates.

◆ y

double OnlineMapsDrawingRect.y
getset

Gets or sets the y position of the rectangle. Geographic coordinates.