PDA

View Full Version : SKCalloutView positioning not synchronised with map



space0
02.09.2015, 07:45
I use SKCalloutView on Skobbler Map (v2.5) for Android. Problem is that Popup is not always centered on annotation. If annotation is not at center, then popup displayed with big offset, so it become difficult to understand to which annotation is popup belongs.

Another problem that if I move map with popup view, popup movement on map not synchronised. It moves with notable delay.

Is it possible to solve this issues?

dandronic
02.09.2015, 08:32
Please add a code snippet with the code you are using to define your annotation & its callout (popup)

space0
02.09.2015, 08:42
// Create annotation
mapView.deleteAllAnnotationsAndCustomPOIs();
mapView.clearAllOverlays();

SKCoordinate coordinate = new SKCoordinate(latLng.longitude, latLng.latitude);
SKAnnotation annotation = new SKAnnotation(id++);

SKAnnotationView skView = new SKAnnotationView();

LayoutInflater inflater = (LayoutInflater) App.getApp().getSystemService(Service.LAYOUT_INFLA TER_SERVICE);
View view = inflater.inflate(R.layout.layout_purchased_marker, null);
TextView textView = (TextView) view.findViewById(R.id.text);
textView.setText(String.valueOf(tourLocation.getOr der()));
skView.setView(view);

annotation.setAnnotationView(skView);
annotation.setLocation(coordinate);

mapView.addAnnotation(annotation, SKAnimationSettings.ANIMATION_NONE);

// Create popup
mapPopup = mapViewGroup.getCalloutView();
LayoutInflater inflater = (LayoutInflater) App.getApp().getSystemService(Service.LAYOUT_INFLA TER_SERVICE);
View view = inflater.inflate(R.layout.layout_preview_info_wind ow, null);
popupView = view;
mapPopup.setCustomView(view);

// Show
int annotationHeight = 0;
float annotationOffset = annotation.getOffset().getY();
mapPopup.setVerticalOffset(-annotationOffset + annotationHeight);
mapPopup.showAtLocation(annotation.getLocation(), true);

dandronic
02.09.2015, 08:46
Please also add the layouts for layout_purchased_marker and layout_preview_info_window (if there are any custom icons there, please also add them)

space0
02.09.2015, 09:02
Sorry, forum not allow me to post


The following errors occurred with your submission
You have included a total of 16 images and/or videos in your message. The maximum number that you may include is 10. Please correct the problem and then continue again.

Images include use of smilies, the BB code [img] tag, and HTML <img> tags. Videos are included with the BB code [video] tag. The use of these is all subject to them being enabled by the administrator.

So I've pasted code here - http://pastebin.com/8KhV3eus

It reproduced as well on AndroidOpenSourceDemo, but effect is not such notable.

Adela_Silvia
03.09.2015, 08:59
Thank you.
We've reported this ticket to our development team. We'll get back to you as soon as we have an update.

Adela_Silvia
20.10.2015, 14:52
Hi @space0,

You'll find here the updated code:https://www.dropbox.com/s/tk0rfawn3rw1h7e/code%204%20SKCalloutView%20positioning%20issue%20u pdated.txt?dl=0

Our developers made a few changes for fixing the wrong popup movement on map, removing the android: orientation="vertical" and android:gravity="center_horizontal" from layout_preview_info_window
Please test and let us know if everything works as expected now

sbonakdar
26.08.2016, 07:32
Even after Latest update as of AUG/25/2016, this problem still persists

Adela_Silvia
31.08.2016, 10:21
We havenít included our developers suggestion in the demo app. The suggestion shared was for that app specific issue.