[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.Comments
- Jebun Naher 2016-02-04
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 }
- Feon Sua Xin Miao 2016-02-19
The pin is way off the visible region of the map, also
Module
tag should be used. Try this one:index.xml
<Alloy> <Window class="container"> <Module id="mapview" module="ti.map" method="createView"> <Annotation id="appcHQ" myid="1"/> </Module> </Window> </Alloy>
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 }
- David Call 2017-06-07 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.
- Eric Merriman 2018-03-07 Closing as invalid. If this is incorrect, please reopen.