OptionalapiKey?: stringAPI key. The key "calcul" is used by default.
Optionalcollapsed?: booleanSpecify if MousePosition control should be collapsed at startup. Default is true.
OptionaldisplayAltitude?: booleanactivate (true) or deactivate (false) the altitude panel. True by default
OptionaldisplayCoordinates?: booleanactivate (true) or deactivate (false) the coordinates panel. True by default
Optionaldraggable?: booleanSpecify if widget is draggable
OptionaleditCoordinates?: booleanIf true, coordinates from the MousePosition control can be edited by users to re-center the view. False by default.
Optionalid?: numberAbility to add an identifier on the widget (advanced option)
OptionalmapCenterCallback?: Functioncallback...
Optionalssl?: booleanuse of ssl or not (default true, service requested using https protocol)
Optionalsystems?: any[]list of projection systems, default are Geographical ("EPSG:4326"), Web Mercator ("EPSG:3857"), Lambert 93 ("EPSG:2154") and extended Lambert 2 ("EPSG:27572"). Each array element (=system) is an object with following properties :
Optionalunits?: any[]list of 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
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"]
});
{Boolean} specify if MousePosition control is collapsed (true) or not (false)
ProtecteddisposedThe object has already been disposed.
{Boolean} specify if MousePosition control is draggable (true) or not (false)
ProtectedlistenerKey name.
Listener.
Type.
Listener.
Set additional projection system
projection system
Proj4 crs alias (from proj4 defs) e.g. "EPSG:4326"
Optionallabel?: stringCRS label to be displayed in control. Default is system.crs alias
Optionaltype?: stringCRS units type for coordinates conversion (one of control options.units). Default is "Metric"
Set additional projection systems
Array of system object, with following properties :
ProtectedapplyProtectedApply any properties from another object without triggering events.
The source object.
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type property.
Event object.
false if anyone called preventDefault on the
event object or if any of the listeners returned false.
Display or hide elevation panel
true to display elevation panel, false to hide it
Display or hide coordinates panel
true to display coordinates panel, false to hide it
Clean up.
ProtecteddisposeProtectedExtension point for disposable objects.
Get container
container
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Get an object of all property names and values.
Object.
Optionaltype: stringType. If not provided,
true will be returned if this event target has any listeners.
Has listeners.
The object has properties.
Key name.
Old value.
ProtectedonceProtectedonKey name.
Listener.
Type.
Listener.
Remove projection system (in case there are several system with same code, only the first one will be removed)
CRS alias (from proj4 defs)
Set control altitude options (useless if displayAltitude == false)
altitude options
OptionalresponseDelay?: numberlatency for elevation request, 500 ms by default
OptionalserviceOptions?: anyoptions of elevation service
OptionaltriggerDelay?: numberimmobilisation time of movement on the map to trigger the elevation calculation, 200 ms by default
Collapse or display control main container
True to collapse control, False to display it
Overload ol.control.Control setMap method, called when
the map
This function is used to set a target element for the control. It has no
effect if it is called after the control has been added to the map (i.e.
after setMap is called on the control). If no target is set in the
options passed to the control constructor and if setTarget is not called
then the control is added to the map's overlay container.
Target.
Set control units (to be displayed)
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
ProtectedunProtectedUnlisten for a certain type of event.
Type.
Listener.
options for function call.