Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11780] MobileWeb: latitudeDelta or longitudeDelta does not update properly when animation is set

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-02-11T21:45:49.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.2.0
ComponentsMobileWeb
Labelsn/a
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2012-11-15T13:53:35.000+0000
Updated2014-03-12T09:52:28.000+0000

Description

Problem Description

When updating the region of the map in MobileWeb (setRegion or setLocation), the zoom does not change accordingly to the delta, if animate is set to true.

Steps to reproduce

USe the following code to reproduce the problem: clicking on the buttons the region changes, but the zoom doesn't.
var defaultLat = 49.809597;
var defaultLng = -97.132756;

var win = Titanium.UI.createWindow({
    backgroundColor : 'black'
});

var mapView = Titanium.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    animate:true,
    animated:true,
    regionFit:true,
    userLocation:true,
    region : {'latitude':defaultLat,'longitude':defaultLng,animate:true,'latitudeDelta':0.01,'longitudeDelta':0.01}
});

win.add(mapView);

var buttonView = Ti.UI.createView({
    layout : 'horizontal',
    width : Ti.UI.SIZE,
    top: 0
})

var button = Ti.UI.createButton({
    title:'setLocation'
});

button.addEventListener('click', function() {
    mapView.setLocation({'latitude':defaultLat,'longitude':defaultLng,animate:true,'latitudeDelta':0.1,'longitudeDelta':0.1});
});

buttonView.add(button);

var button2 = Ti.UI.createButton({
    title:'setRegion'
});

button2.addEventListener('click', function() {
    mapView.setRegion({'latitude':defaultLat,'longitude':defaultLng,animate:true,'latitudeDelta':0.1,'longitudeDelta':0.1});
});

buttonView.add(button2);

win.add(buttonView);

win.open();

Comments

  1. Shak Hossain 2014-02-11

    This issue can't be reproduced with TISDK 3.2 or higher. Therefore, marking it as resolved.
  2. Paras Mishra 2014-03-12

    Verified the fix, hence closing the issue. Environment used: SDK: 3.2.3.v20140311115447 CLI version : 3.2.1 OS : MAC OSX 10.9 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.2.201403061827 titanium-code-processor: 1.1.0 XCode : 5.1

JSON Source