How can I retrieve and object on google map without user interaction. Meaning the user do not click on the object. I have 10 polygons and I want user to navigate to each of them, manipulate maybe the color. without clicking on the polygon itself.
I do have a "next" button that when user click, it suppose to navigate to the next polygon setting it active and to be filled with desire color.
The polygons are store in an array with json format.
Im using Data Layer. I am not sure how to implement this. I can click on polygon itself and change the color, but I need to traverse them without clicking.
Thanks
making map:
function loadJson(url, style) { var jsonfile = $.getJSON(url).done(function (data){ map.data.addGeoJson(data); map.data.setStyle(style); }); }
change color
map.data.addListener('click', function(event) { mapName.data.overrideStyle(event.feature, currentStyle);
});