{ "id": "171968", "key": "MOD-2442", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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:04.000+0000", "created": "2018-07-25T09:52:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-08-17T21:52:04.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": "When using a MapView with clustering support clicking an Annotation not in a cluster does not trigger a {{click}} event, but opens the InfoWindow.\r\n\r\n*Sample code:*\r\n_app.js_\r\n{code:java}\r\n\r\nvar MapModule = require('ti.map');\r\n var win = Ti.UI.createWindow({ backgroundColor: 'white' });\r\n var opera = MapModule.createAnnotation({\r\n latitude: -33.8569,\r\n longitude: 151.2153,\r\n centerOffset: { x: 80, y: 25 },\r\n pincolor: MapModule.ANNOTATION_RED,\r\n //image: 'SydneyOperaHouse.jpg',\r\n title: 'Sydney Opera',\r\n subtitle: 'Sydney, New South Wales, Australia',\r\n // For eventing, use the Map View's click event\r\n // and monitor the clicksource property for 'rightButton'. \r\n //rightButton: Ti.UI.ios.SystemButton.CONTACT_ADD\r\n });\r\n\r\n\r\n\r\n var mapview = MapModule.createView({\r\n mapType: MapModule.NORMAL_TYPE,\r\n region: { latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },\r\n annotations: [opera]\r\n });\r\n\r\n win.add(mapview);\r\n\r\n mapview.addEventListener('click', function(e) {\r\n if (e.annotation === opera) {\r\n mapview.removeAnnotation(opera);\r\n opera = null;\r\n opera = MapModule.createAnnotation({\r\n latitude: -33.8569,\r\n longitude: 151.2153,\r\n pincolor: MapModule.ANNOTATION_BLUE,\r\n //title: 'Test Annotation'\r\n });\r\n mapview.addAnnotation(opera);\r\n }\r\n });\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: MapView with clustering does not send click event", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "environment": null, "comment": { "comments": [ { "id": "439481", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator-modules/ti.map/pull/239", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-07-25T15:19:15.000+0000", "updated": "2018-07-25T15:19:15.000+0000" }, { "id": "439483", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Not working correctly for me.\r\n{code}\r\nvar Map = require('ti.map');\r\nvar win = Titanium.UI.createWindow();\r\nvar mapview = Map.createView({\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n});\r\n\r\nfunction addData() {\r\n\tvar ann = [];\r\n\tfor (var i = 0; i < 10; i++) {\r\n\t\tann.push(Map.createAnnotation({\r\n\t\t\tclusterIdentifier: (i % 2 == 0) ? 'cluster' : null,\r\n\t\t\tcollisionMode: Map.ANNOTATION_VIEW_COLLISION_MODE_RECTANGLE,\r\n\t\t\tshowAsMarker: true,\r\n\t\t\tmarkerGlyphText: i.toString(),\r\n\t\t\tmarkerColor: 'blue',\r\n\t\t\tmarkerGlyphColor: 'green',\r\n\t\t\ttitle: 'Title',\r\n\t\t\tsubtitle: 'subtitle',\r\n\t\t\tmarkerTitleVisibility: Map.FEATURE_VISIBILITY_VISIBLE,\r\n\t\t\tmarkerSubtitleVisibility: Map.FEATURE_VISIBILITY_HIDDEN,\r\n\t\t\tmarkerGlyphImage: 'Flag.png',\r\n\t\t\tmarkerSelectedGlyphImage: 'social-facebook-icon.png',\r\n\t\t\tannotationDisplayPriority: Map.FEATURE_DISPLAY_PRIORITY_DEFAULT_LOW,\r\n\t\t\tlatitude: Math.random() * 10 + 40,\r\n\t\t\tlongitude: Math.random() * 10,\r\n\t\t\timage: (i % 2 == 0) ? \"img1.png\" : \"img2.png\"\r\n\t\t}));\r\n\t}\r\n\tmapview.setAnnotations(ann);\r\n}\r\nfunction onCluster(e) {\r\n\tvar clusterAnnotation = Map.createAnnotation({\r\n\t\tshowAsMarker: true,\r\n\t\tmarkerText: e.memberAnnotations.length.toString(),\r\n\t\ttitle: 'Cluster Title',\r\n\t\tsubtitle: 'Cluster Subtitle',\r\n\t});\r\n\tmapview.setClusterAnnotation({\r\n\t\tannotation: clusterAnnotation,\r\n\t\tmemberAnnotations: e.memberAnnotations\r\n\t});\r\n\r\n}\r\n\r\nmapview.addEventListener('clusteringstarted', onCluster);\r\nwin.add(mapview);\r\naddData(); \r\n\r\nmapview.addEventListener(\"click\", function(e) {\r\n\tconsole.log(e.clicksource)\r\n})\r\nwin.open();\r\n{code}\r\n\r\nthat are not inside a cluster return \"pin\" but annotations inside a cluster - that are visible when zooming in - only open the infobox but won't return \"pin\"", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-07-25T18:15:41.000+0000", "updated": "2018-07-25T18:15:41.000+0000" }, { "id": "439528", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~michael] I have updated the PR. Would you be able to give it a shot now? ", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-07-27T08:32:44.000+0000", "updated": "2018-07-27T08:32:44.000+0000" }, { "id": "439540", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ybanev] much better now! Click on the cluster still zooms, click on each annotation (normal or out of a cluster) fires the \"pin\" source. I like the removal of the TiClusterMarker so it's easier to handle the items!", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-07-27T14:34:16.000+0000", "updated": "2018-07-27T14:34:16.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }