djangodeveloper
djangodeveloper

Reputation: 213

Change Icon Marker Color in Google Maps

How do change the color of icon markers in Google Maps?

Example:

var icon = {
      url: 'custom.svg', // url

}

var marker = new google.maps.Marker({
        position: {lat: p[1], lng: p[2]},
        map: map,
        icon: icon,
});

Inside var icon I tried to fill color and color, but it did not change the color of the icon map marker. Does anybody know how to change the color?

Upvotes: 0

Views: 143

Answers (1)

Use following code -

 let marker = new google.maps.Marker({
    map: map,
    position: {lat: -34.397, lng: 150.644},
    icon: {
      url: "http://maps.google.com/mapfiles/ms/icons/blue-dot.png"
    }
  });

Upvotes: -1

Related Questions