ramesh
ramesh

Reputation: 2477

How do I add custom marker for gmap.js?

I am currently trying to add custom marker for for a map that I am using and I was wondering if anyone has had managed to add a customer marker when using gmap.js?

Upvotes: 8

Views: 20570

Answers (1)

Praveen
Praveen

Reputation: 56509

map.addMarker({
    lat: latlng.lat(),
    lng: latlng.lng(),
    icon: "/images/mapicon.png"
});

or we can initialize:

var marker = new google.maps.Marker({
  position: myLatLng,
  map: map,
  icon: 'schools_maps.png',
  shadow: 'schools_maps.shadow.png'
});

Upvotes: 21

Related Questions