Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the Google Maps V3 Marker drag animation?

When I drag and drop a marker it raises a little bit and a skewed X appears underneath it to denote dragging position.

Is there anyway to get rid of this completely? I have custom markers and would like to display their dragging state in a different way.

like image 739
Flarex Avatar asked Feb 23 '23 14:02

Flarex


2 Answers

You can set the property of the marker raiseOnDrag to false

var marker = new google.maps.Marker({
  draggable: true,
  map: map,
  raiseOnDrag: false
});

And then you could use ScottE solution to create a custom drag effect.

like image 83
Charles Ouellet Avatar answered Feb 26 '23 03:02

Charles Ouellet


raiseOnDrag is undocumented in the current API version (3.17). Instead there is a crossOnDrag property:

crossOnDrag : boolean - If false, disables cross that appears beneath the marker when dragging. This option is true by default.

https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions


Edit (Sep. 2016): raiseOnDrag is still undocumented in 3.25

like image 38
MrUpsidown Avatar answered Feb 26 '23 04:02

MrUpsidown