Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8092] iOS: Mapview zooms to Titanium default even after modifying the mapview region property

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-05T09:22:15.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 2.0.0, Sprint 2012-06, Release 1.8.3
ComponentsiOS
Labelsmodule_map, qe-testadded
ReporterVarun Joshi
AssigneeVishal Duggal
Created2012-03-19T16:07:51.000+0000
Updated2012-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.

Comments

  1. Max Stepanov 2012-03-23

    PR https://github.com/appcelerator/titanium_mobile/pull/1801 merged
  2. Wilson Luu 2012-03-24

    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)
  3. Sabil Rahim 2012-03-28

    Reopening to add Fix Version 1.8.3
  4. Michael Pettiford 2012-04-05

    Reopening/closing to add/remove labels

JSON Source