new GeoportalMousePosition(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
options for function call.
|
Example
var MousePosition = new ol.control.GeoportalMousePosition({
"collapsed" : false,
"graggable" : true,
"displayCoordinates" : true,
"displayAltitude" : true,
"altitude" : {
"triggerDelay" : 100,
"responseDelay" : 500,
"noDataValue" : -99999,
"noDataValueTolerance" : 99000,
"serviceOptions" : {}
},
"systems" : [
{
"crs" : "EPSG:3857",
"label" : "Web Mercator",
"type" : "Metric"
},
{
"crs" : "EPSG:4326",
"label" : "Géographiques",
"type" : "Geographical"
},
{
"label" : "Lambert 93",
"crs" : "EPSG:2154",
"type" : "Metric",
"geoBBox" : {
"left" : -9.86,
"bottom" : 41.15,
"right" : 10.38,
"top" : 51.56
}
}
],
"units" : ["DEC", "DMS"]
});
Extends
- ol.control.Control
Members
-
collapsed
-
{Boolean} specify if MousePosition control is collapsed (true) or not (false)
-
draggable
-
{Boolean} specify if MousePosition control is draggable (true) or not (false)
Methods
-
addSystem(system)
Controls/MousePosition/MousePosition.js, line 273 -
Set additional projection system
Name Type Description system Object projection system
Name Type Description crs String Proj4 crs alias (from proj4 defs) e.g. "EPSG:4326"
label String optional CRS label to be displayed in control. Default is system.crs alias
type String optional CRS units type for coordinates conversion (one of control options.units). Default is "Metric"
-
addSystems(systems)
Controls/MousePosition/MousePosition.js, line 329 -
Set additional projection systems
Name Type Description systems Array Array of system object, with following properties :
Name Type Description crs String Proj4 CRS alias (from proj4 defs) e.g. "EPSG:4326"
label String CRS label (for coordinates conversion)
type String CRS units type to be displayed in control (one of control options.units). Default is "Metric"
-
displayAltitude(displayAltitude)
Controls/MousePosition/MousePosition.js, line 449 -
Display or hide elevation panel
Name Type Description displayAltitude Boolean true to display elevation panel, false to hide it
-
displayCoordinates(displayCoordinates)
Controls/MousePosition/MousePosition.js, line 463 -
Display or hide coordinates panel
Name Type Description displayCoordinates Boolean true to display coordinates panel, false to hide it
-
getContainer(){DOMElement}
Controls/MousePosition/MousePosition.js, line 498 -
Get container
-
onMousePositionEditModeClick(editing)
Controls/MousePosition/MousePosition.js, line 1311 -
this method is called by event 'click' on input coordinate
Name Type Description editing Boolean editing mode
-
removeSystem(systemCrs)
Controls/MousePosition/MousePosition.js, line 347 -
Remove projection system (in case there are several system with same code, only the first one will be removed)
Name Type Description systemCrs String CRS alias (from proj4 defs)
-
setAltitudeOptions(options)
Controls/MousePosition/MousePosition.js, line 429 -
Set control altitude options (useless if displayAltitude == false)
Name Type Description options Object altitude options
Name Type Description serviceOptions Object optional options of elevation service
responseDelay Number optional latency for elevation request, 500 ms by default
triggerDelay Number optional immobilisation time of movement on the map to trigger the elevation calculation, 200 ms by default
-
setCollapsed(collapsed)
Controls/MousePosition/MousePosition.js, line 477 -
Collapse or display control main container
Name Type Description collapsed Boolean True to collapse control, False to display it
-
setMap(map)
Controls/MousePosition/MousePosition.js, line 171 -
Overload ol.control.Control setMap method, called when
Name Type Description map Object the map
-
setUnits(units)
Controls/MousePosition/MousePosition.js, line 409 -
Set control units (to be displayed)
Name Type Description units Array list of all coordinates units, to be displayed in control units list.
Values may be "DEC" (decimal degrees), "DMS" (sexagecimal), "RAD" (radians) and "GON" (grades) for geographical coordinates,
and "M" or "KM" for metric coordinates