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

Mapsv2 Module: Setting map animate property after map creation does not work

    Details

      Description

      When a map is created and the animate property set to false, the map will not animate even when the property is subsequently set to true.

      var win = Ti.UI.createWindow({fullscreen: false, backGroundColor: 'white'});
       
      var MapModule = require('ti.map');
       
      // make the map 
      var map = MapModule.createView({
          mapType: MapModule.NORMAL_TYPE,
          userLocation: true,
          animate: false,
          region: {latitude: 37.389569, longitude: -122.050212, latitudeDelta: 0.2, longitudeDelta: 0.2},
          
      });
       
      var button5 = Ti.UI.createButton({top: 0, left: 0, title: "Toggle Animate"});
      	button5.addEventListener('click', function() {
      		map.animate=!map.animate; 	
      		Ti.API.info("=====> Animate set to: "+map.animate);
      	});
       
      // set variables for location
      var location ="mv";
       
      var button6 = Ti.UI.createButton({top: 45, left: 0, title: "Change Location"});
      	button6.addEventListener('click', function(){
      	if (location==="noida") {
      		map.region={latitude: 37.390665, longitude: -122.050210, latitudeDelta: 0.05, longitudeDelta: 0.05 };
      		location="mv";
      	} else {
      		map.region={latitude: 28.605924, longitude: 77.361817, latitudeDelta: 0.05, longitudeDelta: 0.05 };
      		location="noida";
      	}
      });
       
       
      win.add(map);
      win.add(button5);
      win.add(button6);
       
      win.open();
      

      Steps to reproduce:
      1) Use sample code above in your pre-configured app with Google map API v2 key
      2) Run the app
      3) Click the "change location" Button - note the lack of animation
      4) Click the "toggle animate" button -note the property set in log cat
      5) Click the "change location" Button

      Result:
      Map does not animate regardless of property setting

      Expected:
      Setting property to true allow map animation during region change

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              emerriman Eric Merriman
              Reviewer:
              Ping Wang
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration