{ "id": "172099", "key": "MOD-2455", "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": "20268", "name": "Ti.Map iOS 3.1.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-09-05T08:45:27.000+0000", "created": "2018-08-20T18:58:11.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "clustering", "ios", "maps" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-09-05T08:45:27.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": [], "description": "In the sample app click \"add annotations\" and then click \"remove annotations\". If you remove the 2 types of annotations separately, like I have commented out in the remove function, it seems to work without issue.\r\n\r\nerror should resemble \r\n\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 29;\r\n[ERROR] : line = 105;\r\n[ERROR] : message = \"Invalid type passed to function\";\r\n[ERROR] : nativeLocation = \"-[TiMapViewProxy annotationFromArg:] (TiMapViewProxy.m:163)\";\r\n[ERROR] : nativeReason = \"expected: Object, was: MKClusterAnnotation\";\r\n[ERROR] : nativeStack = \"3 MapClustering problems 0x00000001089bd379 -[TiProxy throwException:subreason:location:] + 105\\n4 MapClustering problems 0x0000000108ba880f -[TiMapViewProxy annotationFromArg:] + 347\\n5 MapClustering problems 0x0000000108baaa9a -[TiMapViewProxy removeAllAnnotations:] + 406\\n6 CoreFoundation 0x000000011139336c __invoking___ + 140\\n7 CoreFoundation 0x0000000111393240 -[NSInvocation invoke] + 320\\n8 MapClustering problems 0x00000001088f5cdd -[KrollMethod call:] + 2045\\n9 MapClustering problems 0x00000001088f45a1 __KrollCallAsFunction_block_invoke + 49\\n10 MapClustering problems 0x00000001089fb4bd TiThreadPerformOnMainThread + 77\\n11 MapClustering problems 0x00000001088f424e KrollCallAsFunction + 702\\n12 JavaScriptCore 0x000000010988b940 _ZN3JSC16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 512\\n13 JavaScriptCore 0x0000000109996cd1 _ZN3JSC5LLInt9setUpCallEPNS_9ExecStateEPNS_11InstructionENS_22CodeSpecializationKindENS_7JSValueEPNS_17LLIntCallLinkInfoE + 577\\n14 JavaScriptCore 0x000000010999ff4d llint_entry + 27269\\n15 JavaScriptCore 0x00000001099992e0 vmEntryToJavaScript + 304\\n16 JavaScriptCore 0x000000010982a1df _ZN3JSC7JITCode7executeEPNS_2VMEPNS_14ProtoCallFrameE + 127\\n17 JavaScriptCore 0x00000001097f0871 _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 433\\n18 JavaScriptCore 0x00000001094e14d2 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 178\\n19 JavaScriptCore 0x00000001098eb29d JSObjectCallAsFunction + 461\";\r\n[ERROR] : sourceURL = \"file:///Users/mikestancliffe/Library/Developer/CoreSimulator/Devices/36D76DE8-F88D-40AA-A46E-7D2B8BBD7247/data/Containers/Bundle/Application/4DAF6BFF-CEDD-4439-94A4-DA4293EAD45C/MapClustering%20problems.app/alloy/controllers/index.js\";\r\n[ERROR] : stack = \" at [native code]\\n at remove@file:///Users/mikestancliffe/Library/Developer/CoreSimulator/Devices/36D76DE8-F88D-40AA-A46E-7D2B8BBD7247/data/Containers/Bundle/Application/4DAF6BFF-CEDD-4439-94A4-DA4293EAD45C/MapClustering%20problems.app/alloy/controllers/index.js:105:29)\";\r\n[ERROR] : }\r\n", "attachment": [ { "id": "65459", "filename": "index.js", "author": { "name": "cliff_stander", "key": "cliff_stander", "displayName": "Mike Stancliffe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-20T18:54:29.000+0000", "size": 1289, "mimeType": "application/javascript" }, { "id": "65458", "filename": "index.xml", "author": { "name": "cliff_stander", "key": "cliff_stander", "displayName": "Mike Stancliffe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-20T18:54:45.000+0000", "size": 268, "mimeType": "text/xml" } ], "flagged": false, "summary": "Ti.Map: iOS - Calling removeAllAnnotations when using clusters throws error", "creator": { "name": "cliff_stander", "key": "cliff_stander", "displayName": "Mike Stancliffe", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "cliff_stander", "key": "cliff_stander", "displayName": "Mike Stancliffe", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "440901", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tested the issue. I was able to reproduce the issue on our end. Removing annotation does cause the issue as described. I will forward this to our engineering. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-08-20T20:36:43.000+0000", "updated": "2018-08-20T20:36:43.000+0000" }, { "id": "441288", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator-modules/ti.map/pull/246\r\n\r\nTest Case -\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar mapContainer = Ti.UI.createView({\r\n bottom: 50\r\n});\r\n\r\nvar addBtn = Ti.UI.createButton({\r\n title: 'Add Annotations',\r\n bottom: 0,\r\n left: 20\r\n});\r\n\r\nvar removeBtn = Ti.UI.createButton({\r\n title: 'Remove Annotations',\r\n bottom: 0,\r\n left: 150\r\n});\r\n\r\nvar clusters = [];\r\nvar points = [];\r\n\r\nvar Map = require('ti.map');\r\nvar map = Map.createView();\r\nmap.addEventListener('clusterstart', cluster);\r\n\r\n\r\nfunction add(e) {\r\n map.removeAnnotations(points);\r\n map.removeAnnotations(clusters);\r\n \r\n clusters = [];\r\n points = [];\r\n \r\n var lat = 29.951318;\r\n var long = -90.080998;\r\n \r\n \r\n \r\n for(var x = 0; x<200; x++ ){\r\n var point = Map.createAnnotation({\r\n clusterIdentifier: 'a',\r\n latitude: parseFloat(lat),\r\n longitude: parseFloat(long),\r\n title: x,\r\n subtitle: lat +' - '+long,\r\n index: x,\r\n });\r\n\r\n points.push(point);\r\n \r\n console.warn(lat +' - '+long);\r\n \r\n lat = lat+parseFloat( (Math.random() * .1)); \r\n long = long+parseFloat( (Math.random() * .1)); \r\n }\r\n \r\n console.log('ADD ANNOTATIONS');\r\n map.addAnnotations(points);\r\n}\r\n\r\nfunction remove(){\r\n map.removeAllAnnotations();\r\n \r\n // $.map.removeAnnotations(points);\r\n // $.map.removeAnnotations(clusters);\r\n}\r\n\r\nfunction cluster(e) {\r\n Ti.API.info('clustering started');\r\n var clusterAnnotation = Map.createAnnotation({\r\n showAsMarker: true,\r\n markerText: e.memberAnnotations.length.toString() + '+',\r\n });\r\n\r\n clusters.push(clusterAnnotation);\r\n\r\n map.setClusterAnnotation({\r\n annotation: clusterAnnotation,\r\n memberAnnotations: e.memberAnnotations\r\n });\r\n}\r\n\r\naddBtn.addEventListener('click', function(e) {\r\n add();\r\n});\r\n\r\nremoveBtn.addEventListener('click', function(e) {\r\n remove();\r\n});\r\n\r\nmapContainer.add(map);\r\nwin.add(addBtn);\r\nwin.add(removeBtn);\r\nwin.add(mapContainer);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-04T05:25:39.000+0000", "updated": "2018-09-04T05:25:39.000+0000" }, { "id": "441326", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cliff_stander] Can you please verify with https://github.com/appcelerator-modules/ti.map/releases (iOS-3.1.1) .Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-05T05:07:54.000+0000", "updated": "2018-09-05T05:07:54.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }