[TIMOB-8092] iOS: Mapview zooms to Titanium default even after modifying the mapview region property
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-05T09:22:15.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | Release 2.0.0, Sprint 2012-06, Release 1.8.3 |
Components | iOS |
Labels | module_map, qe-testadded |
Reporter | Varun Joshi |
Assignee | Vishal Duggal |
Created | 2012-03-19T16:07:51.000+0000 |
Updated | 2012-04-05T09:22:15.000+0000 |
Description
1. Run the attached app.js sample.
2. Click on the Select Annotation button (This event listener has mapview region modified)
3. The map zooms to what seems to be a default zoom level instead of what is specified in the event listener above.
4. Now move the map around and then from this point, on clicking the Select Annotation button the zoom level is always taken as the one that has been modified.
*Note:* Just modifying the latitude and longitude properties and not the delta ones for the map too has this behavior.
{noformat}
var win = Ti.UI.createWindow();
//
// CREATE ANNOTATIONS
//
var atlantaParams = {
latitude:33.74511,
longitude:-84.38993,
title:"Atlanta, GA",
subtitle:'Atlanta Braves Stadium\nfoo',
animate:true,
rightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE,
myid:3
};
atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
var atlanta = Titanium.Map.createAnnotation(atlantaParams);
//
// CREATE MAP VIEW
//
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
animate:true,
regionFit:true,
userLocation:true
});
mapview.addAnnotation(atlanta);
win.add(mapview);
var bt = Ti.UI.createButton({
title: "Select Annotation",
width: 130,
height: 40,
left: 0,
top: 0
});
bt.addEventListener("click",function(e){
mapview.region = {latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5};
mapview.selectAnnotation(atlanta);
});
win.add(bt);
win.open();
{noformat}
*EXPECTED BEHAVIOR*
The mapview should center around the window with the assigned coordinates.
PR https://github.com/appcelerator/titanium_mobile/pull/1801 merged
Closing bug. Verified fix on: SDK build: 2.0.0.v20120323221800 Titanium Studio, build: 2.0.0.201203240504 xcode: 4.3 Device: iphone 4s Verizon (5.0.1)
Reopening to add Fix Version 1.8.3
Reopening/closing to add/remove labels