【发布时间】:2012-07-25 14:20:48
【问题描述】:
我编写了一个在地图上显示当前位置的应用程序。 问题是它适用于 Galaxy Tab 10.1、HTC Desire、Desire Z、Galaxy S 但是,当我使用 Samsung Galaxy Ace 或带有 Android 2.3.3 的模拟器时,它不起作用 - 只显示灰屏。
代码:
Ext.define('MyApp.view.WhereAmI', {
extend: 'Ext.Container',
xtype: 'whereAmI',
config: {
layout: 'fit',
scrollable: true,
styleHtmlContent: true,
style: 'text-align: center; background-color:white;',
items:
[
{
xtype: 'toolbar',
docked: 'top',
title: 'Where am I?',
items: [
{
ui: 'back',
xtype: 'button',
id: 'back',
text: 'Back'
}
]
},
{
xtype: 'mapview'
}
]
}
});
地图视图:
Ext.define("MyApp.view.MapView", {
extend: "Ext.Map",
xtype: 'mapview',
config: {
useCurrentLocation: true,
mapOptions:{
zoom: 14,
},
listeners: {
maprender : function(comp, map){
new google.maps.Marker({
position: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude()),
map: map
});
},
}
},
})
当然还有 index.html:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
有可能让它工作吗?
【问题讨论】:
标签: google-maps google-maps-api-3 extjs sencha-touch-2 google-maps-markers