[MOD-2240] Android: Ti.Map Annotation not showing if IMAGE property points to a square shaped image
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2016-04-22T04:36:28.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Map |
| Labels | android-6, annotation, map |
| Reporter | Rodolfo Perottoni |
| Assignee | Srikanth Sombhatla |
| Created | 2016-04-07T08:07:12.000+0000 |
| Updated | 2016-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
| File | Date | Size |
|---|---|---|
| pin-red.gif | 2016-04-07T22:15:43.000+0000 | 1297 |
| pin-red.jpg | 2016-04-07T22:15:43.000+0000 | 12462 |
| pin-red.png | 2016-04-07T22:15:43.000+0000 | 17990 |
| pin-red-test.png | 2016-04-07T22:15:43.000+0000 | 18460 |
| pin-red-test2.png | 2016-04-07T22:15:43.000+0000 | 20602 |
| pin-red-test3.png | 2016-04-07T22:15:43.000+0000 | 18477 |
| pin-red-test4.png | 2016-04-07T22:15:43.000+0000 | 18512 |
| pin-red-test5.png | 2016-04-07T22:15:43.000+0000 | 18917 |
| pin-red-test6.png | 2016-04-07T22:15:43.000+0000 | 3192 |
| pin-red-test7.png | 2016-04-07T22:15:43.000+0000 | 3194 |
| pin-red-test8.png | 2016-04-07T22:15:43.000+0000 | 3203 |
| rectangle1.mov | 2016-04-07T08:05:46.000+0000 | 5030069 |
| rectangle2.mov | 2016-04-07T08:05:46.000+0000 | 5314827 |
| square2.mov | 2016-04-07T08:05:58.000+0000 | 6986016 |
| square image1.mov | 2016-04-07T08:05:55.000+0000 | 4777605 |
Hi, Thanks for reaching out.Could you please share with us your all shaped images? So that we can give you a right direction.
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.
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.
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.<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>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.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();*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.201511241829image:'/images/square.png', // refers to square size image // image:'/images/rectangle.png', // refers to rectangle size imageNot 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.