{ "id": "83390", "key": "TIMOB-6459", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-12-05T13:58:13.000+0000", "created": "2011-12-05T10:48:12.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "branch-v8", "dr-list", "regression" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:35.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": "h2. Expected bahavior\r\n\r\nGiven the test case below, the delete.png image should be shown as the leftButton on the MapView Annotation when selected.\r\n\r\nh2. Actual Behavior\r\n\r\nThe leftButton does not appear at all. This occurs only on 1.8.0.1 for both rhino and v8. 1.7.5 and 1.8.0v20111114 perform as expected.\r\n\r\nThe problem occurs only when the annotation/mapview are created in a commonjs module that is in a subdirectory of the Resources directory. So for example, the below test case will show the failing behavior, but if you moved winInclude.js to the main Resources directory, instead of the 'ui' subdirectory, it will work as it should.\r\n\r\nh2. test case\r\nh4. app.js\r\n\r\nCreating the window from *Resources/winInclude.js* rather than *Resources/ui/winInclude.js* will make everything work fine.\r\n\r\n{code:javascript}\r\n// This will make it work, provided you move winInclude.js to the Resources directory\r\n// var win = require('winInclude').createWin();\r\n\r\nvar win = require('ui/winInclude').createWin();\r\nwin.open();\r\n{code}\r\n\r\nh4. ui/winInclude.js\r\n\r\n{code:javascript}\r\nexports.createWin = function() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tbackgroundColor: '#fff',\r\n\t\tfullscreen: false\r\n\t});\r\n\tvar mapview;\r\n\t\r\n\t// win gets create in open function otherwise the map won't re-render\r\n\t// on pinch, zoom, location change, etc...\r\n\twin.addEventListener('open', function(e) {\r\n\t\tmapview = Titanium.Map.createView({\r\n\t\t mapType: Titanium.Map.STANDARD_TYPE,\r\n\t\t region: {\r\n\t\t\t\tlatitude: 37.389569, \r\n\t\t\t\tlongitude: -122.050212,\r\n\t\t latitudeDelta: 0.1, \r\n\t\t longitudeDelta: 0.1\r\n\t\t },\r\n\t\t animate:true,\r\n\t\t regionFit:true,\r\n\t\t userLocation:false\r\n\t\t});\r\n\t\t\r\n\t\t// Add initial annotation\r\n\t\tmapview.addAnnotation(Ti.Map.createAnnotation({\r\n\t\t\tanimate: true,\r\n\t\t\tpincolor: Titanium.Map.ANNOTATION_RED,\r\n\t\t\ttitle: 'Appcelerator',\r\n\t\t\tlatitude: 37.389569,\r\n\t\t\tlongitude: -122.050212,\r\n\t\t\tleftButton: 'delete.png'\r\n\t\t}));\r\n\t\t\r\n\t\t// Handle all map annotation clicks\r\n\t\tmapview.addEventListener('click', function(e) {\r\n\t\t if (e.annotation && (e.clicksource === 'leftButton' || e.clicksource === 'leftPane')) { \r\n\t\t mapview.removeAnnotation(e.annotation);\r\n\t\t } \r\n\t\t});\r\n\t\twin.add(mapview);\r\n\t});\r\n\treturn win;\r\n};\r\n{code}\r\n", "attachment": [ { "id": "24467", "filename": "delete.png", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T13:39:21.000+0000", "size": 2515, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: MapView Annotations - leftButton/rightButton don't appear when included from a commonjs subdirectory", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 1.8.0.1 (12/05/11 01:18 8f6f25b...)\r\nJavascript Engine: Rhino & V8 \r\nPlatform & version: Android 2.2 emulator \r\nHost Operating System: OSX 10.7.2\r\nTitanium Studio version: 1.0.6.201110251616", "comment": { "comments": [ { "id": "174903", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You don't explicitly state this, but I assume that {{delete.png}} lives at {{Resources/ui/delete.png}} ?", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T13:35:05.000+0000", "updated": "2011-12-05T13:35:05.000+0000" }, { "id": "174904", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I attached delete.png, which can be placed at Resources/delete.png", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T13:40:03.000+0000", "updated": "2011-12-05T13:40:03.000+0000" }, { "id": "174910", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Turns out this was a result of a change in behavior in how paths are handled in commonjs modules. In versions prior to 1.8.0.1, all paths were considered relative to the root of the project. With 1.8.0.1, paths are relative to the path of the module. You can make the paths relative to the root simply by appending '/' in front to make it an absolute path.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T13:57:08.000+0000", "updated": "2011-12-05T13:57:08.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }