Skip to content
Titanium SDK

ti.map

Officialtidev/ti.map

Native Apple Maps and Google Maps for iOS and Android.

5.5.2AndroidJun 3, 2023v5.5.2-androidNot the current release →

Install

A module is a zip you unpack in your project. There is no installer command yet - a ti module install is planned but does not exist today, so the steps below are the ones that work.

  1. 1. Download the release archive

  2. 2. Unpack it at your project root

    cd /path/to/your-project
    unzip ~/Downloads/ti.map-android-5.5.2.zip

    The archive already contains the full path, so it lands in place:

    • modules/android/ti.map/5.5.2/
  3. 3. Add it to tiapp.xml

    <modules>
      <module platform="android" version="5.5.2">ti.map</module>
    </modules>

    The platform attribute is the packager’s name for the platform, which is iphone for iOS - the same word the archive uses in its own path.

  4. 4. Require it from your app

    const mod = require('ti.map');

Manifest

Android 5.5.2

Minimum SDK
9.0.0
Module API version
4
Architectures
arm64-v8a, armeabi-v7a, x86, x86_64
Resource package
com.google.android.gms
GUID
f0d8fd44-86d2-4730-b67d-bd454577aeee
Author
Appcelerator
License
Apache Public License v2
Copyright
Copyright (c) 2013-present by Axway, Inc.

API reference

Compiled from tidev/ti.map@5.5.2 (d0bde93).

Modules.Map

moduleAndroidiPhoneiPadmacOSsince Android 3.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Extends Titanium.Module

Add-on Map module

Requirements

  • Google Maps API key (required for both development and production)
  • Google Play services SDK installed using the Android SDK manager
  • This module only works on Android devices. This module is not supported on the Android emulator

Getting Started

  • Edit the modules section of your tiapp.xml file to include this module:

    <ti:app>
        [modules](api:Modules)
            <!-- Add this line to your modules section -->
            <module platform="android">ti.map</module>
        </modules>
    </ti:app>
  • Obtain a Google Maps API key. For instructions, refer to the "Obtain and Add a Google API Key" section in the Google Maps v2 for Android guide.

  • Add the following meta-tag element to the Android manifest section of the tiapp.xml file. You may need to add the manifest and application elements.

    <ti:app>
        <android xmlns:android="http://schemas.android.com/apk/res/android">
            <manifest>
                <application>
                    <!-- Replace "YOUR_API_KEY" with the Google API key you obtained -->
                    <meta-data 
                        android:name="com.google.android.geo.API_KEY"
                        android:value="YOUR_API_KEY" />
                </application>
            </manifest>
        </android>
    </ti:app>
  • Instantiate the module with the require('ti.map') method, then make subsequent API calls with the new map object.

    var Map = require('ti.map');
    var mapview = Map.createView({ 
      mapType: Map.NORMAL_TYPE 
    });

iOS

This module is a replacement for the built-in Titanium.Map module on iOS.

For more instructions and examples of using the module, refer to the iOS Map Kit guide.

Requirements

  • Applications using this module must be built using Xcode 5 or later.

Getting Started

  • Edit the modules section of your tiapp.xml file to include this module:

    <ti:app>
        [modules](api:Modules)
            <!-- Add this line to your modules section -->
            <module platform="iphone">ti.map</module>
        </modules>
    </ti:app>
  • To use the userLocation property in iOS 8 and later, add either the NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription key to the iOS plist section of the project's tiapp.xml file.

    <ti:app>
        <ios>
            <plist>
                <dict>
                    <key>NSLocationAlwaysUsageDescription</key>
                    [string](api:Global.String)
                        Specify the reason for accessing the user's location information.
                        This appears in the alert dialog when asking the user for permission to
                        access their location.
                    </string>
                </dict>
            </plist>
        </ios>
    </ti:app>
  • Instantiate the module with the require('ti.map') method, then make subsequent API calls with the new map object.

    var Map = require('ti.map');
    var mapview = Map.createView({
      mapType: Map.NORMAL_TYPE
    });

Breaking Changes

  • The addRoute method no longer accepts a dictionary as a parameter. Pass a Modules.Map.Route object instead.

Examples

Basic Map Example

This is a basic map example that places a custom annotation on the map, and listens for click events on the annotation.

In this example, a custom property (myid) is added to the annotation object. While adding custom members to a Titanium object is not generally recommended, in this case it provides a mechanism for uniquely identifying an annotation. This can be useful, for example, if the annotations are dynamically generated and it is not practical to identify them by title.

var Map = require('ti.map');
var win = Titanium.UI.createWindow();

var mountainView = Map.createAnnotation({
    latitude: 37.390749,
    longitude: -122.081651,
    title: 'Appcelerator Headquarters',
    subtitle: 'Mountain View, CA',
    pincolor: Map.ANNOTATION_RED,
    myid: 1 // Custom property to uniquely identify this annotation.
});

var mapview = Map.createView({
    mapType: Map.NORMAL_TYPE,
    region: { 
        latitude: 33.74511,
        longitude: -84.38993,
        latitudeDelta: 0.01,
        longitudeDelta: 0.01
    },
    animate: true,
    regionFit: true,
    userLocation: true,
    annotations: [ mountainView ]
});

var circle = Map.createCircle({
    center: {
        latitude: 33.74511,
        longitude: -84.38993
    },
    radius: 1000, // = 1.0 km
    fillColor: '#20FF0000'
});
mapview.addCircle(circle);

win.add(mapview);

mapview.addEventListener('click', function(event) {
    Ti.API.info('Clicked ' + event.clicksource + ' on ' + event.latitude + ', ' + event.longitude);
});
win.open();

Alloy XML Markup

Previous example as an Alloy view.

In XML markup, use the View element with the module attribute set to ti.map to create an instance of a map view, then use the Annotation element to define an annotation.

In the initializer file, load the map module and assign it to the Alloy.Globals.Map namespace. This variable can be used to reference map module constants in the project, as seen in the TSS file to assign the pincolor attribute.

alloy.js:

// Loads the map module to the global Alloy scope, which can be referenced by Alloy.Globals.Map
Alloy.Globals.Map = require('ti.map');

app/views/index.xml:

<Alloy>
    <Window>
        <Module id="mapview" module="ti.map" onClick="report" method="createView">
            <Annotation id="appcHQ" myId="1337" />
        </Module>
    </Window>
</Alloy>

app/styles/index.tss:

"#mapview": {
    region: {
        latitude: 33.74511,
        longitude: -84.38993,
        latitudeDelta: 0.01,
        longitudeDelta: 0.01
    }
},
"#appcHQ": {
    latitude: 37.368122,
    longitude: -121.913653,
    title: "Appcelerator Headquarters",
    subtitle: "San Jose, CA",
    pincolor: Alloy.Globals.Map.ANNOTATION_RED
}

app/controllers/index.js:

function report(event) {
    Ti.API.info('Annotation ' + event.title + ' clicked, ID: ' + event.annotation.myID);
}

$.index.open();

Map Clustering (iOS 11+)

This is a map-example which creates marker annotation and clustering of annotations.

The clusterIdentifier property and the clusterstart event are required in order to enable clustering. You can control the clustering by defining the collisionMode property and setting special cluster annotations using the setClusterAnnotation method on your map view instance.

var Map = require('ti.map');
var win = Titanium.UI.createWindow();
var annotations = [];

for (var i = 0; i < 10; i++) {
    annotations.push(Map.createAnnotation({
        title: 'Appcelerator Inc.',
        subtitle: 'TiRocks!',
        clusterIdentifier: 'abc', // Required for clusters
        collisionMode: Map.ANNOTATION_VIEW_COLLISION_MODE_RECTANGLE,
        showAsMarker: true,
        markerGlyphText: i.toString(),
        markerColor: 'blue',
        markerGlyphColor: 'green',
        markerTitleVisibility: Map.FEATURE_VISIBILITY_VISIBLE,
        markerSubtitleVisibility: Map.FEATURE_VISIBILITY_HIDDEN,
        markerGlyphImage: 'path/to/flag.png',
        markerSelectedGlyphImage: 'path/to/flag-selected.png',
        annotationDisplayPriority: Map.FEATURE_DISPLAY_PRIORITY_DEFAULT_LOW,
        latitude: (Math.random() * 10) + 40,
        longitude: Math.random() * 10,
    }));
}

var mapview = Map.createView({
    annotations: annotations,
    rotateEnabled: true,
    mapType: Map.MUTED_STANDARD_TYPE,
    showsPointsOfInterest: false,
    userLocation: true
});

mapview.addEventListener('clusterstart', function(e) {
    Ti.API.info('clustering started!');

    var clusterAnnotation = Map.createAnnotation({
        showAsMarker: true,
        markerText: e.memberAnnotations.length.toString(),
        title: 'Cluster Title',
        subtitle: 'Cluster Subtitle',
    });

    mapview.setClusterAnnotation({
        annotation: clusterAnnotation,
        memberAnnotations: e.memberAnnotations
    });
});
win.add(mapview);
win.open();

Properties 46

ANNOTATION_VIEW_COLLISION_MODE_CIRCLE

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that a circle inscribed in the collision frame rectangle should be used to determine collisions.

FEATURE_DISPLAY_PRIORITY_DEFAULT_HIGH

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that the item's display priority is high.

An annotation view with this priority is removed from the map when its bounds collide with the bounds of another view with a higher priority. If the priorities of the two views are equal, the view furthest from the center of the map's visible region is hidden first.

FEATURE_DISPLAY_PRIORITY_DEFAULT_LOW

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that the item's display priority is low.

An annotation view with this priority is removed from the map when its bounds collide with the bounds of another view with a higher priority. If the priorities of the two views are equal, the view furthest from the center of the map's visible region is hidden first.

FEATURE_DISPLAY_PRIORITY_REQUIRED

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that the item is required.

An annotation view with this priority does not participate in clustering.

FEATURE_PHYSICAL_FEATURES

NumberAndroidsince 12.0.0read-onlyiOS 16.0+

The option that represents physical map features such as mountain ranges, rivers, and ocean basins.

FEATURE_TERRITORIES

NumberAndroidsince 12.0.0read-onlyiOS 16.0+

The option that represents territorial boundaries such as a national border, a state boundary, or a neighborhood.

FEATURE_TYPE_POINT_OF_INTEREST

NumberAndroidsince 12.0.0read-onlyiOS 16.0+

The option that represents points of interest such as museums, cafes, parks, or schools.

FEATURE_VISIBILITY_ADAPTIVE

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that title text adapts to the current map state.

For markers in the normal state, title text is displayed and subtitle text is hidden. When a marker is selected, the title and subtitle text are hidden when the marker requires a callout.

FEATURE_VISIBILITY_HIDDEN

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that title text is always hidden.

FEATURE_VISIBILITY_VISIBLE

NumberiPhoneiPadmacOSsince 6.3.0read-onlyiOS 11.0+

Constant indicating that title text is always visible.

HYBRID_FLYOVER_TYPE

NumberiPhoneiPadmacOSread-only

Used with mapType to display a satellite flyover image of the area with road and road name information layered on top. Available in iOS 9.0 and later.

HYBRID_TYPE

Numberread-only

Used with mapType to display a satellite image of the area with road and road name information layered on top.

MUTED_STANDARD_TYPE

Numberread-onlyiOS 11.0+

Used with mapType to display a street map where your data is emphasized over the underlying map details. Available in iOS 11.0 and later. On Android it is mapped to NORMAL_TYPE.

NORMAL_TYPE

Numberread-only

Used with mapType to display a street map that shows the position of all roads and some road names.

OVERLAY_LEVEL_ABOVE_LABELS

NumberiPhoneiPadmacOSsince 3.2.0read-only

Place the overlay above roadways but below map labels, shields, or point-of-interest icons. Available in iOS 7.0 and later.

OVERLAY_LEVEL_ABOVE_ROADS

NumberiPhoneiPadmacOSsince 3.2.0read-only

Place the overlay above map labels, shields, or point-of-interest icons but below annotations and 3D projections of buildings. Available in iOS 7.0 and later.

POLYLINE_JOINT_DEFAULT

NumberAndroidsince 5.1.0read-only

Default: Mitered joint, with fixed pointed extrusion equal to half the stroke width on the outside of the joint.

POLYLINE_JOINT_ROUND

NumberAndroidsince 5.1.0read-only

