use of net.osmand.plus.views.mapwidgets.MapMarkersWidgetsFactory in project Osmand by osmandapp.
the class MapInfoLayer method registerAllControls.
public void registerAllControls() {
RouteInfoWidgetsFactory ric = new RouteInfoWidgetsFactory();
MapInfoWidgetsFactory mic = new MapInfoWidgetsFactory();
MapMarkersWidgetsFactory mwf = map.getMapLayers().getMapMarkersLayer().getWidgetsFactory();
OsmandApplication app = view.getApplication();
lanesControl = ric.createLanesControl(map, view);
streetNameView = new TopTextView(map.getMyApplication(), map);
updateStreetName(false, calculateTextState());
topToolbarView = new TopToolbarView(map);
updateTopToolbar(false);
alarmControl = ric.createAlarmInfoControl(app, map);
alarmControl.setVisibility(false);
rulerControl = ric.createRulerControl(app, map);
rulerControl.setVisibility(false);
// register left stack
registerSideWidget(null, R.drawable.ic_action_compass, R.string.map_widget_compass, "compass", true, 4);
NextTurnInfoWidget bigInfoControl = ric.createNextInfoControl(map, app, false);
registerSideWidget(bigInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn, "next_turn", true, 5);
NextTurnInfoWidget smallInfoControl = ric.createNextInfoControl(map, app, true);
registerSideWidget(smallInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn_small, "next_turn_small", true, 6);
NextTurnInfoWidget nextNextInfoControl = ric.createNextNextInfoControl(map, app, true);
registerSideWidget(nextNextInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_next_turn, "next_next_turn", true, 7);
// register right stack
// priorityOrder: 10s navigation-related, 20s position-related, 30s recording- and other plugin-related, 40s general device information, 50s debugging-purpose
TextInfoWidget intermediateDist = ric.createIntermediateDistanceControl(map);
registerSideWidget(intermediateDist, R.drawable.ic_action_intermediate, R.string.map_widget_intermediate_distance, "intermediate_distance", false, 13);
TextInfoWidget dist = ric.createDistanceControl(map);
registerSideWidget(dist, R.drawable.ic_action_target, R.string.map_widget_distance, "distance", false, 14);
TextInfoWidget time = ric.createTimeControl(map);
registerSideWidget(time, new TimeControlWidgetState(app), "time", false, 15);
TextInfoWidget marker = mwf.createMapMarkerControl(map, true);
registerSideWidget(marker, R.drawable.ic_action_flag_dark, R.string.map_marker_1st, "map_marker_1st", false, 16);
TextInfoWidget bearing = ric.createBearingControl(map);
registerSideWidget(bearing, new BearingWidgetState(app), "bearing", false, 17);
TextInfoWidget marker2nd = mwf.createMapMarkerControl(map, false);
registerSideWidget(marker2nd, R.drawable.ic_action_flag_dark, R.string.map_marker_2nd, "map_marker_2nd", false, 18);
TextInfoWidget speed = ric.createSpeedControl(map);
registerSideWidget(speed, R.drawable.ic_action_speed, R.string.map_widget_speed, "speed", false, 20);
TextInfoWidget maxspeed = ric.createMaxSpeedControl(map);
registerSideWidget(maxspeed, R.drawable.ic_action_speed_limit, R.string.map_widget_max_speed, "max_speed", false, 21);
TextInfoWidget alt = mic.createAltitudeControl(map);
registerSideWidget(alt, R.drawable.ic_action_altitude, R.string.map_widget_altitude, "altitude", false, 23);
TextInfoWidget gpsInfo = mic.createGPSInfoControl(map);
registerSideWidget(gpsInfo, R.drawable.ic_action_gps_info, R.string.map_widget_gps_info, "gps_info", false, 28);
TextInfoWidget plainTime = ric.createPlainTimeControl(map);
registerSideWidget(plainTime, R.drawable.ic_action_time, R.string.map_widget_plain_time, "plain_time", false, 41);
TextInfoWidget battery = ric.createBatteryControl(map);
registerSideWidget(battery, R.drawable.ic_action_battery, R.string.map_widget_battery, "battery", false, 42);
TextInfoWidget ruler = mic.createRulerControl(map);
registerSideWidget(ruler, R.drawable.ic_action_ruler_circle, R.string.map_widget_ruler_control, "ruler", false, 43);
}
use of net.osmand.plus.views.mapwidgets.MapMarkersWidgetsFactory in project Osmand by osmandapp.
the class MapMarkersLayer method initUI.
private void initUI() {
bitmapPaint = new Paint();
bitmapPaint.setAntiAlias(true);
bitmapPaint.setFilterBitmap(true);
markerBitmapBlue = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_blue);
markerBitmapGreen = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_green);
markerBitmapOrange = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_orange);
markerBitmapRed = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_red);
markerBitmapYellow = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_yellow);
markerBitmapTeal = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_teal);
markerBitmapPurple = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_purple);
arrowLight = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_direction_arrow_p1_light);
arrowToDestination = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_direction_arrow_p2_color);
arrowShadow = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_direction_arrow_p3_shadow);
bitmapPaintDestBlue = createPaintDest(R.color.marker_blue);
bitmapPaintDestGreen = createPaintDest(R.color.marker_green);
bitmapPaintDestOrange = createPaintDest(R.color.marker_orange);
bitmapPaintDestRed = createPaintDest(R.color.marker_red);
bitmapPaintDestYellow = createPaintDest(R.color.marker_yellow);
bitmapPaintDestTeal = createPaintDest(R.color.marker_teal);
bitmapPaintDestPurple = createPaintDest(R.color.marker_purple);
widgetsFactory = new MapMarkersWidgetsFactory(map);
contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
textSize = map.getResources().getDimensionPixelSize(R.dimen.guide_line_text_size);
verticalOffset = map.getResources().getDimensionPixelSize(R.dimen.guide_line_vertical_offset);
}
Aggregations