0

我正在使用基于 openlayers API 的 jquery mobile 创建一个基于 Web 的应用程序。我无法在地图上触发“taphold”事件。你能告诉我如何在地图上触发 taphold 事件。我已经尝试了许多 taphold 的例子,但不幸的是失败了。

这是我的代码:

$('#map').bind('taphold', function(e){
var position = map.getLonLatFromPixel(e.xy);
alert(position);

});

4

1 回答 1

0

Once you succeed you will notice that the tap event is also fired which you may not want. More here: https://github.com/jquery/jquery-mobile/issues/3803. It seems that with jQM 1.4 there will be an option to prevent tap from firing.

I realize this is not an answer but I see absolutely no possibility to place a comment. Which is very weird because 1. other comments have been made (how?) and 2. after saving this answer there is an "add comment" link to comment this answer...

于 2013-06-11T21:06:23.697 回答