开发者

Appcelerator titanium - MapView on android causes app crash

开发者 https://www.devze.com 2023-03-27 19:30 出处:网络
am trying to display a map on android emulator, using the following code: var window = Ti.UI.createWindow();

am trying to display a map on android emulator, using the following code:

var window = Ti.UI.createWindow();
window.open();
var mapView = Ti.Map.createView({
  mapType: Ti.Map.STANDARD_TYPE,
  region:{
  latitude:33.74511, longitude:-84.38993,
  latitudeDelta:0.5, longitudeDelta:0开发者_Go百科.5
  },
  animate:true,
  regionFit:true,
  userLocation:true
});

window.add(mapView);
alert(mapView)//outputs Ti.Map.View

I have made all the steps mentioned here http://wiki.appcelerator.org/display/guides/Maps+for+Android but the application crashes. Does anyone has an idea what might be causing this?

thank you


Without a stacktrace of your crash I can only guess it's caused by an emulator which does not provide the Google Maps API. See http://developer.appcelerator.com/question/121105/crash-in-android-when-using-maps


try removing the your key here from the tiapp.xml file then refreshing the android emulator and it will work but resets to the empty google interface anybody got any ideas


You may have created other Map views elsewhere in your code.In that event,Google doesnt allow that and you end up with a force close (IllegalStateException)

0

精彩评论

暂无评论...
验证码 换一张
取 消