Unable to Navigate Map once reached to map edge while drawing Free Polyline and Polygon.

383
5
05-20-2019 11:58 PM
ahmadwali
New Contributor

Esri allow move map via mouse pan (Map navigation | Guide | ArcGIS API for JavaScript 3.28 ), while drawing any geometry shape other than free polyline and ploygon.

Anyone can help how can we move map once reached at map edge while drawing free ploygon and ploygon?

0 Kudos
5 Replies
VictorTey
Esri Contributor

Perhaps you can do map.enablePan when a key is pressed and hold down and when released, map.disablePan

0 Kudos
ahmadwali
New Contributor

Thanks for reply!

How can i find that the mouse reached at the edge of Map while drawing freehand polygon and polyline?  here at this example: https://developers.arcgis.com/javascript/3/samples/util_buffergraphic/  try to draw freehand ployline, so how can i come to know the mouse drawing reached at edge of map?

actually i want to move the map once drawing reached to edge of map, so at a time mouse is dragging(for drawing) and arrow keys should move the map. is it possible?

0 Kudos
VictorTey
Esri Contributor

I might really be missing the point here but using the map extent and using the map mouse move event as follow

https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=map_xycoords

can provide you information on where your mouse currently is in relation to the map current extend. 

If this what you are after?

0 Kudos
ahmadwali
New Contributor

Victor Tey are you clear about my problem?

let me explain again:

i am working on drawing geometry shapes on map, so during drawing of shapes (other than Freehand polyline/ploygon) i can move map using mouse pan and arrow keys, But i am unable to move map(via arrow keys) during drawing  FREEHAND polyline/polygon.

so in this case i was thinking i should call mapRight(), mapLeft() methods if i know mouse reached at edges.

let me know you got issue, or if you have any good solution please share

0 Kudos
ahmadwali
New Contributor

Victor Tey‌ could you please reply on this?

0 Kudos