Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1353] Annotation doesn't appear in only Alloy Map

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2016-02-19T23:23:28.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sn/a
ComponentsTitanium SDK
Labelsn/a
ReporterStefano Zanellato
AssigneeFeon Sua Xin Miao
Created2016-02-04T09:44:35.000+0000
Updated2018-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

  1. 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*
       Alloy.Globals.Map = require('ti.map');
       
    *index.xml*
       <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.js*
       function report(evt) {
           Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid);
       }
       
       $.index.open();
       Defined By
       
       
    *index.tss*
       "#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
       }
       
    *Steps to test:* Run above code and observe that map annotation is not showing. *Expected:* Map annotation should be visible Thanks.
  2. 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
       }
       
  3. 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.
  4. Eric Merriman 2018-03-07

    Closing as invalid. If this is incorrect, please reopen.

JSON Source