Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5660] Android: Annotation.image can't be changed if annotation added to mapView.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2018-04-11T21:27:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
Labelsandroid, annotation, ti.map
ReporterCREATIVE KAIZEN
AssigneeShak Hossain
Created2018-03-14T17:54:42.000+0000
Updated2018-04-11T21:27:35.000+0000

Description

If annotation is on the map then changing image attribute will not change image itself. Similar problem to TIMOB-20620 with color attribute, which was fixed in one of the Sprints.
var window = Ti.UI.createWindow({
  backgroundColor : 'white'
}); 

window.open(); 

var mapModule = require('ti.map');  

var map = mapModule.createView({
   bottom : 50
}); 

window.add(map); 

var annotation = mapModule.createAnnotation({
   latitude : 1,
   longitude : 1,
   image: '/images/baloon_green.png'
}); 

map.addAnnotation(annotation); 

var view = Ti.UI.createView({
   backgroundColor: 'red',
   bottom: 0,
   height: 50
});

window.add(view);

view.addEventListener('click', function() {

   view.backgroundColor = 'green';
  annotation.image = '/images/baloon_red.png';		//Change annotation image here
  annotation.setImage('/images/baloon_red.png');   //Change annotation image here


});

Attachments

FileDateSize
1.png2018-03-14T17:53:27.000+0000308548
2.png2018-03-14T17:53:27.000+0000307230

Comments

  1. Hans Knöchel 2018-03-14

    You probably just need to change [this line](https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/AnnotationProxy.java#L401) to
       } else if (name.equals(TiC.PROPERTY_PINCOLOR) || name.equals(TiC.PROPERTY_IMAGE)) {
       
    and likely do the same for other properties that should be changeable, like customView.
  2. CREATIVE KAIZEN 2018-03-14

    @Hans: I guess so. But I believe that as in TIMOB-20620 with pincolor property it should be fixed with image property as well. Why would we have setImage method if it doesn't work?
  3. Hans Knöchel 2018-03-14

    It is a computer setter.
  4. Sharif AbuDarda 2018-04-09

    Hello [~CREATIVE KAIZEN], Whats the status of your issue? Are you steen having the issue? did you follow Hans's guide?

JSON Source