Closed stefanovic72 closed 7 years ago
Can you check if toggling the main-thread changes something:
<property name="run-on-main-thread" type="bool">true</property>
vs.
<property name="run-on-main-thread" type="bool">false</property>
I think either @yozef or @m1ga had something related a few weeks ago?
I had already tried that since i saw something similar in another issue indeed. I now tried it once again. run-on-main-thread false or true does not make a difference.
Can you provide the exact demo-code or even whole project? And the iOS + SDK version you're testing with.
iOS 10.1 SDK 6.0.1. module version 3.2.0.
When I comment out line 172 in app.js (mapView.addAnnotation(annotation)) the map is being shown.
Wait. There is a lot of unused / unrelated code there. Does this crash (it doesn't for me):
var maps = require("ti.googlemaps");
/**
* SET YOUR API-KEY BEFORE USING THIS MODULE
*/
maps.setAPIKey("AIzaSyAbjmJ1RSHQCxvtTG6APBVv9rn3h71qwYo");
var win = Ti.UI.createWindow({
title: "Ti.Googlemaps"
});
var nav = Ti.UI.iOS.createNavigationWindow({
window: win
});
/*
* Test data
*/
var companies = {
appcelerator: {
title: "Appcelerator",
city: "San Jose, CA",
latitude: 37.368122,
longitude: -121.913653
},
apple: {
title: "Apple",
city: "Cupertino, CA",
latitude: 37.331711,
longitude: -122.030184
},
facebook: {
title: "Facebook",
city: "Menlo Park, CA",
latitude: 37.4748624,
longitude: -122.1490817
},
microsoft: {
title: "Microsoft",
city: "Redmond, WA",
latitude: 47.641959,
longitude: -122.130588
}
};
/*
* MapView
*/
var mapView = maps.createView({
region: {
latitude: companies.appcelerator.latitude,
longitude: companies.appcelerator.longitude,
zoom: 10
}
});
/*
* Marker
*/
for (var key in companies) {
if (companies.hasOwnProperty(key)) {
var company = companies[key];
var annotation = maps.createAnnotation({
latitude: company.latitude,
longitude: company.longitude,
title: company.title,
subtitle: company.city
});
mapView.addAnnotation(annotation);
Ti.API.warn(key + ": " + company.title + " (" + company.city + ")");
}
}
win.add(mapView);
nav.open();
Also note to not use addMarker
(anything with "xxxMarker"). That API has been deprecated in 2.x and been removed in 3.0.0. Only use addAnnotation
etc.
Hi, I copied the code and tried again. App is still crashing with this code. I also tested on the device. When it works at your side it looks like it has something to do with my environment.... Any other suggestions?
I just noticed that i use an older version of xcode (8.1). I'll update Xcode and let you know if that helps
Nope, updates XCode 8.2.1: same thing...
Sorry, no more ideas. If even the trace-log (appc run -p ios --log-level trace
) doesn't bring any logs, there is nothing I can do right now.
My app was crashing with the old version and running on main thread. But the latest version (3.2.2 now) was displaying all example files without any problem (SDK 6.0.1). Did you copy over the images? Does the cluster example work for you (be sure to zoom in)? It will display custom markers at first and at the end it will display the normal pin.
Please try 3.2.2, I'll close for now, thx!
Thanks very much for helping me with this. Unfortunately, i'm still facing the same problem (even in 3.3.0). Strange but true...
Duplicate of #83
Hi, I'm not sure whether this is a module issue. probably not. I use module version 3.2.0. Titanium SDK 6.0.1.
I've generated an API KEY and enabled the Google maps SDK for Ios. After setting the APIKey i create a mapview. The map is shown in my app. In the Google API console I can see the request that is done, so the connection with the Google API works. So far so good.
But...when I try to add an annotation, the app crashes. There is nothing written in the console, no error message.
I have first tried it inside a custom app. Then I created a test app with the exact same code as in the provided example (example/app.js). The test app crashes as well.
Any idea what the cause can be?