Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13989] Android: Implement longpress event for Google Maps v2

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-05-28T12:59:49.000+0000
Affected Version/sRelease 3.2.3
Fix Version/s2013 Sprint 20, 2013 Sprint 20 API, Release 3.2.0
ComponentsAndroid
Labelsandroid, event, eventlistener, longpress, mapView, module_map, qe-testadded, triage
ReporterDavid Thulke
AssigneeSunila
Created2013-05-23T07:30:36.000+0000
Updated2014-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.

Comments

  1. Daniel Sefton 2013-05-25

    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!
  2. David Thulke 2013-05-27

    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);
  3. Carlo Hermus 2013-07-19

    Hi, Any progress on an ETA? I need this option. Cheers, Carlo
  4. Carlo Hermus 2013-07-24

    Hi, Any ETA? And progress update please.
  5. Carlo Hermus 2013-07-25

    Hi, Any ETA?
  6. Carlo Hermus 2013-07-30

    Any ETA?
  7. Carlo Hermus 2013-08-09

    Any ETA on a nightly?
  8. Carlo Hermus 2013-08-21

    Although it lacks communication around here, just trying again. Any ETA on this bug, which is wrongly classified as a new feature?
  9. Ingo Muschenetz 2013-08-21

    [~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.
  10. Sunila 2013-09-09

    Added support for longclick https://github.com/appcelerator-modules/ti.map/pull/7
  11. Carlo Hermus 2013-09-13

    Sunila, do you also have a binairy you can upload to your fork? This will help me a lot.
  12. Sunila 2013-09-22

    Added a new pull request to merge to master https://github.com/appcelerator-modules/ti.map/pull/13
  13. Hieu Pham 2013-09-30

    Test case:
        var win = Ti.UI.createWindow({
            modal: false,
            backgroundColor: 'white'
        });
              
        
              
        var MapModule = require('ti.map');
        var map = MapModule.createView({
            mapType:MapModule.NORMAL_TYPE
        });
        
        map.addEventListener('longclick',function(e) {
            Ti.API.info('map is clicked at: ' + e.longitude + ' longitude, ', + e.latitude + ' latitude' ); 
        });
        win.add(map);
        win.open();
        
    1. Run code 2. Long click on map, observe log
  14. Hieu Pham 2013-10-07

    CR + FR
  15. Priya Agarwal 2013-10-23

    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.
  16. Hieu Pham 2013-10-23

    Priya, which map zip are you testing this with?
  17. Priya Agarwal 2013-10-25

    I am using the latest Android ti.map version 2.1.2
  18. Hieu Pham 2013-10-29

    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.
  19. Ingo Muschenetz 2013-11-01

    [~hpham] Should we re-resolve this?
  20. Paras Mishra 2014-03-28

    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
  21. Sunila 2014-05-15

    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
  22. Satyam Sekhri 2014-05-20

    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)
  23. Lokesh Choudhary 2014-05-23

    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
  24. Ingo Muschenetz 2014-05-28

    Removing Sprint

JSON Source