{ "id": "116938", "key": "TIMOB-14493", "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": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "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": "2014-08-19T06:42:56.000+0000", "created": "2013-07-08T11:53:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Ti.map", "Titanium", "i0S", "mapView", "mobilesdk", "module_map", "qe-manualtest" ], "versions": [ { "id": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-19T06:42:56.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "In iOS Environment removeAnnotations method documentation says, annotations to be removed should be passed as an array, but the SDK Implementation does not handle that.\r\n\r\nWhile The SDK implementation is written for the annotation names to be passed directly as a multiple parameter without any array being involved.\r\n\r\nDocumentation Link: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Map.View-method-removeAnnotations\r\n\r\n\r\n\r\nSDK Implementation Link:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiMapViewProxy.m\r\n\r\nLine Number 310 to 329...\r\n\r\n**Sample code to test**\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow();\r\n\r\nvar mountainView = Titanium.Map.createAnnotation({\r\n latitude:37.390749,\r\n longitude:-122.081651,\r\n title:\"Appcelerator Headquarters\",\r\n subtitle:'Mountain View, CA',\r\n pincolor:Titanium.Map.ANNOTATION_RED,\r\n animate:true,\r\n leftButton: '../images/appcelerator_small.png',\r\n myid:1 // Custom property to uniquely identify this annotation.\r\n});\r\n\r\nvar mountainViewAnno = Titanium.Map.createAnnotation({\r\n latitude:28.390749,\r\n longitude:-72.081651,\r\n title:\"Custome 1\",\r\n subtitle:'Mountain View 2',\r\n pincolor:Titanium.Map.ANNOTATION_GREEN,\r\n animate:true,\r\n leftButton: '../images/appcelerator_small.png',\r\n myid:2 // Custom property to uniquely identify this annotation.\r\n});\r\n\r\nvar view1 = Ti.UI.createView({\r\n\ttop:100,\r\n\tleft:10,\r\n\twidth:310,\r\n\theight:320,\r\n\tbackgroundColor:\"gray\"\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttop:10,\r\n\tleft:50,\r\n\twidth:110,\r\n\theight:80,\r\n\tbackgroundColor:\"gray\",\r\n\ttitle:\"Remove Annotations\"\r\n});\r\nvar annoArr = [mountainView,mountainViewAnno];\r\nvar mapview = Titanium.Map.createView({\r\n mapType: Titanium.Map.STANDARD_TYPE,\r\n region: {latitude:33.74511, longitude:-84.38993, \r\n latitudeDelta:0.01, longitudeDelta:0.01},\r\n animate:true,\r\n regionFit:true,\r\n userLocation:true,\r\n annotations:annoArr\r\n});\r\n\r\nview1.add(mapview);\r\nwin.add(view1);\r\n// Handle click events on any annotations on this map.\r\nmapview.addEventListener('click', function(evt) {\r\n\r\n Ti.API.info(\"Annotation \" + evt.title + \" clicked, id: \" + evt.annotation.myid);\r\n\r\n // Check for all of the possible names that clicksouce\r\n // can report for the left button/view.\r\n if (evt.clicksource == 'leftButton' || evt.clicksource == 'leftPane' ||\r\n evt.clicksource == 'leftView') {\r\n Ti.API.info(\"Annotation \" + evt.title + \", left button clicked.\");\r\n }\r\n});\r\n\r\nbutton.addEventListener(\"click\",function(){\r\n\t//mapview.removeAnnotations(mountainView,mountainViewAnno); // this is working but it should not as per documentation\r\n\t\r\n\tmapview.removeAnnotations(annoArr); // this is not working though it should as per documentation\r\n});\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n\r\nTest Cases:\r\n\r\n1: Use the above code sample, and put it on app.js of new sample project.\r\n2: Run the sample and once you click remove annotations button, you will see some error and annotations are not removed.\r\n3: now go to below mentioned code in the sample provided above\r\n{code}\r\nbutton.addEventListener(\"click\",function(){\r\n\t//mapview.removeAnnotations(mountainView,mountainViewAnno); // this is working but it should not as per documentation\r\n\t\r\n\tmapview.removeAnnotations(annoArr); // this is not working though it should as per documentation\r\n});\r\n{code}\r\n\r\n4: Alternate the comment line and test again.\r\n5: this time it will work.\r\n\r\nConclusion: Either documentation is wrong or TiSDK TiMapViewProxy needs to be modified to accomodate documentation use cases.", "attachment": [], "flagged": false, "summary": "iOS: TiMapViewProxy removeAnnotations method does not work as per documentation.", "creator": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Titanium Mobile SDK, iOS", "comment": { "comments": [ { "id": "262774", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4470", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-23T03:59:21.000+0000", "updated": "2013-07-23T03:59:21.000+0000" }, { "id": "276764", "author": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested & Verified the fix with:\r\nOSX: 10.8.5\r\nXcode:5.0\r\nAppcelerator Studio: 3.2.0.201310250414\r\nSDK: 3.2.0.v20131024120843\r\nacs:1.0.7\r\nalloy:1.2.2\r\nnpm:1.3.2\r\ntitanium:3.2.0\r\ntitanium-code-processo:1.0.3\r\nDevice: iPod touch 2 (v iOS7)", "updateAuthor": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-25T11:05:56.000+0000", "updated": "2013-10-25T11:05:56.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }