{ "id": "110267", "key": "TIMOB-12870", "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": null, "resolutiondate": null, "created": "2013-02-26T20:06:10.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "qe-mapv2" ], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:25.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "While using the map test app, I toggled the \"user location\" property on an existing map which caused the user location button and the user location indicator to appear on the map. The first click of this button did nothing. The second click took me to the user location.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({fullscreen: false, backGroundColor: 'white'});\r\n\r\n// make the map \r\nvar map = MapModule.createView({\r\n mapType: MapModule.NORMAL_TYPE,\r\n animate:true,\r\n region: {latitude: 37.389569, longitude: -122.050212, latitudeDelta: 0.2, longitudeDelta: 0.2}\r\n \r\n});\r\n\r\n//make a bunch of control buttons\r\nvar button = Ti.UI.createButton({top: 0, left: 0, title: \"Normal\"});\r\nbutton.addEventListener('click', function(e) {\r\n\t\tmap.setMapType(MapModule.NORMAL_TYPE);\r\n\t});\r\n\r\nvar button1 = Ti.UI.createButton({top: 45, left: 0, title: \"Terrain\"});\r\n\tbutton1.addEventListener('click', function(e) {\r\n\t\tmap.setMapType(MapModule.TERRAIN_TYPE);\r\n\t});\r\n\r\n// a button to cycle the color of the route\r\nvar button2 = Ti.UI.createButton({top: 90, left: 0, title: \"Hybrid\"});\r\nbutton2.addEventListener('click', function(e) {\r\n\t\tmap.setMapType(MapModule.HYBRID_TYPE);\r\n\t});\r\n\r\nvar button3 = Ti.UI.createButton({top: 135, left: 0, title: \"Satellite\"});\r\n\tbutton3.addEventListener('click', function(e) {\r\n\t\tmap.setMapType(MapModule.SATELLITE_TYPE);\t\t\r\n\t});\r\n\t\r\nvar button4 = Ti.UI.createButton({top: 180, left: 0, title: \"Toggle User\"});\r\n\tbutton4.addEventListener('click', function(e) {\r\n\t\tmap.userLocation=!map.userLocation; \t\r\n\t});\r\n\t\r\nvar button5 = Ti.UI.createButton({top: 225, left: 0, title: \"Toggle Animate\"});\r\n\tbutton5.addEventListener('click', function(e) {\r\n\t\tmap.animate=!map.animate; \t\r\n\t\tTi.API.info(\"=====> Animate set to: \"+map.animate);\r\n\t});\r\n\r\n// set variables for location\r\nvar location =\"mv\";\r\n\r\nvar button6 = Ti.UI.createButton({top: 270, left: 0, title: \"Change Location\"});\r\n\tbutton6.addEventListener('click', function(){\r\n\tif (location===\"noida\") {\r\n\t\tmap.region={latitude: 37.390665, longitude: -122.050210, latitudeDelta: 0.05, longitudeDelta: 0.05 };\r\n\t\tlocation=\"mv\";\r\n\t} else {\r\n\t\tmap.region={latitude: 28.605924, longitude: 77.361817, latitudeDelta: 0.05, longitudeDelta: 0.05 };\r\n\t\tlocation=\"noida\";\r\n\t}\r\n});\r\n\r\nvar button7 = Ti.UI.createButton({top: 315, left: 0, title: \"Toggle Traffic\"});\r\n\tbutton7.addEventListener('click', function(e) {\r\n\t\tmap.traffic=!map.traffic; \r\n\t\t\r\n\t});\r\n\t\r\n\r\n\t\r\nwin.add(map);\r\nwin.add(button);\r\nwin.add(button1);\r\nwin.add(button2);\r\nwin.add(button3);\r\nwin.add(button4);\r\nwin.add(button5);\r\nwin.add(button6);\r\nwin.add(button7);\r\nwin.open();\r\n{code}\r\n\r\nSteps to reproduce:\r\n1) Incorporate test code into your existing app with google maps api v2 key\r\n2) Launch test app\r\n3) If your location is on the map, move to another location\r\n4) Click \"toggle user\"\r\n5) Click the \"User location\" target button in the upper-right portion of the screen\r\n\r\nResult:\r\nNothing happens. A second click will take you to the location. In some cases, the first click will work.\r\n\r\nExpected:\r\nThe user location button works on the first click.\r\n\r\nNote:\r\nI expect this may be an unusual use-case, with the more prevalent option being setting the property during map creation.", "attachment": [], "flagged": false, "summary": "mapsv2 Module: Setting \"user location\" map property to \"true\" after map creation sometimes requires two clicks on the \"locate\" button to change to user location", "creator": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OS X 10.8.2\r\nDroid 3 (2.3.4)\r\nDroid 1 (2.2.3)\r\nSDK 3.0.2.GA", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }