use of net.osmand.plus.views.AnimateDraggingMapThread in project Osmand by osmandapp.
the class MapContextMenuFragment method showOnMap.
private void showOnMap(LatLon latLon, boolean updateCoords, boolean needMove, boolean alreadyAdjusted, int zoom) {
AnimateDraggingMapThread thread = map.getAnimatedDraggingThread();
LatLon calcLatLon = calculateCenterLatLon(latLon, zoom, updateCoords);
if (updateCoords) {
mapCenter = calcLatLon;
menu.setMapCenter(mapCenter);
}
if (!alreadyAdjusted) {
calcLatLon = getAdjustedMarkerLocation(getPosY(), calcLatLon, true, zoom);
}
if (needMove) {
thread.startMoving(calcLatLon.getLatitude(), calcLatLon.getLongitude(), zoom, true);
}
}
use of net.osmand.plus.views.AnimateDraggingMapThread in project Osmand by osmandapp.
the class AvoidSpecificRoads method showOnMap.
private void showOnMap(MapActivity ctx, double lat, double lon, String name, DialogInterface dialog) {
AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread();
int fZoom = ctx.getMapView().getZoom() < 15 ? 15 : ctx.getMapView().getZoom();
if (thread.isAnimating()) {
ctx.getMapView().setIntZoom(fZoom);
ctx.getMapView().setLatLon(lat, lon);
} else {
thread.startMoving(lat, lon, fZoom, true);
}
ctx.getContextMenu().show(new LatLon(lat, lon), new PointDescription("", name), null);
dialog.dismiss();
}
Aggregations