new GeoportalMousePosition(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
options for function call.
|
Example
var MousePosition = new ol.control.GeoportalMousePosition({
collapsed : false,
displayCoordinates : true,
displayAltitude : true,
altitude : {
triggerDelay : 100,
responseDelay : 500,
noDataValue : -99999,
noDataValueTolerance : 99000,
serviceOptions : {}
},
systems : [
{
crs : "EPSG:3857",
label : "Mercator",
type : "Metric"
},
{
crs : "EPSG:4326",
label : "Géographiques",
type : "Geographical"
}
],
units : ["DEC", "DMS"]
});
Extends
- ol.control.Control
Members
-
collapsed
-
{Boolean} specify if MousePosition control is collapsed (true) or not (false)
Methods
-
addSystems(systems)
Ol3/Controls/MousePosition.js, line 238 -
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)
Ol3/Controls/MousePosition.js, line 337 -
Display or hide elevation panel
Name Type Description displayAltitude Boolean true to display elevation panel, false to hide it
-
displayCoordinates(displayCoordinates)
Ol3/Controls/MousePosition.js, line 350 -
Display or hide coordinates panel
Name Type Description displayCoordinates Boolean true to display coordinates panel, false to hide it
-
removeSystem(systemCode)
Ol3/Controls/MousePosition.js, line 256 -
Remove projection system (in case there are several system with same code, only the first one will be removed)
Name Type Description systemCode String CRS alias (from proj4 defs)
-
setAltitudeOptions(options)
Ol3/Controls/MousePosition.js, line 317 -
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)
Ol3/Controls/MousePosition.js, line 364 -
Collapse or display control main container
Name Type Description collapsed Boolean True to collapse control, False to display it
-
setMap()
Ol3/Controls/MousePosition.js, line 126 -
Overload ol.control.Control setMap method, called when
-
setUnits(units)
Ol3/Controls/MousePosition.js, line 297 -
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