Rounded on the outside of the joint by an arc of radius equal to half the stroke width, centered at the vertex.

SATELLITE_FLYOVER_TYPE

NumberiPhoneiPadmacOSread-only

Used with mapType to display satellite flyover imagery of the area. Available in iOS 9.0 and later.

TERRAIN_TYPE

NumberAndroidread-only

Used with mapType to display the terrain that shows the position of all roads and some road names.

Methods 13

getLookAroundImage

iPhoneiPadmacOSsince 12.0.0iOS 16.0+

A utility function that you use to create a static image from a LookAround scene.

Parameters
ParametersTypeDescription
callbackCallback<Object>

Function to be called upon completion (either success with an image or an error).

latitudeNumber

Latitude of the preferred region.

longitudeNumber

Longitude of the preferred region.

openLookAroundDialog

iPhoneiPadmacOSsince 12.0.0iOS 16.0+

Opens a LookAround window modally.

Parameters
ParametersTypeDescription
latitudeNumber

Latitude of the preferred region.

longitudeNumber

Longitude of the preferred region.

Modules.Map.Annotation

proxyAndroidiPhoneiPadmacOSsince Android 3.0.2, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a labeled point of interest on the map that the user can click on.

The Annotation object gives you low-level control over annotations that can be added to map view. An annotation must have its latitude and longitude properties set to appear on a map.

Use the Modules.Map.createAnnotation method to create an annotation. Starting with Alloy 1.4.0, use the <Annotation> Alloy element to define one in XML markup.

An annotation can also have a title, a subtitle, and two inset buttons or views on the left and right side of the title. All of these items are optional.

The controls on the left and right side of the annotation can be specified in one of two ways:

  • To display an image, set the leftButton or rightButton property to an image URL. (On iOS, you can also use a SystemButton constant to use one of the native system button icons.)

  • To add another type of view to the annotation, set the leftView or rightView property to a View object.

An annotation has two states: selected and deselected. A deselected annotation is marked by a pin image. When the user selects the pin, the full annotation is displayed.

You can specify a custom image for the map pin by setting the image property.

When the user clicks on an annotation, a click event is generated.

On iOS, You can add a click event listener to a specific annotation, or add a click event listener to the map view to receive click events from all annotations on the map.

On Android, you must add the click event listener to the map view; the annotation itself does not generate these events.

Properties 31

annotationDisplayPriority

NumberiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The display priority of this annotation view.

An annotation view whose priority is set to MKFeatureDisplayPriorityRequired is always visible on the map, whereas other priorities may result in the annotation view being hidden. Use Modules.Map.FEATURE_DISPLAY_PRIORITY_REQUIRED, Modules.Map.FEATURE_DISPLAY_PRIORITY_DEFAULT_HIGH or Modules.Map.FEATURE_DISPLAY_PRIORITY_DEFAULT_LOW.

Default: Modules.Map.FEATURE_DISPLAY_PRIORITY_REQUIRE

canShowCallout

BooleaniPhoneiPadmacOS

Defines whether the annotation view is able to display extra information in a callout bubble.

When this is set to true, the annotation view shows the callout bubble on selection. Set this to false to disabled the showing of the callout bubble on selection. This must be set before the annotation is added to the map.

If this value is undefined, the value is treated as explicit true.

Defines a center offset point for the annotation.

By default, the center point of an annotation view is placed at the coordinate point of the associated annotation. Use this property to reposition the annotation view as needed. Positive offset values move the annotation view down and right, while negative values move it up and left.

clusterIdentifier

Stringsince Android 7.4.0, iPhone 6.3.0, iPad 6.3.0, macOS 9.2.0iOS 11.0+

An identifier that determines whether the annotation view participates in clustering.

The default value of this property is null, which prevents the annotation view from being clustered with other annotation views. Setting the property to a non null value it to participate in clustering. Clustering occurs when there is a collision between multiple annotation views with the same identifier on the map surface. The annotation views involved in the collision are removed from the map view and replaced by a clustering annotation view, which displays the title from one of the annotations and provides access to the other annotations.

Default: null

Defines a custom view to be used by the annotation.

Must be set during creation. User interaction is disabled on the view. No view interaction events (click, touchstart etc) will be fired.

draggable

Boolean

Determines whether the pin can be dragged by the user.

When an annotation is draggable, it can be moved by the user by long pressing on the pin.

Default: false

hidden

Booleansince 6.1.0

Determines whether the annotation is hidden or not.

Default: false

Image to use for the the pin.

Must be set during creation. This is ignored if the customView property is set.

Default: If not specified, a standard map pin image is used.

latitude

Number

Latitude of the annotation, in decimal degrees.

leftButton

Stringsince 3.1.0

Left button image on the annotation, specified as an image URL.

Left view that is displayed on the annotation.

This is ignored if the leftButton property is set.

longitude

Number

Longitude of the annotation, in decimal degrees.

markerAnimatesWhenAdded

BooleaniPhoneiPadmacOSsince 6.3.0iOS 11.0+

Boolean indicating whether the marker animates into position onscreen.

Default: false

markerColor

StringiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The background color of the marker balloon.

The default value of this property is undefined, which applies the standard color that is appropriate for the current map style.

markerGlyphColor

StringiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The color to apply to the glyph text or image.

The default value of this property is undefined, which applies the standard tint color for the current map style.

markerGlyphImage

String | Titanium.BlobiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The image displayed in the marker balloon.

Use this property or the Modules.Map.Annotation.markerGlyphText property to specify the marker balloon content. If you specify both an image and text, the text is displayed. The glyph image is displayed when the marker is in the normal state. Create glyph images as template images so that the glyph tint color can be applied to it. Normally, you set the size of this image to 20 by 20 points on iOS. However, if you do not provide a separate selected image in the Modules.Map.Annotation.markerSelectedGlyphImage property, make the size of this image 40 by 40 points on iOS. MapKit scales images that are larger or smaller than those sizes.

markerGlyphText

StringiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The text to display in the marker balloon.

Use this property or the Modules.Map.Annotation.markerGlyphImage property to specify the marker balloon content. If you specify both an image and text, the text is displayed. The amount of space available for displaying your glyph text is limited. Specify no more than two or three characters for any strings you assign to this property.

markerSelectedGlyphImage

String | Titanium.BlobiPhoneiPadmacOSsince 6.3.0iOS 11.0+

The image to display when the marker is selected.

The glyph image is displayed when the marker is in the selected state. This image is displayed only when the marker is selected. If you specify an image for this property, you should also specify an image in the Modules.Map.Annotation.markerGlyphImage property. Create glyph images as template images so that the glyph tint color can be applied to it. Set the size of this image to 40 by 40 points on iOS. MapKit scales images that are larger or smaller than those sizes.

pincolor

Number | String

The color of the pin-annotation. Use the ANNOTATION_* constants for pre- defined colors, e.g ANNOTATION_GREEN.

Note for iOS: Apps running iOS 9 and later can also specify a non-constant value, e.g. "blue", "rgb(0, 0, 255 ,1)" or "#0000ff".

Pin color is ignored if a custom pin image is specified using Modules.Map.Annotation.image.

rightButton

Stringsince 3.1.0

Right button image on the annotation, specified as an image URL.

Right view that is displayed on the annotation.

This is ignored if the rightButton property is set.

showAsMarker

BooleaniPhoneiPadmacOSsince 6.3.0iOS 11.0+

Boolean to show an annotation view that displays a balloon-shaped marker at the designated location.

Must be set during creation. This is ignored if the customView property is set. See the example "Map Example With Marker Annotation and Clustering".

Default: false

showInfoWindow

Booleansince 3.2.0

Show or hide the view that is displayed on the annotation when clicked.

When this is false, clicking on the annotation will not center it on the map, but the annotation will still be selected, thus triggering the click event. If the annotation is selected, and the info window is hidden, then the next click will deselect the annotation, thus will NOT show the info window, regardless of the current state of this property.

Default: true

subtitle

String

Secondary title of the annotation view.

subtitleid

Stringsince 3.1.0

Key in the locale file to use for the subtitle property.

title

String

Primary title of the annotation view.

titleid

Stringsince 3.1.0

Key in the locale file to use for the title property.

Methods 2

animate

iPhoneiPadmacOSsince 9.2.0

Animate annotation to new location.

Parameters
ParametersTypeDescription
newLocationArray<Number>

latitude and longitude where annotation will animate.

rotate

iPhoneiPadmacOSsince 9.2.0

Rotate annotation on its location.

Parameters
ParametersTypeDescription
angleNumber

angle on which annotation will rotate.

Modules.Map.Camera

proxyAndroidiPhoneiPadmacOSsince Android 9.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Extends Titanium.Proxy

A camera object defines a point above the map's surface from which to view the map. Available in iOS 7.0 and later.

Applying a camera to a map has the effect of giving the map a 3D-like appearance. You can use a camera to rotate the map so that it is oriented to match the user's heading or to apply a pitch angle to tilt the plane of the map.

If the app is run on pre iOS 7, camera functionality will not be available. After creating a Camera object, it can be applied to the map by setting the camera property of the map view.

Use the Modules.Map.createCamera method to create a camera.

If altitude, eyeCoordinate, and centerCoordinate are passed in on creation, a camera will be returned using the specified viewing angle information.

Example:

var camera = Map.createCamera({
    altitude: 15.5,
    centerCoordinates: {
        longitude: 151.276417,
        latitude: -33.891614
    },
    heading: 45,
    pitch: 75
});
mapview.camera = camera;

Properties 5

altitude

Number

The altitude above the ground, measured in meters. On Android these zoom values are: 1: World 5: Landmass/continent 10: City 15: Streets 20: Buildings

The coordinate point at which to place the camera. Only used on creation when altitude and centerCoordinate are also provided. Setting this property at anytime other time will have no effect.

If the value for this parameter is equal to the value in the centerCoordinate parameter, the map is displayed as if the camera is looking straight down. If this point is offset from the centerCoordinate value, the map is displayed with an appropriate heading and pitch angle. Not used on Android.

heading

Number

The heading of the camera (measured in degrees) relative to true north.

The value 0 means that the top edge of the map view corresponds to true north. The value 90 means the top of the map is pointing due east. The value 180 means the top of the map points due south, and so on.

pitch

Number

The viewing angle of the camera, measured in degrees.

A value of 0 results in a camera pointed straight down at the map. Angles greater than 0 result in a camera that is pitched toward the horizon by the specified number of degrees. The value in this property may be clamped to a maximum value to maintain map readability. There is no fixed maximum value, though, because the actual maximum value is dependent on the current altitude of the camera.

Modules.Map.Circle

proxyAndroidiPhoneiPadmacOSsince Android 4.1.0, iPhone 4.1.0, iPad 4.1.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a bounded area on the map.

The Circle object gives you low-level control over circles that can be added to a map view. A circle must have a center property and a radius set to appear on a map.

Use the Modules.Map.createCircle method to create a circle.

Properties 9

blendMode

NumberiPhoneiPadmacOSsince 12.0.0iOS 16.0+

The blend mode to apply to the overlay.

Use one of the Ti.UI.BLEND_MODE_* constants!

An object with longitude and latitude values. Can also be an array with longitude (index 0), latitude (index 1) touples.

fillColor

String

Color to use when shading the circle, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black

opacity

Number

Opacity of this map circle, from 0.0 (transparent) to 1.0 (opaque).

Default: 1.0 (opaque)

radius

Number

The radius of the circle, specified in meters. It should be zero or greater.

Color to use for the border of the circle, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black

Line width in pixels to use when drawing the circle.

Default: 10

touchEnabled

Booleansince 6.2.0

Determines whether view should receive touch events.

Default: true

zIndex

NumberAndroid

The order (depth) in which to display the circles.

For iOS, the circles are drawn in the order in which they are added.

Modules.Map.ImageOverlay

proxyAndroidiPhoneiPadmacOSsince iPhone 7.2.0, iPad 7.2.0, Android 7.4.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a bounded area on the map that has an image overlay.

The ImageOverlay object gives you low-level control over image overlays that can be added to a map view. An image overlay must have a boundsCoordinate property and a image set to appear on a map.

Use the Modules.Map.createImageOverlay method to create an image overlay.

Properties 2

boundsCoordinate

MapBoundsCoordinateType

An object representing diagonal coordinates (topLeft and bottomRight) on the map.

