{ "id": "85072", "key": "TIMOB-7272", "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": "12094", "description": "", "name": "Sprint 2012-02", "archived": true, "released": true, "releaseDate": "2012-01-29" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-18T18:34:25.000+0000", "created": "2012-01-18T07:56:22.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_map", "parity", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "15517", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "87296", "key": "TIMOB-7868", "fields": { "summary": "iOS: change map annotation to fire event when the annotation pin is clicked", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2012-03-02T14:57:59.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": "In Android, when click on a annotation pin within the map view the description box is presented but not click event is fired. A user must click the description box that is displayed in order to fire a event back to javascript. A click event should be fired in both cases.", "attachment": [], "flagged": false, "summary": "Android: change map annotation to fire event when the annotation pin is clicked", "creator": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "179783", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Test app.js\r\n\r\n{code}\r\n/*var win = Ti.UI.createWindow({fullscreen:true,navBarHidden:true,width:320,height:480,orientationModes:[Titanium.UI.PORTRAIT]});\r\nvar foo = Ti.UI.createButton({width:200,height:40,title:'LAUNCH',color:'black'})\r\nwin.add(foo);\r\n\t\r\nfoo.addEventListener('click',function(){\r\n\tvar win1 = Titanium.UI.createWindow({url:\"map.js\"});\r\n\twin1.open();\r\n});\r\n\t\r\nwin.open();\r\n*/\r\n\r\nvar win = Titanium.UI.createWindow();\r\n\r\nvar isAndroid = false;\r\nif (Titanium.Platform.name == 'android') {\r\n\tisAndroid = true;\r\n}\r\n\r\n//\r\n// CREATE ANNOTATIONS\r\n//\r\n\r\nvar atlantaParams = {\r\n\t\tlatitude:33.74511,\r\n\t\tlongitude:-84.38993,\r\n\t\ttitle:\"Atlanta, GA\",\r\n\t\tsubtitle:'Atlanta Braves Stadium\\nfoo',\r\n\t\tanimate:true,\r\n\t\trightButton: Titanium.UI.iPhone.SystemButton.DISCLOSURE,\r\n\t\tmyid:3 // CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS\r\n\t};\r\n\r\natlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;\r\nvar atlanta = Titanium.Map.createAnnotation(atlantaParams);\r\n\r\n//\r\n// PRE-DEFINED REGIONS\r\n//\r\nvar regionAtlanta = {latitude:33.74511,longitude:-84.38993,animate:true,latitudeDelta:0.04, longitudeDelta:0.04};\r\n\r\n//\r\n// CREATE MAP VIEW\r\n//\r\nvar mapview = Titanium.Map.createView({\r\n\tmapType: Titanium.Map.STANDARD_TYPE,\r\n\tregion:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},\r\n\tanimate:true,\r\n\tregionFit:true,\r\n\tuserLocation:true,\r\n\tannotations:[atlanta]\r\n});\r\nmapview.addEventListener(\"click\", function(e) {\r\n\tTi.API.info(\"ANNOTATION CLICKED:\" + e.title + \":\" + e.subtitle + \":\" + e.longitude + \":\" + e.latitude + \":\" + e.annotation + \":\" + e.clicksource);\r\n});\r\n\r\nif (!isAndroid) {\r\n\tmapview.addAnnotation(atlanta);\r\n}\r\nmapview.selectAnnotation(atlanta);\r\nwin.add(mapview);\r\n\r\n//\r\n// NAVBAR BUTTONS\r\n//\r\n\r\nvar removeAll = null;\r\nvar atl = null;\r\nvar sv = null;\r\nvar sat = null;\r\nvar std = null;\r\nvar hyb = null;\r\nvar zoomin = null;\r\nvar zoomout = null;\r\n\t\t\r\nvar wireClickHandlers = function() {\r\n\tremoveAll.addEventListener('click', function() {\r\n\t\tmapview.removeAllAnnotations();\r\n\t});\r\n\r\n\tatl.addEventListener('click', function() {\r\n\t\t// set location to atlanta\r\n\t\tmapview.setLocation(regionAtlanta);\r\n\t\r\n\t\t// activate annotation\r\n\t\tmapview.selectAnnotation(mapview.annotations[0].title,true);\r\n\t\tTi.API.error(\"CLICKED ATL\");\r\n\t});\r\n\t\r\n\tsv.addEventListener('click', function() {\r\n\t\tTi.API.info('IN SV CHANGE');\r\n\t\t// set location to sv\r\n\t\tmapview.setLocation(regionSV);\r\n\t\r\n\t\t// activate annotation\r\n\t\tmapview.selectAnnotation(mapview.annotations[1].title,true);\r\n\t});\r\n\t\r\n\tsat.addEventListener('click',function() {\r\n\t\t// set map type to satellite\r\n\t\tmapview.setMapType(Titanium.Map.SATELLITE_TYPE);\r\n\t});\r\n\t\r\n\tstd.addEventListener('click',function() {\r\n\t\t// set map type to standard\r\n\t\tmapview.setMapType(Titanium.Map.STANDARD_TYPE);\r\n\t});\r\n\t\r\n\thyb.addEventListener('click',function() {\r\n\t\t// set map type to hybrid\r\n\t\tmapview.setMapType(Titanium.Map.HYBRID_TYPE);\r\n\t});\r\n\t\r\n\tzoomin.addEventListener('click',function() {\r\n\t\tmapview.zoom(1);\r\n\t});\r\n\t\r\n\tzoomout.addEventListener('click',function() {\r\n\t\tmapview.zoom(-1);\r\n\t});\r\n};\r\n\r\nif (!isAndroid) {\r\n\tremoveAll = Titanium.UI.createButton({\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\r\n\t\ttitle:'Remove All'\r\n\t});\r\n\twin.rightNavButton = removeAll;\r\n\r\n\t//\r\n\t// TOOLBAR BUTTONS\r\n\t//\r\n\t\r\n\t// button to change to ATL\r\n\tatl = Titanium.UI.createButton({\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\r\n\t\ttitle:'ATL'\r\n\t});\r\n\t// activate annotation\r\n\tmapview.selectAnnotation(mapview.annotations[0].title,true);\r\n\t\r\n\t// button to change to SV\t\r\n\tsv = Titanium.UI.createButton({\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\r\n\t\ttitle:'SV'\r\n\t});\r\n\tmapview.addEventListener('complete', function()\r\n\t{\r\n\t\tTi.API.info(\"map has completed loaded region\");\r\n\t});\r\n\t\r\n\t\r\n\tvar flexSpace = Titanium.UI.createButton({\r\n\t\tsystemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\r\n\t});\r\n\t\r\n\t// button to change map type to SAT\r\n\tsat = Titanium.UI.createButton({\r\n\t\ttitle:'Sat',\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n\t});\r\n\t// button to change map type to STD\r\n\tstd = Titanium.UI.createButton({\r\n\t\ttitle:'Std',\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n\t});\r\n\t// button to change map type to HYBRID\r\n\thyb = Titanium.UI.createButton({\r\n\t\ttitle:'Hyb',\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n\t});\r\n\t// button to zoom-in\r\n\tzoomin = Titanium.UI.createButton({\r\n\t\ttitle:'+',\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n\t});\r\n\t// button to zoom-out\r\n\tzoomout = Titanium.UI.createButton({\r\n\t\ttitle:'-',\r\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n\t});\r\n\t\r\n\twireClickHandlers();\r\n\t\r\n\twin.setToolbar([flexSpace,std,flexSpace,hyb,flexSpace,sat,flexSpace,atl,flexSpace,sv,flexSpace,zoomin,flexSpace,zoomout,flexSpace]);\r\n} else {\r\n\tvar activity = Ti.Android.currentActivity;\r\n\tactivity.onCreateOptionsMenu = function(e) {\r\n\t\tvar menu = e.menu;\r\n\t\t\r\n\t\tatl = menu.add({title : 'ATL'});\r\n\t\tsv = menu.add({title : 'SV'});\r\n\t\tsat = menu.add({title : 'Sat'});\r\n\t\tstd = menu.add({title : 'Std'});\r\n\t\thyb = menu.add({title : 'Hyb'});\r\n\t\tzoomin = menu.add({title : \"Zoom In\"});\r\n\t\tzoomout = menu.add({title : 'Zoom Out'});\r\n\t\tremoveAll = menu.add({title:'Remove All'});\r\n\t\t\r\n\t\twireClickHandlers();\r\n\t};\r\n}\r\n\r\n//\r\n// EVENT LISTENERS\r\n//\r\n\r\n// region change event listener\r\nmapview.addEventListener('regionChanged',function(evt)\r\n{\r\n\tTitanium.API.info('maps region has updated to '+evt.longitude+','+evt.latitude);\r\n});\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\nWhen running the app, if you click on the pin itself you will see the popup toggle and a log statement from the click handler indicate \"pin\" as te click source. If you click the popup then the click source will indicate \"title\" or \"subtitle\" and the popup will remain.", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-01-18T15:11:33.000+0000", "updated": "2012-01-18T15:11:33.000+0000" }, { "id": "179956", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 1.9.0.v20120119134634 on Nexus S (2.3.6) and emulator 2.3.1", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-19T16:07:31.000+0000", "updated": "2012-01-19T16:07:31.000+0000" }, { "id": "181271", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "updated labels", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-31T15:29:20.000+0000", "updated": "2012-01-31T15:29:20.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }