Reputation: 43923
Using the jquery gmap3
plugin, I have this function, and basically when it runs, its supposed to loop through all the markers on the map, and alert their tag data. But this code isn't working... Does anyone know how to do this?
This alerts undefined
. However the marker is being returned, I just don't know how to get its tag data.
Thanks.
function search_markers() {
var map_id = "#my_map";
var value = document.getElementById('tags').value;
$(map_id).gmap3({
get: {
name:"marker",
all: true,
callback: function(objs) {
$.each(objs, function(i, obj){
//obj.setIcon("http://maps.google.com/mapfiles/marker_green.png");
alert(obj.tag);
});
}
}
});
}
Upvotes: 0
Views: 821
Reputation: 1
$('#mapaZonaPoligono').gmap3({
get: {
name:"marker",
all: true,
callback: function(objs) {
$.each(objs, function(i, obj){
$.each( obj, function( key, value ) {
alert( key + ": " + value );
});
});
}
}
});
Upvotes: 0