{ "id": "113923", "key": "TIMOB-13778", "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": "15547", "description": "2013 Sprint 14", "name": "2013 Sprint 14", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15548", "description": "2013 Sprint 14 API", "name": "2013 Sprint 14 API", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-12T22:41:13.000+0000", "created": "2013-05-07T16:45:02.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "mapv2", "qe-testadded", "supportTeam" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "29972", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "116355", "key": "TIMOB-14346", "fields": { "summary": "Android: MapView crash while doing swipe ", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "30492", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "117494", "key": "TIDOC-1208", "fields": { "summary": "Community Release Notes 3.1.2", "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": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-24T07:27:19.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Issue\r\nWhen an annotation is selected using the selectAnnotation function or when a pin is clicked on the map the map view used to automatically move so that the annotation title and subtitle would be visible. \r\n\r\nThis is how the native google maps application and current TiMap View object performs. Sample attached reproduces on TiMapView object. Tap on \"Open TiMapView\" row.\r\n\r\nUsing the V2 Maps module when an annotation is selected using the function or when a pin is clicked the map stay stationary and the annotation is shown with half or more of it potentially cut off. Tap on \"Open MapModule\" row.\r\n\r\nh6.Actual behavior\r\nselecting a map pin pops up an annotation that runs off the edge of the screen, \r\n\r\nh6.Expected behavior\r\nthe map should move so that the annotation title and subtitle are fully visible.\r\n\r\nh6.snippet\r\n{code}\r\nvar MapModule = require('ti.map');\r\n\r\nvar win = Ti.UI.createWindow();\r\nvar table = Ti.UI.createTableView();\r\nvar tableData = [];\r\n\r\nvar centerTrue = Ti.UI.createTableViewRow({\r\n\ttitle : 'Open TiMapView'\r\n});\r\ntableData.push(centerTrue);\r\ncenterTrue.addEventListener('click', function(e) {\r\n\topenTiMapView();\r\n});\r\n\r\nvar annotationRow = Ti.UI.createTableViewRow({\r\n\ttitle : 'Open MapModule'\r\n});\r\ntableData.push(annotationRow);\r\nannotationRow.addEventListener('click', function(e) {\r\n\tannotationTest();\r\n});\r\n\r\ntable.setData(tableData);\r\nwin.add(table);\r\nwin.open();\r\n\r\nfunction openTiMapView() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tbackgroundColor : '#fff'\r\n\t});\r\n\tvar map = Ti.Map.createView({\r\n\t\tmapType : Ti.Map.STANDARD_TYPE,\r\n\t\tregionFit : true\r\n\t});\r\n\tvar annotation = Ti.Map.createAnnotation({\r\n\t\tlatitude : 59.93473,\r\n\t\tlongitude : 10.760797,\r\n\t\ttitle : 'Center TRUE _ Print House AS',\r\n\t\tsubtitle : 'Sandakerveien 24 C Bygg A2, 0473 Oslo',\r\n\t\tanimate : true,\r\n\t\tpincolor : Ti.Map.ANNOTATION_PURPLE\r\n\t});\r\n\tmap.addAnnotation(annotation);\r\n\tmap.selectAnnotation({\r\n\t\tannotation : annotation,\r\n\t\tcenter : false//either true or false makes no difference\r\n\t});\r\n\tmap.setLocation({\r\n\t\tlatitude : 60,\r\n\t\tlongitude : 10.760797,\r\n\t\tlatitudeDelta : 0.035,\r\n\t\tlongitudeDelta : 0.035\r\n\t});\r\n\r\n\twin.add(map);\r\n\twin.open();\r\n\r\n}\r\n\r\nfunction annotationTest() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tfullscreen : false\r\n\t});\r\n\tvar anno = MapModule.createAnnotation({\r\n\t\tlatitude : -33.87365,\r\n\t\timage : 'map_pin.png',\r\n\t\tlongitude : 151.20689,\r\n\t\ttitle : \"Sydney\",\r\n\t\tsubtitle : \"Sydney is quite chill\",\r\n\t\tdraggable : true\r\n\t});\r\n\tvar anno2 = MapModule.createAnnotation({\r\n\t\tlatitude : -33.86365,\r\n\t\tpincolor : MapModule.ANNOTATION_BLUE,\r\n\t\tlongitude : 151.21689,\r\n\t\ttitle : \"Anno2\",\r\n\t\tsubtitle : \"This is anno2\",\r\n\t\tdraggable : true\r\n\t});\r\n\tvar anno3 = MapModule.createAnnotation({\r\n\t\tlatitude : -33.85365,\r\n\t\tlongitude : 151.20689,\r\n\t\ttitle : \"Anno3\",\r\n\t\tsubtitle : \"This is anno3\",\r\n\t\tdraggable : false\r\n\t});\r\n\tvar anno4 = MapModule.createAnnotation({\r\n\t\tlatitude : -33.86365,\r\n\t\tlongitude : 151.22689,\r\n\t\ttitle : \"Anno4\",\r\n\t\tsubtitle : \"This is anno4\",\r\n\t\tdraggable : true\r\n\t});\r\n\r\n\tTi.API.info(\"Latitude:\" + anno.latitude);\r\n\tTi.API.info(\"Title:\" + anno.title);\r\n\r\n\tvar map = MapModule.createView({\r\n\t\tuserLocation : true,\r\n\t\tmapType : MapModule.NORMAL_TYPE,\r\n\t\tanimate : true,\r\n\t\tannotations : [anno, anno2, anno4],\r\n\t\tregion : {\r\n\t\t\tlatitude : -33.87365,\r\n\t\t\tlongitude : 151.20689,\r\n\t\t\tlatitudeDelta : 0.1,\r\n\t\t\tlongitudeDelta : 0.1\r\n\t\t}, //Sydney\r\n\t\ttop : '30%'\r\n\t});\r\n\tTi.API.info(\"userLocation: \" + map.userLocation);\r\n\twin.add(map);\r\n\r\n\tmap.addEventListener('click', function(e) {\r\n\t\tTi.API.info(\"Latitude: \" + e.latitude);\r\n\t\tTi.API.info(\"Source: \" + e.clicksource);\r\n\t});\r\n\tvar button = Ti.UI.createButton({\r\n\t\ttop : 0,\r\n\t\tleft : 0,\r\n\t\ttitle : \"Go Mt. View\"\r\n\t});\r\n\tbutton.addEventListener('click', function(e) {\r\n\t\tmap.region = {\r\n\t\t\tlatitude : 37.3689,\r\n\t\t\tlongitude : -122.0353,\r\n\t\t\tlatitudeDelta : 0.1,\r\n\t\t\tlongitudeDelta : 0.1\r\n\t\t};\r\n\t\t//Mountain View\r\n\t});\r\n\r\n\tvar button2 = Ti.UI.createButton({\r\n\t\ttop : 0,\r\n\t\tright : 0,\r\n\t\ttitle : \"add anno3\"\r\n\t});\r\n\tbutton2.addEventListener('click', function(e) {\r\n\t\tmap.addAnnotation(anno3);\r\n\t});\r\n\r\n\tvar button3 = Ti.UI.createButton({\r\n\t\ttop : 0,\r\n\t\ttitle : \"rm anno3\"\r\n\t});\r\n\tbutton3.addEventListener('click', function(e) {\r\n\t\tmap.removeAnnotation(anno3);\r\n\t});\r\n\r\n\tvar button4 = Ti.UI.createButton({\r\n\t\ttop : '10%',\r\n\t\ttitle : \"rm all\"\r\n\t});\r\n\tbutton4.addEventListener('click', function(e) {\r\n\t\tmap.removeAllAnnotations();\r\n\t});\r\n\r\n\tvar button5 = Ti.UI.createButton({\r\n\t\ttop : '10%',\r\n\t\tleft : 0,\r\n\t\ttitle : \"remove annos\"\r\n\t});\r\n\tbutton5.addEventListener('click', function(e) {\r\n\t\tTi.API.info(anno.getTitle());\r\n\t\tmap.removeAnnotations([\"Sydney\", anno2]);\r\n\t});\r\n\r\n\tvar button6 = Ti.UI.createButton({\r\n\t\ttop : '10%',\r\n\t\tright : 0,\r\n\t\ttitle : \"select anno2\"\r\n\t});\r\n\tbutton6.addEventListener('click', function(e) {\r\n\t\tmap.selectAnnotation(anno2);\r\n\t});\r\n\tmap.selectAnnotation(anno2);\r\n\tvar button7 = Ti.UI.createButton({\r\n\t\ttop : '20%',\r\n\t\tleft : 0,\r\n\t\ttitle : \"desel anno2\"\r\n\t});\r\n\tbutton7.addEventListener('click', function(e) {\r\n\t\tmap.deselectAnnotation(anno2);\r\n\t});\r\n\r\n\tvar button8 = Ti.UI.createButton({\r\n\t\ttop : '20%',\r\n\t\tright : 0,\r\n\t\ttitle : \"modify anno2\"\r\n\t});\r\n\tbutton8.addEventListener('click', function(e) {\r\n\t\tanno2.title = \"Hello\";\r\n\t\tanno2.subtitle = \"Hi there.\";\r\n\t\tanno2.longitude = 151.27689;\r\n\t});\r\n\r\n\twin.add(button);\r\n\twin.add(button2);\r\n\twin.add(button3);\r\n\twin.add(button4);\r\n\twin.add(button5);\r\n\twin.add(button6);\r\n\twin.add(button7);\r\n\twin.add(button8);\r\n\twin.open();\r\n}\r\n{code}\r\n\r\nTesting Steps:\r\n\r\n1. Click on \"Open MapModule\"\r\n2. Click on an annotation, it should be centered.\r\n", "attachment": [], "flagged": false, "summary": "Android: Maps V2 module - selecting a map pin pops up an annotation that runs off the edge of the screen", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.0.GA\r\nMapModule 2.1.0\r\nAndroid 4.0.4", "comment": { "comments": [ { "id": "259314", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_modules/pull/122\r\nIn Android map v2, default behavior is annotation will be centered when clicked. This is fixed with the above PR. This will be a behavior change from map v1, where clicking on an annotation will just move it enough to be fully on screen. \r\n", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-25T00:21:42.000+0000", "updated": "2013-07-03T18:18:32.000+0000" }, { "id": "260487", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_modules/pull/122", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-01T21:07:01.000+0000", "updated": "2013-07-01T21:07:01.000+0000" }, { "id": "263290", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "SDK PR: https://github.com/appcelerator/titanium_mobile/pull/4495\nhttps://github.com/appcelerator/titanium_mobile/pull/4496", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T00:01:02.000+0000", "updated": "2013-07-26T00:01:02.000+0000" }, { "id": "266708", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with:\nSDK 3.1.2.v20130814124556\nTitanium Studio: 3.1.2.201308091617\n\nMap v1 annotation moves enough to be fully visible, map v2 centers.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-15T18:04:20.000+0000", "updated": "2013-08-15T18:04:20.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }