Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2240] Android: Ti.Map Annotation not showing if IMAGE property points to a square shaped image

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-04-22T04:36:28.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMap
Labelsandroid-6, annotation, map
ReporterRodolfo Perottoni
AssigneeSrikanth Sombhatla
Created2016-04-07T08:07:12.000+0000
Updated2016-04-22T04:36:28.000+0000

Description

Annotations are not showing up on Android 6.0 + if you point the *image* property to a square-shaped image. I've tried with several different images and it only showed up with rectangle shaped images. Instructions: -> Create a classic or an alloy mobile project -> Add a Ti.Map View to the main Window -> Add an Annotation pointing to a random square shaped .png -> It wont show up in the map -> Add an annotation pointing to a random rectangle shaped .png -> It shows normally See attached videos for example.

Attachments

FileDateSize
pin-red.gif2016-04-07T22:15:43.000+00001297
pin-red.jpg2016-04-07T22:15:43.000+000012462
pin-red.png2016-04-07T22:15:43.000+000017990
pin-red-test.png2016-04-07T22:15:43.000+000018460
pin-red-test2.png2016-04-07T22:15:43.000+000020602
pin-red-test3.png2016-04-07T22:15:43.000+000018477
pin-red-test4.png2016-04-07T22:15:43.000+000018512
pin-red-test5.png2016-04-07T22:15:43.000+000018917
pin-red-test6.png2016-04-07T22:15:43.000+00003192
pin-red-test7.png2016-04-07T22:15:43.000+00003194
pin-red-test8.png2016-04-07T22:15:43.000+00003203
rectangle1.mov2016-04-07T08:05:46.000+00005030069
rectangle2.mov2016-04-07T08:05:46.000+00005314827
square2.mov2016-04-07T08:05:58.000+00006986016
square image1.mov2016-04-07T08:05:55.000+00004777605

Comments

  1. Aminul Islam 2016-04-07

    Hi, Thanks for reaching out.Could you please share with us your all shaped images? So that we can give you a right direction.
  2. Rodolfo Perottoni 2016-04-07

    Here you go. Several different image sizes / formats. Rectangle images show up normally, while square ones don't show. JPG's are OK, but i need transparency and that won't work.
  3. Nazmus Salahin 2016-04-17

    Hello, I am not able to reproduce this issue. Annotations are showing up on Android 6.0.1 with both square size image and rectangle size image. I have tested this issue in a classic project with ti.map 2.3.6 module. I am adding the screenshots here. [Square Annotation Visible| http://s24.postimg.org/4dlwz3arp/square_Annotation_Visible.png] [Rectangle Annotation Visible| http://s23.postimg.org/6xgtj1ybv/rectangle_Annotation_Visible.png] *Steps:* 1. Create a classic project for Android. 2. Add the following meta data for android manifest in tiapp.xml.
          <android xmlns:android="http://schemas.android.com/apk/res/android">
               <manifest>
                   <application>
                       <!-- Replace "PASTE YOUR GOOGLE MAPS API KEY HERE" with the Google API key you obtained -->
                       <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your_api_key"/>
                       <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
                   </application>
               </manifest>
           </android>
       
    3. Paste rectangle.png and square.png file in "android/images" folder. [square.png| http://s22.postimg.org/xo7czv1xp/square.png] [rectangle.png| http://s24.postimg.org/fw82plk5d/rectangle.png] 4. Replace code in app.js with following code.
       var Map = require('ti.map');
       var win = Titanium.UI.createWindow();
       
       var mountainView = Map.createAnnotation({
           latitude:37.390749,
           longitude:-122.081651,
           title:"Appcelerator Headquarters",
           subtitle:'Mountain View, CA',
           image:'/images/square.png',  // refers to square size image
           //image:'/images/rectangle.png', // refers to rectangle size image
           myid:1 // Custom property to uniquely identify this annotation.
       });
       
       var mapview = Map.createView({
           mapType: Map.NORMAL_TYPE,
           region: {latitude:37.390749, longitude:-122.081651,
                   latitudeDelta:0.01, longitudeDelta:0.01},
           animate:true,
           regionFit:true,
           userLocation:true,
           annotations:[mountainView]
       });
       
       win.add(mapview);
       // Handle click events on any annotations on this map.
       mapview.addEventListener('click', function(evt) {
           Ti.API.info("Clicked " + evt.clicksource + " on " + evt.latitude + "," + evt.longitude);
       });
       win.open();
       
    5. Add ti.map module in tiapp.xml 6. Build and run the app. 7. Change the following two lines in app.js and test again.
           image:'/images/square.png',  // refers to square size image
          // image:'/images/rectangle.png', // refers to rectangle size image
       
    *Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.4.0.201511241829
  4. Srikanth Sombhatla 2016-04-22

    Not able to reproduce this issue >= ti.map 2.3.6 on Android 4.4.2, 5.0. Used the provided square images, they show as expected.

JSON Source