Search in sources :

Example 1 with ContextMenuLayer

use of net.osmand.plus.views.ContextMenuLayer in project Osmand by osmandapp.

the class AudioNotesLayer method initLayer.

@Override
public void initLayer(OsmandMapTileView view) {
    this.view = view;
    pointAltUI = new Paint();
    pointAltUI.setColor(0xa0FF3344);
    pointAltUI.setStyle(Style.FILL);
    audio = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_note_audio);
    video = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_note_video);
    photo = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_note_photo);
    pointSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_note_small);
    paintIcon = new Paint();
    Paint point = new Paint();
    point.setColor(Color.GRAY);
    point.setAntiAlias(true);
    point.setStyle(Style.STROKE);
    contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
}
Also used : ContextMenuLayer(net.osmand.plus.views.ContextMenuLayer) Paint(android.graphics.Paint)

Example 2 with ContextMenuLayer

use of net.osmand.plus.views.ContextMenuLayer in project Osmand by osmandapp.

the class AvoidSpecificRoads method selectFromMap.

private void selectFromMap(final MapActivity mapActivity) {
    ContextMenuLayer cm = mapActivity.getMapLayers().getContextMenuLayer();
    cm.setSelectOnMap(new CallbackWithObject<LatLon>() {

        @Override
        public boolean processResult(LatLon result) {
            addImpassableRoad(mapActivity, result, true, null, false);
            return true;
        }
    });
}
Also used : LatLon(net.osmand.data.LatLon) ContextMenuLayer(net.osmand.plus.views.ContextMenuLayer)

Example 3 with ContextMenuLayer

use of net.osmand.plus.views.ContextMenuLayer in project Osmand by osmandapp.

the class ParkingPositionLayer method initLayer.

@Override
public void initLayer(OsmandMapTileView view) {
    this.view = view;
    dm = new DisplayMetrics();
    WindowManager wmgr = (WindowManager) view.getContext().getSystemService(Context.WINDOW_SERVICE);
    wmgr.getDefaultDisplay().getMetrics(dm);
    bitmapPaint = new Paint();
    bitmapPaint.setDither(true);
    bitmapPaint.setAntiAlias(true);
    bitmapPaint.setFilterBitmap(true);
    parkingNoLimitIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_poi_parking_pos_no_limit);
    parkingLimitIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_poi_parking_pos_limit);
    timeLimit = plugin.getParkingType();
    contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
}
Also used : ContextMenuLayer(net.osmand.plus.views.ContextMenuLayer) Paint(android.graphics.Paint) DisplayMetrics(android.util.DisplayMetrics) WindowManager(android.view.WindowManager)

Example 4 with ContextMenuLayer

use of net.osmand.plus.views.ContextMenuLayer in project Osmand by osmandapp.

the class MapContextMenu method update.

public void update(LatLon latLon, PointDescription pointDescription, Object object) {
    WeakReference<MapContextMenuFragment> fragmentRef = findMenuFragment();
    init(latLon, pointDescription, object, true, false);
    if (fragmentRef != null) {
        fragmentRef.get().rebuildMenu(centerMarker);
    }
    ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer();
    contextMenuLayer.updateContextMenu();
    centerMarker = false;
}
Also used : ContextMenuLayer(net.osmand.plus.views.ContextMenuLayer)

Example 5 with ContextMenuLayer

use of net.osmand.plus.views.ContextMenuLayer in project Osmand by osmandapp.

the class MapMultiSelectionMenu method openContextMenu.

public void openContextMenu(@NonNull MenuObject menuObject) {
    IContextMenuProvider provider = selectedObjects.remove(menuObject.getObject());
    hide();
    ContextMenuLayer contextMenuLayer = getMapActivity().getMapLayers().getContextMenuLayer();
    contextMenuLayer.showContextMenu(menuObject.getLatLon(), menuObject.getPointDescription(), menuObject.getObject(), provider);
}
Also used : ContextMenuLayer(net.osmand.plus.views.ContextMenuLayer) IContextMenuProvider(net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider)

Aggregations

ContextMenuLayer (net.osmand.plus.views.ContextMenuLayer)7 Paint (android.graphics.Paint)3 DisplayMetrics (android.util.DisplayMetrics)1 WindowManager (android.view.WindowManager)1 LatLon (net.osmand.data.LatLon)1 OsmandApplication (net.osmand.plus.OsmandApplication)1 MeasurementToolLayer (net.osmand.plus.measurementtool.MeasurementToolLayer)1 MapVectorLayer (net.osmand.plus.render.MapVectorLayer)1 RoutingHelper (net.osmand.plus.routing.RoutingHelper)1 IContextMenuProvider (net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider)1 DownloadedRegionsLayer (net.osmand.plus.views.DownloadedRegionsLayer)1 FavouritesLayer (net.osmand.plus.views.FavouritesLayer)1 GPXLayer (net.osmand.plus.views.GPXLayer)1 ImpassableRoadsLayer (net.osmand.plus.views.ImpassableRoadsLayer)1 MapControlsLayer (net.osmand.plus.views.MapControlsLayer)1 MapInfoLayer (net.osmand.plus.views.MapInfoLayer)1 MapMarkersLayer (net.osmand.plus.views.MapMarkersLayer)1 MapQuickActionLayer (net.osmand.plus.views.MapQuickActionLayer)1 MapTextLayer (net.osmand.plus.views.MapTextLayer)1 MapTileLayer (net.osmand.plus.views.MapTileLayer)1