Skip to content

Instantly share code, notes, and snippets.

@amiel
Created June 4, 2012 22:11
Show Gist options
  • Save amiel/2871121 to your computer and use it in GitHub Desktop.
Save amiel/2871121 to your computer and use it in GitHub Desktop.
google maps api v3 custom icons hack for Internet Explorer
var point = xxx; // set from geolocation
var image = new google.maps.MarkerImage(
map_icon,
new google.maps.Size(18,29),
new google.maps.Point(0,0),
new google.maps.Point(0,29)
);
var marker = new google.maps.Marker({
draggable: true,
raiseOnDrag: false,
icon: image,
map: map,
position: point
});
// Stop the 'drag' event, and put the marker right back where it was.
google.maps.event.addListener(marker, 'drag', function(e) {
e.stop();
marker.setPosition(point);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment