[ALOY-1353] Annotation doesn't appear in only Alloy Map
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2016-02-19T23:23:28.000+0000 |
| Affected Version/s | Release 5.1.2 |
| Fix Version/s | n/a |
| Components | Titanium SDK |
| Labels | n/a |
| Reporter | Stefano Zanellato |
| Assignee | Feon Sua Xin Miao |
| Created | 2016-02-04T09:44:35.000+0000 |
| Updated | 2018-03-07T22:28:28.000+0000 |
Description
I followed this example:
http://docs.appcelerator.com/platform/latest/#!/api/Modules.Map-method-createAnnotation
but if i create the map with Alloy, the map is ok but the annotation doesn't appear. With this example (no Alloy) all work well:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Map_Kit
i think there are a bug with annotation in Alloy.
Hello, We tested and observed the same behavior. Map annotation is not showing properly. *Testing environment:* Appcelerator Studio, build: 4.4.0.201511241829 Appcelerator Command-Line Interface, version 5.1.0 Titanium Command-Line Interface, CLI version 5.0.5, Titanium SDK version : 5.1.2 GA Mac OS X : 10.11.1 (EI Capitan) Android device: Nexus 7(android version 6) *Test Code:* *alloy.js*
*index.xml*Alloy.Globals.Map = require('ti.map');*index.js*<Alloy> <Window> <View id="mapview" module="ti.map" onClick="report"> <!-- Starting with Alloy 1.4.0, use the Annotation tag to define an annotation --> <!-- Prior to Alloy 1.4.0, create annotations in the controller --> <Annotation id='appcHQ' myid='1' /> </View> </Window> </Alloy>*index.tss*function report(evt) { Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid); } $.index.open(); Defined By*Steps to test:* Run above code and observe that map annotation is not showing. *Expected:* Map annotation should be visible Thanks."#mapview" : { region : { latitude:33.74511, longitude:-84.38993, latitudeDelta:0.01, longitudeDelta:0.01 } }, "#appcHQ" : { latitude: 37.390749, longitude: -122.081651, title: "Appcelerator Headquarters", subtitle: "Mountain View, CA", pincolor: Alloy.Globals.Map.ANNOTATION_RED }The pin is way off the visible region of the map, also
Moduletag should be used. Try this one:index.xml
index.tss
"#mapview" : { region : { latitude: 37.38, longitude: -122.05, latitudeDelta: 0.1, longitudeDelta: 0.1 }, mapType: Alloy.Globals.Map.NORMAL_TYPE, }, "#appcHQ": { latitude:37.390749, longitude:-122.081651, title: "Appcelerator Headquarters", subtitle: "Mountain View, CA", pincolor: Alloy.Globals.Map.ANNOTATION_PURPLE }This may not be a bug in the Module however, there does seem to be an error in the documentation, because it's example shows using a "View" tag instead of the "Module" tag.
Closing as invalid. If this is incorrect, please reopen.