On Sep 16, 11:51 am, 83maxi <[EMAIL PROTECTED]> wrote:
> Why change the icon of a GMarker?
Because the original coder wanted to (or perhaps they had a
requirement to do so). Why don't you ask them?
(or are they supposed to recognize their code from the snippet you
posted?)
>
> 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);
>
>
>
> }
> }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---