new MousePosition(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
options for function call.
|
Example
var mousePosition = new itowns.control.MousePosition({
collapsed : false,
displayCoordinates : true,
displayAltitude : true,
altitude : {
triggerDelay : 100,
responseDelay : 500,
serviceOptions : {}
},
systems : [
{
crs : "EPSG:3857",
label : "Mercator",
type : "Metric"
},
{
crs : "EPSG:32620",
label : "UTM 20N (Guadeloupe, Martinique)",
type : "Metric",
geoBBox : {
left: -66.00,
bottom : 0.00,
right : -60.00,
top : 84.00
}
}
],
units : ["DEC", "DMS"]
});
Extends
- itowns.control.Control
Members
-
collapsed
-
{Boolean} specify if MousePosition control is collapsed (true) or not (false)
-
constructor
-
Constructor (alias)
Methods
-
addSystem(system)
Itowns/Controls/MousePosition.js, line 162 -
Sets additional projection system
Name Type Description system Object Projection system defined in the Itowns/CRS/CRS.js class
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)
Itowns/Controls/MousePosition.js, line 210 -
Sets 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)
Itowns/Controls/MousePosition.js, line 327 -
Displays or hides elevation panel
Name Type Description displayAltitude Boolean true to display elevation panel, false to hide it
-
displayCoordinates(displayCoordinates)
Itowns/Controls/MousePosition.js, line 340 -
Displays or hides coordinates panel
Name Type Description displayCoordinates Boolean true to display coordinates panel, false to hide it
-
removeSystem(systemCrs)
Itowns/Controls/MousePosition.js, line 228 -
Removes 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)
Itowns/Controls/MousePosition.js, line 307 -
Sets 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 globe to trigger the elevation calculation, 200 ms by default
-
setCollapsed(collapsed)
Itowns/Controls/MousePosition.js, line 354 -
Collapses or displays control main container
Name Type Description collapsed Boolean True to collapse control, False to display it
-
setGlobe(globe)
Itowns/Controls/MousePosition.js, line 120 -
Bind globe to control
Name Type Description globe GlobeViewExtended the globe
-
setUnits(units)
Itowns/Controls/MousePosition.js, line 287 -
Sets 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