PDA

View Full Version : Android: onAnnotationSelected when driving in MODE_3D



mz87
11.04.2015, 19:19
Is it possible? Version 2.4.0

When using MODE_3D for navigation this event never gets called:



@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:


@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

Adela_Silvia
11.05.2015, 13:15
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?

mz87
26.08.2015, 14:14
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
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

mz87
26.08.2015, 14:46
Here's some more 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 2228 I'm trying to click on every colored icon (which is annotation)

mz87
28.08.2015, 11:31
My colleague says that same problem persists on iOS, by the way

Adela_Silvia
28.08.2015, 15:21
We've reported the ticket to our development team. They will look over it as soon as possible.

mz87
28.08.2015, 16:46
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



private void applySettingsOnMapView() {
...

mapView.getMapSettings().setMapDisplayMode(SKMapSe ttings.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

dandronic
31.08.2015, 12:17
We've verified with the development team and currently click events on annotations are not supported when in 3D

mz87
31.08.2015, 12:38
Are there any plans to implement this feature?

dandronic
31.08.2015, 13:24
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)

mz87
31.08.2015, 16:59
ouhh... that's a shame, actually..
Any suggestions how to implement something clickable in 3D ? Custom POI's doesn't allow to change icon as far as I know