Modules.Map.Polygon

proxyAndroidiPhoneiPadmacOSsince Android 4.1.0, iPhone 4.1.0, iPad 4.1.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a bounded area on the map.

The Polygon object gives you low-level control over polygons that can be added to a map view. A polygon must have its points property set to appear on a map.

Use the Modules.Map.createPolygon method to create a polygon.

Properties 7

fillColor

String

Color to use when shading the polygon, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black

holes

Array<Array<MapPointType>>

Array of points arrays that define holes in the polygon.

Array of map points making up the polygon. Can also be an array of longitude (index 0), latitude (index 1) touples.

Color to use for the border of the polygon, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black

Line width in pixels to use when drawing the polygon.

Default: 10

touchEnabled

Booleansince 6.2.0

Determines whether view should receive touch events.

Default: true

zIndex

NumberAndroid

The order (depth) in which to display the polygons.

For iOS, the polygons are drawn in the order in which they are added.

Modules.Map.Polyline

proxyAndroidiPhoneiPadmacOSsince Android 4.1.0, iPhone 4.1.0, iPad 4.1.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a bounded area on the map.

The Polyline object gives you low-level control over polylines that can be added to a map view. A polyline must have its points property set to appear on a map.

Use the Modules.Map.createPolyline method to create a polyline.

Example

var polyline = Map.createPolyline({
    points: [{
            latitude: -33.891614,
            longitude: 151.276417
        },
        [-33.87365, 151.20689]
    ],
    strokeWidth: 3,
    strokeColor: '#f00',
    zIndex: 1
});
mapView.addPolyline(polyline);

Properties 7

pattern

Objectsince 6.2.0

Pattern used to draw the polylines.

As per default polylines are drawn with a solid line. You can specify to draw them with a dashed line using Modules.Map.POLYLINE_PATTERN_DASHED or with a dotted line using Modules.Map.POLYLINE_PATTERN_DOTTED.

You can also specify the dimensions to use when you create a dashed or dotted polyline.

For a dashed polyline, you can do something like this:

polyline.setPattern({
    type: TiMap.POLYLINE_PATTERN_DASHED,
    gapLength: 25,
    dashLength: 50
});

or for a dotted polyline, you can do:

polyline.setPattern({
    type: TiMap.POLYLINE_PATTERN_DOTTED,
    gapLength: 25
});

points

Array<MapPointType> | String

Array of map points making up the polyline. Can also be an array of longitude (index 0), latitude (index 1) touples. On Android platform you can use an encoded polyline as string.

Color to use for the the polyline, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

Default: black

Line width in pixels to use when drawing the polyline.

Default: 10

touchEnabled

Booleansince 6.2.0

Determines whether view should receive touch events.

Default: true

zIndex

NumberAndroid

The order (depth) in which to display the polylines.

For iOS, the polylines are drawn in the order in which they are added.

Modules.Map.Route

proxyAndroidiPhoneiPadmacOSsince Android 3.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Extends Titanium.Proxy

Represents a path between two or more points of interest.

The Route object gives you low-level control over routes that can be added to a map view. A route must have its points property set to appear on a map.

Use the Modules.Map.createRoute method to create a route.

iOS Platform Notes

The addRoute method no longer accepts a dictionary as a parameter. Pass a Modules.Map.Route object instead.

Android Platform Notes

The parameter points accepts additional the route in format encoded polyline.
https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Properties 4

color

String

Color to use when drawing the route, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.

iOS Note: Changing the color of an existing route will only work on iOS 7 and later

Default: black

width

Number

Line width in pixels to use when drawing the route.

iOS Note: Changing the width of an existing route will only work on iOS 7 and later

Default: 10

Modules.Map.Snapshotter

proxyiPhoneiPadmacOSsince iPhone 6.0.0, iPad 6.0.0, macOS 9.2.0

Extends Titanium.Proxy

Snapshotter is used to allow screen shots to be taken of a specified region or a mapview.

Examples

Taking a simple snapshot

This is a map-example which creates a simple snapshot of the specified map-area.

var MapModule = require('ti.map');

var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});

var Snapshotter = MapModule.createSnapshotter({
    mapType: MapModule.HYBRID_TYPE,
    region: {
        latitude: 37.3382,
        longitude: -121.8863,
        latitudeDelta: 0.4,
        longitudeDelta: 0.4
    },
    size: {
        width: 300, 
        height: 200
    }
});

Snapshotter.takeSnapshot({
    success: function(e) {
        var imageView = Ti.UI.createImageView({
            image: e.image
        });
        win.add(imageView);
    },
    error: function(e) {
        Ti.API.error("The snapshot could not be taken: " + e.error);
    }
});

win.open();

Properties 5

Determines whether building will be shown on the map. The mapType property must be set to <Modules.Map.STANDARD_TYPE> for extruded buildings to be displayed.

Default: true

When this property is set to YES, the map displays icons and labels for restaurants, schools, and other relevant points of interest.

Default: true

size

SnapshotSize

A dictionary specifying the width and height of the snapshot.

Methods 1

Takes a snap shot of of the map corresponding to the region property or a snap of the mapView if passed in as a second parameter.

Parameters
ParametersTypeDescription
successCallback<Titanium.Blob>

Function to be called upon successful completion.

errorCallback

Function to call upon receiving an error.

Modules.Map.StreetViewPanorama

viewAndroidsince 5.2.0

Extends Titanium.UI.View

Provides panoramic 360-degree views from designated roads throughout its coverage area.

Each street view panorama is an image, or set of images, that provides a full 360-degree view from a single location. It provides a viewer that renders the panorama as a sphere with a camera at its center. A window can only contain one street view.

Properties 5

panning

Boolean

Determines whether the user is able to re-orient the camera by dragging.

Default: true

position

StreetViewPosition

A dictionary specifying the position of the street view.

Determines whether the user is able to see street names displayed.

Default: true

Determines whether the user is able to move to a different panorama.

If true, users can use a single tap on navigation links, or double tap the view, to move to a new panorama.

Default: true

zoom

Boolean

Determines whether the user is able to pinch to zoom.

Default: true

Modules.Map.View

viewAndroidiPhoneiPadmacOSsince Android 3.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Extends Titanium.UI.View

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

