Select to view content in your preferred language

Map Pan interfering with touch gestures

2239
4
06-27-2011 07:02 AM
Hwee_KiangSim
Emerging Contributor
Hi, I am using Arcgis silverlight for my Multitouch app. However, I find that the map panning action is always interferring with my touch move event. When I try to draw a polyline on graphics layer using drawmode = polyline, I end up panning the map when i use my fingers to drag. i had to workaround by using drawmode = freehand(somehow the map panning is disabled for this) and use the start and end vertices to force draw a polyline.
The same goes for trying to move my graphics using MapGestures events, I end up panning instead when I use my fingers to move.
I tried using e.enabled = true for mouseleftbuttondown event, but this disables all my touch events on the map too. I am unable to move my graphics properly using touch.
Is there a better workaround for this o am I doing something wrong?
Thanks!
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
Are you using Draw or EditVertices (or both)? Drawing a polyline requires a tap (to add vertex), tap & hold (to activate the magnifier), drag (to update vertex), double tap (to complete). Drawing a polyine with freehand mode is different in that drag continuously add vertices until you let go. Editing a polyline is no different from editing other geometries, you simply activate Editor.EditVertices command and start dragging the graphic.

You can look at the following related thread: http://forums.arcgis.com/threads/32558-Disable-pan-zoom-while-editing
0 Kudos
Hwee_KiangSim
Emerging Contributor
Thanks Jennifer! I see what you mean by, tap to add vertices, tap and hold to update and double tap to complete. However, this works only for Arcgis silverlight v2.2 (which I've tried and is ok), but not with Arcgis silverlight v2.1 ( I tapped and held for a long time, the magnifying glass appeared but no updated lines drawn). The graphic also did not move when I drag with my finger. I also realised it's difficult to complete the polyline with a double tap, my straight line will have an extra "tail" (or maybe my fingers are fat!)

Because I have override certain functions in openstreetmap.cs, due to some reasons which I have not found out, it only works well with v2.1. So I'm stuck with editing features of v2.1. Is there anything I can do to use editing features of 2.2 yet maintain my toolkit.datasource for 2.1?

Thanks very much!
0 Kudos
JenniferNery
Esri Regular Contributor
You can download the Toolkit.DataSources from CodePlex again: http://esrisilverlight.codeplex.com/ and maybe use WinMerge (or other file compare tools) to include your changes.

You are right about completing edit on polyline. This doesn't seem possible with touch. You can however, use EditGeometry which functions the same as Editor.EditVertices, except you will have more control over StopEdit() to complete the edit.
0 Kudos
Hwee_KiangSim
Emerging Contributor
Hi Jennifer, thanks again for the replies. I have tried EditGeometry. Unfortunately, my map still pans upon trying to use my fingers to move the geometry, similarly with Editor of v2.2.

I think I will have to revert back to Editor v2.1 and do some workaround. Is there anyway I can access the vertices while it is currently being edited (i.e. like polylineVertex_onMoved??) while I am performing a Gesture.Drag ? That way I can perform a re-draw of the edited polyline when my user clicks a "Confirm" button, and I'll delete the polyline under editor.editvertices so as to avoid having to commit the edit using a mouse click.

Arcgis API for Silverlight works beautifully with mouse, but there are still certain restrictions with touch and it is unfortunate that my proj is dependant on a touch screen. So any suggestions are greatly appreciated. Thanks!
0 Kudos