Example #1
0
  @Override
  public void createLayers() {
    mMap.setMapPosition(53.08, 8.83, 1 << 14);

    // TileSource tileSource = new OSciMap4TileSource();

    MapFileTileSource tileSource = new MapFileTileSource();
    // tileSource.setMapFile("/home/jeff/src/vtm/Freizeitkarte_DEU_NW.map");
    tileSource.setMapFile("/home/jeff/germany.map");

    VectorTileLayer l = mMap.setBaseMap(tileSource);
    mapLayer = l;

    // mMap.getLayers().add(new BuildingLayer(mMap, l.getTileLayer()));
    mMap.layers().add(new LabelLayer(mMap, l));

    try {
      IRenderTheme theme = ThemeLoader.load("themes/freizeitkarte/theme.xml");
      // IRenderTheme theme =
      // ThemeLoader.load("themes/elevate/theme.xml");
      // IRenderTheme theme = ThemeLoader.load("themes/vmap/theme.xml");
      l.setRenderTheme(theme);
      MapRenderer.setBackgroundColor(theme.getMapBackground());
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    // mMap.getLayers().add(new GenericLayer(mMap, new MeshRenderer()));
    // mMap.getLayers().add(new GenericLayer(mMap, new GridRenderer()));
  }
Example #2
0
  @Override
  protected boolean onKeyDown(int keycode) {
    String name = null;
    if (keycode == Input.Keys.NUM_1) name = "themes/freizeitkarte/theme.xml";
    if (keycode == Input.Keys.NUM_2) name = "themes/elevate/theme.xml";
    if (keycode == Input.Keys.NUM_3) name = "themes/vmap/theme.xml";

    if (name == null) return false;

    try {
      IRenderTheme theme = ThemeLoader.load(name);
      mapLayer.setRenderTheme(theme);
      MapRenderer.setBackgroundColor(theme.getMapBackground());
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    mMap.clearMap();
    mMap.updateMap(true);
    return true;
  }
Example #3
0
 public void setTheme(MapzenStyle.Theme theme) {
   IRenderTheme t = ThemeLoader.load(theme);
   baseLayer.setRenderTheme(t);
   MapRenderer.setBackgroundColor(t.getMapBackground());
   getMap().clearMap();
 }