Search in sources :

Example 6 with AnimateDraggingMapThread

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);
    }
}
Also used : LatLon(net.osmand.data.LatLon) AnimateDraggingMapThread(net.osmand.plus.views.AnimateDraggingMapThread)

Example 7 with AnimateDraggingMapThread

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();
}
Also used : LatLon(net.osmand.data.LatLon) AnimateDraggingMapThread(net.osmand.plus.views.AnimateDraggingMapThread) PointDescription(net.osmand.data.PointDescription)

Aggregations

AnimateDraggingMapThread (net.osmand.plus.views.AnimateDraggingMapThread)7 LatLon (net.osmand.data.LatLon)4 View (android.view.View)1 TextView (android.widget.TextView)1 Location (net.osmand.Location)1 PointDescription (net.osmand.data.PointDescription)1 MapMarker (net.osmand.plus.MapMarkersHelper.MapMarker)1 OsmAndLocationProvider (net.osmand.plus.OsmAndLocationProvider)1 DrawSettings (net.osmand.plus.views.OsmandMapLayer.DrawSettings)1 OsmandMapTileView (net.osmand.plus.views.OsmandMapTileView)1 TextInfoWidget (net.osmand.plus.views.mapwidgets.TextInfoWidget)1