Online Maps  v3
OnlineMapsTileSetControl Class Reference

Class control the map for the Tileset. Tileset - a dynamic mesh, created at runtime. More...

Inheritance diagram for OnlineMapsTileSetControl:
OnlineMapsControlBaseDynamicMesh OnlineMapsControlBase3D OnlineMapsControlBase IOnlineMapsSavableComponent

Public Types

enum  OnlineMapsColliderType
 Type of tileset map collider. More...
 
- Public Types inherited from OnlineMapsControlBaseDynamicMesh
enum  CreateMapTarget { CreateMapTarget.currentGameobject, CreateMapTarget.newGameobject }
 Where to create a mesh? More...
 

Public Member Functions

Vector2 GetCoordsByWorldPosition (Vector3 position)
 Returns the geographical coordinates by world position. More...
 
bool GetCoordsByWorldPosition (out double lng, out double lat, Vector3 position)
 Returns the geographical coordinates by world position. More...
 
bool GetCoordsByWorldPosition (Vector3 position, out double lng, out double lat)
 Returns the geographical coordinates by world position. More...
 
override Vector2 GetScreenPosition (double lng, double lat)
 Converts geographical coordinate to position in screen space. More...
 
override void OnAwakeBefore ()
 Event that occurs before Awake. More...
 
void Resize (int width, int height, bool changeSizeInScene=true)
 Resize map More...
 
void Resize (int width, int height, float sizeX, float sizeZ)
 Resize map More...
 
void Resize (int width, int height, Vector2 sizeInScene)
 Resize map More...
 
override void UpdateControl ()
 Updates the current control. More...
 
- Public Member Functions inherited from OnlineMapsControlBaseDynamicMesh
override void GetPosition (double lng, double lat, out double px, out double py)
 Converts geographical coordinate to position in the scene relative to the top-left corner of the map in map space. More...
 
override Vector2 GetScreenPosition (double lng, double lat)
 Converts geographical coordinate to position in screen space. More...
 
Vector3 GetWorldPosition (Vector2 coords)
 Converts geographical coordinates to position in world space. More...
 
Vector3 GetWorldPosition (double lng, double lat)
 Converts geographical coordinates to position in world space. More...
 
Vector3 GetWorldPositionWithElevation (double lng, double lat)
 Converts geographical coordinates to position in world space with elevation. More...
 
Vector3 GetWorldPositionWithElevation (Vector2 coords, Vector2 topLeftPosition, Vector2 bottomRightPosition)
 Converts geographical coordinates to position in world space with elevation. More...
 
Vector3 GetWorldPositionWithElevation (Vector2 coords, double tlx, double tly, double brx, double bry)
 Converts geographical coordinates to position in world space with elevation. More...
 
Vector3 GetWorldPositionWithElevation (double lng, double lat, double tlx, double tly, double brx, double bry)
 Converts geographical coordinates to position in world space with elevation. More...
 
override void UpdateControl ()
 Updates the current control. More...
 
- Public Member Functions inherited from OnlineMapsControlBase3D
OnlineMapsMarkerInstanceBase GetBillboardMarkerFromScreen (Vector2 screenPosition)
 Gets billboard marker on the screen position. More...
 
- Public Member Functions inherited from OnlineMapsControlBase
Vector2 GetCoords ()
 Returns the geographical coordinates of the location where the cursor is. More...
 
Vector2 GetCoords (Vector2 position)
 Returns the geographical coordinates at the specified coordinates of the screen. More...
 
bool GetCoords (out double lng, out double lat)
 Returns the geographical coordinates of the location where the cursor is. More...
 
Vector2 GetInputPosition ()
 Returns the current cursor position. More...
 
Vector2 GetPosition (Vector2 coords)
 Converts geographical coordinate to position in the scene relative to the top-left corner of the map in map space. More...
 
virtual Rect GetRect ()
 Screen area occupied by the map. More...
 
OnlineMapsSavableItem[] GetSavableItems ()
 Returns an array of items to save More...
 
Vector2 GetScreenPosition (Vector2 coords)
 Converts geographical coordinate to position in screen space. More...
 
int GetTouchCount ()
 Returns the current number of touches. More...
 
void InvokeBasePress ()
 Invokes OnMapBasePress. More...
 
void InvokeBaseRelease ()
 Invokes OnMapBaseRelease. More...
 
virtual void SetTexture (Texture2D texture)
 Specifies the texture, which will draw the map. In texture must be enabled "Read / Write Enabled". More...
 
