mapView events don't work
Hi. I have noticed than only regionChanged event fired while moving the mapview. There are no click, singletap, focus events available.This is very annoying because i cannot hide (blur) search control while touching the mapview like in Google maps.app. How can I determine the latitude/longitude of the point I touched on the mapview? (without using annotation)
6 Answers
-
Got the same problem. I have a mapview and want to attach 'click' even handler - nothing is firing. What is the story here?
-
Has any solution been found? I am having the same problem. The region changed event works and the click event for an annotation works, but clicking the mapview does not fire any events. By the way, I am on Android, and I tested this on 1.7.5
-
Same issue here. The only event that gets fired is the 'click' event. None of the others below are getting handled. I need to be able to add an annotation at the point where a user taps a map.
mapview.addEventListener('click', function(e) { alert('click!'); if (e.annotation && (e.clicksource === 'leftButton' || e.clicksource == 'leftPane')) { mapview.removeAnnotation(e.annotation); } }); mapview.addEventListener('dblclick', function(e) { alert('dblclick'); }); mapview.addEventListener('doubletap', function(e) { alert('doubletap'); }); mapview.addEventListener('singletap', function(e) { alert('singletap'); }); mapview.addEventListener('longpress', function(e) { alert('longpress'); });
-
i have a View (A) contains a webView (B) wich url property point to html file.
when addEventListener to A (dblclick, doubletap, or even click),
B's event are not fired :(
-
i'm seeing the same problem… it sucks that this issue is not fixed after more than a year :(
-
I also faced the same problem, but resolved through following code :
mapview.addEventListener('regionChanged',function(evt){
alert(evt.latitude.toPrecision(10));
alert(evt.latitude.toPrecision(10));`
});Hope it helps you !!