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

iOS: Map cannot pan / zoom after applying camera

    Details

    • Story Points:
      3
    • Sprint:
      2014 Sprint 21 SDK

      Description

      Problem Description

      After a map view is loaded, and a camera is applied to the map one cannot pan or zoom on the map (touch is lost). The view get's "locked" in position. Removing the camera by applying a pitch of zero, does not restore it.

      The sample code below shows this problem. To test; Load the code. Pan and zoom the map. Then tap the "3D Camera ON" button to apply the camera. Now when you try to pan or zoom, is not possible. Tap the button again to set pitch to 0 and restore the map. Pan and zoom still don't work.

      I should note that the click event is also lost as well if you have any annotations on the map.

      Steps to reproduce

      1. CReate a new mobile project (classic titanium)
      2. Add this to app.js
      app.js:

      Titanium.UI.setBackgroundColor('#fff');
       
      var camOn = false;
       
      var Map = require('ti.map');
       
      var win = Titanium.UI.createWindow();
       
      var map = Map.createView({
      	 mapType: Map.NORMAL_TYPE
      	,animate: false
      	,regionFit: true
      	,pitchEnabled: true
      	,showsBuildings: true
      	,showsPointsOfInterest: true
      	,rotateEnabled: true
      	,region: {
      		latitude: 51.507222, 
      		longitude:  -0.1275,
      		latitudeDelta: 0.01, 
      		longitudeDelta: 0.01
      	 }
      	,userLocation: false
      });
       
      var bCam = Ti.UI.createButton({
      	title: '3D Camera ON',
      	color: '#000',
      	backgroundColor: '#cdcdcd',
      	width: 150,
      	bottom: 30
      });
       
      bCam.addEventListener('click', function(e) {
      	
      	var cam = Map.createCamera({
      	    altitude: 2000, 
      	    centerCoordinate: {
      	        latitude: 51.507222,
      	        longitude: -0.1275
      	    }, 
      	    heading: 0,
      	    pitch: (camOn ? 0 : 60)
      	});
      	
      	map.animateCamera({
      		camera: cam,
      		curve: Ti.UI.ANIMATION_CURVE_EASE_IN,
      		duration: 500
      	});
      	
      	camOn = !camOn;
      	
      	bCam.title = (camOn ? '3D Camera OFF' : '3D Camera ON');
      	
      });
       
       
      win.add(map);
      win.add(bCam);
      win.open();
      

      3. Run it in a device

        Attachments

          Activity

            People

            • Assignee:
              jalter Jon Alter
              Reporter:
              bcproductions Ed
              Reviewer:
              Vishal Duggal (Inactive)
              Tester:
              Kajenthiran Velummaylum
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code