I uploaded a GeoJson file into GMaps API that has many polygon features in it, and now I'd like to create a pop up for each polygon. The content will be obtained from the attribute table of the GeoJson file from a field called "NAME".
1 Answer
This is a follow up answer. The quick way to do it is to use a listener event and extract values for each polygon using
event.feature.H.ATTRIBUTE_FIELD;
So, in my case it ended up as the following?
Cities.addListener('click', function(event) {
var str = event.feature.H.NAME;
infowindow.setContent(str);
infowindow.setPosition(event.LatLng());
infowindow.open(map);
});