Why change the icon of a GMarker?
example:
var myIcon = new GIcon(G_DEFAULT_ICON);
myIcon.image = 'img/googlemaps/iconos/'+unaEmpresa['icono'];
myIcon.shadow = 'img/googlemaps/iconos/shadow-Oficina_R3.png';
markerOptions = { icon:myIcon };
// Creo una marca con el punto y el icono
var marker = new GMarker(point,markerOptions);
// Creo un la ventana de info
GEvent.addListener(marker, "click", function() {
cargarFichaEmpresa(marker,unaEmpresa['id']);
});
// Agrego el punto al mapa
map.addOverlay(marker);
// Agrego a la coleccion de iconos dibujados
cantIconosDibujados++;
//SAVE MARKER
markers[unaEmpresa['id']] = marker;
....
....
....
....
funtion changeMarker(id){
mark=markers[id]
map.removeOverlay(mark);//remuevo la marca
//Why change the icon of a GMarker
mark.setIcon(new icono);
map.addOverlay(mark);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---