The coordinates at the centre of the map view.
The heading of the camera, in degrees relative to true north.
The span of the map view in map units.
The span of the map view in metres.
Whether the shift or control key needs to be held down for mouse wheel events to affect the map view.
If a mouse wheel event is handled by the map view, MapLayr will prevent the event's default action, stopping the browser window from scrolling. If the host web page contains custom scrolling logic, it is recommended that it checks that the event's defaultPrevented
property is still false
before it decides to apply that logic.
Whether the mouse wheel zooms the map.
If set to false, and neither the alt nor meta/command keys are held down, mouse wheel events will scroll the map instead of panning the map.
If the control key is held down, the map always zooms in regardless of this property.
Adds the given map layer to the map.
The map layer to add to the map view.
Removes the given map layer from the map view.
The map layer to remove.
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in ยง 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Optional
options: boolean | AddEventListenerOptionsDispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Adjusts the camera using the specified options with an optional animation.
The new properties of the camera. A missing property indicates that that property of the camera shouldn't be affected.
Adds the given shape to the map.
The shape to add to the map view.
Removes the given shape from the map view.
The shape to remove.
The user location markers which are drawn on the map.
Adds the given user location marker to the map.
The user location marker to add to the map view.
Removes the given user location marker from the map view.
The user location marker to remove.
An interactive instance of a map attached to the DOM.
Remarks
Call Map.attach to create instances of this class.
Fires
MapView#camerachange - Fired when the camera position, heading, or span changes.
Fires
MapView#click - Fired when the user clicks on the map. The event is a MapMouseEvent with map coordinates.
Fires
MapView#dblclick - Fired when the user double-clicks on the map. The event is a standard MouseEvent.