Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>have a look at this simple example. If you don't want to add an annotation, setRegion might be what you are looking for.</p> <pre class="lang-js prettyprint-override"><code>// Create a simple fullscreen map and add an annotation to it // This example assumes you have a window called "win" // Our lat/lng fake data var latitude = 11.11111; var longitude = 11.11111; // Create Map View // For more information on Map Views refer to: // http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Map-method-createView var mapView = Titanium.Map.createView({ top : 0, left : 0, bottom : 0, right : 0, mapType : Titanium.Map.STANDARD_TYPE, animate : true, regionFit : true, userLocation : true, touchEnabled : true }); win.add(mapView); // Create an annotation with a right button // For more information on annotations refer to: // http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Map-method-createView var annotation = Ti.Map.createAnnotation({ latitude : latitude, longitude : longitude, title : 'My Annotation', subtitle : 'My Subtitle', rightButton : Ti.UI.iPhone.SystemButton.DISCLOSURE }); // Add this annotation to your map View // Note that this is an array, you can add more // than one annotation at a time mapView.setAnnotations([annotation]); // Set the region of your map // that is, zoom to where our annotation is var region = { latitude : latitude, longitude : longitude, animate : true, latitudeDelta : 0.005, longitudeDelta : 0.005 }; mapView.setRegion(region); // Check if our annotation is clicked mapView.addEventListener('click', function(e) { if(e.clicksource === 'rightButton') { // Do something here }; }); </code></pre> <p>This is more or less the same as Appcelerators own example at: <a href="http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Map-method-createAnnotation" rel="nofollow">http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Map-method-createAnnotation</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload