Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Android: onAnnotationSelected when driving in MODE_3D

  1. #1
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41

    Android: onAnnotationSelected when driving in MODE_3D

    Is it possible? Version 2.4.0

    When using MODE_3D for navigation this event never gets called:

    Code:
    @Override
    public void onAnnotationSelected(SKAnnotation skAnnotation) {
        Log.e("ANNOTATION", "SELECTED");
    }
    Instead works this code, but I don't know how to use it for myself:
    Code:
    @Override
    public void onSingleTap(SKScreenPoint skScreenPoint) {
    }
    But when I turn on Panning and/or switch to MODE_2D - Annotation gets selected ..

    I would like to display my friends on the map while driving. Would be great to give user an opportunity to click on friend and see some details in a popup view (like in Waze application).

    So please, can somebody clarify is that even possible?

    thanks
    Last edited by mz87; 11.04.2015 at 19:25. Reason: more details

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    It should work- it's possible to use onAnnotationSelected when driving in MODE_3D.

    Can you please send us your demo project to check what could be the issue?

  3. #3
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Quote Originally Posted by Adela_Silvia View Post
    It should work- it's possible to use onAnnotationSelected when driving in MODE_3D.

    Can you please send us your demo project to check what could be the issue?
    We had a little delay in our project, so sorry for such a long response.
    Well, it's hard to provide demo project with this issue, but it doesn't even work in Your own provided demo project.
    I guess there's something wrong with a positioning of the TAP. Library can not detect where did I exactly clicked, that's why no Annotation balloon gets shown.

    I made my own implementation of SingleTap by simply looping through all annotations I've placed using SKCoordinate class
    Code:
    SKCoordinate sko = mapView.pointToCoordinate(skScreenPoint);
    , but depending on zoom and if two or more annotations are close to each other - it's not precise anymore.

    I also upgraded lib from 2.4 to 2.5 - this also didn't help..

    I don't know what to do anymore

  4. #4
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Here's some more code

    Code:
        @Override
        public void onSingleTap(SKScreenPoint skScreenPoint) {
            Log.e("ANNOTATION", "onSingleTap");
            if(mapPopup.getVisibility() == View.VISIBLE){
                mapPopup.setVisibility(View.GONE);
            }
        }
    
        @Override
        public void onPOIClusterSelected(SKPOICluster skpoiCluster) {
            Log.e("ANNOTATION", "onPOIClusterSelected");
        }
    
        @Override
        public void onMapPOISelected(SKMapPOI skMapPOI) {
            Log.e("ANNOTATION", "onMapPOISelected");
        }
    
        @Override
        public void onCustomPOISelected(SKMapCustomPOI skMapCustomPOI) {
            Log.e("ANNOTATION", "onCustomPOISelected");
        }
    
        @Override
        public void onObjectSelected(int i) {
            Log.e("ANNOTATION", "onObjectSelected");
        }
    
        @Override
        public void onDoubleTap(SKScreenPoint point) {
            // zoom in on a position when double tapping
            mapView.zoomInAt(point);
        }
    
       @Override
        public void onAnnotationSelected(SKAnnotation annotation) {
            Log.e("ANNOTATION", "onAnnotationSelected");
        }
    and all I see in logCat in MODE_3D is
    E/ANNOTATION﹕ onSingleTap

    I'm also attaching screenshot device-2015-08-26-153830.jpg I'm trying to click on every colored icon (which is annotation)

  5. #5
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    My colleague says that same problem persists on iOS, by the way

  6. #6
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    We've reported the ticket to our development team. They will look over it as soon as possible.

  7. #7
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Thanks for submitting this issue..
    Anyway, I checked some other things, and actually it's really easy to track this problem - you don't need to DRIVE our do anything like that - add this code to your own Android Studio Demo project and go to annotations and try to select something

    Code:
        private void applySettingsOnMapView() {
            ...
    
            mapView.getMapSettings().setMapDisplayMode(SKMapSettings.SKMapDisplayMode.MODE_3D);
        }
    Actually, sometimes it is possible to click on Red Pin Point (at initial zoom)..

    Anyway, I think this is not correct behavior

  8. #8
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    We've verified with the development team and currently click events on annotations are not supported when in 3D

  9. #9
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Are there any plans to implement this feature?

  10. #10
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    It's on the wish list but it's not on the top/upper part of the list (so realistically I don't expect this any time soon - i.e. by early/mid 2016)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •