Move a marker on mouse move event of map

567 views
Skip to first unread message

shah

unread,
Aug 19, 2011, 9:54:23 AM8/19/11
to Google Maps JavaScript API v3
I want to move a maker on mouse move event of map.
I am using the code below, but while moving the mouse , i can still
notice a delay between mouse moved and update of maker's position. any
idea about other alternatives?

marker = g.Marker({position:null,map:_mapInstance});
_mouseMoveListner = google.maps.event.addListener(FM.Map.Instance,
"mousemove", function(event){


marker.setPosition( event.latLng);


});


thanks

Esa

unread,
Aug 19, 2011, 11:04:35 AM8/19/11
to Google Maps JavaScript API v3
I would try {optimized: false} in Marker options.
http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions

That makes the marker an independent DOM object. Not rendered by
canvas layer.

This is just a wild quess but please report.

shah

unread,
Aug 19, 2011, 11:13:31 AM8/19/11
to Google Maps JavaScript API v3
Tried but no success. The problem is I can see the racing condition
while the mouse is being moved on map, the action has to be similar to
what we get while we are dragging a draggable marker.



On Aug 19, 4:04 pm, Esa <esa.ilm...@gmail.com> wrote:
> I would try {optimized: false} in Marker options.http://code.google.com/apis/maps/documentation/javascript/reference.h...
Reply all
Reply to author
Forward
0 new messages