vtm-android-gdx module, fix #435
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
<activity
|
||||
android:name=".ClusterMarkerOverlayActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".GdxMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".JeoIndoorMapActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
|
||||
@@ -25,6 +25,10 @@ dependencies {
|
||||
}
|
||||
implementation 'com.android.support:support-v4:27.0.0'
|
||||
|
||||
implementation project(':vtm-android-gdx')
|
||||
implementation project(':vtm-gdx')
|
||||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||
|
||||
implementation 'org.mapsforge:mapsforge-core:master-SNAPSHOT'
|
||||
implementation 'org.mapsforge:mapsforge-poi:master-SNAPSHOT'
|
||||
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
|
||||
@@ -60,6 +64,9 @@ android {
|
||||
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
|
||||
jniLibs.srcDirs += "${dir.path}/lib"
|
||||
}
|
||||
file("${rootDir}/vtm-android-gdx/natives").eachDir() { dir ->
|
||||
jniLibs.srcDirs += "${dir.path}/lib"
|
||||
}
|
||||
}
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016-2017 devemux86
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* 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;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.badlogic.gdx.utils.SharedLibraryLoader;
|
||||
|
||||
import org.oscim.android.canvas.AndroidGraphics;
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.gdx.AndroidGL;
|
||||
import org.oscim.gdx.GdxAssets;
|
||||
import org.oscim.gdx.GdxMap;
|
||||
import org.oscim.tiling.TileSource;
|
||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||
|
||||
public class GdxMapActivity extends AndroidApplication {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
AndroidGraphics.init();
|
||||
GdxAssets.init("");
|
||||
GLAdapter.init(new AndroidGL());
|
||||
|
||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
||||
Tile.SIZE = Tile.calculateTileSize();
|
||||
|
||||
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
||||
cfg.stencil = 8;
|
||||
cfg.numSamples = 2;
|
||||
|
||||
new SharedLibraryLoader().load("vtm-jni");
|
||||
|
||||
initialize(new GdxMapAndroid(), cfg);
|
||||
}
|
||||
|
||||
class GdxMapAndroid extends GdxMap {
|
||||
@Override
|
||||
public void createLayers() {
|
||||
TileSource ts = new OSciMap4TileSource();
|
||||
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,7 @@ public class Samples extends Activity {
|
||||
linearLayout.addView(createButton(MapzenMvtMapActivity.class));
|
||||
linearLayout.addView(createButton(MapzenGeojsonMapActivity.class));
|
||||
linearLayout.addView(createButton(OpenMapTilesGeojsonMapActivity.class));
|
||||
linearLayout.addView(createButton(GdxMapActivity.class));
|
||||
|
||||
linearLayout.addView(createLabel("Features"));
|
||||
linearLayout.addView(createButton(null, "GraphHopper Routing", new View.OnClickListener() {
|
||||
|
||||
Reference in New Issue
Block a user