EMAPI.Map
EMAPI.Map instances are interactive maps embedded in web applications. The new map is created using the constructor EMAPI.Map. Map data searching is performed by an instance of EMAPI.Finder class.
Additional object layers are superimposed on the map with EMAPI.VectorLayer or EMAPI.ClusterLayer class.
Summary
| EMAPI.Map | EMAPI.Map instances are interactive maps embedded in web applications. |
| Functions | |
| EMAPI.Map | The constructor of a new instance of EMAPI.Map. |
| addMapAction | Adds a new action to the map’s toolbar. |
| addMapAction | Dodaje nową akcję do panelu narzędziowego mapy. |
| removeMapAction | Removes action from the context map menu. |
| addLayer | Adds new objects layer to map. |
| removeLayer | Removes indicated objects layer from the map. |
| getBounds | Returns the rectangle’s coordinates of the current map view. |
| setBounds | Adjusts the current mapview to present a rectangle with given geographical coordinates. |
| setMapType | Changes current map view kind. |
| getCenterPos | Returns the geographical coordinates of midpoint from current map view. |
| setCenterPos | Centers the current map view with respect to the given geographical coordinates point. |
| setCallback | Sets function of event’s service on the map. |
| categoryObjects | Returns to management of static objects e.g. |
| getZoom | Returns zoom level of current map view. |
| updateSize | Refresh map after resizing of the window. |
| convertLonLatToScreen | Converts the coordinates to screen points from the current map view. |
| convertScreenToLonLat | Converts the screen coordinates for the geographical point from the current map view. |
| getVersion | Returns version of the map data. |
| isChanging | Returns information about map status. |
EMAPI.Map
The constructor of a new instance of EMAPI.Map.
Parameters
| div | {String} An element’s ID on the page, which will contain the map. |
| token | {String} User ID. |
| options | {Object} Additional map’s parameters: mapType (kind of map presented: ‘std’ - standard map, ‘hipso’ - hypsometric map, ‘hybrid’ - map with satellite background), Boolean flags: noZoom (no zoom panel), noScale (no scale indicator), noMiniMap (lack of the map navigator). |
addMapAction
Adds a new action to the map’s toolbar.
Parameters
| index | {Integer} The position in the toolbar, where should appear a new action (value >= 0). |
| action | {String} {String} Title of the action. |
| icon | {String} URL of icon for action |
| callback | {Function} The function starts after selecting action from the context menu. |
addMapAction
| addMapAction: function( | index, | | action, | | icon, | | callback | ) |
|
Dodaje nową akcję do panelu narzędziowego mapy.
Parameters
| index | {Integer} The position in the toolbar, where should appear a new action (value >= 0). |
| action | {EMAPI.Actions.MapClick} Action. |
removeMapAction
| removeMapAction: function( | index | ) |
|
Removes action from the context map menu.
Parameters
| index | {Integer} The position in the context menu, which is intended an action to delete (value >= 0). |
addLayer
| addLayer: function( | layer | ) |
|
Adds new objects layer to map.
Parameters
removeLayer
| removeLayer: function( | layer | ) |
|
Removes indicated objects layer from the map.
Parameters
getBounds
Returns the rectangle’s coordinates of the current map view.
Result
{EMAPI.Bounds} The EMAPI.Bounds object representing the range of the map..
setBounds
| setBounds: function( | bounds | ) |
|
Adjusts the current mapview to present a rectangle with given geographical coordinates.
Parameters
| bounds | {EMAPI.Bounds} The EMAPI.Bounds objects representing the desired area of the map. |
setMapType
| setMapType: function ( | mType | ) |
|
Changes current map view kind.
Parameters
| mType | {String} Kind of map presented (‘std’ - standard map, ‘hipso’ - hypsometric map, ‘hybrid’ - map with satellite background). |
getCenterPos
Returns the geographical coordinates of midpoint from current map view.
Result
{EMAPI.LonLat} The EMAPI.LonLat object representing coordinates of the returned point.
setCenterPos
| setCenterPos: function( | center, | | zoom | ) |
|
Centers the current map view with respect to the given geographical coordinates point.
Parameters
| center | {EMAPI.LonLat} The EMAPI.LonLat object representing coordinates of the required point. |
| zoom | {Integer} Required zoom (value from the scope 0-17). |
setCallback
| setCallback: function( | type, | | callback | ) |
|
Sets function of event’s service on the map.
Parameters
| type | {String} Event type (mapChange, objClick, objOver, objOut, objDragBegin, objDragEnd, onCategoriesChange, info, contextMenu). |
| callback | {Function} Function starts during the event. |
categoryObjects
| categoryObjects:function() |
Returns to management of static objects e.g. POI.
Result
{EMAPI.CategoryObjects} An object to provide static objects that appear on the maps. (including POI and additional client’s objects automatically loaded).
getZoom
Returns zoom level of current map view.
Result
{Integer} Zoom level (value from the scope 0-17).
updateSize
Refresh map after resizing of the window.
convertLonLatToScreen
| convertLonLatToScreen: function( | lonLat | ) |
|
Converts the coordinates to screen points from the current map view.
Parameters
| lonLat | {EMAPI.LonLat} The EMAPI.LonLat object representing geographical coordinates of the point. |
Result
{EMAPI.Pixel} The EMAPI.Pixel object representing screen coordinates of the point.
convertScreenToLonLat
| convertScreenToLonLat: function( | px | ) |
|
Converts the screen coordinates for the geographical point from the current map view.
Parameters
| px | {EMAPI.Pixel} The EMAPI.Pixel object representing screen coordinates of the point. |
Result
{EMAPI.LonLat} The EMAPI.LonLat object representing geographical coordinates of the point.
getVersion
| getVersion: function ( | callback | ) |
|
Returns version of the map data.
Parameters
| callback | {Function} Map version is send to this function. |
isChanging
Returns information about map status.
Result
{Boolean} Map status (true or false).