With native maps, you can control the mapping location, the type of map, the zoom level and you can add custom annotations and routes directly to the map. Once the map view is displayed, the user can pan, zoom and tilt the map using the native control gestures.

Use the Modules.Map.createView method to create a map view.

In Alloy, use the <Module> element with the module attribute set to ti.map and method attribute set to createView to create a map view in XML markup:

<Module module="ti.map" method="createView" />

All latitude and longitude values are specified in decimal degrees. Values in degrees, minutes and seconds (DMS) must be converted to decimal degrees before being passed to the map view.

You can add Annotation objects to the map to mark points of interest. An annotation has two states: selected and deselected. A deselected annotation is marked by a pin image. When selected, the full annotation is displayed, typically including a title and an optional subtitle.

You can add Route objects to the map to create paths between two or more points of interest.

To use the userLocation property in iOS 8 and later, add either the NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription key to the iOS plist section of the project's tiapp.xml file.

<ti:app>
    <ios>
        <plist>
            <dict>
                <key>NSLocationAlwaysUsageDescription</key>
                [string](api:Global.String)
                    Specify the reason for accessing the user's location information.
                    This appears in the alert dialog when asking the user for permission to
                    access their location.
                </string>
            </dict>
        </plist>
    </ios>
</ti:app>

Properties 29

animate

Boolean

Indicates if changes to the mapping region should be animated.

Setting this to 'false' will not stop the animation from clicking the My Location button, since that is native Android behavior.

Default: false

An array of annotations to add to the map.

There is no guarantee that the order of elements in the annotations property will be maintained when creating, adding or deleting annotations from the Ti.Map.View object. If the application depends on the annotations being in a set order, it should keep references to all of the annotations in a separate array.

camera

Modules.Map.Camerasince Android 9.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

The camera used for determining the appearance of the map.

A camera object defines a point above the map's surface from which to view the map. Applying a camera to a map has the effect of giving the map a 3D-like appearance. You can use a camera to rotate the map so that it is oriented to match the user's heading or to apply a pitch angle to tilt the plane of the map.

Assigning a new camera to this property updates the map immediately and without animating the change. If you want to animate changes in camera position, use the animateCamera method instead.

You must not set this property to null. To restore the map to a flat appearance, apply a camera with a pitch angle of 0, which yields a camera looking straight down onto the map surface.

compassEnabled

Booleansince Android 3.2.3, iPhone 6.1.0, iPad 6.1.0, macOS 9.2.0iOS 9.0+

Enable or disables the compass button.

Default: true

enableZoomControls

BooleanAndroid

Enables or disables the built-in zoom controls.

If enabled, the zoom controls are a pair of buttons (one for zooming in, one for zooming out) that appear on the screen. When pressed, they cause the camera to zoom in (or out) by one zoom level. If disabled, the zoom controls are not shown.

Default: true

indoorEnabled

BooleanAndroidsince 7.5.0

A Boolean value indicating whether the indoor mapping is enabled.

This property is used to enabled/disable the indoor mapping feature of Google Maps. Changing the value after the MapView is drawn can cause flickering. You can read more at: Google Indoor Maps

Default: true

liteMode

BooleanAndroidsince 5.0.3

Create a liteMode map version

When the liteMode is switched on the map will be displayed as a bitmap with limited interaction. Please refer to Google developers documentation for more details.

Default: false

mapToolbarEnabled

BooleanAndroidsince 6.1.0

Enable or disables the map toolbar.

Default: true

maxZoomLevel

NumberAndroidsince 3.2.3read-only

Returns the maximum zoom level available at the current camera position.

Returns the maximum zoom level for the current camera position. This takes into account what map type is currently being used. For example, satellite or terrain may have a lower max zoom level than the base map tiles.

This will only give the correct value after the 'complete' event is fired.

minClusterSize

NumberAndroidsince 5.2.0

Sets the minium size of a cluster.

The minium cluster size is the smallest number of annotations that are merged together and (minClusterSize + 1) is the smallest number that will appear on the cluster.

Default: 4

minZoomLevel

NumberAndroidsince 3.2.3read-only

Returns the minimum zoom level available at the current camera position.

Returns the minimum zoom level. This is the same for every location (unlike the maximum zoom level) but may vary between devices and map sizes.

This will only give the correct value after the 'complete' event is fired.

padding

MapViewPaddingsince 7.4.0

Sets the distance between each edges of the view to the map controls.

The map view controls may be obscured by other elements.

pitchEnabled

BooleaniPhoneiPadmacOSsince 3.2.0

A Boolean value indicating whether the map camera's pitch information is used.

When this property is set to true and a valid camera is associated with the map, the camera's pitch angle is used to tilt the plane of the map. When this property is set to false, the camera's pitch angle is ignored and the map is always displayed as if the user is looking straight down onto it.

A dictionary specifying the location and zoom level of the map.

Default: latitude 0, longitude 0

rotateEnabled

BooleaniPhoneiPadmacOSsince 3.2.0

A Boolean value indicating whether the map camera's heading information is used.

When this property is set to true and a valid camera is associated with the map, the camera's heading angle is used to rotate the plane of the map around its center point. When this property is set to false, the camera's heading angle is ignored and the map is always oriented so that true north is situated at the top of the map view.

scrollEnabled

Booleansince Android 8.0.0, iPhone 7.2.0, iPad 7.2.0, macOS 9.2.0

A Boolean value indicating whether the map can be scrolled by dragging gesture.

When this property is set to true the a map view can be panned or scrolled by dragging the map view.

Default: true

showsBuildings

BooleaniPhoneiPadmacOSsince 3.2.0

A Boolean indicating whether the map displays extruded building information.

When this property is set to true and the camera has a pitch angle greater than zero, the map extrudes buildings so that they extend above the map plane, creating a 3D effect. The mapType property must be set to Modules.Map.NORMAL_TYPE for extruded buildings to be displayed.

Default: true

showsCompass

BooleandeprecatediPhoneiPadmacOSsince 5.2.0iOS 9.0+

Deprecated since 6.1.0

Please use Modules.Map.View.compassEnabled for parity instead.

A Boolean indicating whether the map displays a compass control.

When this property is set to true, the map displays the control that lets users change the heading orientation of the map.

Default: true

showsPointsOfInterest

BooleaniPhoneiPadmacOSsince 3.2.0

