{ "id": "109007", "key": "TIMOB-13102", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15274", "description": "2013 Sprint 06 API", "name": "2013 Sprint 06 API", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-22T19:34:23.000+0000", "created": "2013-02-01T10:44:01.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "regression", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-04-06T07:17:01.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Problem description*\r\nThe method setRegion in MapView is not causing any effect in MapView region.\r\n\r\nBelow is a code example of what happens: No one error occurs, but the MapView region doesn't change.\r\n\r\nIt works fine in 3.0.0.GA.\r\n\r\n*Test case*\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#FFF\"\r\n});\r\n\r\nvar map = Ti.Map.createView();\r\nwin.add(map);\r\n\r\n// Change Region of MapView, this method is not working\r\nmap.setRegion({\r\n\tlatitude : -29.688053,\r\n\tlongitude : -52.03125,\r\n\tlatitudeDelta : 0.005,\r\n\tlongitudeDelta : 0.005\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Method *setRegion* is not working anymore", "creator": { "name": "rafaelks", "key": "rafaelks", "displayName": "Rafael Kellermann Streit", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "rafaelks", "key": "rafaelks", "displayName": "Rafael Kellermann Streit", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": "iOS (Any version)\r\nTi SDK 3.0.2.v20130129171611", "comment": { "comments": [ { "id": "239461", "author": { "name": "rafaelks", "key": "rafaelks", "displayName": "Rafael Kellermann Streit", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Any updates here? This is a critical bug, IMHO.", "updateAuthor": { "name": "rafaelks", "key": "rafaelks", "displayName": "Rafael Kellermann Streit", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-02-22T22:44:57.000+0000", "updated": "2013-02-22T22:44:57.000+0000" }, { "id": "242085", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed issue with:\nTitanium Studio, build: 3.0.3.201302201202\nTitanium SDK, build: 3.1.0.v20130312161655 and 3.0.0.GA\nDevice:\niPhone5 iOS 6.0", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-13T21:36:20.000+0000", "updated": "2013-03-13T21:36:20.000+0000" }, { "id": "242088", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This seems to be a timing issue. We will investigate why this is occurring.\n\nIf you add the map to the window before trying to set the region, or if you set a timeout, or if you set the region at creation then change it once the map is added to the window, it works.\n\nhere are some samples that worked for me:\n{code}\nvar win = Ti.UI.createWindow({\n backgroundColor : \"#FFF\"\n});\n\nvar map = Ti.Map.createView();\nwin.add(map);\n\nsetTimeout(function(){\nmap.setRegion({\n latitude : -29.688053,\n longitude : -52.03125,\n latitudeDelta : 0.005,\n longitudeDelta : 0.005\n});\n}, 500);\n\nwin.open();\n{code}\n\n{code}\nvar win = Ti.UI.createWindow({\n backgroundColor : \"#FFF\"\n});\n\nvar regionAtlanta = {latitude:33.74511,longitude:-84.38993,latitudeDelta:0.04, longitudeDelta:0.04};\nvar boston = {latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018};\n\t\nvar map = Ti.Map.createView({\n\tmapType: Titanium.Map.STANDARD_TYPE,\n\tregion: boston,\n\tregionFit:true\n\t});\n\n\nvar button= Ti.UI.createButton({\n\ttitle:\"Click me\",\n\ttop: 15\n});\n\nmap.setRegion({latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018});\n\nwin.add(map);\n\nwin.add(button);\n\nbutton.addEventListener('click', function(){\n\tmap.setRegion({latitude:33.74511,longitude:-84.38993,latitudeDelta:0.04, longitudeDelta:0.04});\n});\n\nwin.open();\n{code}\n\n{code}\nvar win = Ti.UI.createWindow({\n backgroundColor : \"#FFF\"\n});\n\nvar map = Ti.Map.createView();\n\nwin.add(map);\n\nwin.open();\n\nmap.setRegion({\n latitude : -29.688053,\n longitude : -52.03125,\n latitudeDelta : 0.005,\n longitudeDelta : 0.005\n});\n{code}\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-13T21:42:46.000+0000", "updated": "2013-03-13T21:42:46.000+0000" }, { "id": "243518", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending \r\nhttps://github.com/appcelerator/titanium_mobile/pull/4002", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T20:25:42.000+0000", "updated": "2013-03-21T20:25:42.000+0000" }, { "id": "246128", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "setRegion method is working fine as expected.\r\n\r\nVerified on:\r\nDevice : iPad mini, iOS version: 6+\r\nSDK: 3.1.0.v20130405170202\r\nCLI version : 3.1.0-beta\r\nOS : MAC OSX 10.7.5\r\nAppcelerator Studio, build: 3.1.0.201304011603", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-06T07:17:01.000+0000", "updated": "2013-04-06T07:17:01.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }