Online Maps  v3
OnlineMapsNGUITextureControl Class Reference

Class control the map for the NGUI. More...

Inheritance diagram for OnlineMapsNGUITextureControl:
OnlineMapsControlBase2D OnlineMapsControlBase IOnlineMapsSavableComponent

Public Member Functions

override bool GetCoords (Vector2 position, out double lng, out double lat)
 Returns the geographical coordinates of the location where the position is. More...
 
override bool GetTile (Vector2 position, out double tx, out double ty)
 Gets a tile by screen position. More...
 
- Public Member Functions inherited from OnlineMapsControlBase
virtual OnlineMapsTile CreateTile (int x, int y, int zoom, bool isMapTile=true)
 Creates a new tile. More...
 
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...
 
virtual IOnlineMapsInteractiveElement GetInteractiveElement (Vector2 screenPosition)
 Get the interactive element located at the screen 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 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...
 
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...
 
virtual Vector2 GetScreenPosition (double lng, double lat)
 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...
 
bool IsCursorOnUIElement (Vector2 position)
 Whether the screen position is on UI element More...
 
virtual void OnAwakeBefore ()
 Event that occurs before Awake. 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...
 

Additional Inherited Members

- Public Attributes inherited from OnlineMapsControlBase
Action OnDrawMarkers
 Event that occurs when need to draw markers. More...
 
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...
 
Predicate< GameObject > OnValidateCursorOnUIElement
 Event validating that cursor is on UI element.
True - cursor on UI element, false - otherwise. 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...
 
- 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 Member Functions inherited from OnlineMapsControlBase
virtual void AfterUpdate ()
 Function, which is executed after map updating. More...
 
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 bool HitTest (Vector2 position)
 Checks whether specified position over the map. More...
 
virtual void OnDestroyLate ()
 Event is called after the control has been disposed. More...
 
virtual void OnEnableLate ()
 Function that is called after control of the map enabled. More...
 
virtual void OnGestureZoom (Vector2 p1, Vector2 p2)
 Called when a gesture zoom. More...
 
virtual void OnMapBasePress ()
 Method that is called when you press the map. More...
 
virtual void OnMapBaseRelease ()
 Method that is called when you release the map. More...
 
void UpdatePosition ()
 Updates the map coordinates for the actions of the user. More...
 
void UpdateZoom ()
 Updates the map zoom for mouse wheel. More...
 
- Static Protected Attributes inherited from OnlineMapsControlBase
static OnlineMapsControlBase _instance
 Singleton of control More...
 
- Properties inherited from OnlineMapsControlBase2D
static new OnlineMapsControlBase2D instance [get]
 Singleton instance of OnlineMapsControlBase2D control. More...
 
override bool allowMarkerScreenRect [get]
 Indicates whether it is possible to get the screen coordinates store. True - for 2D map. 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...
 
virtual bool allowTouchZoom [get]
 Indicates whether it is possible to use the touch zoom. More...
 
OnlineMapsMarkerBase dragMarker [get, set]
 Marker that dragged at the moment. More...
 
OnlineMapsMarker2DDrawer markerDrawer [get, set]
 Gets/sets the marker drawer. 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...
 
bool resultIsTexture [get]
 Whether the current control draws to a texture. More...
 
virtual OnlineMapsTarget resultType [get]
 The result type of the current control. More...
 
virtual bool useRasterTiles [get]
 Whether the current control uses raster tiles. 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...
 

Detailed Description

Class control the map for the NGUI.

Member Function Documentation

◆ GetCoords()

override bool OnlineMapsNGUITextureControl.GetCoords ( Vector2  position,
out double  lng,
out double  lat 
)
virtual

Returns the geographical coordinates of the location where the position is.

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

Implements OnlineMapsControlBase.

◆ GetTile()

override bool OnlineMapsNGUITextureControl.GetTile ( Vector2  position,
out double  tx,
out double  ty 
)
virtual

Gets a tile by screen position.

Parameters
positionScreen position
txTile X
tyTile Y
Returns
Tile

Implements OnlineMapsControlBase.