Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20620] Android: Annotation.pincolor can't be changed if annotation added to mapView.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-04-13T05:51:01.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsannotation
ReporterCREATIVE KAIZEN
AssigneeSrikanth Sombhatla
Created2016-03-21T21:23:04.000+0000
Updated2017-03-31T22:04:43.000+0000

Description

I am not sure if it is a bug or it needs improvement. If annotation is created than changing it's pincolor by
annotation.pincolor = mapModule.ANNOTATION_AZURE;
//or
annotation.setPincolor =  mapModule.ANNOTATION_AZURE;
won't change annotation color unless it is removed and added again to mapView.

Attachments

FileDateSize
annotation1.png2016-03-22T19:26:59.000+0000355711
annotation2.png2016-03-22T19:26:58.000+0000353788
app.js2016-04-11T07:46:23.000+0000883

Comments

  1. CREATIVE KAIZEN 2016-03-22

    Hello, In you sample code you change color from AZURE to AZURE so there is no change of the color. Try to change to different color. The code you wrote works. Probably it is caused by the thing that during the execution of these lines annotation is not yet visible. Please try this code:
       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,
          pincolor : mapModule.ANNOTATION_AZURE
       });
       
       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.setPincolor(mapModule.ANNOTATION_RED);   //Change annotation color here
          annotation.pincolor = mapModule.ANNOTATION_RED;        //Change annotation color here*/
       });
       
    I am attaching screenshots as a proof - view changes its color but annotation doesn't.
  2. Srikanth Sombhatla 2016-04-11

    PR: https://github.com/appcelerator-modules/ti.map/pull/156 Use [^app.js] for testing.
  3. Ashraf Abu 2016-04-12

    PR approved and merged.
  4. Ashraf Abu 2016-04-14

    [~ssombhatla] could you add a release binary to the Github page as well?
  5. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source