Titanium.Map.Annotation
> Titanium.Map.Annotation

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

deprecated

3.2.0 For new Android applications or to use Google Maps v2, use the ti.map add-on module.

For the iOS platform, use the ti.map add-on module. Support for the Titanium.Map module on iOS was removed in Release 3.2.0.

For all other platforms, continue to use this module.

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.

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.

leftButton and leftView are mutually exclusive, as are rightButton and rightView.

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.

Use the Titanium.Map.createAnnotation method to create an annotation.

  • 0.9
  • 0.9
  • 0.9
Defined By

Properties

Titanium.Map.Annotation
animate : Boolean

Boolean to indicate whether the pin should animate when dropped.

Boolean to indicate whether the pin should animate when dropped.

Must be set before the annotation is added to the map view.

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0
Titanium.Map.Annotation
canShowCallout : Boolean

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

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.

  • 3.2.0
  • 3.2.0
Titanium.Map.Annotation
centerOffset : Point

Defines a center offset point for the annotation.

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 to the right, while negative values move it up and to the left.

  • 3.1.2
  • 3.1.2
Titanium.Map.Annotation
customView : Titanium.UI.View

Defines a custom view to be used by the annotation.

Defines a custom view to be used by the annotation.

A custom View to display for the annotation. User interaction is disabled on the view. No view interaction events (click, touchstart etc) will be fired.

  • 3.1.0
  • 3.1.0
Titanium.Map.Annotation
: Boolean
Determines whether the pin can be dragged by the user. ...

Determines whether the pin can be dragged by the user.

Must be set before the annotation is added to the map view.

Default: false

  • 2.1.0
  • 2.1.0
Titanium.Map.Annotation
: String/Titanium.Blob
Image to use for the the pin. ...

Image to use for the the pin.

The image can be specified using a local URL or an image Blob. This is ignored if the customView property is set.

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

Titanium.Map.Annotation
latitude : Number

Latitude of the annotation, in decimal degrees.

Latitude of the annotation, in decimal degrees.

Titanium.Map.Annotation
leftButton : Number/String

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

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

On iOS, you can specify a system button icon using one of the SystemButton constants:

myAnnotation.leftButton = Titanium.UI.iPhone.SystemButton.INFO_LIGHT;

Mutually exclusive with leftView.

Titanium.Map.Annotation
leftView : Titanium.UI.View

Left view that is displayed on the annotation.

Left view that is displayed on the annotation.

Mutually exclusive with leftButton.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Titanium.Map.Annotation
longitude : Number

Longitude of the annotation, in decimal degrees.

Longitude of the annotation, in decimal degrees.

Titanium.Map.Annotation
: Stringdeprecated
Image for the pin instead of the default image. ...

Image for the pin instead of the default image.

deprecated since 1.4

Use <Titanium.Map.Annotation.image> instead.

  • 0.9
Titanium.Map.Annotation
: Number
Pin color. ...

Pin color. Specify one of: Titanium.Map.ANNOTATION_GREEN, Titanium.Map.ANNOTATION_PURPLE or Titanium.Map.ANNOTATION_RED.

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

Titanium.Map.Annotation
rightButton : Number/String

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

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

On iOS, you can specify a system button icon using one of the SystemButton constants.

Mutually exclusive with rightView.

Titanium.Map.Annotation
rightView : Titanium.UI.View

Right view that is displayed on the annotation.

Right view that is displayed on the annotation.

Mutually exclusive with rightButton.

Titanium.Map.Annotation
subtitle : String

Secondary title of the annotation view.

Secondary title of the annotation view.

Titanium.Map.Annotation
subtitleid : String

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

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

Titanium.Map.Annotation
title : String

Primary title of the annotation view.

Primary title of the annotation view.

Titanium.Map.Annotation
titleid : String

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

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

Defined By

Methods

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

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

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • name : String

    Name of the event.

  • event : Dictionary

    A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Returns

  • void
Titanium.Map.Annotation
( ) : Boolean
Gets the value of the animate property. ...

Gets the value of the animate property.

Returns

  • Boolean
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Titanium.Map.Annotation
( ) : Boolean
Gets the value of the canShowCallout property. ...

Gets the value of the canShowCallout property.

  • 3.2.0
  • 3.2.0

Returns

  • Boolean
Titanium.Map.Annotation
( ) : Point
Gets the value of the centerOffset property. ...

Gets the value of the centerOffset property.

  • 3.1.2
  • 3.1.2

Returns

Titanium.Map.Annotation
( ) : Titanium.UI.View
Gets the value of the customView property. ...

Gets the value of the customView property.

  • 3.1.0
  • 3.1.0

Returns

Titanium.Map.Annotation
( ) : Boolean
Gets the value of the draggable property. ...

Gets the value of the draggable property.

  • 2.1.0
  • 2.1.0

Returns

  • Boolean
Titanium.Map.Annotation
( ) : String/Titanium.Blob
Gets the value of the image property. ...

Gets the value of the image property.

Returns

Titanium.Map.Annotation
( ) : Number
Gets the value of the latitude property. ...

Gets the value of the latitude property.

Returns

  • Number
Titanium.Map.Annotation
( ) : Number/String
Gets the value of the leftButton property. ...

Gets the value of the leftButton property.

Returns

  • Number/String
Titanium.Map.Annotation
( ) : Titanium.UI.View
Gets the value of the leftView property. ...

Gets the value of the leftView property.

Returns

Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Titanium.Map.Annotation
( ) : Number
Gets the value of the longitude property. ...

Gets the value of the longitude property.

Returns

  • Number
Titanium.Map.Annotation
( ) : Stringdeprecated
Gets the value of the pinImage property. ...

Gets the value of the pinImage property.

deprecated since 1.4

Use <Titanium.Map.Annotation.image> instead.

  • 0.9

Returns

  • String
Titanium.Map.Annotation
( ) : Number
Gets the value of the pincolor property. ...

Gets the value of the pincolor property.

Returns

  • Number
Titanium.Map.Annotation
( ) : Number/String
Gets the value of the rightButton property. ...

Gets the value of the rightButton property.

Returns

  • Number/String
Titanium.Map.Annotation
( ) : Titanium.UI.View
Gets the value of the rightView property. ...

Gets the value of the rightView property.

Returns

Titanium.Map.Annotation
( ) : String
Gets the value of the subtitle property. ...

Gets the value of the subtitle property.

Returns

  • String
Titanium.Map.Annotation
( ) : String
Gets the value of the subtitleid property. ...

Gets the value of the subtitleid property.

Returns

  • String
Titanium.Map.Annotation
( ) : String
Gets the value of the title property. ...

Gets the value of the title property.

Returns

  • String
Titanium.Map.Annotation
( ) : String
Gets the value of the titleid property. ...

Gets the value of the titleid property.

Returns

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

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

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to remove. Must be the same function passed to addEventListener.

Returns

  • void
Titanium.Map.Annotation
( animate )
Sets the value of the animate property. ...

Sets the value of the animate property.

Parameters

  • animate : Boolean

    New value for the property.

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( canShowCallout )
Sets the value of the canShowCallout property. ...

Sets the value of the canShowCallout property.

  • 3.2.0
  • 3.2.0

Parameters

  • canShowCallout : Boolean

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( centerOffset )
Sets the value of the centerOffset property. ...

Sets the value of the centerOffset property.

  • 3.1.2
  • 3.1.2

Parameters

  • centerOffset : Point

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( customView )
Sets the value of the customView property. ...

Sets the value of the customView property.

  • 3.1.0
  • 3.1.0

Parameters

Returns

  • void
Titanium.Map.Annotation
( draggable )
Sets the value of the draggable property. ...

Sets the value of the draggable property.

  • 2.1.0
  • 2.1.0

Parameters

  • draggable : Boolean

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( image )
Sets the value of the image property. ...

Sets the value of the image property.

Parameters

Returns

  • void
Titanium.Map.Annotation
( latitude )
Sets the value of the latitude property. ...

Sets the value of the latitude property.

Parameters

  • latitude : Number

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( leftButton )
Sets the value of the leftButton property. ...

Sets the value of the leftButton property.

Parameters

  • leftButton : Number/String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( leftView )
Sets the value of the leftView property. ...

Sets the value of the leftView property.

Parameters

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Titanium.Map.Annotation
( longitude )
Sets the value of the longitude property. ...

Sets the value of the longitude property.

Parameters

  • longitude : Number

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( pinImage )deprecated
Sets the value of the pinImage property. ...

Sets the value of the pinImage property.

deprecated since 1.4

Use <Titanium.Map.Annotation.image> instead.

  • 0.9

Parameters

  • pinImage : String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( pincolor )
Sets the value of the pincolor property. ...

Sets the value of the pincolor property.

Parameters

  • pincolor : Number

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( rightButton )
Sets the value of the rightButton property. ...

Sets the value of the rightButton property.

Parameters

  • rightButton : Number/String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( rightView )
Sets the value of the rightView property. ...

Sets the value of the rightView property.

Parameters

Returns

  • void
Titanium.Map.Annotation
( subtitle )
Sets the value of the subtitle property. ...

Sets the value of the subtitle property.

Parameters

  • subtitle : String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( subtitleid )
Sets the value of the subtitleid property. ...

Sets the value of the subtitleid property.

Parameters

  • subtitleid : String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( title )
Sets the value of the title property. ...

Sets the value of the title property.

Parameters

  • title : String

    New value for the property.

Returns

  • void
Titanium.Map.Annotation
( titleid )
Sets the value of the titleid property. ...

Sets the value of the titleid property.

Parameters

  • titleid : String

    New value for the property.

Returns

  • void
Defined By

Events

Titanium.Map.Annotation
Fired when the user selects, deselects, or clicks on this annotation. ...

Fired when the user selects, deselects, or clicks on this annotation.

This event is not currently supported on Android. Register for the click event on the map view to receive events when any of the map's annotations are clicked.

This event is fired in two circumstances:

  • If the user clicks on an annotation.
  • The user deselects an annotation.

On iOS, the user deselects an annotation by clicking in the map view outside of the annotation. On Android, the user deselects an annotation by clicking on the annotation pin.

The click event includes a value, clicksource, which describes the part of the annotation that was clicked. Note that the possible values for clicksource differ between platforms.

On iOS, if the user clicks on the pin or annotation, the clicksource is one of: pin, annotation, leftButton, rightButton, leftView, rightView, title, or subtitle. If the user deselects the annotation by clicking elsewhere in the map view, clicksource is null.

  • 0.9
  • 0.9

Properties

  • index : Number

    Index of the annotation in the map view's annotations array.

  • title : String

    Title of the annotation.

  • map : Titanium.Map.View

    The map view instance that this annotation belongs to.

  • clicksource : String

    Source of the click event, such as pin, or leftButton.

  • annotation : Titanium.Map.Annotation

    Annotation source object.

  • source : Object

    Source object that fired the event.

    •  
    •  
    •  
  • type : String

    Name of the event fired.

    •  
    •  
    •  
  • bubbles : Boolean

    True if the event will try to bubble up if possible.

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •