Get marker id in google maps

前端 未结 2 1232
北恋
北恋 2020-12-17 03:59

I want to pass related marker id by clicking marker on google map. I am using marker.getId() function to retrieve marker id. But the marker id is not passing along with url.

2条回答
  •  旧时难觅i
    2020-12-17 04:57

    you can try directly to access the id:

    google.maps.event.addListener(marker, 'click', function() {               
      window.location = "www.cickstart.com/" + marker.id;
    });
    

提交回复
热议问题