These events are fired when the camera moves.
- The
MAP_DRAG_START
event is fired when you drag the map with gesture. - The
MAP_DRAG
event is fired while you are dragging the map. - The
MAP_DRAG_END
event is fired when the dragging is stopped.
<div class="map" id="map_canvas">
<span class="smallPanel">map status : <span id="label"></span></span>
</div>
var label = document.getElementById("label");
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {
// Catch all map drag events
map.on(plugin.google.maps.event.MAP_DRAG_START, onMapDragEvents);
map.on(plugin.google.maps.event.MAP_DRAG, onMapDragEvents);
map.on(plugin.google.maps.event.MAP_DRAG_END, onMapDragEvents);
});
function onMapDragEvents() {
label.innerText = this.event.type;
}