S3DB layer samples #475

This commit is contained in:
Emux 2018-01-09 12:06:22 +02:00
parent ca9786dca3
commit 699d63db10
No known key found for this signature in database
GPG Key ID: 89C6921D7AF2BDD0
7 changed files with 87 additions and 5 deletions

View File

@ -2,6 +2,7 @@
## New since 0.9.2 ## New since 0.9.2
- S3DB layer [#475](https://github.com/mapsforge/vtm/pull/475)
- OpenMapTiles GeoJSON vector tiles [#385](https://github.com/mapsforge/vtm/issues/385) - OpenMapTiles GeoJSON vector tiles [#385](https://github.com/mapsforge/vtm/issues/385)
- Many other minor improvements and bug fixes - Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0) - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0)

View File

@ -63,6 +63,9 @@
<activity <activity
android:name=".MapsforgePolyLabelActivity" android:name=".MapsforgePolyLabelActivity"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapsforgeS3DBActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity <activity
android:name=".MapsforgeStyleActivity" android:name=".MapsforgeStyleActivity"
android:configChanges="keyboardHidden|orientation|screenSize" /> android:configChanges="keyboardHidden|orientation|screenSize" />

View File

@ -1,6 +1,6 @@
/* /*
* Copyright 2014 Hannes Janetzek * Copyright 2014 Hannes Janetzek
* Copyright 2016-2017 devemux86 * Copyright 2016-2018 devemux86
* Copyright 2017 Longri * Copyright 2017 Longri
* *
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@ -34,6 +34,7 @@ import org.oscim.core.Tile;
import org.oscim.layers.TileGridLayer; import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.MapTile; import org.oscim.layers.tile.MapTile;
import org.oscim.layers.tile.buildings.BuildingLayer; 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.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer; import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.BitmapRenderer; import org.oscim.renderer.BitmapRenderer;
@ -64,9 +65,19 @@ public class MapsforgeMapActivity extends MapActivity {
private TileGridLayer mGridLayer; private TileGridLayer mGridLayer;
private DefaultMapScaleBar mMapScaleBar; private DefaultMapScaleBar mMapScaleBar;
private Menu mMenu; private Menu mMenu;
private boolean mS3db;
private VectorTileLayer mTileLayer; private VectorTileLayer mTileLayer;
MapFileTileSource mTileSource; MapFileTileSource mTileSource;
public MapsforgeMapActivity() {
this(false);
}
public MapsforgeMapActivity(boolean s3db) {
super();
mS3db = s3db;
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -173,7 +184,10 @@ public class MapsforgeMapActivity extends MapActivity {
mTileLayer = mMap.setBaseMap(mTileSource); mTileLayer = mMap.setBaseMap(mTileSource);
loadTheme(null); loadTheme(null);
mMap.layers().add(new BuildingLayer(mMap, mTileLayer)); if (mS3db)
mMap.layers().add(new S3DBLayer(mMap, mTileLayer));
else
mMap.layers().add(new BuildingLayer(mMap, mTileLayer));
mMap.layers().add(new LabelLayer(mMap, mTileLayer)); mMap.layers().add(new LabelLayer(mMap, mTileLayer));
mMapScaleBar = new DefaultMapScaleBar(mMap); mMapScaleBar = new DefaultMapScaleBar(mMap);

View File

@ -0,0 +1,22 @@
/*
* 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.android.test;
public class MapsforgeS3DBActivity extends MapsforgeMapActivity {
public MapsforgeS3DBActivity() {
super(true);
}
}

View File

@ -1,7 +1,7 @@
/* /*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2013 Hannes Janetzek * Copyright 2013 Hannes Janetzek
* Copyright 2016-2017 devemux86 * Copyright 2016-2018 devemux86
* Copyright 2017 Longri * Copyright 2017 Longri
* Copyright 2017 nebular * Copyright 2017 nebular
* *
@ -98,6 +98,7 @@ public class Samples extends Activity {
linearLayout.addView(createLabel("Vector Features")); linearLayout.addView(createLabel("Vector Features"));
linearLayout.addView(createButton(MapsforgeStyleActivity.class)); linearLayout.addView(createButton(MapsforgeStyleActivity.class));
linearLayout.addView(createButton(MapsforgePolyLabelActivity.class)); linearLayout.addView(createButton(MapsforgePolyLabelActivity.class));
linearLayout.addView(createButton(MapsforgeS3DBActivity.class));
linearLayout.addView(createButton(AtlasThemeActivity.class)); linearLayout.addView(createButton(AtlasThemeActivity.class));
linearLayout.addView(createButton(POTTextureActivity.class)); linearLayout.addView(createButton(POTTextureActivity.class));

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). * 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.GdxMapApp;
import org.oscim.gdx.GdxMapImpl; import org.oscim.gdx.GdxMapImpl;
import org.oscim.layers.tile.buildings.BuildingLayer; 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.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer; import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.BitmapRenderer; import org.oscim.renderer.BitmapRenderer;
@ -39,9 +40,15 @@ import java.io.File;
public class MapsforgeTest extends GdxMapImpl { public class MapsforgeTest extends GdxMapImpl {
private File mapFile; private File mapFile;
private boolean s3db;
MapsforgeTest(File mapFile) { MapsforgeTest(File mapFile) {
this(mapFile, false);
}
MapsforgeTest(File mapFile, boolean s3db) {
this.mapFile = mapFile; this.mapFile = mapFile;
this.s3db = s3db;
} }
@Override @Override
@ -53,7 +60,10 @@ public class MapsforgeTest extends GdxMapImpl {
VectorTileLayer l = mMap.setBaseMap(tileSource); VectorTileLayer l = mMap.setBaseMap(tileSource);
loadTheme(null); 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)); mMap.layers().add(new LabelLayer(mMap, l));
DefaultMapScaleBar mapScaleBar = new DefaultMapScaleBar(mMap); DefaultMapScaleBar mapScaleBar = new DefaultMapScaleBar(mMap);