我正在寻找使用我的Ionic 2/Angular 2应用程序实现GoogleMap.OnInfoWindowClickListener的语法。我想重定向到新页面,即当用户单击Google地图内的信息窗口时,将新页面推送到NavController上的堆栈。在Ionic 2中实现GoogleMap.OnInfoWindowClickListener
我已经能够使用下面的代码来设置标记:
//Creates the event listener for clicking the marker and places the marker on the map
google.maps.event.addListener(marker, 'click', (function(marker, markerCount) {
return function() {
infowindow.setContent(htmlMarkupForInfoWindow);
infowindow.open(this.map, marker);
}
})(marker, this.markerCount));
不幸的是,该函数的信息窗口里面的内容调用失去参考“这”导致的错误。任何帮助表示赞赏!
欣赏提示,但这并没有解决原来的问题。我正在寻找一个实现OnInfoWindowClickListener的例子,或者是任何信息窗口触发的事件。我引用的代码是为了表明我能够绑定到标记点击事件,但没有成功捕获某人单击打开的信息窗口。 – smedcalf