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.

Additional object layers are superimposed on the map with EMAPI.VectorLayer or EMAPI.ClusterLayer.

Summary
EMAPI.MapEMAPI.Map instances are interactive maps embedded in web applications.
Functions
EMAPI.MapThe constructor of a new instance of EMAPI.Map.
addMapActionAdds a new action to the map’s toolbar.
addMapActionAdds new action to map’s context menu.
removeMapActionRemoves action from the context map menu.
addLayerAdds new objects layer to map.
removeLayerRemoves indicated objects layer from the map.
getBoundsReturns the rectangle’s coordinates of the current map view.
setBoundsAdjusts the current mapview to present a rectangle with given geographical coordinates.
getCenterPosReturns the geographical coordinates of midpoint from current map view.
setCenterPosCenters the current map view with respect to the given geographical coordinates point.
setCallbackSets function of event’s service on the map
categoryObjectsReturns to management of static objects e.g.
getZoomReturns zoom level of current map view.
updateSizeRefresh map after resizing of the window.
convertLonLatToScreenConverts the coordinates to screen points from the current map view.
convertScreenToLonLatConverts the screen coordinates for the geographical point from the current map view.
getVersionReturns version of the map data.
isChangingReturns information about map status.

Functions

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, 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{EMAPI.Actions.MapClick} Action.

addMapAction

addMapAction: function(index,
action,
icon,
callback)

Adds new action to map’s context menu.

Parameters

index{Integer} The position in the context menu, where should appear a new action (value >= 0).
action{String} Title of the action.
icon{String} URL of icon for action.
callback{Function} The function starts after selecting action from the context menu.

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

layer{EMAPI.VectorLayer} New objects layer.

removeLayer

removeLayer: function(layer)

Removes indicated objects layer from the map.

Parameters

layer{EMAPI.VectorLayer} Objects layer which have to be removed from the map.

getBounds

getBounds: function()

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.

getCenterPos

getCenterPos: function()

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

getZoom: function()

Returns zoom level of current map view.

Result

{Integer} Zoom level (value from the scope 0-17).

updateSize

updateSize: function()

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

isChanging: function ()

Returns information about map status.

Result

{Boolean} Map status (true or false).

addMapAction: function(index,
action,
icon,
callback)
Adds new action to map’s context menu.
removeMapAction: function(index)
Removes action from the context map menu.
addLayer: function(layer)
Adds new objects layer to map.
removeLayer: function(layer)
Removes indicated objects layer from the map.
getBounds: function()
Returns the rectangle’s coordinates of the current map view.
setBounds: function(bounds)
Adjusts the current mapview to present a rectangle with given geographical coordinates.
getCenterPos: function()
Returns the geographical coordinates of midpoint from current map view.
setCenterPos: function(center,
zoom)
Centers the current map view with respect to the given geographical coordinates point.
setCallback: function(type,
callback)
Sets function of event’s service on the map
categoryObjects:function()
Returns to management of static objects e.g.
getZoom: function()
Returns zoom level of current map view.
updateSize: function()
Refresh map after resizing of the window.
convertLonLatToScreen: function(lonLat)
Converts the coordinates to screen points from the current map view.
convertScreenToLonLat: function(px)
Converts the screen coordinates for the geographical point from the current map view.
getVersion: function (callback)
Returns version of the map data.
isChanging: function ()
Returns information about map status.
The constructor of a new instance of EMAPI.Map.
The class responsible for searching informations on the map, current address points.
An additional layer of objects applied to the map.
An additional layer of grouped objects applied on the map.
Instances of EMAPI.Actions.MapClick class are definitions of additional map panel actions.
This class instances represent rectangles limiting a map.
A class representing the geographic coordinates in the form of latitude and longitude.
Class responsible for the management of static objects.
A class representing the screen point.
Close