A Boolean indicating whether the map displays point-of-interest information.

When this property is set to true, the map displays icons and labels for restaurants, schools, and other relevant points of interest.

Default: true

showsScale

BooleaniPhoneiPadmacOSsince 5.2.0iOS 9.0+

A Boolean indicating whether the map shows scale information.

When this property is set to true, the map displays the scale information.

Default: false

style

StringAndroidsince 6.1.0

JSON String to style the Map.

This property will change the look (colors, roads, labels) of the map. A valid JSON can be created at Google Maps Styling Wizard

Default: false

traffic

BooleanAndroid

Toggles the traffic layer on or off.

Set to true to display the traffic layer or false to hide it. This is subject to the availability of traffic data.

Default: false

Boolean indicating if the user's current device location should be shown on the map.

If true, the user's location is marked with a pin, and the My Location button will appear in the top right corner of the screen. Starting in iOS 8, permissions must be added to tiapp.xml. Details in description.

Default: false

userLocationButton

BooleanAndroidsince 3.1.1

Enable or disables the My Location button. If the button is enabled, it is only shown when userLocation is enabled.

If true, the My Location button is enabled.

Default: true

zoom

NumberAndroidsince 7.1.0read-only

Returns the current zoom level from the current camera position.

Returns the current zoom level from the current camera position. Note: This will only return the correct value once the complete event is fired.

zoomEnabled

Booleansince Android 8.0.0, iPhone 7.2.0, iPad 7.2.0, macOS 9.2.0

A Boolean value indicating whether the map can be zoomed by pinching or tapping.

When this property is set to true the a map view can be zoomed by pinching inwards to zoom out and reverse to zoom in. Zooming in can also be accoplished by double-tapping the map view. Zooming out can also be accomplished by two-finger tapping the map view.

Default: true

Controls wether the map view's surface is placed on top of its window.

Please refer to zOrderOnTop for more details.

Default: false

Methods 34

addHeatmap

Androidsince 10.1.0

Adds a heatmap to the map.

A heatmap is defined by an array of coordinates.

Parameters
ParametersTypeDescription
coordinatesMapPointType

An array of coordinates

animateCamera

since Android 9.1.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Changes the camera used for determining the map's viewing parameters and animates the change.

Parameters
ParametersTypeDescription
animationParamsCameraAnimationParams

Properties for controlling the camera animation. The property camera is required.

3 fields
camera Modules.Map.Annotation

Modules.Map.Camera to be animated to.

curve Number

Animation curve or easing function to apply to the animation.

duration Number

The amount of time (in milliseconds) that the animation will last.

callbackCallback<Object>

A method that will be called when the camera animation completes. Optionally, the completion of camera animations can be captured by listening for a regionchanged event with animated set to true.

containsCoordinate

since 10.1.0

Validated whether or not a given coordinate is currently visible in the map rect.

Parameters
ParametersTypeDescription
coordinateMapPointType

The latitude and longitude pair represented by an Object.

Returns Boolean

Returns true if given coordinate is within the displayed map view.

removeAllImageOverlays

since Android 7.4.0, iPhone 7.2.0, iPad 7.2.0, macOS 9.2.0

Remove all image overlays from the map.

setClusterAnnotation

since Android 7.4.0, iPhone 6.3.0, iPad 6.3.0, macOS 9.2.0iOS 11.0+

Set new cluster annotation for the clustered annotation.

This method should be called inside the clusterstart event. See the example "Map Example With Marker Annotation and Clustering".

Parameters
ParametersTypeDescription
clusterAnnotationParamClusterAnnotationParams

Properties for creating cluster annotation.

2 fields
annotation Modules.Map.Annotation

Modules.Map.Annotation instance, which you want to show as clustered annotation. There is no need to provide latitude and longitude as clustered annotation decides its location itself.

memberAnnotations Array<Modules.Map.Annotation>

Array of Modules.Map.Annotation, which is recieved in event 'clusteringstarted' as memberAnnotations.

setLocation

since 3.1.0

Sets the map location and zoom level.

The location is set using a simple dictionary object, described in MapLocationTypeV2. If latitudeDelta and longitudeDelta are set, these specified parameters bound the area of interest, which is centered and displayed at the greatest possible zoom level. This method can only be called after the map completes loading. Before that, use region to set the map location. For example:

myMapView.setLocation({
  latitude: 37.337681,
  longitude: -122.038193,
  animate: true,
  latitudeDelta: 0.04,
  longitudeDelta: 0.04
});
Parameters
ParametersTypeDescription
locationMapLocationTypeV2

Dictionary specifying the location and the zoom level for the map.

5 fields
animate Boolean

Set to true to animate the move to the new location.

latitude Number

Latitude value for the center point of the map, in decimal degrees.

latitudeDelta Number

The amount of north-to-south distance displayed on the map, measured in decimal degrees.

longitude Number

Longitude value for the center point of the map, in decimal degrees.

longitudeDelta Number

The amount of east-to-west distance displayed on the map, measured in decimal degrees.

showAnnotations

since Android 8.0.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Sets the visible region so that the map displays the specified annotations. If no array is passed annotations on the map will be shown. The default padding of 20px is applied and can be changed by using the Modules.Map.View.padding property.

Parameters
ParametersTypeDescription
annotations?Array<Modules.Map.Annotation>

An array of Modules.Map.Annotation to display.

snapshot

Androidsince 3.2.3

Takes a snapshot of the map

Takes a snapshot of the current map and returns the image via onsnapshotready event.

zoom

since 3.1.0

Zooms in or out of the map.

Zooms in or out by specifying a relative zoom level. A positive value increases the current zoom level and a negative value decreases the zoom level.

Each increase in zoom level increases the magnification by a factor of two.

Parameters
ParametersTypeDescription
levelNumber

Relative zoom level (positive to zoom in, negative to zoom out).

Events 11

Fired when the user selects or deselects an annotation, a polygon, a polyline or a circle.

Note that the click event is not fired every time the user clicks on the map. It is fired in two circumstances:

  • The user clicks on the annotation. This will select the annotation.
  • The user deselects an annotation either by clicking on the map or another annotation.
  • The user clicks on a polygon, a polyline or a circle.

Note that only one annotation can be selected at any given time.

