Ejemplo n.º 1
0
  @Override
  public void createLayers() {
    MapRenderer.setBackgroundColor(0xf0f0f0);

    TileSource ts = new OSciMap4TileSource();
    VectorTileLayer l = mMap.setBaseMap(ts);

    mMap.setTheme(VtmThemes.DEFAULT);
    RenderTheme t = (RenderTheme) l.getTheme();
    mTheme = t;
    // t.traverseRules(new DesaturateAreaStyles());
    // t.traverseRules(new DesaturateLineStyles());
    t.traverseRules(new SaturateLineStyles(0.5, true, true, true));
    t.updateStyles();

    // mMap.setMapPosition(7.707, 81.689, 1 << 16);

    mMap.setMapPosition(53.08, 8.82, 1 << 16);
  }
Ejemplo n.º 2
0
  @Override
  protected boolean onKeyDown(int keycode) {
    VectorTileLayer l = (VectorTileLayer) mMap.layers().get(1);
    RenderTheme t = (RenderTheme) l.getTheme();

    if (keycode == Input.Keys.NUM_1) {
      mSaturation += 0.1;
      t.traverseRules(new SaturateLineStyles(mSaturation, true, true, true));
      t.updateStyles();
      mMap.render();
      return true;
    }
    if (keycode == Input.Keys.NUM_2) {
      mSaturation -= 0.1;
      t.traverseRules(new SaturateLineStyles(mSaturation, true, true, true));
      t.updateStyles();
      mMap.render();
      return true;
    }

    return super.onKeyDown(keycode);
  }