Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.39 KB

File metadata and controls

53 lines (41 loc) · 1.39 KB

⚠️ This document is aim for older versions (from 2.3.0 to 2.5.3). Document for new version is https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/README.md

POI_CLICK event

This event is fired when you tap on POIs(such as building icon).

Parameters

name type description
placeId string place id for Google Places API
name string place name
latLng LatLng place location

Demo code

<div id="map_canvas"></div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div, {
  camera: {
    target: {
      lat: 37.422000,
      lng: -122.084057
    },
    zoom: 15
  }
});

// Show a virtual dialog (loader.js)
showVirtualDialog(div, "Click on POI icon!");

map.on(plugin.google.maps.event.POI_CLICK, function(placeId, name, latLng) {
  var marker = map.addMarker({
    'position': latLng,
    'title': [
      "placeId = " + placeId,
      "name = " + name,
      "position = " + latLng.toUrlValue()
    ].join("\n")
  });
  marker.showInfoWindow();
});