![]() |
Online Maps
v3
|
The main class. With it you can control the map. More...
Public Member Functions | |
void | CheckServerConnection (Action< bool > callback) |
Allows you to test the connection to the Internet. More... | |
void | DispatchEvent (params OnlineMapsEvents[] evs) |
Dispatch map events. More... | |
void | GetBottomRightPosition (out double lng, out double lat) |
Get the bottom-right corner of the map. More... | |
void | GetCorners (out double tlx, out double tly, out double brx, out double bry) |
Returns the coordinates of the corners of the map More... | |
OnlineMapsDrawingElement | GetDrawingElement (Vector2 screenPosition) |
Gets drawing element from screen. More... | |
void | GetPosition (out double lng, out double lat) |
Get the map coordinate. More... | |
OnlineMapsSavableItem[] | GetSavableItems () |
Returns an array of items to save More... | |
void | GetTileCorners (out double tlx, out double tly, out double brx, out double bry) |
Get the tile coordinates of the corners of the map More... | |
void | GetTileCorners (out double tlx, out double tly, out double brx, out double bry, int zoom) |
Get the tile coordinates of the corners of the map More... | |
void | GetTilePosition (out double px, out double py) |
Get the tile coordinates of the map More... | |
void | GetTilePosition (out double px, out double py, int zoom) |
Get the tile coordinates of the map More... | |
void | GetTopLeftPosition (out double lng, out double lat) |
Get the top-left corner of the map. More... | |
bool | InMapView (double lng, double lat) |
Checks if the coordinates are in the map view. More... | |
void | Redraw () |
Full redraw map. More... | |
void | RedrawImmediately () |
Stops the current process map generation, clears all buffers and completely redraws the map. More... | |
void | SetPosition (double lng, double lat, bool ignoreSamePosition=true) |
Set the the map coordinate. More... | |
void | SetPositionAndZoom (double lng, double lat, float? ZOOM=null) |
Sets the position and zoom. More... | |
void | SetTexture (Texture2D newTexture) |
Sets the texture, which will draw the map. Texture displaying on the source you need to change yourself. More... | |
void | SetTilePosition (double tx, double ty, int? tileZoom=null) |
Sets the position of the center point of the map based on the tile position. More... | |
void | UpdateCorners () |
Updates the coordinates of the corners of the map More... | |
Public Attributes | |
Action | OnChangePosition |
Event caused when the user change map position. More... | |
Action | OnChangeZoom |
Event caused when the user change map zoom. More... | |
Action | OnGUIAfter |
Event caused at the end of OnGUI method More... | |
Action | OnGUIBefore |
Event caused at the beginning of OnGUI method More... | |
Func< Vector2, OnlineMapsMarker > | OnGetMarkerFromScreen |
Intercepts getting marker by the screen coordinates. More... | |
Action | OnLateUpdateAfter |
The event is invoked at the end LateUpdate. More... | |
Action | OnLateUpdateBefore |
The event is called at the start LateUpdate. More... | |
Action | OnMapUpdated |
Event which is called after the redrawing of the map. More... | |
Action | OnUpdateBefore |
Event is called before Update. More... | |
Action | OnUpdateLate |
Event is called after Update. More... | |
bool | allowRedraw |
Allows drawing of map. Important: The interaction with the map, add or remove markers and drawing elements, automatically allowed to redraw the map. Use lockRedraw, to prohibit the redrawing of the map. More... | |
bool | blockAllInteractions |
Allows you to block all user interactions with the map, markers, drawing elements. But you can still interact with the map using the API. More... | |
int | countParentLevels = 5 |
Tiles for the specified number of parent levels will be loaded. More... | |
string | customProviderURL = "http://localhost/{zoom}/{y}/{x}" |
URL of custom provider. Support tokens: {x} - tile x {y} - tile y {zoom} - zoom level {quad} - uniquely identifies a single tile at a particular level of detail. More... | |
string | customTrafficProviderURL = "http://localhost/{zoom}/{y}/{x}" |
URL of custom traffic provider. Support tokens: {x} - tile x {y} - tile y {zoom} - zoom level {quad} - uniquely identifies a single tile at a particular level of detail. More... | |
Texture2D | defaultTileTexture |
Texture displayed until the tile is not loaded. More... | |
bool | dispatchEvents = true |
Specifies whether to dispatch the event. More... | |
bool | dragMarkerHoldingCTRL = false |
Drag marker while holding CTRL. More... | |
Color | emptyColor = Color.gray |
Color, which is used until the tile is not loaded, unless specified field defaultTileTexture. More... | |
int | height = 1024 |
Map height in pixels. More... | |
bool | labels = true |
Specifies whether to display the labels on the map. More... | |
string | language = "en" |
Language of the labels on the map. More... | |
bool | lockRedraw = false |
Prohibits drawing of maps. Important: Do not forget to disable this restriction. Otherwise, the map will never be redrawn. More... | |
bool | needRedraw |
A flag that indicates that need to redraw the map. More... | |
bool | notInteractUnderGUI = true |
Not interact under the GUI. More... | |
string | mapType |
ID of current map type. More... | |
OnlineMapsOSMOverpassServer | osmServer = OnlineMapsOSMOverpassServer.main |
Server for requests to the Open Street Map Overpass API. More... | |
string | proxyURL = "https://service.infinity-code.com/redirect.php?" |
URL of the proxy server used for WebGL platform. More... | |
bool | redrawOnPlay |
A flag that indicates whether to redraw the map at startup. More... | |
bool | renderInThread = true |
Render map in a separate thread. Recommended. More... | |
string | resourcesPath = "OnlineMapsTiles/{zoom}/{x}/{y}" |
Template path in Resources, from where the tiles will be loaded. This field supports tokens. More... | |
string | streamingAssetsPath = "OnlineMapsTiles/{zoom}/{x}/{y}.png" |
Template path in Streaming Assets, from where the tiles will be loaded. This field supports tokens. More... | |
OnlineMapsShowMarkerTooltip | showMarkerTooltip = OnlineMapsShowMarkerTooltip.onHover |
Indicates when the marker will show tips. More... | |
OnlineMapsSource | source = OnlineMapsSource.Online |
Specifies from where the tiles should be loaded (Online, Resources, Online and Resources). More... | |
bool | stopPlayingWhenScriptsCompile = true |
Indicates that Unity need to stop playing when compiling scripts. More... | |
Texture2D | texture |
Texture, which is used to draw the map. To change this value, use OnlineMaps.SetTexture. More... | |
OnlineMapsTileManager | tileManager |
Reference to tile manager More... | |
OnlineMapsTooltipDrawerBase | tooltipDrawer |
Reference to tooltip drawer More... | |
Texture2D | tooltipBackgroundTexture |
Background texture of tooltip More... | |
bool | traffic = false |
Specifies whether to draw traffic More... | |
OnlineMapsTrafficProvider | trafficProvider |
Provider of traffic jams More... | |
string | trafficProviderID = "googlemaps" |
ID of current traffic provider More... | |
bool | useCurrentZoomTiles = false |
Use only the current zoom level of the tiles. More... | |
bool | useProxy = true |
Use a proxy server for WebGL? More... | |
bool | useSoftwareJPEGDecoder = false |
Specifies is necessary to use software JPEG decoder. Use only if you have problems with hardware decoding of JPEG. More... | |
int | width = 1024 |
Map width in pixels. More... | |
Static Public Attributes | |
const string | version = "3.8.3.1" |
The current version of Online Maps More... | |
const int | MINZOOM = 1 |
The minimum zoom level More... | |
const int | MAXZOOM = 20 |
The maximum zoom level More... | |
static Action< OnlineMaps > | OnStart |
The event is called when the map starts. More... | |
static Action< OnlineMaps > | OnPreloadTiles |
The event occurs after generating buffer and before update control to preload tiles for tileset. More... | |
static bool | isUserControl = false |
Specifies whether the user interacts with the map. More... | |
Properties | |
static OnlineMaps | instance [get] |
Singleton instance of map. More... | |
OnlineMapsProvider.MapType | activeType [get, set] |
Active type of map. More... | |
Vector2 | bottomRightPosition [get] |
Gets the bottom right position. More... | |
OnlineMapsGeoRect | bounds [get] |
Gets the coordinates of the map view. More... | |
OnlineMapsBuffer | buffer [get] |
Reference to the current draw buffer. More... | |
OnlineMapsBufferStatus | bufferStatus [get] |
The current state of the drawing buffer. More... | |
OnlineMapsControlBase | control [get] |
Gets the current control. More... | |
OnlineMapsControlBase3D | control3D [get] |
Gets the current 3D control. More... | |
OnlineMapsDrawingElementManager | drawingElementManager [get] |
Gets the drawing element manager from control. More... | |
float | floatZoom [get, set] |
Gets and sets float zoom value More... | |
OnlineMapsMarkerManager | markerManager [get] |
Gets the markers manager from control. More... | |
OnlineMapsMarker3DManager? | marker3DManager [get] |
Gets the 3D markers manager from control. More... | |
Vector2 | position [get, set] |
Coordinates of the center point of the map. More... | |
OnlineMapsPositionRange | positionRange [get, set] |
Limits the range of map coordinates. More... | |
OnlineMapsProjection | projection [get] |
Projection of active provider. More... | |
Vector2 | topLeftPosition [get] |
Gets the top left position. More... | |
int | zoom [get, set] |
Current zoom. More... | |
float | zoomFactor [get] |
The scaling factor for zoom More... | |
OnlineMapsRange | zoomRange [get, set] |
Specifies the valid range of map zoom. More... | |
float | zoomScale [get] |
The fractional part of zoom More... | |
The main class. With it you can control the map.
void OnlineMaps.CheckServerConnection | ( | Action< bool > | callback | ) |
Allows you to test the connection to the Internet.
callback | Function, which will return the availability of the Internet. |
void OnlineMaps.DispatchEvent | ( | params OnlineMapsEvents[] | evs | ) |
Dispatch map events.
evs | Events you want to dispatch. |
void OnlineMaps.GetBottomRightPosition | ( | out double | lng, |
out double | lat | ||
) |
Get the bottom-right corner of the map.
lng | Longitude |
lat | Latitude |
void OnlineMaps.GetCorners | ( | out double | tlx, |
out double | tly, | ||
out double | brx, | ||
out double | bry | ||
) |
Returns the coordinates of the corners of the map
tlx | Longitude of the left border |
tly | Latitude of the top border |
brx | Longitude of the right border |
bry | Latitude of the bottom border |
OnlineMapsDrawingElement OnlineMaps.GetDrawingElement | ( | Vector2 | screenPosition | ) |
Gets drawing element from screen.
screenPosition | Screen position. |
void OnlineMaps.GetPosition | ( | out double | lng, |
out double | lat | ||
) |
Get the map coordinate.
lng | Longitude |
lat | Latitude |
OnlineMapsSavableItem [] OnlineMaps.GetSavableItems | ( | ) |
Returns an array of items to save
Implements IOnlineMapsSavableComponent.
void OnlineMaps.GetTileCorners | ( | out double | tlx, |
out double | tly, | ||
out double | brx, | ||
out double | bry | ||
) |
Get the tile coordinates of the corners of the map
tlx | Left tile X |
tly | Top tile Y |
brx | Right tile X |
bry | Bottom tile Y |
void OnlineMaps.GetTileCorners | ( | out double | tlx, |
out double | tly, | ||
out double | brx, | ||
out double | bry, | ||
int | zoom | ||
) |
Get the tile coordinates of the corners of the map
tlx | Left tile X |
tly | Top tile Y |
brx | Right tile X |
bry | Bottom tile Y |
zoom | Zoom |
void OnlineMaps.GetTilePosition | ( | out double | px, |
out double | py | ||
) |
Get the tile coordinates of the map
px | Tile X |
py | Tile Y |
void OnlineMaps.GetTilePosition | ( | out double | px, |
out double | py, | ||
int | zoom | ||
) |
Get the tile coordinates of the map
px | Tile X |
py | Tile Y |
zoom | Zoom |
void OnlineMaps.GetTopLeftPosition | ( | out double | lng, |
out double | lat | ||
) |
Get the top-left corner of the map.
lng | Longitude |
lat | Latitude |
bool OnlineMaps.InMapView | ( | double | lng, |
double | lat | ||
) |
Checks if the coordinates are in the map view.
lng | Longitude |
lat | Latitude |
void OnlineMaps.Redraw | ( | ) |
Full redraw map.
void OnlineMaps.RedrawImmediately | ( | ) |
Stops the current process map generation, clears all buffers and completely redraws the map.
void OnlineMaps.SetPosition | ( | double | lng, |
double | lat, | ||
bool | ignoreSamePosition = true |
||
) |
Set the the map coordinate.
lng | Longitude |
lat | Latitude |
void OnlineMaps.SetPositionAndZoom | ( | double | lng, |
double | lat, | ||
float? | ZOOM = null |
||
) |
Sets the position and zoom.
lng | Longitude |
lat | Latitude |
ZOOM | Zoom |
void OnlineMaps.SetTexture | ( | Texture2D | newTexture | ) |
Sets the texture, which will draw the map. Texture displaying on the source you need to change yourself.
newTexture | Texture, where you want to draw the map. |
void OnlineMaps.SetTilePosition | ( | double | tx, |
double | ty, | ||
int? | tileZoom = null |
||
) |
Sets the position of the center point of the map based on the tile position.
tx | Tile X |
ty | Tile Y |
tileZoom | Tile zoom |
void OnlineMaps.UpdateCorners | ( | ) |
Updates the coordinates of the corners of the map
bool OnlineMaps.allowRedraw |
Allows drawing of map.
Important: The interaction with the map, add or remove markers and drawing elements, automatically allowed to redraw the map.
Use lockRedraw, to prohibit the redrawing of the map.
bool OnlineMaps.blockAllInteractions |
Allows you to block all user interactions with the map, markers, drawing elements. But you can still interact with the map using the API.
int OnlineMaps.countParentLevels = 5 |
Tiles for the specified number of parent levels will be loaded.
string OnlineMaps.customProviderURL = "http://localhost/{zoom}/{y}/{x}" |
URL of custom provider.
Support tokens:
{x} - tile x
{y} - tile y
{zoom} - zoom level
{quad} - uniquely identifies a single tile at a particular level of detail.
string OnlineMaps.customTrafficProviderURL = "http://localhost/{zoom}/{y}/{x}" |
URL of custom traffic provider.
Support tokens:
{x} - tile x
{y} - tile y
{zoom} - zoom level
{quad} - uniquely identifies a single tile at a particular level of detail.
Texture2D OnlineMaps.defaultTileTexture |
Texture displayed until the tile is not loaded.
bool OnlineMaps.dispatchEvents = true |
Specifies whether to dispatch the event.
bool OnlineMaps.dragMarkerHoldingCTRL = false |
Drag marker while holding CTRL.
Color OnlineMaps.emptyColor = Color.gray |
Color, which is used until the tile is not loaded, unless specified field defaultTileTexture.
int OnlineMaps.height = 1024 |
Map height in pixels.
|
static |
Specifies whether the user interacts with the map.
bool OnlineMaps.labels = true |
Specifies whether to display the labels on the map.
string OnlineMaps.language = "en" |
Language of the labels on the map.
bool OnlineMaps.lockRedraw = false |
Prohibits drawing of maps.
Important: Do not forget to disable this restriction. Otherwise, the map will never be redrawn.
string OnlineMaps.mapType |
ID of current map type.
|
static |
The maximum zoom level
|
static |
The minimum zoom level
bool OnlineMaps.needRedraw |
A flag that indicates that need to redraw the map.
bool OnlineMaps.notInteractUnderGUI = true |
Not interact under the GUI.
Action OnlineMaps.OnChangePosition |
Event caused when the user change map position.
Action OnlineMaps.OnChangeZoom |
Event caused when the user change map zoom.
Func<Vector2, OnlineMapsMarker> OnlineMaps.OnGetMarkerFromScreen |
Intercepts getting marker by the screen coordinates.
Action OnlineMaps.OnGUIAfter |
Event caused at the end of OnGUI method
Action OnlineMaps.OnGUIBefore |
Event caused at the beginning of OnGUI method
Action OnlineMaps.OnLateUpdateAfter |
The event is invoked at the end LateUpdate.
Action OnlineMaps.OnLateUpdateBefore |
The event is called at the start LateUpdate.
Action OnlineMaps.OnMapUpdated |
Event which is called after the redrawing of the map.
|
static |
The event occurs after generating buffer and before update control to preload tiles for tileset.
|
static |
The event is called when the map starts.
Action OnlineMaps.OnUpdateBefore |
Event is called before Update.
Action OnlineMaps.OnUpdateLate |
Event is called after Update.
OnlineMapsOSMOverpassServer OnlineMaps.osmServer = OnlineMapsOSMOverpassServer.main |
Server for requests to the Open Street Map Overpass API.
string OnlineMaps.proxyURL = "https://service.infinity-code.com/redirect.php?" |
URL of the proxy server used for WebGL platform.
bool OnlineMaps.redrawOnPlay |
A flag that indicates whether to redraw the map at startup.
bool OnlineMaps.renderInThread = true |
Render map in a separate thread. Recommended.
string OnlineMaps.resourcesPath = "OnlineMapsTiles/{zoom}/{x}/{y}" |
Template path in Resources, from where the tiles will be loaded. This field supports tokens.
OnlineMapsShowMarkerTooltip OnlineMaps.showMarkerTooltip = OnlineMapsShowMarkerTooltip.onHover |
Indicates when the marker will show tips.
OnlineMapsSource OnlineMaps.source = OnlineMapsSource.Online |
Specifies from where the tiles should be loaded (Online, Resources, Online and Resources).
bool OnlineMaps.stopPlayingWhenScriptsCompile = true |
Indicates that Unity need to stop playing when compiling scripts.
string OnlineMaps.streamingAssetsPath = "OnlineMapsTiles/{zoom}/{x}/{y}.png" |
Template path in Streaming Assets, from where the tiles will be loaded. This field supports tokens.
Texture2D OnlineMaps.texture |
Texture, which is used to draw the map.
To change this value, use OnlineMaps.SetTexture.
OnlineMapsTileManager OnlineMaps.tileManager |
Reference to tile manager
Texture2D OnlineMaps.tooltipBackgroundTexture |
Background texture of tooltip
OnlineMapsTooltipDrawerBase OnlineMaps.tooltipDrawer |
Reference to tooltip drawer
bool OnlineMaps.traffic = false |
Specifies whether to draw traffic
OnlineMapsTrafficProvider OnlineMaps.trafficProvider |
Provider of traffic jams
string OnlineMaps.trafficProviderID = "googlemaps" |
ID of current traffic provider
bool OnlineMaps.useCurrentZoomTiles = false |
Use only the current zoom level of the tiles.
bool OnlineMaps.useProxy = true |
Use a proxy server for WebGL?
bool OnlineMaps.useSoftwareJPEGDecoder = false |
Specifies is necessary to use software JPEG decoder. Use only if you have problems with hardware decoding of JPEG.
|
static |
The current version of Online Maps
int OnlineMaps.width = 1024 |
Map width in pixels.
|
getset |
Active type of map.
|
get |
Gets the bottom right position.
The bottom right position.
|
get |
Gets the coordinates of the map view.
|
get |
Reference to the current draw buffer.
|
get |
The current state of the drawing buffer.
|
get |
Gets the current control.
|
get |
Gets the current 3D control.
|
get |
Gets the drawing element manager from control.
|
getset |
Gets and sets float zoom value
|
staticget |
Singleton instance of map.
|
get |
Gets the 3D markers manager from control.
|
get |
Gets the markers manager from control.
|
getset |
Coordinates of the center point of the map.
|
getset |
Limits the range of map coordinates.
|
get |
Projection of active provider.
|
get |
Gets the top left position.
The top left position.
|
getset |
Current zoom.
|
get |
The scaling factor for zoom
|
getset |
Specifies the valid range of map zoom.
|
get |
The fractional part of zoom