Search in sources :

Example 21 with MapInfoLayer

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

the class MapillaryPlugin method setWidgetVisible.

public void setWidgetVisible(MapActivity mapActivity, boolean visible) {
    if (mapillaryWidgetRegInfo != null) {
        final List<ApplicationMode> allModes = ApplicationMode.allPossibleValues();
        for (ApplicationMode mode : allModes) {
            mapActivity.getMapLayers().getMapWidgetRegistry().setVisibility(mode, mapillaryWidgetRegInfo, visible, false);
        }
        MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer();
        if (mil != null) {
            mil.recreateControls();
        }
        mapActivity.refreshMap();
    }
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer) ApplicationMode(net.osmand.plus.settings.backend.ApplicationMode)

Example 22 with MapInfoLayer

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

the class ContextMenuScrollFragment method setupMapRulerWidget.

protected void setupMapRulerWidget(@NonNull View view, @NonNull MapLayers mapLayers) {
    View mapRulerView = view.findViewById(R.id.map_ruler_layout);
    MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
    rulerWidget = mapInfoLayer.setupRulerWidget(mapRulerView);
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer) OsmandMapTileView(net.osmand.plus.views.OsmandMapTileView) View(android.view.View) LockableScrollView(net.osmand.plus.LockableScrollView)

Example 23 with MapInfoLayer

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

the class ContextMenuScrollFragment method onDestroyView.

@Override
public void onDestroyView() {
    super.onDestroyView();
    MapActivity mapActivity = getMapActivity();
    if (mapActivity != null) {
        MapLayers mapLayers = mapActivity.getMapLayers();
        MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer();
        mapControlsLayer.removeHudButtons(Arrays.asList(ZOOM_IN_BUTTON_ID, ZOOM_OUT_BUTTON_ID, BACK_TO_LOC_BUTTON_ID));
        MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
        mapInfoLayer.removeRulerWidgets(Collections.singletonList(rulerWidget));
    }
}
Also used : MapControlsLayer(net.osmand.plus.views.layers.MapControlsLayer) MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer) MapActivity(net.osmand.plus.activities.MapActivity) MapLayers(net.osmand.plus.views.MapLayers)

Example 24 with MapInfoLayer

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

the class SnapTrackWarningFragment method setupControlButtons.

private void setupControlButtons(@NonNull View view) {
    MapActivity mapActivity = getMapActivity();
    View zoomInButtonView = view.findViewById(R.id.map_zoom_in_button);
    View zoomOutButtonView = view.findViewById(R.id.map_zoom_out_button);
    View myLocButtonView = view.findViewById(R.id.map_my_location_button);
    View mapRulerView = view.findViewById(R.id.map_ruler_layout);
    MapLayers mapLayers = mapActivity.getMapLayers();
    OsmandMapTileView mapTileView = mapActivity.getMapView();
    View.OnLongClickListener longClickListener = MapControlsLayer.getOnClickMagnifierListener(mapTileView);
    MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer();
    mapControlsLayer.setupZoomInButton(zoomInButtonView, longClickListener, ZOOM_IN_BUTTON_ID);
    mapControlsLayer.setupZoomOutButton(zoomOutButtonView, longClickListener, ZOOM_OUT_BUTTON_ID);
    mapControlsLayer.setupBackToLocationButton(myLocButtonView, false, BACK_TO_LOC_BUTTON_ID);
    MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
    mapInfoLayer.setupRulerWidget(mapRulerView);
}
Also used : MapControlsLayer(net.osmand.plus.views.layers.MapControlsLayer) MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer) OsmandMapTileView(net.osmand.plus.views.OsmandMapTileView) OsmandMapTileView(net.osmand.plus.views.OsmandMapTileView) View(android.view.View) MapActivity(net.osmand.plus.activities.MapActivity) MapLayers(net.osmand.plus.views.MapLayers)

Aggregations

MapInfoLayer (net.osmand.plus.views.layers.MapInfoLayer)24 OsmandMapTileView (net.osmand.plus.views.OsmandMapTileView)6 View (android.view.View)4 MapActivity (net.osmand.plus.activities.MapActivity)4 TextInfoWidget (net.osmand.plus.views.mapwidgets.widgets.TextInfoWidget)4 ContextMenuItem (net.osmand.plus.ContextMenuItem)3 MapControlsLayer (net.osmand.plus.views.layers.MapControlsLayer)3 BroadcastReceiver (android.content.BroadcastReceiver)2 Context (android.content.Context)2 Intent (android.content.Intent)2 Drawable (android.graphics.drawable.Drawable)2 WeakReference (java.lang.ref.WeakReference)2 OsmandApplication (net.osmand.plus.OsmandApplication)2 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)2 MapLayers (net.osmand.plus.views.MapLayers)2 SuppressLint (android.annotation.SuppressLint)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 MenuItem (android.view.MenuItem)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1