Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25567] Android: customView of Map.Annotation won't show the first time app runs if it has an image

GitHub Issuen/a
TypeBug
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.3.0, Release 8.0.2
Fix Version/sn/a
ComponentsAndroid
LabelsengSchedule, map, mapView
ReporterGuillermo Figueras
AssigneeGary Mathews
Created2017-11-24T11:22:10.000+0000
Updated2019-07-30T15:39:49.000+0000

Description

When using customView property on an Annotation which contains an ImageView and a Label, the first time you open the app you won't see the image. If you go back and open the map again, the images will show. I uploaded a couple of files. One of them is a video showing the bug, the other one is a test case project (remember to change google maps API_KEY on tiapp.xml).

Attachments

FileDateSize
bug_map_customview.mov2017-11-24T11:14:31.000+00009639473
BugMapTest.zip2017-11-24T11:14:31.000+000010013298

Comments

  1. Mostafizur Rahman 2017-11-26

    Hello [~gfigueras], Thanks for sharing with us. We have tested the issue on HUAWEI GR3 2017 using SDK 6.3.0.GA with the sample project provided by you but unable to produce the issue. When we press "Click here" the pages shows nothing. Only a white blank [page](https://s19.postimg.org/7yn43ze9v/imgpsh_fullsize2.jpg) is visible. Please share us a complete reproducible test case to reproduce the issue on our end. Thanks
  2. Guillermo Figueras 2017-11-27

    That's because you have to use your own google maps API key https://i.imgur.com/KeCVm3y.png http://docs.appcelerator.com/platform/latest/#!/guide/Google_Maps_v2_for_Android-section-src-36739898_GoogleMapsv2forAndroid-ObtainandAddaGoogleAPIKey
  3. Guillermo Figueras 2018-01-18

    Well, I came up with a solution for the images not showing, just in case someone is facing the same problem. At first I was adding an ImageView and a Label inside a View, which was the customView of the Annotation, but now instead of doing that, I'm doing this:
       var view = Ti.UI.createView({
       	height: "40dp",
       	width: "25dp",
       	backgroundImage: "/images/pin_red.png"
       });
       		
       var number = Ti.UI.createLabel({
       	text: (i+1),
       	top: "10%"
       });
       		
       view.add(number);
       		
       var annotation = MapModule.createAnnotation({
               latitude : legs[i].start_location.lat,
               longitude : legs[i].start_location.lng,
               title: legs[i].start_address,
               id : i,
               customView: view
       });
       
    Anyways, customView property isn't working properly if you add an ImageView to it.
  4. Gary Mathews 2018-01-18

    This should be fixed by https://github.com/appcelerator-modules/ti.map/releases/tag/android-4.1.1
  5. Guillermo Figueras 2018-01-19

    I tried the old code (the one attached to the ticket) with the new ti.map version but the bug is still there.

JSON Source