{ "id": "163979", "key": "TIMOB-24039", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-11-17T23:21:23.000+0000", "created": "2016-10-14T23:27:53.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-6.0.0" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-11-29T01:35:05.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": "Can't say if this is a regression, I tried it with 5.5.1.GA, 5.5.0.GA, 5.4.0.GA along with appropriate map module version & I could reproduce this issue. I am pretty sure we ran this test for at least one of these releases & it worked fine but not sure why its failing now.\r\n\r\nh5.Steps to reproduce:\r\n1. Make sure your app is setup for android maps.\r\n2. Use the code below in your app.js:\r\n{code}\r\nvar MapModule = require('ti.map');\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar map = MapModule.createView({\r\n userLocation: true,\r\n mapType: MapModule.NORMAL_TYPE,\r\n animate: true,\r\n region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta:0.05, longitudeDelta:0.05}, //Sydney\r\n top: '50%'\r\n});\r\nTi.API.info(\"userLocation: \" + map.userLocation);\r\n\r\n\r\nvar polyline = MapModule.createPolyline({\r\n points : [\r\n {latitude: -33.854419, longitude: 151.214429},\r\n [151.224428, -33.855427],\r\n {latitude: -33.877698, longitude: 151.225072}\r\n ],\r\n color : \"#60FF0000\",\r\n width : 5.0,\r\n zIndex : 10\r\n});\r\nmap.addPolyline(polyline);\r\n\r\nwin.add(map);\r\nwin.open();\r\n{code}\r\n3. Build for android device.\r\n\r\nh5.Actual Results:\r\n1. A runtime error:\r\n{code}\r\n[ERROR] : TiExceptionHandler: (main) [161,161] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,161] - In /app.js:1,2375\r\n[ERROR] : TiExceptionHandler: (main) [0,161] - Message: Uncaught ti.map.PolylineProxy cannot be cast to ti.map.PolygonProxy\r\n[ERROR] : TiExceptionHandler: (main) [0,161] - Source: var MapModule=require(\"ti.map\"),win=Ti.UI.createWindow(),rows=[{title:\"add poly1\",run:function(){map.addPolygon(poly1)}},{title:\"rm poly1\",run:function(){map.removePolygon(poly1)}},{title:\"rm all polygons\",run:function(){map.removeAllPolygons()}},{title:\"add circle\",run:function(){map.addCircle(circle)}},{title:\"rm circle\",run:function(){map.removeCircle(circle)}},{title:\"add polyline\",run:function(){map.addPolyline(polyline)}},{title:\"rm polyline\",run:function(){map.removePolyline(polyline)}},{title:\"rm all shapes\",run:function(){map.removeAllPolygons(),map.removeAllPolylines(),map.removeAllCircles()}}],tableView=Ti.UI.createTableView({top:\"10%%\",bottom:\"50%%\",data:rows});win.add(tableView),tableView.addEventListener(\"click\",function(e){rows[e.index].run&&rows[e.index].run()});var poly1=MapModule.createPolygon({points:[{latitude:-33.855534,longitude:151.200266},{latitude:-33.859098,longitude:151.230994},{latitude:-33.877698,longitude:151.225072},{latitude:-33.875418,longitude:151.201554}],holes:[[{latitude:-33.870002,longitude:151.210395},[151.211939,-33.869503],{latitude:-33.86594,longitude:151.21254},{latitude:-33.865084,longitude:151.211682},{latitude:-33.866439,longitude:151.210738}],[{latitude:-33.858652,longitude:151.204429},{latitude:-33.858946,longitude:151.205803},{latitude:-33.860095,longitude:151.205298},{latitude:-33.860487,longitude:151.204097},{latitude:-33.859133,longitude:151.204054}]],fillColor:\"rgba(237,5,42,75)\",strokeColor:\"#912911\",strokeWidth:10}),poly2=MapModule.createPolygon({points:[[151.22829,-33.85728],[151.224428,-33.855427],[151.22417,-33.858991]],fillColor:\"#F2FA0C\",strokeColor:\"#D4D93F\",strokeWidth:5,zIndex:3}),poly3=MapModule.createPolygon({points:[{latitude:-33.854429,longitude:151.214429},{latitude:-33.854928,longitude:151.236101},{latitude:-33.866189,longitude:151.232668}],fillColor:\"#5EB0DB\",strokeColor:\"#00679E\",strokeWidth:5,zIndex:2}),map=MapModule.createView({userLocation:!0,mapType:MapModule.NORMAL_TYPE,animate:!0,polygons:[poly1,poly2,poly3],region:{latitude:-33.87365,longitude:151.20689,latitudeDelta:.05,longitudeDelta:.05},top:\"50%%\"});Ti.API.info(\"userLocation: \"+map.userLocation),win.add(map);var polyline=MapModule.createPolyline({points:[{latitude:-33.854419,longitude:151.214429},[151.224428,-33.855427],{latitude:-33.877698,longitude:151.225072}],color:\"#60FF0000\",width:5,zIndex:10});map.addPolyline(polyline);var circle=MapModule.createCircle({center:{latitude:-33.87365,longitude:151.20689},radius:1e3,borderWidth:\"2dp\",borderColor:\"#40D2BE1F\",backgroundColor:\"#20FFE725\",opacity:.3,zIndex:0});map.addCircle(circle),map.addEventListener(\"click\",function(e){Ti.API.info(\"Source: \"+e.clicksource+\", Latitude: \"+e.latitude+\" Longitude: \"+e.longitude)}),win.open();\r\n[DEBUG] : OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true\r\n[ERROR] : V8Exception: Exception occurred at /app.js:1: Uncaught ti.map.PolylineProxy cannot be cast to ti.map.PolygonProxy\r\n[ERROR] : V8Exception: ti.map.PolylineProxy cannot be cast to ti.map.PolygonProxy\r\n{code}\r\n\r\nh5.Expected results:\r\n1. Should not see any runtime error & code should run successfully.\r\n \r\nThere is also a stackoverflow post for this : http://stackoverflow.com/questions/39612680/titanium-error-adding-polyline-to-a-mapview-android", "attachment": [], "flagged": false, "summary": "Android: ti.map.PolylineProxy cannot be cast to ti.map.PolygonProxy when adding polyline to map", "creator": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Environment:\r\nAppc Studio : 4.8.0.201610060953\r\nTi SDK : 6.0.0.v20161013072802\r\nTi CLI : 5.0.10\r\nAlloy : 1.9.3\r\nMAC El Capitan : 10.11.6\r\nAppc NPM : 4.2.8-7\r\nAppc CLI : 6.0.0-58\r\nNode: 4.6.0\r\nNexus 6 - Android 6.0.1", "closedSprints": [ { "id": 752, "state": "closed", "name": "2016 Sprint 23 SDK", "startDate": "2016-11-05T00:39:37.027Z", "endDate": "2016-11-19T01:39:00.000Z", "completeDate": "2016-11-29T06:51:57.887Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "401965", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nPolyline gets added successfully to the map with map module ver 3.0.2.\r\nClosing.\r\n\r\nAppc Studio : 4.8.0.201611121409\r\nSDK Version : 6.0.1.v20161128031834\r\nMac OS Version : 10.12\r\nXcode Version : Xcode 8.1 Build version 8B62\r\nAppc CLI AND Appc NPM : {\"NPM\":\"4.2.9-1\",\"CLI\":\"6.0.0\"}\r\nTi CLI : 5.0.10\r\nAlloy : 1.9.4\r\nNode : v4.6.0\r\nDevice: running 7.1.1Nexus 6P", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-29T01:34:59.000+0000", "updated": "2016-11-29T01:34:59.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }