Map Interactions and Events
This chapter introduces you to map interactions and events, including:
1. Map interaction description
2. Map events
Map interaction description
PC side
Interaction | Action |
---|---|
Mouse Wheel | Zoom map |
Double left mouse button | Enlarge map |
Mouse drag | Move map |
keyboard arrow keys:up,down,left,right | Move map |
Mobile
Interaction | Action |
---|---|
Two-finger pinch | Zoom map |
Single finger swipe | Move map |
Map Events
A map event is an event triggered after a Map basemap operation, and a MapsEvent object is returned in the event callback. This object contains information such as the target of the trigger, the latitude and longitude of the trigger.
map.on('click',function (point) { document.getElementById("lnglat").value =point.lngLat.toString(); })