Titanium.Map

Submodule of Titanium.
Platform Since
Android 0.8
iPhone 0.8
iPad 0.8

Summary

The top level Map module. The Map module is used for creating in-application native maps.

Code Examples

Map Example

This is a basic map example that uses a custom annotation on the map.

var mountainView = Titanium.Map.createAnnotation({
    latitude:37.390749,
    longitude:-122.081651,
    title:"Appcelerator Headquarters",
    subtitle:'Mountain View, CA',
    pincolor:Titanium.Map.ANNOTATION_RED,
    animate:true,
    leftButton: '../images/appcelerator_small.png',
    myid:1 // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS
});
 
var mapview = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region: {latitude:33.74511, longitude:-84.38993, 
            latitudeDelta:0.01, longitudeDelta:0.01},
    animate:true,
    regionFit:true,
    userLocation:true,
    annotations:[mountainView]
});
 
win.add(mapview);

Objects

Name Summary
Titanium.Map.Annotation

An Annotation object that is created by the method Titanium.Map.createAnnotation. This object gives you low level control over annotations that can be added to a Map View.

Titanium.Map.View

Map view is used for embedding native mapping capabilities as a view in your application.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

createAnnotation

Create and return an instance of Titanium.Map.Annotation.

createView

Create and return an instance of Titanium.Map.View.

fireEvent

Fires a synthesized event to any registered listeners.

removeEventListener

Removes the specified callback as an event listener for the named event.

Properties

Name Type Summary
HYBRID_TYPE Number

Displays a satellite image of the area with road and road name information layered on top. read-only

SATELLITE_TYPE Number

Displays satellite imagery of the area. read-only

STANDARD_TYPE Number

Displays a street map that shows the position of all roads and some road names. read-only

Events

This type has no events.