コード例 #1
0
  public void updateApplicationModeSettings() {
    // update vector renderer
    RendererRegistry registry = app.getRendererRegistry();
    RenderingRulesStorage newRenderer = registry.getRenderer(settings.RENDERER.get());
    if (newRenderer == null) {
      newRenderer = registry.defaultRender();
    }
    if (registry.getCurrentSelectedRenderer() != newRenderer) {
      registry.setCurrentSelectedRender(newRenderer);
      app.getResourceManager().getRenderer().clearCache();
    }
    mapViewTrackingUtilities.updateSettings();
    app.getRoutingHelper().setAppMode(settings.getApplicationMode());
    if (mapLayers.getMapInfoLayer() != null) {
      mapLayers.getMapInfoLayer().recreateControls();
    }
    mapLayers.updateLayers(mapView);
    app.getDaynightHelper()
        .startSensorIfNeeded(
            new StateChangedListener<Boolean>() {

              @Override
              public void stateChanged(Boolean change) {
                getMapView().refreshMap(true);
              }
            });
    getMapView().refreshMap(true);
  }
コード例 #2
0
ファイル: OsmandSettings.java プロジェクト: Boris-de/Osmand
 protected void switchApplicationMode(ApplicationMode oldMode) {
   // change some global settings/ for car
   if (currentMode == ApplicationMode.CAR) {
     SHOW_TRANSPORT_OVER_MAP.set(false);
     SHOW_OSM_BUGS.set(false);
   }
   // update vector renderer
   RendererRegistry registry = ctx.getRendererRegistry();
   BaseOsmandRender newRenderer = registry.getRenderer(RENDERER.get());
   if (newRenderer == null) {
     newRenderer = registry.defaultRender();
   }
   if (registry.getCurrentSelectedRenderer() != newRenderer) {
     registry.setCurrentSelectedRender(newRenderer);
     ctx.getResourceManager().getRenderer().clearCache();
   }
 }