Reputation: 871
I've written an app which shows current location on map. The problem is that it works on Galaxy Tab 10.1, HTC Desire, Desire Z, Galaxy S BUT when I use Samsung Galaxy Ace or emulator with Android 2.3.3 it doesn't work - t shows me just grey screen.
Code:
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'
}
]
}
});
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
});
},
}
},
})
and of course in index.html:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
Is it possible to make it works?
Upvotes: 0
Views: 828
Reputation: 871
I found the solution.
Problem was in the device settings.
Settings -> Location and security -> My location -> Use wireless networks
on my device was unchecked. It works when it's checked.
Upvotes: 1