Optional
opt_options: MousePositionOptionsMouse position options.
A control to show the 2D coordinates of the mouse cursor. By default, these
are in the view projection, but can be in any supported projection.
By default the control is shown in the top right corner of the map, but this
can be changed by using the css selector .ol-mouse-position
.
stable
Return the coordinate format type used to render the current position or undefined.
The format to render the current position in.
stable
Return the projection that is used to report the mouse position.
The projection to report mouse position in.
stable
Listen for a certain type of event.
The event type or array of event types.
The listener function.
Optional
opt_this: ObjectThe object to use as this
in listener
.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
stable
Listen once for a certain type of event.
The event type or array of event types.
The listener function.
Optional
opt_this: ObjectThe object to use as this
in listener
.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
stable
Static
renderUpdate the mouseposition element.
Map event.
Set the coordinate format type used to render the current position.
The format to render the current position in.
stable
Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.
Map.
stable
Set the projection that is used to report the mouse position.
The projection to report mouse position in.
stable
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
Values.
Optional
opt_silent: booleanUpdate without triggering an event.
stable
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.
Static
unRemoves an event listener using the key returned by on()
or once()
.
Note that using the ol.Observable.unByKey static function is to
be preferred.
stable
Generated using TypeDoc
Classdesc
A control to show the 2D coordinates of the mouse cursor. By default, these are in the view projection, but can be in any supported projection. By default the control is shown in the top right corner of the map, but this can be changed by using the css selector
.ol-mouse-position
.Param: opt_options
Mouse position options.
Api
stable