void UpdateLastPosition ()
 Force updates the latest coordinates of cursor. More...
 
bool ZoomOnPoint (float zoomOffset, Vector2 screenPosition)
 Changes the zoom keeping a specified point on same place. More...
 

Public Attributes

Action< OnlineMapsTile, Material > OnChangeMaterialTexture
 The event, which occurs when the changed texture tile maps. More...
 
Action< OnlineMapsTile, Material > OnDrawTile
 The event that occurs after draw the tile. More...
 
OnlineMapsColliderType colliderType = OnlineMapsColliderType.fullMesh
 Type of collider: box - for performance, mesh - for elevation. More...
 
bool compressTextures = true
 Compress texture to reduce memory usage. More...
 
Plane? dragPlane
 Plane by using which the map is dragged. Exists only during drag. More...
 
GameObject drawingsGameObject
 Container for drawing elements. More...
 
OnlineMapsTilesetDrawingMode drawingMode = OnlineMapsTilesetDrawingMode.meshes
 Drawing API mode (meshes or overlay). More...
 
Shader drawingShader
 Shader of drawing elements. More...
 
Material tileMaterial
 Material that will be used for tile. More...
 
Shader tilesetShader
 Shader of map. More...
 
- Public Attributes inherited from OnlineMapsControlBaseDynamicMesh
Action OnMeshUpdated
 Event that occurs after the map mesh has been updated. More...
 
OnlineMapsTilesetCheckMarker2DVisibility checkMarker2DVisibility = OnlineMapsTilesetCheckMarker2DVisibility.pivot
 Type of checking 2D markers on visibility. More...
 
int elevationResolution = 32
 Resolution of the elevation map. More...
 
Material markerMaterial
 Material that will be used for marker. More...
 
Shader markerShader
 Shader of markers. More...
 
Vector2 sizeInScene = new Vector2(1024, 1024)
 Size of the map in the scene More...
 
- Public Attributes inherited from OnlineMapsControlBase3D
Camera activeCamera
 The camera you are using to display the map. More...
 
OnlineMapsElevationManagerBase elevationManager
 Reference to the elevation manager More...
 
OnlineMapsMarker2DMode marker2DMode = OnlineMapsMarker2DMode.flat
 Mode of 2D markers. Bake in texture or Billboard. More...
 
float marker2DSize = 100
 Size of billboard markers. More...
 
- Public Attributes inherited from OnlineMapsControlBase
Func< Vector2 > OnGetInputPosition
 Event intercepts getting current cursor position. More...
 
Func< Vector2[]> OnGetMultitouchInputPositions
 The event intercepts getting of the current multitouch points. More...
 
Func< int > OnGetTouchCount
 Event intercepts getting number of touches. More...
 
Action OnMapClick
 Event that occurs when you click on the map. More...
 
Action OnMapDoubleClick
 Event that occurs when you double-click on the map. More...
 
Action OnMapDrag
 Event that occurs when you drag the map. More...
 
Action OnMapLongPress
 Event that occurs when you long press the map. More...
 
Action OnMapPress
 Event that occurs when you press on the map. More...
 
Action OnMapRelease
 Event that occurs when you release the map. More...
 
Action OnMapZoom
 Event that occurs when you zoom the map. More...
 
Action OnSmoothZoomBegin
 Event, which occurs when the smooth zoom is started. More...
 
Action OnSmoothZoomFinish
 Event, which occurs when the smooth zoom is finish. More...
 
Action OnSmoothZoomInit
 Event, which occurs when the smooth zoom is starts init. More...
 
Action OnSmoothZoomProcess
 Event, which occurs when the smooth zoom is process. More...
 
Action OnUpdateAfter
 Event that occurs at end Update. More...
 
Action OnUpdateBefore
 Event that occurs at start Update. More...
 
Func< OnlineMapsZoomEvent, float, bool > OnValidateZoom
 Event validating that current zoom event is allowed.
True - zoom is allowed, false - forbidden. More...
 
Texture2D activeTexture
 Texture, which will draw the map.
To change the texture use OnlineMapsControlBase.SetTexture. More...
 
bool allowZoom = true
 Specifies whether the user can change zoom of the map. More...
 
bool allowUserControl = true
 Specifies whether the user can manipulate the map. More...
 
bool checkScreenSizeForWheelZoom = true
 Check that the input position is on the screen. More...
 
OnlineMapsDrawingElementManager drawingElementManager
 Reference to drawing element manager More...
 
bool isMapDrag
 Specifies whether to move map. More...
 
