Skip to content Skip to sidebar Skip to footer

Changing Google Maps V3 Maker Icon The Correct Way?

The code in example 1 works. I would like to understand the marker.setIcon(); function more (new to JavaScript also). My question is. In the documentation for Google maps you see s

Solution 1:

You're giving a V2 answer for a V3 question.

There is no GIcon in V3.

var image = new google.maps.MarkerImage("newIcon.png");

Can be used inside your marker as the icon.

var marker = new google.maps.Marker({
        position: new google.maps.LatLng(lat,lng),
        icon:image
    });

Post a Comment for "Changing Google Maps V3 Maker Icon The Correct Way?"