嗨,我正在尝试向 sencha touch v.2.2.1 谷歌地图添加一个标记。我可以看到地图,但看不到标记。我还添加了所需的库:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
config: {
items: [{
xtype: 'map',
itemId: 'mapHomeView',
width: Ext.os.deviceType == 'Phone' ? null : 1500,
height: Ext.os.deviceType == 'Phone' ? null : 350,
useCurrentLocation: true,
listeners: {
maprender: function(extMapComponent, googleMapComp){
var marker = new google.maps.Marker({
title: 'test',
position: new google.maps.LatLng (49.279989, -123.126333),
map: Ext.ComponentQuery.query('#mapHomeView')[0].map,
// map: googleMapComp,
});
marker.setMap(Ext.ComponentQuery.query('#mapHomeView')[0].map);
}
}]
}
我正在使用谷歌浏览器来测试应用程序。我在设置中启用了位置请求。
line map: ... 和注释 map: ... line 都不起作用。