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);
}
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;
}
});
}
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);
}
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;
}
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);
}
Aggregations