Hi to the community!
I just start working with Titanium and i try to understand how the Maps API works,
i have create a Map and i pass the 2 Annotations p1 and p2,
in the Ti.Map.createView i set to true the userLocation,
i pass the lon and lan vars to (p1 and mapview have the same latitude, longitude),
but the current position of the p1 is not the same with mapview,
how i can attach the p1 annotation to the mapview as the current position and also, how i can change the "Current Position" title in the mapview?
i'm using Ti SDK v1.8.2 on Mac
here is my code:
var lat = 37.30168900; var lon = -122.03073100; var p1 = Ti.Map.createAnnotation({ latitude: lat, longitude: lon, title: "C.Norris", pincolor: Ti.Map.ANNOTATION_GREEN, animate: true }); var p2 = Ti.Map.createAnnotation({ latitude: 37.318844002395444, longitude: -122.01622009277344, title: "Samurai Master", pincolor: Ti.Map.ANNOTATION_RED, animate: true }); var mapview = Ti.Map.createView({ mapType: Ti.Map.STANDARD_TYPE, region: { latitude: lat, longitude: lon, latitudeDelta: 0.05, longitudeDelta: 0.05 }, animate: true, regionFit: true, userLocation: true, annotations: [p1, p2] }); win.add(mapview);thanks a lot!
1 Answer
Accepted Answer
Your Answer
Think you can help? Login to answer this question!