bool invertTouchZoom = false
 Inverts the map touch zoom for mobile devices. More...
 
OnlineMapsMarkerManager markerManager
 Reference to marker manager More...
 
bool smoothZoom = true
 Specifies whether to use a smooth touch zoom. More...
 
bool zoomInOnDoubleClick = true
 Allows you to zoom the map when double-clicked. More...
 
OnlineMapsZoomMode zoomMode = OnlineMapsZoomMode.target
 Mode of zoom. More...
 
float zoomSensitivity = 1
 Sensitivity of the zoom More...
 

Protected Member Functions

override void OnDestroyLate ()
 Event is called after the control has been disposed. More...
 
override void OnMapBasePress ()
 Method that is called when you press the map. More...
 
override void OnMapBaseRelease ()
 Method that is called when you release the map. More...
 
- Protected Member Functions inherited from OnlineMapsControlBaseDynamicMesh
override void OnEnableLate ()
 Function that is called after control of the map enabled. More...
 
- Protected Member Functions inherited from OnlineMapsControlBase3D
override void AfterUpdate ()
 Function, which is executed after map updating. More...
 
override void OnDestroyLate ()
 Event is called after the control has been disposed. More...
 
- Protected Member Functions inherited from OnlineMapsControlBase
virtual void BeforeUpdate ()
 Function, which is executed before map updating. More...
 
void DragMarker ()
 Moves the marker to the location of the cursor. More...
 
bool HitTest ()
 Checks whether the cursor over the map. More...
 
virtual void OnGestureZoom (Vector2 p1, Vector2 p2)
 Called when a gesture zoom. More...
 
void UpdatePosition ()
 Updates the map coordinates for the actions of the user. More...
 
void UpdateZoom ()
 Updates the map zoom for mouse wheel. More...
 

Properties

static new OnlineMapsTileSetControl instance [get]
 Singleton instance of OnlineMapsTileSetControl control. More...
 
- Properties inherited from OnlineMapsControlBaseDynamicMesh
OnlineMapsVector2i bufferPosition [get, set]
 Position of the buffer More...
 
Vector3 center [get]
 The center point of the map (without elevations) in local space. More...
 
bool hasElevation [get]
 Returns true when the elevation manager is available and enabled. More...
 
- Properties inherited from OnlineMapsControlBase3D
static new OnlineMapsControlBase3D instance [get]
 Singleton instance of OnlineMapsControlBase3D control. More...
 
Collider cl [get]
 Reference to the collider. More...
 
Renderer rendererInstance [get]
 Reference to the renderer. More...
 
- Properties inherited from OnlineMapsControlBase
static OnlineMapsControlBase instance [get]
 Singleton instance of map control. More...
 
virtual bool allowMarkerScreenRect [get]
 Indicates whether it is possible to get the screen coordinates store. True - for 2D map, false - for the 3D map. More...
 
OnlineMapsMarkerBase dragMarker [get, set]
 Marker that dragged at the moment. More...
 
OnlineMaps map [get]
 Reference to map instance. More...
 
virtual bool mipmapForTiles [get, set]
 Mipmap for tiles. More...
 
virtual Rect screenRect [get]
 Screen area occupied by the map. More...
 
virtual Rect uvRect [get]
 UV rectangle used by the texture of the map. NGUI: uiTexture.uvRect. Other: new Rect(0, 0, 1, 1); More...
 

Additional Inherited Members

- Static Public Attributes inherited from OnlineMapsControlBase
static float longPressDelay = 1
 Delay before invoking event OnMapLongPress. More...
 
static float startDragDistance = 4
 Distance (pixels) after which will start drag the map. More...
 
- Protected Attributes inherited from OnlineMapsControlBaseDynamicMesh
bool colliderWithElevation
 Does the collider contain elevations? More...
 
- Static Protected Attributes inherited from OnlineMapsControlBase
static OnlineMapsControlBase _instance
 Singleton of control More...
 

Detailed Description

Class control the map for the Tileset. Tileset - a dynamic mesh, created at runtime.

Member Enumeration Documentation

◆ OnlineMapsColliderType

Type of tileset map collider.

Member Function Documentation

◆ GetCoordsByWorldPosition() [1/3]

bool OnlineMapsTileSetControl.GetCoordsByWorldPosition ( out double  lng,
out double  lat,
Vector3  position 
)

Returns the geographical coordinates by world position.

Parameters
lngLongitude
latLatitude
positionWorld position
Returns
True - success, False - otherwise.

