MAP_CLICK event
April 20, 2018 ยท View on GitHub
This event is fired when you click on the map.
map.on(GoogleMapsEvent.MAP_CLICK).subscribe((params: any[]) => {
})
Parameters
| name | type | description |
|---|---|---|
| params[0] | LatLng | clicked position |
| params[1] | GoogleMap | map instance itself |
Demo code
<div id="map_canvas"></div>
map: GoogleMap;
loadMap() {
this.map = GoogleMaps.create("map_canvas");
this.map.on(plugin.google.maps.event.MAP_CLICK).subscribe((params: any[]) => {
let latLng: LatLng = params[0];
this.map.addMarkerSync({
position: latLng,
title: latLng,
animation: GoogleMapsAnimation.DROP
});
});
}
