/
Annotation.yml
245 lines (196 loc) Β· 8.93 KB
/
Annotation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
---
name: Titanium.Map.Annotation
summary: Represents a labeled point of interest on the map that the user can click on.
description: |
The `Annotation` object gives you low-level control over annotations that can be added to
[map view](Titanium.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](Titanium.Map.Annotation.leftButton) or
[rightButton](Titanium.Map.Annotation.rightButton) property to an image URL. (On
iOS, you can also use a [SystemButton](Titanium.UI.iPhone.SystemButton) constant
to use one of the native system button icons.)
* To add another type of view to the annotation, set the
[leftView](Titanium.Map.Annotation.leftView) or
[rightView](Titanium.Map.Annotation.rightView) property to a [View](Titanium.UI.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](Titanium.Map.Annotation.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.
extends: Titanium.Proxy
since: "0.9"
deprecated:
since: "3.2.0"
notes: |
For new Android applications or to use Google Maps v2, use the [ti.map add-on module](Modules.Map).
For the iOS platform, use the [ti.map add-on module](Modules.Map). Support for the
`Titanium.Map` module on iOS was removed in Release 3.2.0.
For all other platforms, continue to use this module.
properties:
- name: animate
summary: Boolean to indicate whether the pin should animate when dropped.
description: |
Must be set before the annotation is added to the map view.
type: Boolean
exclude-platforms: [blackberry]
- name: canShowCallout
summary: Defines whether the annotation view is able to display extra information in a callout bubble.
description: |
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**.
type: Boolean
platforms: [iphone, ipad]
since: "3.2.0"
- name: centerOffset
summary: Defines a center offset point for the annotation.
description: |
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.
type: Point
platforms: [iphone, ipad]
since: "3.1.2"
- name: customView
summary: Defines a custom view to be used by the annotation.
description: |
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.
type: Titanium.UI.View
platforms: [iphone, ipad]
since: "3.1.0"
- name: draggable
summary: Determines whether the pin can be dragged by the user.
description: |
Must be set before the annotation is added to the map view.
type: Boolean
default: false
platforms: [iphone, ipad]
since: "2.1.0"
- name: image
summary: Image to use for the the pin.
description: |
The image can be specified using a local URL or an image `Blob`. This is ignored if the customView property is set.
type: [String, Titanium.Blob]
default: If not specified, a standard map pin image is used.
exclude-platforms: [blackberry]
- name: latitude
summary: Latitude of the annotation, in decimal degrees.
type: Number
- name: longitude
summary: Longitude of the annotation, in decimal degrees.
type: Number
- name: leftButton
summary: |
Left button image on the annotation, specified as an image URL or an iOS
button constant.
description: |
On iOS, you can specify a system button icon using one of the
[SystemButton](Titanium.UI.iPhone.SystemButton) constants:
myAnnotation.leftButton = Titanium.UI.iPhone.SystemButton.INFO_LIGHT;
Mutually exclusive with `leftView`.
type: [Number,String]
exclude-platforms: [blackberry]
- name: leftView
summary: Left view that is displayed on the annotation.
description: |
Mutually exclusive with `leftButton`.
type: Titanium.UI.View
platforms: [android, iphone, ipad]
- name: pinImage
deprecated:
since: "1.4"
notes: Use <Titanium.Map.Annotation.image> property instead.
summary: Image for the pin instead of the default image.
platforms: [android]
type: String
- name: pincolor
summary: |
Pin color. Specify one of: <Titanium.Map.ANNOTATION_GREEN>, <Titanium.Map.ANNOTATION_PURPLE>
or <Titanium.Map.ANNOTATION_RED>.
description: |
Pin color is ignored if a custom pin image is specified using <Titanium.Map.Annotation.image>.
type: Number
- name: rightButton
summary: |
Right button image on the annotation, specified as an image URL or an iOS
button constant.
description: |
On iOS, you can specify a system button icon using one of the
[SystemButton](Titanium.UI.iPhone.SystemButton) constants.
Mutually exclusive with `rightView`.
type: [Number,String]
exclude-platforms: [blackberry]
- name: rightView
summary: Right view that is displayed on the annotation.
description: |
Mutually exclusive with `rightButton`.
type: Titanium.UI.View
platforms: [android, iphone, ipad]
- name: subtitle
summary: Secondary title of the annotation view.
type: String
- name: subtitleid
summary: Key in the locale file to use for the subtitle property.
type: String
exclude-platforms: [blackberry]
- name: title
summary: Primary title of the annotation view.
type: String
- name: titleid
summary: Key in the locale file to use for the title property.
type: String
exclude-platforms: [blackberry]
events:
- name: click
summary: |
Fired when the user selects, deselects, or clicks on this annotation.
description: |
This event is not currently supported on Android. Register for the
[click](Titanium.Map.View.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`.
platforms: [iphone, ipad, mobileweb, tizen, blackberry]
properties:
- name: index
summary: |
Index of the annotation in the map view's [annotations](Titanium.Map.View.annotations) array.
type: Number
- name: title
summary: Title of the annotation.
type: String
- name: map
summary: The map view instance that this annotation belongs to.
type: Titanium.Map.View
- name: clicksource
summary: Source of the click event, such as `pin`, or `leftButton`.
type: String
- name: annotation
summary: Annotation source object.
type: Titanium.Map.Annotation