简体   繁体   中英

Adding an id to an infowindow (google maps API)

I have a map with infowindows. In my code, I open infowindows and I want to add events, like divs, on this infowindows.

What I would like to now it's if it is possible to add an id to an infowindow ( google.maps.InfoWindow({}); ) with javascript google's maps api 3.

I declare the infowindows like this:

var infowindow = new google.maps.InfoWindow({});
infowindow.setContent(
   '<p>TEST Stack overflow</p>'
   );

Why don't you add an id to the tags which you are creating and then access them that way?

Look at the google example which references a string.

Google shows an example of the way in which they declare info windows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM