Appearance
Ogma.geo
Geographical mode API : allows to display nodes which have geographical coordinates (latitude and longitude) on a map.
ogma.geo.disable([options])
Disables geo layout
Arguments
- options(optional)
GeoModeOptions
Returns
-
Promise<void>
ogma.geo.enable([options])
Enables geo mode layout
Arguments
- options(optional)
GeoModeOptions
Returns
-
Promise<void>
ogma.geo.enabled()
Check whether geographical mode is enabled.
Returns
-
boolean
ogma.geo.getCenter()
Returns current map position. Returns undefined when the Geo mode is disabled.
Returns
ogma.geo.getMap()
Get the underling map object (a Leaflet Map instance). Returns null when the Geo mode is disabled.
Returns
-
Map
ogma.geo.getOptions()
Get module settings.
Returns
ogma.geo.getUnprojectedCoordinates([selector])
Returns underlying X and Y positions for the nodes that are currently handled by the geo-mode.
Arguments
Returns
-
Array<{x: number, y: number}>
ogma.geo.getView()
Returns current map position. Returns undefined when the Geo mode is disabled.
Returns
ogma.geo.getZoom()
Returns current map zoom level. Returns undefined when the Geo mode is disabled.
Returns
-
number
ogma.geo.resetCoordinates()
Reset geographical coordinates of the nodes to the initial values
ogma.geo.setCenter(latitude, longitude)
Centers the map at given coodinates
Arguments
- latitude
number
- longitude
number
ogma.geo.setOptions([options])
Update module settings
Arguments
- options(optional)
GeoModeOptions
ogma.geo.setView(latitude, longitude, zoom)
Set map view - coordinates and zoom level
Arguments
- latitude
number
- longitude
number
- zoom
number
ogma.geo.setZoom(zoom)
Sets zoom level of the map
Arguments
- zoom
number
ogma.geo.toggle([options])
Toggles geo mode. Useful when you don't want to store information about whether the mode was on or off(e.g. with an UI switcher).
Arguments
- options(optional)
GeoModeOptions
Returns
-
Promise<void>