capacitor-community / google-maps

Capacitor Plugin using native Google Maps SDK for Android and iOS.
https://capacitor-community.github.io/google-maps/
MIT License
153 stars 64 forks source link

Need a HTML Info Window option. #128

Closed mugundhan26 closed 2 years ago

mugundhan26 commented 2 years ago

Need an option to implement HTML info window in Map for Both IOS & Android.

Example in Cordova.

var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {
  var htmlInfoWindow = new plugin.google.maps.HtmlInfoWindow();

  var html = [
    'This is <b>Html</b> InfoWindow',
    '<br>',
    '<button onclick="javascript:alert(\'clicked!\');">click here</button>',
  ].join("");
  htmlInfoWindow.setContent(html);

  map.addMarker({
    position: {lat: 0, lng: 0},
    draggable: true
  }, function(marker) {

    marker.on(plugin.google.maps.event.MARKER_CLICK, function() {
      htmlInfoWindow.open(marker);
    });
    marker.trigger(plugin.google.maps.event.MARKER_CLICK);

  });
});

Need the same option. Please try to create it ASAP.

tafelnl commented 2 years ago

As of v2 (see the next branch, it's still WIP though) we've made it possible to add any custom HTMLElement on top of the Map. So that makes this feature superfluous. Therefore I will close this issue (I am doing a cleanup on the open issues).