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)
OpenLayers/Controls/MousePosition.js, line 268 -
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)
OpenLayers/Controls/MousePosition.js, line 324 -
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)
OpenLayers/Controls/MousePosition.js, line 444 -
Display or hide elevation panel
Name Type Description displayAltitude Boolean true to display elevation panel, false to hide it
-
displayCoordinates(displayCoordinates)
OpenLayers/Controls/MousePosition.js, line 458 -
Display or hide coordinates panel
Name Type Description displayCoordinates Boolean true to display coordinates panel, false to hide it
-
onMousePositionEditModeClick(editing)
OpenLayers/Controls/MousePosition.js, line 1387 -
this method is called by event 'click' on input coordinate
Name Type Description editing Boolean editing mode
-
removeSystem(systemCrs)
OpenLayers/Controls/MousePosition.js, line 342 -
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)
OpenLayers/Controls/MousePosition.js, line 424 -
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)
OpenLayers/Controls/MousePosition.js, line 472 -
Collapse or display control main container
Name Type Description collapsed Boolean True to collapse control, False to display it
-
setMap(map)
OpenLayers/Controls/MousePosition.js, line 178 -
Overload ol.control.Control setMap method, called when
Name Type Description map Object the map
-
setUnits(units)
OpenLayers/Controls/MousePosition.js, line 404 -
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