我设置标记时出现了一些问题,我发现这个代码用于生成谷歌地图并且工作正常。但现在我想设置一个标记与我目前的位置,问题是,我不知道哪里是谷歌地图对象,没有这个标记不显示。在sencha touch中设置谷歌标记
this.mapg = new Ext.Map({
useCurrentLocation:true,
geo:new Ext.util.GeoLocation({
autoUpdate:true,
timeout:2000,
listeners:{
locationupdate: function(geo) {
center = new google.maps.LatLng(geo.latitude, geo.longitude);
// Set the marker
marker = new google.maps.Marker({
map:geo.map,//??? No idea where is the google map object
position: center
});
if (this.rendered)
this.update(center);
else
this.on('activate', this.onUpdate, this, {single: true, data: center});
},
locationerror: function(geo){
alert('got geo error');
}
}
})
});
很好的例子,但信息窗口才会打开,因为它明确地解雇 - 信息窗口。打开。点击事件侦听器似乎不适合我。我也试过'点击' - 没有运气让这个响应用户交互 - 在iOS6和iOS7上测试。其他人得到这个问题? – barneymc 2013-11-12 22:35:08