use of net.osmand.plus.views.MapInfoLayer in project Osmand by osmandapp.
the class OsmandAidlApi method registerRemoveMapWidgetReceiver.
private void registerRemoveMapWidgetReceiver(final MapActivity mapActivity) {
removeMapWidgetReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String widgetId = intent.getStringExtra(AIDL_OBJECT_ID);
if (widgetId != null) {
MapInfoLayer layer = mapActivity.getMapLayers().getMapInfoLayer();
TextInfoWidget widgetControl = widgetControls.get(widgetId);
if (layer != null && widgetControl != null) {
layer.removeSideWidget(widgetControl);
widgetControls.remove(widgetId);
layer.recreateControls();
}
}
}
};
mapActivity.registerReceiver(removeMapWidgetReceiver, new IntentFilter(AIDL_REMOVE_MAP_WIDGET));
}
use of net.osmand.plus.views.MapInfoLayer in project Osmand by osmandapp.
the class OsmandMonitoringPlugin method updateLayers.
@Override
public void updateLayers(OsmandMapTileView mapView, MapActivity activity) {
if (isActive()) {
if (monitoringControl == null) {
registerWidget(activity);
}
} else {
if (monitoringControl != null) {
MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer();
layer.removeSideWidget(monitoringControl);
layer.recreateControls();
monitoringControl = null;
}
}
}
use of net.osmand.plus.views.MapInfoLayer in project Osmand by osmandapp.
the class ParkingPositionPlugin method registerWidget.
private void registerWidget(MapActivity activity) {
MapInfoLayer mapInfoLayer = activity.getMapLayers().getMapInfoLayer();
if (mapInfoLayer != null) {
parkingPlaceControl = createParkingPlaceInfoControl(activity);
mapInfoLayer.registerSideWidget(parkingPlaceControl, R.drawable.ic_action_parking_dark, R.string.map_widget_parking, "parking", false, 10);
mapInfoLayer.recreateControls();
}
}
use of net.osmand.plus.views.MapInfoLayer in project Osmand by osmandapp.
the class OsmandMonitoringPlugin method registerWidget.
private void registerWidget(MapActivity activity) {
MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer();
monitoringControl = createMonitoringControl(activity);
layer.registerSideWidget(monitoringControl, R.drawable.ic_action_play_dark, R.string.map_widget_monitoring, "monitoring", false, 30);
layer.recreateControls();
}
use of net.osmand.plus.views.MapInfoLayer in project Osmand by osmandapp.
the class MapillaryPlugin method registerWidget.
private void registerWidget(MapActivity activity) {
MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer();
mapillaryControl = createMonitoringControl(activity);
mapillaryWidgetRegInfo = layer.registerSideWidget(mapillaryControl, R.drawable.ic_action_mapillary, R.string.mapillary, "mapillary", false, 19);
layer.recreateControls();
}
Aggregations