The click event includes a value, clicksource, which describes the part of the annotation that was clicked. The clicksource can be one of pin, infoWindow, leftButton or rightButton on iOS and pin, title, subtitle, leftPane, rightPane, infoWindow or null on Android. If the user deselects an annotation by clicking on the pin, clicksource is pin. If the user deselects the annotation by clicking elsewhere in the map view, clicksource is map.

For polygon, polyline or circle, The click event includes the following values. clicksource is a string describing the shape type. map is the map view instance. latitude and longtitude is the corresponding coordinates on the map where the user clicked in the shape.

Event properties
Event propertiesTypeDescription
titleString

Title of the annotation.

subtitleString

Subtitle of the annotation.

mapModules.Map.View

The map view instance.

clicksourceString

Source of the click event. Can be one of pin, leftPane, rightPane, infoWindow or null. If it's a shape, it can be one of polygon, polyline, or circle. On Android, this also applies for title and subtitle.

annotationModules.Map.Annotation

Annotation source object.

latitudeNumber

Latitude of the clicked annotation or the point clicked in the polygon, polyline and circle.

longitudeNumber

Longitude of the clicked annotation or the point clicked in the polygon, polyline and circle.

deselectedBoolean

Will show if the annotation was selected (false) or deselected (true)

clusterstart

iPhoneiPadmacOSsince 6.3.0

Fired when a collision between annotations occures.

Event properties
Event propertiesTypeDescription
memberAnnotationsArray<Modules.Map.Annotation>

Array of annotations participating in clustering.

mapModules.Map.View

This map view.

Fired when the map completes loading.

longclick

since 3.2.0

Fired when the user makes a long-press gesture on the map.

A long press is generated by touching and holding on the touch screen.

The event occurs before the finger/button is lifted.

The longclick event returns longitude and latitude of the point on the ground that was pressed.

Event properties
Event propertiesTypeDescription
latitudeNumber

latitude of the point on the ground that was pressed.

longitudeNumber

longitude of the point on the ground that was pressed.

mapModules.Map.View

The map view instance.

mapclick

since 6.2.0

Fired when the user clicks on the map

The mapclick event is fired when the user clicks on the map and returns the longitude/latitude of that position.

Event properties
Event propertiesTypeDescription
mapModules.Map.View

The map view instance.

latitudeNumber

Latitude of the clicked position.

longitudeNumber

Longitude of the clicked position.

onsnapshotready

Androidsince 3.2.3

Fired when the snapshot is ready after snapshot is invoked.

Event properties
Event propertiesTypeDescription
snapshotTitanium.Blob

snapshot of the current map

Fired when the user interacts with a draggable annotation.

Event properties
Event propertiesTypeDescription
annotationModules.Map.Annotation

Annotation being dragged.

mapModules.Map.View

This map view.

titleString

Annotation title.

newStateNumber
oldStateNumber

poiclick

iPhoneiPadmacOSsince 12.0.0

Fired when the user selects a Point of Interest (e.g. restaurant or hotel).

Make sure to use the <Modules.Map.View.selectableMapFeatures> property to define annotations tha should be selectable. Available in iOS 16+

Event properties
Event propertiesTypeDescription
nameString

The descriptive name associated with the map item.

featureTypeNumber

The type of map feature this annotation represents. See the Apple docs for all possible enum values.

pointOfInterestCategoryNumber

The point-of-interest category for the map item. See the Apple docs for all possible enum values.

phoneNumberString

The phone number associated with a business at the specified location.

urlString

The URL associated with the specified location.

placeObject

The placemark object containing the location information.

latitudeNumber

Latitude of the annotation that was selected.

longitudeNumber

Longitude of the annotation that was selected.

Fired when the mapping region finished changing.

Event properties
Event propertiesTypeDescription
longitudeNumber

Longitude value for the center point of the map, in decimal degrees.

latitudeNumber

Latitude value for the center point of the map, in decimal degrees.

longitudeDeltaNumber

The amount of east-to-west distance displayed on the map, measured in decimal degrees.

latitudeDeltaNumber

The amount of north-to-south distance displayed on the map, measured in decimal degrees.

animatedBoolean

The regionchanged event was caused by an animation, such as a animating the camera.

regionwillchange

since Android 6.2.0, iPhone 6.0.0, iPad 6.0.0, macOS 9.2.0

Fired when the mapping region will change.

Event properties
Event propertiesTypeDescription
longitudeNumber

Longitude value for the center point of the map, in decimal degrees.

latitudeNumber

Latitude value for the center point of the map, in decimal degrees.

longitudeDeltaNumber

The amount of east-to-west distance displayed on the map, measured in decimal degrees.

latitudeDeltaNumber

The amount of north-to-south distance displayed on the map, measured in decimal degrees.

animatedBoolean

The regionwillchange event was caused by an animation, such as a animating the camera.

reasonNumber

userLocation

since 7.3.0

Fired when the user changes on the map.

When the user location is available or changes at the map it will fire the event.

Event properties
Event propertiesTypeDescription
latitudeNumber

Latitude of the point on the ground that was pressed.

longitudeNumber

Longitude of the point on the ground that was pressed.

MapPointType

pseudoAndroidiPhoneiPadmacOS

An object representing a point on the map.

Properties 2

latitude

Number

Latitude value of the map point, in decimal degrees.

longitude

Number

Longitude value of the map point, in decimal degrees.

MapRegionTypev2

pseudoAndroidiPhoneiPadmacOS

Simple object representing a map location and zoom level.

Properties 8

bearing

NumberAndroidsince 3.2.3

The direction in which a vertical line on the map points, measured in degrees clockwise from north.

For more details, see Google Docs. Cannot be used in conjunction with longitudeDelta or latitudeDelta

latitude

Number

Latitude value for the center point of the map, in decimal degrees.

The amount of north-to-south distance displayed on the map, measured in decimal degrees.

longitude

Number

Longitude value for the center point of the map, in decimal degrees.

The amount of east-to-west distance displayed on the map, measured in decimal degrees.

tilt

NumberAndroidsince 3.2.3

The camera's position on an arc between directly over the map's center position and the surface of the Earth, measured in degrees from the nadir.

For more details, see Google Docs. Cannot be used in conjunction with longitudeDelta or latitudeDelta