Google Maps clicks on InfoWindow

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

Here is the content of the info window:

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's happening now: When I click on the marker, this.goToDealPage (..) is called directly and the page opens just before the infoWindow is clicked. I want it to be called when the user clicks on the infoWindow link, not the marker itself.

0


source to share





All Articles