◆ GetCoordsByWorldPosition() [2/3]

Vector2 OnlineMapsTileSetControl.GetCoordsByWorldPosition ( Vector3  position)

Returns the geographical coordinates by world position.

Parameters
positionWorld position
Returns
Geographical coordinates or Vector2.zero

◆ GetCoordsByWorldPosition() [3/3]

bool OnlineMapsTileSetControl.GetCoordsByWorldPosition ( Vector3  position,
out double  lng,
out double  lat 
)

Returns the geographical coordinates by world position.

Parameters
positionWorld position
lngLongitude
latLatitude
Returns
True - success, False - otherwise.

◆ GetScreenPosition()

override Vector2 OnlineMapsTileSetControl.GetScreenPosition ( double  lng,
double  lat 
)
virtual

Converts geographical coordinate to position in screen space.

Parameters
lngLongitude
latLatitude
Returns
Screen space position

Reimplemented from OnlineMapsControlBase.

◆ OnAwakeBefore()

override void OnlineMapsTileSetControl.OnAwakeBefore ( )
virtual

Event that occurs before Awake.

Reimplemented from OnlineMapsControlBase.

◆ OnDestroyLate()

override void OnlineMapsTileSetControl.OnDestroyLate ( )
protectedvirtual

Event is called after the control has been disposed.

Reimplemented from OnlineMapsControlBase.

◆ OnMapBasePress()

override void OnlineMapsTileSetControl.OnMapBasePress ( )
protectedvirtual

Method that is called when you press the map.

Reimplemented from OnlineMapsControlBase.

◆ OnMapBaseRelease()

override void OnlineMapsTileSetControl.OnMapBaseRelease ( )
protectedvirtual

Method that is called when you release the map.

Reimplemented from OnlineMapsControlBase.

◆ Resize() [1/3]

void OnlineMapsTileSetControl.Resize ( int  width,
int  height,
bool  changeSizeInScene = true 
)

Resize map

Parameters
widthWidth (pixels)
heightHeight (pixels)
changeSizeInSceneChange the size of the map in the scene or leave the same.

◆ Resize() [2/3]

void OnlineMapsTileSetControl.Resize ( int  width,
int  height,
float  sizeX,
float  sizeZ 
)

Resize map

Parameters
widthWidth (pixels)
heightHeight (pixels)
sizeXSize X (in scene)
sizeZSize Z (in scene)

◆ Resize() [3/3]

void OnlineMapsTileSetControl.Resize ( int  width,
int  height,
Vector2  sizeInScene 
)

Resize map

Parameters
widthWidth (pixels)
heightHeight (pixels)
sizeInSceneSize in scene (X-X, Y-Z)

◆ UpdateControl()

override void OnlineMapsTileSetControl.UpdateControl ( )
virtual

Updates the current control.

Reimplemented from OnlineMapsControlBase3D.

Member Data Documentation

◆ colliderType

OnlineMapsColliderType OnlineMapsTileSetControl.colliderType = OnlineMapsColliderType.fullMesh

Type of collider: box - for performance, mesh - for elevation.

◆ compressTextures

bool OnlineMapsTileSetControl.compressTextures = true

Compress texture to reduce memory usage.

◆ dragPlane

Plane? OnlineMapsTileSetControl.dragPlane

Plane by using which the map is dragged. Exists only during drag.

◆ drawingMode

OnlineMapsTilesetDrawingMode OnlineMapsTileSetControl.drawingMode = OnlineMapsTilesetDrawingMode.meshes

Drawing API mode (meshes or overlay).

◆ drawingsGameObject

GameObject OnlineMapsTileSetControl.drawingsGameObject

Container for drawing elements.

◆ drawingShader

Shader OnlineMapsTileSetControl.drawingShader

Shader of drawing elements.

◆ OnChangeMaterialTexture

Action<OnlineMapsTile, Material> OnlineMapsTileSetControl.OnChangeMaterialTexture

The event, which occurs when the changed texture tile maps.

◆ OnDrawTile

Action<OnlineMapsTile, Material> OnlineMapsTileSetControl.OnDrawTile

The event that occurs after draw the tile.

◆ tileMaterial

Material OnlineMapsTileSetControl.tileMaterial

Material that will be used for tile.

◆ tilesetShader

Shader OnlineMapsTileSetControl.tilesetShader

Shader of map.

Property Documentation

◆ instance

new OnlineMapsTileSetControl OnlineMapsTileSetControl.instance
staticget

Singleton instance of OnlineMapsTileSetControl control.