S3DB layer samples #475

This commit is contained in:
Emux
2018-01-09 12:06:22 +02:00
parent ca9786dca3
commit 699d63db10
7 changed files with 87 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2018 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.test;
import org.oscim.gdx.GdxMapApp;
import java.io.File;
public class MapsforgeS3DBTest extends MapsforgeTest {
private MapsforgeS3DBTest(File mapFile) {
super(mapFile, true);
}
public static void main(String[] args) {
GdxMapApp.init();
GdxMapApp.run(new MapsforgeS3DBTest(getMapFile(args)));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 devemux86
* Copyright 2016-2018 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -21,6 +21,7 @@ import org.oscim.core.Tile;
import org.oscim.gdx.GdxMapApp;
import org.oscim.gdx.GdxMapImpl;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.buildings.S3DBLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.BitmapRenderer;
@@ -39,9 +40,15 @@ import java.io.File;
public class MapsforgeTest extends GdxMapImpl {
private File mapFile;
private boolean s3db;
MapsforgeTest(File mapFile) {
this(mapFile, false);
}
MapsforgeTest(File mapFile, boolean s3db) {
this.mapFile = mapFile;
this.s3db = s3db;
}
@Override
@@ -53,7 +60,10 @@ public class MapsforgeTest extends GdxMapImpl {
VectorTileLayer l = mMap.setBaseMap(tileSource);
loadTheme(null);
mMap.layers().add(new BuildingLayer(mMap, l));
if (s3db)
mMap.layers().add(new S3DBLayer(mMap, l));
else
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
DefaultMapScaleBar mapScaleBar = new DefaultMapScaleBar(mMap);