Google Maps click on InfoWindow

[亡魂溺海] 提交于 2019-12-23 04:51:21

问题


I am trying to call a function when user touches(clicks) on infoWindow. User scenario: User clicks on a google maps marker, an info window opens. User clicks on an item in infoWindow content. This click calls a function and another page opens. I am doing this in ionic 2 and typescript.

Here is the info window content :

text2 = text2 + '<div id="wrapper">' + '<div id="sidebar" >' + '<h5 onclick()=" '+ this.goToDealPage(businessDetails.deals[a])+ ' ">'+ businessDetails.deals[a].deal.title +'</h5></div>'+ '<div id="content"><h4 class="realprice"><del>'+ businessDetails.deals[a].deal.real_price + '</del></h4>' +'<h4 class="dealprice">'+ businessDetails.deals[a].deal.deal_price +'</h4></div>'+ '<br></div>';

What is happening now: When I click on the marker, this.goToDealPage(..) is directly called and the page opens immediately before clicking on infoWindow. I want it to be called when user click on infoWindow link not the marker itself.

来源:https://stackoverflow.com/questions/42050376/google-maps-click-on-infowindow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!