Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-10203

iOS: Map Annotation image cannot be changed dynamically

    Details

      Description

      The problem

      The map annotations can be represented by an image with the "image" property. That image cannot be dynamically changed.

      The test case:

      var changeButton = Ti.UI.createButton({
      	title: 'change colour'
      });
      var win = Ti.UI.createWindow({
      	rightNavButton: changeButton
      });
       
      var map = Ti.Map.createView({
      	userLocation:false,
      	animate: true,
      	region: {
      		latitude:12,
      		longitude:12,
      		latitudeDelta:1,
      		longitudeDelta:1
      	}
      });
       
      var annot = Ti.Map.createAnnotation({
      	latitude:12,
      	longitude:12,
      	image: 'blue.png'
      });
       
      map.addAnnotation(annot);
       
      win.add(map);
      win.open({modal: true});
       
      var isBlue = true;
       
      changeButton.addEventListener('click', function(e){
      	annot.image = isBlue ? 'yellow.png' : 'blue.png';
      	isBlue = !isBlue;
      });
      

      To reproduce:

      1. Copy and paste this code to app.js
      2. Run the app and you'll see a blue pin
      3. Click the right navigation button
      4. The blue pin is still blue - it did not change to yellow.

      (Attached are the two images)

        Attachments

          Activity

            People

            • Assignee:
              ngupta Neeraj Gupta
              Reporter:
              penrique Pedro Enrique (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-5549
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code