|
发表帖子
API/SDK版本号: |
js |
产品: |
|
手机型号: |
|
使用接口: |
|
本帖最后由 陆陆酱 于 2018-3-13 17:51 编辑
longTouch(map){
//长按事件
let _this = this;
let timeOutEvent = 0;
map.on('touchstart',function (e) {
let point = [e.lnglat.getLng(), e.lnglat.getLat()];
let judge = _this.judge;
timeOutEvent = setTimeout(function () {
if(judge == 0){
_this.addPoint(point);
}
},700);
});
map.on('touchmove',function () {
_this.judge = 0;
clearTimeout(timeOutEvent);
timeOutEvent = 0;
});
map.on('touchend',function () {
_this.judge = 0;
clearTimeout(timeOutEvent);
return false;
});
}
模拟了一个长按事件,先在浏览器上试了一下,pc和IOS都没问题,就Android有问题,无法触发里面的这个addPoint函数- -
|
|