dragend event not working
Hello everybody,
I have problem with dragend event, when i use Web app emulator, it works but i doesn't work on the phone. I think that the problem is emulator uses the mouse, but the phone uses a finger :)
On the phone when i drag the map and then push a button, the event triggers. The reason may be that the phone thinks that the finger is still on the map and dragging event continues. If you have any idea to overcome this problem or a work around it, please help me.
(Note: the dragstart event works fine)
my code is the following:
[CODE]
mapfield.addListener("dragend", function(evt){
//do something
});
[/CODE]
Best Regards,
Onur
Re: dragend event not working
have you checked our wiki already: [url]http://www.developer.nokia.com/Community/Wiki/Enabling_drag-and-drop_in_Symbian_WRT_touch_devices[/url]
Re: dragend event not working
Thanks symbianyucca for your reply. I already checked that before, use those codes on my widget, but dragend event doesn't work. The other events are working such as mousedown, mousemove when i use my finger.
I also tried mouseup event to catch the end of a dragging event, but when you press the mouse button and move the mouse (which is like dragging), and after than release the mouse button, the mouseup event does not work. (mouse or finger, the result is the same)
Re: dragend event not working
Hi,
I'm afraid that this is limitation of the platform and thus cannot be fixed easily.
Mouseup event is fired only, when finger is lifted just after mousedown event is fired.
I don't know is what is your exact use case for mouseup scenario, but I was thinking if you could monitor map panning?
For example trigger the event, that you would normally do in mouseup/dragend, if map has not been moved for 500ms.
Br,
Ilkka
Re: dragend event not working
I tried to use mouseup event just to mimic dragend event ("mouse up while mouse is moving" is similar to "dragend" (only if mouse up worked when mouse is moving)),
however i plan to use a time limit like you suggested or a distance limit. Thanks for your reply.
Onur
Re: dragend event not working
I really think that dragend event is buggy. The description [URL="http://api.maps.ovi.com/apireference/symbols/ovi.mapsapi.map.Display.html"]here[/URL] actually says that is also covers finger. but it does not work with finger when I use it on nokia E6.
Does it really work in any touch devices? If so, am I doing it wrong or do e6 and some other mobile devices not support this event?
Here is what happens on E6:
When you hold your finger on the screen and move your finger and release it the dragend event is not fired (which should be fired).
It is fired only sometimes when you slide fastly your finger on the screen only for a moment (like cutting a fruit in the fruit ninja game.)
This seems to be a bug, if it is so how should report it?
Re: dragend event not working
Hi,
Ovi maps API is mainly targeted to desktop browser and web sites. For WRT, the best bet is to use Map Image API.
Br,
Ilkka
Re: dragend event not working
Thank for reply, i think i could develop some workaround, but I need to know if in any element of html (such as div) is able to capture the dragend(by dragend I mean: move your finger on the screen, then take it away) event from the phone.
for example
[CODE]<div id="elem"></div>
....
document.getElementById ("elem").addEventListener ("dragend", someFunction, false);[/CODE]