Im developing a measure tool app and would like to make it touch screen friendly. Is there anyway to call the measure-end function besides using a double click?
You could create a button and on click cycle through all the measurement tools and deactivate them via this:
Thanks guys, I did try that and it worked but I still came across an issue. In the measure-end function, I use evt.geometry to convert the measurement into a graphic. I get a Cannot read property 'geometry' of undefined when I use the same code inside the function of the button. this gets me in the right direction, thanks for the replies!
this happens because you don't technically "end" your measurement. The measure-end only runs when the user double-clicks to end the particular measure task.
Within the button maybe use the measure instead of measure-end, which also has a geometry.
Hope this helps!
Great idea, but for some reason it doesnt work.
on mesure I do:
var graphic = new Graphic(evt.geometry, lineColor);
lineColor is defined globally as:
var lineColor = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 3 )
edit - jsfiddle link
I commented out
//var graphic = new Graphic(evt.geometry, lineColor);
in the measure-end, if you uncomment you see it works. put that code in measure and it does not work
Just an FYI; don't know if this works, but SitePoint has code for enabling a double tap if you are using iPhones or iPads at: Implementing doubletap on iPhones and iPads | Appcropolis
Retrieving data ...