Make map annotation display on map load in android?
Is there a way to make a map annotation tooltip show up when the map is first loaded in Android? In IPhone it does this automatically, it pops up the tooltip with the title and subtitle. However in Android, you have to click on the pin in order to pop up the tooltip.
1 Answer
-
Just select that annotation when containing window is opened (which is indicated by event).
Example:
// define annotation to show on map var annotation = Titanium.Map.createAnnotation(location); // create map with annotation in the center var mapView = Titanium.Map.createView({ mapType: Titanium.Map.STANDARD_TYPE, region: { latitude: location.latitude, longitude: location.longitude, latitudeDelta: 0.001, longitudeDelta: 0.001 }, animate: true, regionFit: true, userLocation: false, annotations: [annotation] }); // select annotation to show it's tooltip when window is opened window.addEventListener('open', function () { mapView.selectAnnotation(annotation); }); // add map to window window.add(mapView); // open window with prepared view window.open();