{ "id": "61736", "key": "TIMOB-1104", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11248", "name": "Sprint 2011-13", "archived": true, "released": true, "releaseDate": "2011-04-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-11T17:43:07.000+0000", "created": "2011-04-15T02:44:06.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "click", "defect", "events", "ios", "mapview", "release-1.7.0", "reported-1.6.0", "requires-4.0", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-11T17:43:07.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": "{html}

Ok, it seems that a map view looses its click event listener\nafter the location changes. The attached project demonstrates\nthis.

{html}", "attachment": [ { "id": "17932", "filename": "mappintest.zip", "author": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:07.000+0000", "size": 52719, "mimeType": "application/zip" } ], "flagged": false, "summary": "Map click events", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "124847", "author": { "name": "curtisolson", "key": "curtisolson", "displayName": "Curtis Olson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I had a similar problem where I wasn't able to get any events on\na map view. A child view added to a map view would get a click\nevent, but not the map view itself. I documented this behavior\nhere.

\n

\nhttp://developer.appcelerator.com/question/32451/mapview-ignoring-t...

{html}", "updateAuthor": { "name": "curtisolson", "key": "curtisolson", "displayName": "Curtis Olson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:07.000+0000", "updated": "2011-04-15T02:44:07.000+0000" }, { "id": "124848", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is a duplicate bug and should have been fixed, but I cannot\nget the provided test to work. A simpler test needs to be provided.\nMap views do not receive click events except when a pin is\nselected.

\n

I am unable to duplicate the behavior and I believe this was\nfixed as part of an earlier map view bug. Leaving open until I can\nconfirm this.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:07.000+0000", "updated": "2011-04-15T02:44:07.000+0000" }, { "id": "124849", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Still waiting on a simpler example.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:07.000+0000", "updated": "2011-04-15T02:44:07.000+0000" }, { "id": "124850", "author": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

run Map View test in KS - click on map - no logging occurs\n(click event is not fired)

{html}", "updateAuthor": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:08.000+0000", "updated": "2011-04-15T02:44:08.000+0000" }, { "id": "124851", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Pushing out again.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:08.000+0000", "updated": "2011-04-15T02:44:08.000+0000" }, { "id": "124852", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

A pro client is interested in this fix now as well.

\n

Sample Code

\n

The following demonstrates the problem. Click on the annotation,\nand you will see the map's click event fires and an alert is shown.\nClick anywhere else, and nothing will happen.

\n
\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\n\nvar map = Titanium.Map.createView({\n    annotations: [Titanium.Map.createAnnotation({\n        latitude: 37.390749, longitude: -122.081651,\n        title: 'You Clicked Me!'\n    })],\n    region: {\n        latitude: 37.390749, longitude: -122.081651,\n        latitudeDelta: 0.01, longitudeDelta: 0.01\n    }\n});\nmap.addEventListener('click', function () {\n    alert('Map Clicked!');\n});\n\nwin.add(map);\nwin.open();\n
\n

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/64521

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T02:44:09.000+0000", "updated": "2011-04-15T02:44:09.000+0000" }, { "id": "124853", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [5facf6d39cd9f693da29eab4548a651bf3f3f77d])\n[#1104] Fix to provide click-on/click-off for\nuser-defined annotations. \nhttps://github.com/appcelerator/titanium_mobile/commit/5facf6d39cd9...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:09.000+0000", "updated": "2011-04-15T02:44:09.000+0000" }, { "id": "124854", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

A full fix for this actually requires a guarantee of iOS 3.2+\nrunning on device. Extensive research has shown that Apple does not\nprovide a way to intercept events on a map view in 3.1.x without\nusing undocumented classes or features.

\n

The previous commit is a slap patch to ensure that it is\npossible to detect when somebody \"clicks off\" an annotation. This\ncan be done by checking the \"source\" property.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:09.000+0000", "updated": "2011-04-15T02:44:09.000+0000" }, { "id": "124855", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Forgot to mark \"in-progress\" as well. A full fix will be\nprovided if possible.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:10.000+0000", "updated": "2011-04-15T02:44:10.000+0000" }, { "id": "124856", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Slap patch addresses customer issue. Going to bump the remainder\nof the bug (generic 'click' events) to TBS 1.7 so that we can\ndiscuss with the Android team about whether or not to break them\nand replace the name with something much more sensible.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:10.000+0000", "updated": "2011-04-15T02:44:10.000+0000" }, { "id": "124857", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Had a brief conversation with Marshall, we have parity on iOS\nand Android (only detect clicks on map overlays, i.e. pins and\nannotations). iOS has the addition of checking to see if you click\nOFF of either of these things and back on the map because that was\na feature request.

\n

So, consider this resolved for iOS. We will not support\ngeneral/generic 'click' events on the map.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:11.000+0000", "updated": "2011-04-15T02:44:11.000+0000" }, { "id": "124858", "author": { "name": "mikantchap", "key": "mikantchap", "displayName": "mikantchap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

On Android, I don't see the click event firing if the background\nof the annotation is clicked.

\n

Using this code, you might see 'title' in the info message (if\nyou actually click the title element) but you won't see\n'annotation'. The reason this is important is because a user might\nfail to click through to another page if they happen to miss one of\nthe elements in the annotation.

\n

// this sets the background color of the master UIView (when\nthere are no windows/tab groups on it)\nTitanium.UI.setBackgroundColor('#000');

\n

var win = Ti.UI.createWindow({ backgroundColor: '#fff' });

\n

var map = Titanium.Map.createView({

\n
\n    mapType: Titanium.Map.STANDARD_TYPE,\n    animate: true,\n    regionFit: true,\n    region: {latitude: 37.390749, longitude: -122.081651,latitudeDelta: 0.01, longitudeDelta: 0.01 }\n
\n

});

\n

var myAnot = Titanium.Map.createAnnotation({

\n
\n    latitude: 37.390749,\n    longitude: -122.081651,\n    title: 'You Clicked Me!',\n    pincolor: Titanium.Map.ANNOTATION_PURPLE,\n    animate: true\n});\n
\n

map.addAnnotation(myAnot);

\n

map.addEventListener('click', function(e) {
\nTitanium.API.info(e.clicksource); });

\n

win.add(map);
\nwin.open();

{html}", "updateAuthor": { "name": "mikantchap", "key": "mikantchap", "displayName": "mikantchap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:11.000+0000", "updated": "2011-04-15T02:44:11.000+0000" }, { "id": "124859", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Assigning to Don so that we can get an Android ticket requesting\nfeature parity.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:12.000+0000", "updated": "2011-04-15T02:44:12.000+0000" }, { "id": "124860", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Actually, scratch that. Going to make a new ticket for Android\ninstead. Durr.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:12.000+0000", "updated": "2011-04-15T02:44:12.000+0000" }, { "id": "124861", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

added release-1.7.0 tag.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:44:12.000+0000", "updated": "2011-04-15T02:44:12.000+0000" }, { "id": "133471", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No longer able to reproduce with iPhone 4, iOS 4.3.3. KS 1.7.0, build 1.7.0.879871b. Tried both short test code and sample app. Both functioned as expected. Closing", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-11T17:43:07.000+0000", "updated": "2011-05-11T17:43:07.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }