[TIMOB-13989] Android: Implement longpress event for Google Maps v2
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-28T12:59:49.000+0000 |
Affected Version/s | Release 3.2.3 |
Fix Version/s | 2013 Sprint 20, 2013 Sprint 20 API, Release 3.2.0 |
Components | Android |
Labels | android, event, eventlistener, longpress, mapView, module_map, qe-testadded, triage |
Reporter | David Thulke |
Assignee | Sunila |
Created | 2013-05-23T07:30:36.000+0000 |
Updated | 2014-05-28T12:59:49.000+0000 |
Description
In the progress of developing my app I recognized that the mapview of the Google Maps v2 API for Android can't handle longpress events. For my app and as i think also for other developers this is an important feature to simulate the behavior of the native google maps app. On Android like on ios this is the native gesture to let the user generate custom annotations for example to mark a position.
Hacks like creating a view which overlays the mapview also doesn't work because this view intercepts also other click events.
Hi David, I've escalated your request. If you'd like to help out further, a simple test case demonstrating the lacking functionality would be appreciated. Also please state your current Ti SDK version. Thanks!
Hi Daniel, my Ti SDK version 3.1.0. In my case I've created an app where the user shall mark certain places on a map. I want to implement this functionality like in the Google Maps Android app where an annotation is created by a longpress. But on android this event doesn't fire like on ios. To clarify the case here is a short test code which is working on ios but not on andorid: mapview.addEventListener('longpress',function(e){ alert(e); }); win.win.add(mapview);
Hi, Any progress on an ETA? I need this option. Cheers, Carlo
Hi, Any ETA? And progress update please.
Hi, Any ETA?
Any ETA?
Any ETA on a nightly?
Although it lacks communication around here, just trying again. Any ETA on this bug, which is wrongly classified as a new feature?
[~qoerz] It's currently scheduled for 3.2.0 (early December). I've placed it into Sprint 19, which means you may see it in a nightly as soon as end of September.
Added support for longclick https://github.com/appcelerator-modules/ti.map/pull/7
Sunila, do you also have a binairy you can upload to your fork? This will help me a lot.
Added a new pull request to merge to master https://github.com/appcelerator-modules/ti.map/pull/13
Test case:
1. Run code 2. Long click on map, observe log
CR + FR
Verified with test environment: Appc-Studio: 3.2.0.201310230601 Sdk:3.2.0.v20131022171645 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3) Xcode: 5 OS: Mac OSX 10.8 Android: MapView longpress event still not working for Google Maps v2.
Priya, which map zip are you testing this with?
I am using the latest Android ti.map version 2.1.2
Priya, it looks like you're not using the latest map build. Please grab the zip from https://github.com/appcelerator-modules/ti.map/tree/master for testing purposes. Our current version is 2.1.3.
[~hpham] Should we re-resolve this?
longpress event does not occur, so reopening the bug. Environment used: Device : Google Nexus 5, Android Version: 4.4.2 Device : HTC desire V , Android version : 4.0.3 Android ti.map version: 2.1.4 SDK: 3.2.3.v20140327115429 CLI version : 3.2.3-alpha2 OS : MAC OSX 10.9.2 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.3.201403271826 titanium-code-processor: 1.1.1-alpha XCode : 5.1
I copied the ti.map-android-2.1.5.zip from https://github.com/appcelerator-modules/ti.map/tree/master and integrated in a sample in Titanium studio, used the sample code that Hieu mentioned above. I can see the event getting fired. Here is the console output [INFO][TiAPI (16023)] map is clicked at: 27.773438170552254 longitude, -14.093940268291233 latitude
The longpress event gets fired. The issue is not reproducible using the sample code provided by Hieu when check on following environment: OSX: 10.9.2 Appcelerator Studio: 3.3.0.201405161313 Titanium SDK: 3.3.0.v20140516180912 CLI: 3.3.0-alpha2 Android ti.map version: 2.1.4 Android Device: Google Nexus 5 (v4.4.2)
Verified the issue is not reproducible. Longpress works as expected in android maps v2. Closing. Environment: Appc Studio : 3.3.0.201405211748 Ti SDK : 3.3.0.v20140522144936 Mac OSX : 10.8.5 Alloy : 1.4.0-alpha2 CLI - 3.3.0-alpha5 Code Processor: 1.1.1 Samsung Galaxy S4 running android 4.2.2
Removing Sprint