Adding event to Infowindow to navigate to Detail Page

Hi there,

I am able to display multiple markers with infoWindow on the map based on data from database

I'm also able to navigate to a detail page when I click on any InfoWindow of any markers .
Now I need when I click on a specific infoWindow it sets my selection to a specific db item and it takes me to the detail page which should diplay the detail info of that selected db item . Any tips on how to achieve this would be greatly apprciated ?

Do I have to store my selection to LVS by clicking on the InfoWindow to achieve that ?

This is the code I'm implementing


var markerLatLng = new google.maps.LatLng(localStorage.getItem('markerLat'), localStorage.getItem('markerLng'));

var map = Appery("google_map").options.mapElement.gmap('get', 'map');

var BindMarker = function(marker, pageNagivateTo){
google.maps.event.addListener(marker, 'click', function() {
var nextPage = pageNagivateTo ? pageNagivateTo : "detail_page"; Apperyio.navigateTo(nextPage); });

var marker = new MarkerWithLabel ({
position: markerLatLng,
map: map,
animation: google.maps.Animation.DROP,
clickable: true,

var infowindow = new google.maps.InfoWindow({ content:data.results[0].address_components[0].long_name});
google.maps.event.addListener(marker, 'dblclick', function()
{"google_map").gmap,marker); });

for (var i = 0, j = markerLatLng.length; i < j; i++)
CreateMarker(markerLatLng, i);

BindMarker(marker, "detail_page");



Thanks in advance
1 person has
this question