Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Google map marker

Tags:

google-maps

How i change my marker in google map.is possible to add our custome image to map?

Thanks, Companion

like image 910
user232751 Avatar asked Jan 26 '11 06:01

user232751


1 Answers

it is really simple - see http://code.google.com/intl/en-US/apis/maps/documentation/javascript/overlays.html#SimpleIcons

example straight from the google docs

var image = 'beachflag.png';
var myLatLng = new google.maps.LatLng(-33.890542, 151.274856);
var beachMarker = new google.maps.Marker({
  position: myLatLng,
  map: map,
  icon: image
});

if you want to do more complex stuff, you can also extend googles overlay classes and perform custom rendering ...

like image 172
roman Avatar answered Sep 29 '22 10:09

roman