MapEventType
Contents
MapEventType:
object
MapEventType
- a mapping between the event name and the event value.
These events are used with the Map#on method.
When using a layerId
with Map#on method, please refer to MapLayerEventType.
The following example can be used for all the events.
Example
// Initialize the map
let map = new TrimbleMaps.Map({ // map options });
// Set an event listener
map.on('the-event-name', () => {
console.log('An event has occurred!');
});
Type declaration
boxzoomcancel
boxzoomcancel:
TrimbleMapsZoomEvent
Fired when the user cancels a “box zoom” interaction, or when the bounding box does not meet the minimum size threshold. See BoxZoomHandler.
boxzoomend
boxzoomend:
TrimbleMapsZoomEvent
Fired when a “box zoom” interaction ends. See BoxZoomHandler.
boxzoomstart
boxzoomstart:
TrimbleMapsZoomEvent
Fired when a “box zoom” interaction starts. See BoxZoomHandler.
click
click:
MapMouseEvent
Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
See
contentfilter
contentfilter:
ContentFilter
Fired when content filter changes
contentremove
contentremove:
ContentRemove
Fired when content is removed
contentvisibility
contentvisibility:
ContentVisibility
Fired when content visibility changes
contextmenu
contextmenu:
MapMouseEvent
Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
customplaces
customplaces:
customplaces
Fires when custom places layer loaded
customroad
customroad:
customRoad
Fired when customroad is loaded
customroadloading
customroadloading:
customRoadLoading
Fired when customroad is loading
data
data:
MapDataEvent
Fired when any map data loads or changes. See MapDataEvent for more information.
See
Display HTML clusters with custom properties
dataabort
dataabort:
MapDataEvent
Fired when a request for one of the map’s sources’ tiles or data is aborted.
dataloading
dataloading:
MapDataEvent
Fired when any map data (style, source, tile, etc) begins loading or
changing asynchronously. All dataloading
events are followed by a data
,
dataabort
or error
event.
dblclick
dblclick:
MapMouseEvent
Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on the map in rapid succession.
Note: Under normal conditions, this event will be preceded by two click
events.
drag
drag:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired repeatedly during a “drag to pan” interaction. See DragPanHandler.
dragend
dragend:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired when a “drag to pan” interaction ends. See DragPanHandler.
See
dragstart
dragstart:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired when a “drag to pan” interaction starts. See DragPanHandler.
error
error:
ErrorEvent
Fired when an error occurs. This is GL JS’s primary error reporting
mechanism. We use an event instead of throw
to better accommodate
asynchronous operations. If no listeners are bound to the error
event, the
error will be printed to the console.
idle
idle:
TrimbleMapsEvent
Fired after the last frame rendered before the map enters an “idle” state:
- No camera transitions are in progress
- All currently requested tiles have loaded
- All fade/transition animations have completed
load
load:
TrimbleMapsEvent
Fired immediately after all necessary resources have been downloaded and the first visually complete rendering of the map has occurred.
See
mousedown
mousedown:
MapMouseEvent
Fired when a pointing device (usually a mouse) is pressed within the map.
See
mousemove
mousemove:
MapMouseEvent
Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map. As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
See
- Get coordinates of the mouse pointer
- Highlight features under the mouse pointer
- Display a popup on over
mouseout
mouseout:
MapMouseEvent
Fired when a point device (usually a mouse) leaves the map’s canvas.
mouseover
mouseover:
MapMouseEvent
Fired when a pointing device (usually a mouse) is moved within the map. As you move the cursor across a web page containing a map, the event will fire each time it enters the map or any child elements.
See
- Get coordinates of the mouse pointer
- Highlight features under the mouse pointer
- Display a popup on hover
mouseup
mouseup:
MapMouseEvent
Fired when a pointing device (usually a mouse) is released within the map.
See
move
move:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired repeatedly during an animated transition from one view to another, as the result of either user interaction or methods such as Map#flyTo.
See
Display HTML clusters with custom properties
moveend
moveend:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired just after the map completes a transition from one view to another, as the result of either user interaction or methods such as Map#jumpTo.
See
Display HTML clusters with custom properties
movestart
movestart:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired just before the map begins a transition from one view to another, as the result of either user interaction or methods such as Map#jumpTo.
pitch
pitch:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired repeatedly during the map’s pitch (tilt) animation between one state and another as the result of either user interaction or methods such as Map#flyTo.
pitchend
pitchend:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired immediately after the map’s pitch (tilt) finishes changing as the result of either user interaction or methods such as Map#flyTo.
pitchstart
pitchstart:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired whenever the map’s pitch (tilt) begins a change as the result of either user interaction or methods such as Map#flyTo .
pointsofinterest
pointsofinterest:
PointsofInterestEvent
Fired when pointsofinterest is loaded
pointsofinterestloading
pointsofinterestloading:
PointsofInterestLoading
Fired when pointsofinterest is loading
remove
remove:
TrimbleMapsEvent
Fired immediately after the map has been removed with Map#remove.
render
render:
TrimbleMapsEvent
Fired whenever the map is drawn to the screen, as the result of
- a change to the map’s position, zoom, pitch, or bearing
- a change to the map’s style
- a change to a GeoJSON source
- the loading of a vector tile, GeoJSON file, glyph, or sprite
resize
resize:
TrimbleMapsEvent
Fired immediately after the map has been resized.
roadsurface
roadsurface:
RoadSurfaceEvent
Fired when roadsurface is loaded
roadsurfaceloading
roadsurfaceloading:
RoadSurfaceLoading
Fired when roadsurface is loading
rotate
rotate:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired repeatedly during a “drag to rotate” interaction. See DragRotateHandler.
rotateend
rotateend:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired when a “drag to rotate” interaction ends. See DragRotateHandler.
rotatestart
rotatestart:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|undefined
>
Fired when a “drag to rotate” interaction starts. See DragRotateHandler.
sourcedata
sourcedata:
MapSourceDataEvent
Fired when one of the map’s sources loads or changes, including if a tile belonging to a source loads or changes.
sourcedataabort
sourcedataabort:
MapSourceDataEvent
Fired when a request for one of the map’s sources’ data is aborted.
sourcedataloading
sourcedataloading:
MapSourceDataEvent
Fired when one of the map’s sources begins loading or changing asynchronously.
All sourcedataloading
events are followed by a sourcedata
, sourcedataabort
or error
event.
styledata
styledata:
MapStyleDataEvent
Fired when the map’s style loads or changes.
styledataloading
styledataloading:
MapStyleDataEvent
Fired when the map’s style begins loading or changing asynchronously.
All styledataloading
events are followed by a styledata
or error
event.
styleimagemissing
styleimagemissing:
MapStyleImageMissingEvent
Fired when an icon or pattern needed by the style is missing. The missing image can be added with Map#addImage within this event listener callback to prevent the image from being skipped. This event can be used to dynamically generate icons and patterns.
See
Generate and add a missing icon to the map
terrain
terrain:
MapTerrainEvent
Fired when terrain is changed
tiledataloading
tiledataloading:
MapDataEvent
touchcancel
touchcancel:
MapTouchEvent
Fired when a touchcancel
event occurs within the map.
touchend
touchend:
MapTouchEvent
Fired when a touchend
event occurs within the map.
See
touchmove
touchmove:
MapTouchEvent
Fired when a touchmove
event occurs within the map.
See
touchstart
touchstart:
MapTouchEvent
Fired when a touchstart
event occurs within the map.
See
traffic
traffic:
TrafficEvent
Fired when traffic is loaded
trafficcamera
trafficcamera:
TrafficCameraEvent
Fired when trafficcamera is loaded
trafficcameraloading
trafficcameraloading:
TrafficCameraLoading
Fired when trafficcamera is loading
trafficincident
trafficincident:
TrafficIncidentEvent
Fired when trafficincident is loaded
trafficincidentloading
trafficincidentloading:
TrafficIncidentLoading
Fired when trafficincident is loading
trafficloading
trafficloading:
TrafficLoading
Fired when traffic is loading
truckrestriction
truckrestriction:
TruckRestrictionEvent
Fired when truckrestriction is loaded
truckrestrictionloading
truckrestrictionloading:
TruckRestrictionLoading
Fired when truckrestriction is loading
weatheralert
weatheralert:
WeatherAlertEvent
Fired when weatheralert is loaded
weatheralerteventname
weatheralerteventname:
WeatherAlertEventname
Fired when customroad is loading
weatheralertloading
weatheralertloading:
WeatherAlertLoading
Fired when weatheralert is loading
weathercloud
weathercloud:
WeatherCloudEvent
Fired when weathercloud is loaded
weathercloudloading
weathercloudloading:
WeatherCloudLoading
Fired when weathercloud is loading
weatherradar
weatherradar:
WeatherRadarEvent
Fired when weatherradar is loaded
weatherradarloading
weatherradarloading:
WeatherRadarLoading
Fired when weatherradar is loading
webglcontextlost
webglcontextlost:
MapContextEvent
Fired when the WebGL context is lost.
webglcontextrestored
webglcontextrestored:
MapContextEvent
Fired when the WebGL context is restored.
wheel
wheel:
MapWheelEvent
Fired when a wheel
event occurs within the map.
zoom
zoom:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired repeatedly during an animated transition from one zoom level to another, as the result of either user interaction or methods such as Map#flyTo.
zoomend
zoomend:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired just after the map completes a transition from one zoom level to another, as the result of either user interaction or methods such as Map#flyTo.
zoomstart
zoomstart:
TrimbleMapsEvent
<MouseEvent
|TouchEvent
|WheelEvent
|undefined
>
Fired just before the map begins a transition from one zoom level to another, as the result of either user interaction or methods such as Map#flyTo.