PDA

View Full Version : Help with placing Annotations on the route after navigation has started



pchad
25.03.2016, 15:47
Hi guys,

Please feel free to chip in. I need help with custom Annotations that I am letting the user place on the map while driving. The problem with it is these do not fall right on the road but they fall few meters away from the road. How to get them fall close to the navigation pointer icon? :rolleyes:

pchad
25.03.2016, 19:54
private void showEventMaker(final String tag, final float x, final float y) {
if (!AppData.MAP_READY || mMapView == null)
return;

int type = 0;
int resource = 0;
SKCoordinate coordinate = mMapView.pointToCoordinate(new SKScreenPoint(x, y));

if (tag.equals("pizza")) {
type = Constants.EVENT_TYPE__PIZ;
resource = R.drawable.maker_piz;
}

if (tag.equals("icecream")) {
type = Constants.EVENT_TYPE__icecream;
resource = R.drawable.maker_icecream;
}

if (tag.equals("hotdog")) {
type = Constants.EVENT_TYPE__hotdog;
resource = R.drawable.maker_hotdog;
}

if (checkEventDistance(new LocationInfo(coordinate.getLatitude(), coordinate.getLongitude()))) {
int id = Constants.ANNOTATION_ID__MY_EVENT + mEvents_Me.size();
if (type != 0 && resource != 0) {
EventInfo event = new EventInfo(id, AppData.isUser() ? Utils.checkNull(AppData.USER.getId(), 0) : 0, type);
event.setLocation(new LocationInfo(coordinate.getLatitude(), coordinate.getLongitude()));
mEvents_Me.add(event);

showMaker(id, event.getLocation(), resource);
startMyEvent(event);
}
} else {
showTopMessage(this, "You can restrict it only 1 in a radius of " + Constants.EVENT_RADIUS_METER + " meters!", false);
}
}

Adela_Silvia
19.04.2016, 12:54
Can you please add a screenshot with the actual result and the expected behavior?

pchad
19.04.2016, 17:54
Hi Adela,

These are the before and after images on how I want. The first one is the actual image on how it is working now and the second one is the desired output. 2496 2497

Thanks

Adela_Silvia
20.05.2016, 09:52
This issue could be caused by a known bug in the 2.5.1 version (a precision issue at our CORE level). This issue was fixed for the next release (until the official release you can test if you want our beta build: http://forum.skobbler.com/showthread.php/7584-Android-3-0-beta-build)