Select to view content in your preferred language

Pan the map while dragging the marker as Google maps

923
3
02-09-2011 07:57 PM
Arusham
Emerging Contributor
Hi,

I am trying to implement the the autopan facility in Google maps to our own maps using flex api when we drag a marker map gets panned automatically. As i had already added a marker symbol and able to drag the marker by mousedown , mouseup,mousemove event.

Please suggest me to pan the map when the marker is dragged.

Regards
Arun Mohan
Tags (2)
0 Kudos
3 Replies
DasaPaddock
Esri Regular Contributor
By default you should be able to pan the map when clicking on a marker unless you've added some mouse listeners to the Graphic. You can still pan if you set this to false:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Graphic.html#checkForMouseListeners
0 Kudos
Arusham
Emerging Contributor
Hi Dasa Paddock ,

Thanks for your reply i had already done with the mouse listeners but it doesn't give me the functionality i m looking for.

I need exactly like http://koti.mbnet.fi/ojalesa/exam/draggable.html where in this link they have a small marker at the center which can be dragged and while dragging the map pans automatically. Please help whether we can do the same function using flex api.

Regards
Arun Mohan
0 Kudos
DasaPaddock
Esri Regular Contributor
The user can press the arrow keys to pan while they're moving the Graphic. You could try calling map.panX() methods when the user gets close to an edge.

We'll also look at supporting this in the EditTool in a future release.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tools/EditTool.html
0 Kudos