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

Android: Annotations with the same title cannot be uniquley selected. The first is always selected.

    Details

      Description

      Issue

      On Android if we have annotations with the same title, only 1st of the annotations with the title can be selected. In iOS the correct annotation is selected, even if the titles are the same. It would make more sense to have annotations identified by the titleid instead of the title since the title can be the same.

      Sample Code

      In the attached code there are 4 annotations created with unique titleid's. On iOS, when the Select Annotation button is clicked Citibank #3 is selected (which is correct). On Android however the first annotation with that title is selected so Citibank #1 is selected.

       
      var win = Ti.UI.createWindow({
          backgroundColor : 'white'
      });
      win.open();
       
      //create object instance, a parasitic subclass of Observable
      var self = Ti.UI.createView();
      win.add(self);
      var mapObject = Titanium.Map.createView({
          mapType : Titanium.Map.STANDARD_TYPE,
          animate : true,
          regionFit : true,
          userLocation : true,
          top : '150',
          height : '400dp',
          zoomEnabled : true,
          region : {
              latitude : 37.77501,
              longitude : -122.419,
              latitudeDelta : 0.01,
              longitudeDelta : 0.01
          },
      });
       
      mapObject.addEventListener('click', function() {
          alert('map clicked');
      });
       
      var selectAnnotations = Ti.UI.createButton({
          title : "Select Annotations",
          top : '0',
      });
      var annotations = []
       
      annotations[0] = Titanium.Map.createAnnotation({
          animate : true,
          title : 'Citibank',
          subtitle : '#1',
          id : '1',
          pincolor : Titanium.Map.ANNOTATION_RED,
          latitude : parseFloat(37.776),
          longitude : parseFloat(-122.419),
          image : '/images/locPin.png'
      });
       
      annotations[1] = Titanium.Map.createAnnotation({
          animate : true,
          title : 'Citibank',
          subtitle : '#2',
          id : '2',
          pincolor : Titanium.Map.ANNOTATION_RED,
          latitude : parseFloat(37.77501),
          longitude : parseFloat(-122.419),
          image : '/images/locPin.png'
      });
       
      annotations[2] = Titanium.Map.createAnnotation({
          animate : true,
          title : 'Citibank',
          subtitle : '#3',
          id : '3',
          pincolor : Titanium.Map.ANNOTATION_RED,
          latitude : parseFloat(37.770),
          longitude : parseFloat(-122.419),
          image : '/images/locPin.png'
      });
       
      annotations[3] = Titanium.Map.createAnnotation({
          animate : true,
          title : 'Citibank',
          subtitle : '#4',
          id : '4',
          pincolor : Titanium.Map.ANNOTATION_RED,
          latitude : parseFloat(37.770),
          longitude : parseFloat(-122.43),
          image : '/images/locPin.png'
      });
       
      mapObject.addAnnotation(annotations[0]);
      mapObject.addAnnotation(annotations[1]);
      mapObject.addAnnotation(annotations[2]);
      mapObject.addAnnotation(annotations[3]);
       
      self.add(mapObject);
      self.add(selectAnnotations);
       
      var thisObj = this;
      selectAnnotations.addEventListener('click', function(e) {
          mapObject.selectAnnotation(annotations[2], true);
      });
      
      

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              vjoshi Varun Joshi
            • Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code