Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18181] Android: When setting a border radius on an annotation customView, no view (as pin) is displayed

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.4.0, Release 3.4.1
Fix Version/sn/a
ComponentsAndroid
LabelsMapModule, TCSupport
ReporterVincent Degroote
AssigneeSrikanth Sombhatla
Created2014-08-19T13:52:18.000+0000
Updated2016-04-18T06:08:56.000+0000

Description

H4. Problem Description We have tested this issue with our sample code. When setting a borderRadius property on an annotation customView, no view (as pin) is displayed in Android devices. But if we don’t use borderRadius property it works fine as we expect. It’s a bug.

Test Case

1. Create a new mobile project (Classic Titanium) 2. Paste this code into app.js:
var MapModule = require('ti.map');
 
var win = Ti.UI.createWindow({fullscreen: false});
var myView1 = Ti.UI.createView({
    width:10,
    height:10,
    borderRadius:5,
    backgroundColor:'red'
});
var anno = MapModule.createAnnotation({latitude: -33.87365, customView: myView1, longitude: 151.20689, title: "Test", subtitle: "A red circle"});
var map = MapModule.createView({
    userLocation: true,
    mapType: MapModule.NORMAL_TYPE,
    animate: true,
    annotations: [anno],
    region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
    top: '30%'
});
win.add(map);
win.open();
3. Run it in a device

Actual Results

On iOs no problem, a circle is displayed and is clickable. On android, nothing is displayed on the map but you can still click the same zone and the infoWindow appears.

Comments

  1. Netto Ramalho 2015-03-03

    I'm having the same problem
  2. Flavio De Stefano 2015-07-17

    Com'on guys!
  3. Michael Gangolf 2016-04-16

    I did some testing on this issue: !http://migaweb.de/map_ui.jpg! Left side: with borderRadius (or just borderColor) -> red outline shows that there is an invisible annotation Right side: without any borderColor/borderRadius The box is there but invisible. Then I've added
       File tempFolder = new File(TiFileHelper.getInstance().getDataDirectory(false), "temp");
       tempFolder.mkdirs();
       File tempfilej = new File(tempFolder, "test.png");
       
       try {
           Log.i("I", "file " + tempfilej.getAbsolutePath());
           FileOutputStream imageOut = new FileOutputStream(tempfilej);
           image.compress(Bitmap.CompressFormat.PNG, 85, imageOut);
           imageOut.flush();
           imageOut.close();
       } catch (Exception e){
           Log.w("MAP","error");
       }
       
    to _private void handleCustomView(Object obj)_ to save the actual image. Without border it's the red square. With the border it's just a transparent box. So I guess the problem has to do with TiBorderWrapperView.java since the map is adding an invisible box. So toImage() on a view with a border property produces a transparent image
  4. Srikanth Sombhatla 2016-04-18

JSON Source