Javascript gmaps api关闭按钮没有显示

时间:2017-05-27 10:56:45

标签: angular google-maps-api-3 ionic2 infowindow ionic3

我的问题类似于this question

问题是我关闭Infowindow上的按钮不会被显示,但按钮有效。 我尝试了很多东西,也许你可以提供一点提示或解决方案:)

非常感谢您提前!

Home.ts

setProductMarker(product :any, productLocation :any){

var productMarker = new google.maps.Marker({
  position: new google.maps.LatLng(JSON.parse(productLocation).latitude, JSON.parse(productLocation).longitude),
  map: this.map,
  title: "Product"
})


var infoWindow = new google.maps.InfoWindow({
  content: "test"
});

google.maps.event.addListener(infoWindow, 'domready', () => {
  //now my elements are ready for dom manipulation
  var clickableItem = document.getElementById('clickableItem');
  clickableItem.addEventListener('click', () => {
    this.goToProductPage(product);
  });
});


productMarker.addListener('click', event => {
  if( this.prev_infowindow ) {
       this.prev_infowindow.close();
    }

    this.prev_infowindow = infoWindow;
infoWindow.open(this.map, productMarker);

});

}

home.html的

<div id="map"></div>

home.css

img[src*="gstatic.com/"], img[src*="googleapis.com/"] {
    max-width: none;
 }

以下是一个infoWindow的屏幕截图: enter image description here

奇怪的是,当我将我的应用程序放在ftp服务器上时,关闭按钮就在那里.. enter image description here

0 个答案:

没有答案