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

Android: Maps V2 Module - Click Event Listeners not working on a map

    Details

      Description

      Expected results

      A alert dialog should pop up and the info should be logged

      Actual results

      On DDMS but nothing happens.

      Steps to reproduce

      Please add an Click Event Listener for Map or use sample below on project under test (attached on Timob-13004 as well).

      //FirstView Component Constructor
      function FirstView() {
       
      var self = Ti.UI.createView();
       
      var MapModule = require('ti.map');
       
      var map1 = MapModule.createView({
          userLocation: true,
          mapType: MapModule.NORMAL_TYPE,
          animate: true,
          region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
          height: '80%',
          top: 0,
          left: 0,
          width: '100%'
      });
       
      var anno1 = MapModule.createAnnotation({
                      latitude: -33.86665,
                      longitude: 151.20689,
                      title: "Anno2",
                      subtitle: "Ann2 subtitle",
                      animate: true,
                      id: 33
                  });
          anno1.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
          anno1.rightButton = '/images/locations-android-popover-arrow.png';
          anno1.rightButton.height = 44;
          anno1.rightButton.width = 46;
       
      var anno2 = MapModule.createAnnotation({
                      latitude: -33.87365,
                      longitude: 151.20689,
                      title: "Anno2",
                      subtitle: "Ann2 subtitle",
                      animate: true,
                      id: 43
                  });
          anno2.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
          anno2.rightButton = '/images/locations-android-popover-arrow.png';
          anno2.rightButton.height = 44;
          anno2.rightButton.width = 46;
       
      var anno3 = MapModule.createAnnotation({
                      latitude: -33.87964,
                      longitude: 151.21130,
                      title: "Anno3",
                      subtitle: "Ann3 subtitle",
                      animate: true,
                      id: 45
                  });
          anno3.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
          anno3.rightButton = '/images/locations-android-popover-arrow.png';
          anno3.rightButton.height = 44;
          anno3.rightButton.width = 46;
       
       
      var anns = [];
      anns.push(anno1);
      anns.push(anno2);
      anns.push(anno3);
      map1.addAnnotations(anns);
       
       
       
       
      setTimeout(function () {
           map1.selectAnnotation(anno1, true);
           map1.setHeight('100%');
      }, 8000);
       
       
      map1.addEventListener('click', function(e) {
          var alert = Ti.UI.createAlertDialog({
              title: 'Clicked!',
              message: 'e.annotation.id: ' + e.annotation.id + "e.annotation.index: " + e.annotation.index 
          });
          Ti.API.info("Annotation " + e.title);
          alert.show();
      });
       
      self.add(map1);
          return self;
      }
       
      module.exports = FirstView;
      

      Additional details

      Public link 2.1.3.MapsModule patched 2.1.3.GA SDK for use:
      http://dl.dropbox.com/u/34061091/mobilesdk-2.1.3.MapsModule-osx.zip

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                egomez Eduardo Gomez (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code