{ "id": "171246", "key": "MOD-2401", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20242", "name": "Ti.Map Android 4.3.1", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-17T21:52:54.000+0000", "created": "2018-03-06T11:30:16.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ios", "parity", "ti.map" ], "versions": [ { "id": "20029", "name": "Release 7.1.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-08-17T21:52:54.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13700", "name": "Map" } ], "description": "In ti.map when selecting an annotation on the map a click event is triggered. When selecting another annotation on iOS 2 events are fired for both annotations (a deselect event, and a select event for the new one).\r\n\r\nOn Android only a click event is triggered for the newly selected annotation.\r\n\r\nSome sample code\r\n\r\n{code:js}\r\nvar clickedAnnotation = null;\r\nfunction handleMapClick(e){\r\n // check if annotation was clicked\r\n if (e.hasOwnProperty('annotation')){\r\n \r\n // check if the annotation was selected or deselected based on previous state\r\n if (e.annotation.id == clickedAnnotation){\r\n log.args('annotation deselected', e.annotation);\r\n clickedAnnotation = null;\r\n } else {\r\n log.args('annotation selected', e.annotation);\r\n clickedAnnotation = e.annotation.id;\r\n }\r\n } else {\r\n if (e.clicksource == 'circle'){\r\n log.args('circle clicked', e.latitude, e.longitude);\r\n }\r\n }\r\n}\r\n{code}\r\n\r\n{code:xml}\r\n \t\r\n \t\t\r\n \t\t\r\n \t\r\n{code}\r\n\r\n{code:css}\r\n\"#mapview\": {\r\n region: {\r\n latitude: 37.359996,\r\n longitude: -121.950208,\r\n latitudeDelta: 0.6,\r\n longitudeDelta: 0.6\r\n }\r\n}\r\n\r\n\"#amsterdam\": {\r\n latitude: 52.39,\r\n longitude: 4.89,\r\n title: \"Amsterdam\",\r\n subtitle: \"This is Amsterdam!\",\r\n pincolor: Alloy.Globals.Map.ANNOTATION_RED\r\n}\r\n\r\n\"#appcHQ\": {\r\n latitude: 37.368122,\r\n longitude: -121.913653,\r\n title: \"Appcelerator Headquarters\",\r\n subtitle: \"San Jose, CA\",\r\n pincolor: Alloy.Globals.Map.ANNOTATION_RED\r\n}\r\n{code}\r\n\r\n*Result with example code*\r\nWhen selecting an annotation you'll get a this in the console\r\n{code}log.args('annotation selected', e.annotation);{code}\r\nWhen selecting another one, you'll get both deselected and selected on iOS. But only selected on Android.\r\n\r\n*Expected behaviour*\r\nConsistency across platforms. Either create a click event for both annotations when selecting another, or only trigger a click event for selecting the annotation. The first is preferred in my opinion as that is consistent with other situations (like clicking on the canvas/circle after selecting an annotation).", "attachment": [], "flagged": false, "summary": "Ti.Map: Inconsistency between iOS and Android click events on Annotations", "creator": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android\r\nTiSDK 7.1.0.RC", "comment": { "comments": [ { "id": "435252", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "So to be clear, Android should add support for the deselect-event when reselecting another annotations?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-06T19:28:18.000+0000", "updated": "2018-03-06T19:28:18.000+0000" }, { "id": "435254", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~hknoechel] yes that should be the most logical flow and most consistent with other events.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-06T19:37:51.000+0000", "updated": "2018-03-06T19:37:51.000+0000" }, { "id": "439646", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator-modules/ti.map/pull/240", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-08-01T13:31:43.000+0000", "updated": "2018-08-01T13:31:43.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }