S3DB layer samples #475
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2014 Hannes Janetzek
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016-2018 devemux86
|
||||
* Copyright 2017 Longri
|
||||
*
|
||||
* 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.tile.MapTile;
|
||||
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;
|
||||
@@ -64,9 +65,19 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
private TileGridLayer mGridLayer;
|
||||
private DefaultMapScaleBar mMapScaleBar;
|
||||
private Menu mMenu;
|
||||
private boolean mS3db;
|
||||
private VectorTileLayer mTileLayer;
|
||||
MapFileTileSource mTileSource;
|
||||
|
||||
public MapsforgeMapActivity() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
public MapsforgeMapActivity(boolean s3db) {
|
||||
super();
|
||||
mS3db = s3db;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -173,7 +184,10 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
mTileLayer = mMap.setBaseMap(mTileSource);
|
||||
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));
|
||||
|
||||
mMapScaleBar = new DefaultMapScaleBar(mMap);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016-2018 devemux86
|
||||
* Copyright 2017 Longri
|
||||
* Copyright 2017 nebular
|
||||
*
|
||||
@@ -98,6 +98,7 @@ public class Samples extends Activity {
|
||||
linearLayout.addView(createLabel("Vector Features"));
|
||||
linearLayout.addView(createButton(MapsforgeStyleActivity.class));
|
||||
linearLayout.addView(createButton(MapsforgePolyLabelActivity.class));
|
||||
linearLayout.addView(createButton(MapsforgeS3DBActivity.class));
|
||||
linearLayout.addView(createButton(AtlasThemeActivity.class));
|
||||
linearLayout.addView(createButton(POTTextureActivity.class));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user