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

iOS: No event generated on click of map annotation title or subtitle

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: Release 3.2.0, Release 3.2.1, Release 3.2.3
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:
    • Story Points:
      13
    • Sprint:
      2014 Sprint 09 Tooling

      Description

      Problem

      When clicking on an annotation in a mapview, no event is generated for SDK 7.x/8.x but it’s working well for SDK 6.1.

      For more details visit http://developer.appcelerator.com/question/157471/mapview-click-event-listener-not-working-ios7

      Test Code

      var win2 = Ti.UI.createWindow({
      	barColor : '#ff0000',
      	extendEdges : [Ti.UI.EXTEND_EDGE_ALL],
      });
       
      var mountainView = Titanium.Map.createAnnotation({
      	latitude : 37.390749,
      	longitude : -122.081651,
      	title : "Appcelerator Headquarters",
      	subtitle : 'Mountain View, CA',
      	pincolor : Titanium.Map.ANNOTATION_RED,
      	animate : true,
      	leftButton : '/images/arrow.png',
      	myid : 1 // Custom property to uniquely identify this annotation.
      });
       
      var mapview = Titanium.Map.createView({
      	mapType : Titanium.Map.STANDARD_TYPE,
      	region : {
      		latitude : 37.390749,
      		longitude : -122.081651,
      		latitudeDelta : 0.01,
      		longitudeDelta : 0.01
      	},
      	animate : true,
      	regionFit : true,
      	userLocation : true,
      	annotations : [mountainView]
      });
       
      win2.add(mapview);
      // Handle click events on any annotations on this map.
      mapview.addEventListener('click', function(evt){
          var clicksource = evt.clicksource;
          
          alert(clicksource);
          if (clicksource == 'title' || clicksource == 'rightButton'){  
              Ti.API.info('Item clicked');                           
          }
      });
       
      win2.open();
      
      

      Steps to reproduce

      Please follow my steps to reproduce this bug:-

      1. Create new project
      2. Replace app.js code to my test code
      3. Run with IOS SDK 6.1
      4. Click on annotation pin. Annotation appears with title and subtitle
      5. Click on title or subtitle
      6. Its shows alert message
      7. Now change to iOS SDK 7.x/8.x and follow steps 4 to 6
      8. For iOS 7/8, if you click on title or subtitle, alert message will not display

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                mrahman Mostafizur Rahman
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code