hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

App Crashes when trying to add annotation #57

Closed rafbel closed 7 years ago

rafbel commented 7 years ago

var annotation = maps.createAnnotation({ latitude : 37.368122, longitude : -121.913653, title : "Appcelerator, Inc", subtitle : "1732 N. 1st Street, San Jose", pinColor: "green", image: "pin.png", touchEnabled: true, // Default: true draggable: true, // Default: false flat: true, // Default: false opacity: 1, animationStyle: maps.APPEAR_ANIMATION_POP, // One of "APPEAR_ANIMATION_NONE" (default) and "maps.APPEAR_ANIMATION_POP" rotation: 30, // measured in degrees clockwise from the default position centerOffset: { x: 0.5, y: 0 }, groundOffset: { x: 0.5, y: 0 }, userData: { id: 123, custom_key: "custom_value" } }); mapView.addAnnotation(annotation); win.add(mapView);

This is what I am doing. Tried release 2.4, 2.5, and 2.6 B1 and B2. All didn't work, and app crashes.

hansemannn commented 7 years ago

@rafbel Did you try removing all unnecessary properties? For example, remove the image property if you don't have the image in your project.

rafbel commented 7 years ago

I tried creating the annotation with only the title, subtitle, latitude, and longitude properties and it still didn't work.

hansemannn commented 7 years ago

Just tested. You need to call maps.setAPIKey('<your-api-key>') before. You can get the API key from here.

rafbel commented 7 years ago

We are setting the API key just like that and it still crashes. We are also getting the API key from that link.

hansemannn commented 7 years ago

Did you use the latest version pushed 2 days ago?

rafbel commented 7 years ago

So sorry, forgot to reply! It stopped crashing when we removed app-thinning from tiapp.

Thanks for the help!