1
我使用ti.Map停止通过点击事件注释(从弹出阻止)
我想要做的事,当用户点击注释。
//make mapview
var mapView = Map.createView({
mapType:Map.NORMAL_TYPE,
});
//make anotation
annot= Map.createAnnotation({
latitude: myLatitude
longitude: myLongitude
title: myTitle
width:'100dp',
height:'100dp'
});
// add annotation
mapView.addAnnotation(annot);
//handle the annotation click
mapView.addEventListener('click', function(evt) {
if (evt.clicksource == "pin"){ // if user click annotation
//do something
return; //I try this
}
});
它运作良好。
然而,做一些事情之后,注释弹出窗口(如默认行为)
我想停下来注释弹出。
1)我尝试阻止传递给注记类的事件。
或
2)停止注释不反应点击事件。
我该如何解决?
感谢您的评论。我评论了标题,所以弹出窗口不出来,但不知何故“点击”事件的mapView不会被解雇.... – whitebear
@whitebear您正在使用哪个SDK? – Swanand
5.1.1GA和ti图2.4.1(iOS) – whitebear