{ "id": "63305", "key": "TIMOB-2673", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-07-26T14:26:22.000+0000", "created": "2011-04-15T03:26:35.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "19324", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T21:13:50.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": "{html}

When creating a map view, if you add a regionChanged listener\nthen it changes the displayed region, as illustrated by \nhttp://developer.appcelerator.com/question/77481/map-region-doesnt-...

\n

This is because when firing the event the code alters the region\nobject when it should simply read it.
\nTiMapView.m in the github master as of today reads (around line\n516):

\n
\nif ([self.proxy _hasListeners:@\"regionChanged\"])\n    {\n        region = [mapView region];\n
\n

It should not be modifying the region instance variable, so\nsimply changing this line to read MKCoordinateRegion region =\n[mapView region]; solves the problem.

{html}", "attachment": [], "flagged": false, "summary": "iPhone Map: Adding regionChanged listener causes map region to change", "creator": { "name": "jonathanharlap", "key": "jonathanharlap", "displayName": "Jonathan Harlap", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jonathanharlap", "key": "jonathanharlap", "displayName": "Jonathan Harlap", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "209779", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can't reproduce in SDK 2.2.0.014b86f on iPhone Sim 5.1.\r\n\r\nTest code:\r\n{code}\r\nvar win = Titanium.UI.createWindow();\r\n \r\nvar annotation = Titanium.Map.createAnnotation({\r\n latitude:42.334537,\r\n longitude:-71.170101,\r\n title:\"Boston College\",\r\n subtitle:'Newton Campus, Chestnut Hill, MA',\r\n animate:true,\r\n leftButton:'images/atlanta.jpg'\r\n});\r\n \r\nvar boston = {latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018};\r\n \r\n//\r\n// CREATE MAP VIEW\r\n//\r\nvar mapview = Titanium.Map.createView({\r\n mapType: Titanium.Map.STANDARD_TYPE,\r\n region: boston,\r\n animate:true,\r\n regionFit:true,\r\n userLocation:true,\r\n annotations:[annotation]\r\n});\r\n \r\nwin.add(mapview);\r\n \r\n// map view click event listener\r\nmapview.addEventListener('regionChanged',function(evt)\r\n{\r\n \r\n});\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T14:26:22.000+0000", "updated": "2012-07-26T14:26:22.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }