From f6d2db4c6f4d23c1979679b7bb0b5f51ce17fab8 Mon Sep 17 00:00:00 2001 From: Emux Date: Tue, 29 Aug 2017 19:28:36 +0300 Subject: [PATCH] Enable vtm-jeo module #375 --- build.gradle | 1 + docs/Changelog.md | 1 - settings.gradle | 2 +- vtm-android-example/AndroidManifest.xml | 4 +- vtm-android-example/build.gradle | 4 +- .../android/test/JeoIndoorMapActivity.java | 372 +++++++++--------- .../src/org/oscim/android/test/Samples.java | 2 +- vtm-playground/build.gradle | 2 +- .../src/org/oscim/test/jeo/LayerTest.java | 186 ++++----- .../src/org/oscim/test/jeo/ThemeTest.java | 94 ++--- 10 files changed, 334 insertions(+), 334 deletions(-) diff --git a/build.gradle b/build.gradle index 0dc844ee..b5142c64 100644 --- a/build.gradle +++ b/build.gradle @@ -40,6 +40,7 @@ def versionName() { return version } subprojects { repositories { + maven { url 'https://repo.boundlessgeo.com/main' } jcenter() maven { url 'https://maven.google.com' } } diff --git a/docs/Changelog.md b/docs/Changelog.md index 73f3ae51..fac7570f 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -25,7 +25,6 @@ - Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349) - OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366) - Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338) -- Disable vtm-jeo module until update [#375](https://github.com/mapsforge/vtm/issues/375) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0) diff --git a/settings.gradle b/settings.gradle index 5426f4a3..3733ffea 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,7 +10,7 @@ include ':vtm-gdx' include ':vtm-http' include ':vtm-ios' include ':vtm-ios-example' -//include ':vtm-jeo' +include ':vtm-jeo' include ':vtm-json' include ':vtm-jts' include ':vtm-playground' diff --git a/vtm-android-example/AndroidManifest.xml b/vtm-android-example/AndroidManifest.xml index e5404b01..2c8f41d4 100644 --- a/vtm-android-example/AndroidManifest.xml +++ b/vtm-android-example/AndroidManifest.xml @@ -37,9 +37,9 @@ - + android:configChanges="keyboardHidden|orientation|screenSize" /> diff --git a/vtm-android-example/build.gradle b/vtm-android-example/build.gradle index a06f378a..fbc058d0 100644 --- a/vtm-android-example/build.gradle +++ b/vtm-android-example/build.gradle @@ -4,9 +4,9 @@ dependencies { compile project(':vtm-android') compile project(':vtm-extras') compile project(':vtm-http') - /*compile(project(':vtm-jeo')) { + compile(project(':vtm-jeo')) { exclude group: 'com.vividsolutions', module: 'jts' - }*/ + } compile project(':vtm-json') compile project(':vtm-jts') compile project(':vtm-themes') diff --git a/vtm-android-example/src/org/oscim/android/test/JeoIndoorMapActivity.java b/vtm-android-example/src/org/oscim/android/test/JeoIndoorMapActivity.java index 407c8d64..89ddc82d 100644 --- a/vtm-android-example/src/org/oscim/android/test/JeoIndoorMapActivity.java +++ b/vtm-android-example/src/org/oscim/android/test/JeoIndoorMapActivity.java @@ -1,186 +1,186 @@ -///* -// * Copyright 2014 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 . -// */ -//package org.oscim.android.test; -// -//import android.content.Context; -//import android.os.Bundle; -//import android.view.View; -//import android.widget.Toast; -//import android.widget.ToggleButton; -// -//import org.jeo.map.Style; -//import org.jeo.vector.VectorDataset; -//import org.oscim.backend.canvas.Color; -//import org.oscim.layers.OSMIndoorLayer; -//import org.oscim.layers.tile.buildings.BuildingLayer; -//import org.oscim.layers.tile.vector.labeling.LabelLayer; -//import org.oscim.test.JeoTest; -//import org.oscim.theme.VtmThemes; -//import org.oscim.theme.styles.TextStyle; -//import org.oscim.utils.IOUtils; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -// -//import java.io.IOException; -//import java.io.InputStream; -//import java.net.URL; -//import java.net.URLConnection; -//import java.util.Arrays; -// -//public class JeoIndoorMapActivity extends BaseMapActivity { -// public static final Logger log = LoggerFactory.getLogger(JeoIndoorMapActivity.class); -// -// // from http://overpass-turbo.eu/s/2vp -// String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson"; -// -// private OSMIndoorLayer mIndoorLayer; -// -// public JeoIndoorMapActivity() { -// super(R.layout.jeo_indoor_map); -// } -// -// @Override -// public void onCreate(Bundle savedInstanceState) { -// super.onCreate(savedInstanceState); -// -// mMap.addTask(new Runnable() { -// @Override -// public void run() { -// showToast("load data"); -// InputStream is = null; -// try { -// // File file = new File(Environment.getExternalStorageDirectory() -// // .getAbsolutePath(), "osmindoor.json"); -// // is = new FileInputStream(file); -// -// URL url = new URL(PATH); -// URLConnection conn = url.openConnection(); -// is = conn.getInputStream(); -// loadJson(is); -// } catch (IOException e) { -// e.printStackTrace(); -// } finally { -// IOUtils.closeQuietly(is); -// } -// } -// }); -// -// mMap.setTheme(VtmThemes.DEFAULT); -// -// mMap.layers().add(new BuildingLayer(mMap, mBaseLayer)); -// mMap.layers().add(new LabelLayer(mMap, mBaseLayer)); -// -// // String file = Environment.getExternalStorageDirectory().getAbsolutePath(); -// // VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true); -// // Style style = JeoTest.getStyle(); -// // mMap.layers().add(new JeoVectorLayer(mMap, data, style)); -// } -// -// void loadJson(InputStream is) { -// showToast("got data"); -// -// VectorDataset data = JeoTest.readGeoJson(is); -// Style style = JeoTest.getStyle(); -// float scale = getResources().getDisplayMetrics().density; -// TextStyle textStyle = TextStyle.builder() -// .isCaption(true) -// .fontSize(16 * scale).color(Color.BLACK) -// .strokeWidth(2.2f * scale).strokeColor(Color.WHITE) -// .build(); -// mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle); -// mMap.layers().add(mIndoorLayer); -// -// showToast("data ready"); -// mMap.updateMap(true); -// -// mIndoorLayer.activeLevels[0] = true; -// shift(); -// } -// -// public void showToast(final String text) { -// final Context ctx = this; -// runOnUiThread(new Runnable() { -// @Override -// public void run() { -// Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT); -// toast.show(); -// } -// }); -// } -// -// boolean mShift = true; -// -// public void shift() { -// if (!mShift) -// return; -// -// mMap.postDelayed(new Runnable() { -// -// @Override -// public void run() { -// for (int i = 0; i < 10; i++) { -// if (mIndoorLayer.activeLevels[i]) { -// mIndoorLayer.activeLevels[i] = false; -// mIndoorLayer.activeLevels[(i + 1) % 9] = true; -// mIndoorLayer.update(); -// break; -// } -// } -// shift(); -// } -// }, 200); -// -// } -// -// public void onClick(View v) { -// mShift = false; -// -// if (mIndoorLayer == null) -// return; -// -// int i = 0; -// -// if (v instanceof ToggleButton) { -// ToggleButton b = (ToggleButton) v; -// i = (b.getTextOn().charAt(0) - '0') + 1; -// } -// -// if (i < 0 || i > 9) -// i = 0; -// -// mIndoorLayer.activeLevels[i] ^= true; -// if (v instanceof ToggleButton) -// ((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]); -// log.debug(Arrays.toString(mIndoorLayer.activeLevels)); -// mIndoorLayer.update(); -// } -// -// @Override -// protected void onStop() { -// super.onStop(); -// } -// -// @Override -// protected void onResume() { -// super.onResume(); -// -// /* ignore saved position */ -// //mMap.setMapPosition(49.417, 8.673, 1 << 17); -// mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16); -// } -//} +/* + * Copyright 2014 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 . + */ +package org.oscim.android.test; + +import android.content.Context; +import android.os.Bundle; +import android.view.View; +import android.widget.Toast; +import android.widget.ToggleButton; + +import org.jeo.map.Style; +import org.jeo.vector.VectorDataset; +import org.oscim.backend.canvas.Color; +import org.oscim.layers.OSMIndoorLayer; +import org.oscim.layers.tile.buildings.BuildingLayer; +import org.oscim.layers.tile.vector.labeling.LabelLayer; +import org.oscim.test.JeoTest; +import org.oscim.theme.VtmThemes; +import org.oscim.theme.styles.TextStyle; +import org.oscim.utils.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Arrays; + +public class JeoIndoorMapActivity extends BaseMapActivity { + public static final Logger log = LoggerFactory.getLogger(JeoIndoorMapActivity.class); + + // from http://overpass-turbo.eu/s/2vp + String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson"; + + private OSMIndoorLayer mIndoorLayer; + + public JeoIndoorMapActivity() { + super(R.layout.jeo_indoor_map); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + mMap.addTask(new Runnable() { + @Override + public void run() { + showToast("load data"); + InputStream is = null; + try { + // File file = new File(Environment.getExternalStorageDirectory() + // .getAbsolutePath(), "osmindoor.json"); + // is = new FileInputStream(file); + + URL url = new URL(PATH); + URLConnection conn = url.openConnection(); + is = conn.getInputStream(); + loadJson(is); + } catch (IOException e) { + e.printStackTrace(); + } finally { + IOUtils.closeQuietly(is); + } + } + }); + + mMap.setTheme(VtmThemes.DEFAULT); + + mMap.layers().add(new BuildingLayer(mMap, mBaseLayer)); + mMap.layers().add(new LabelLayer(mMap, mBaseLayer)); + + // String file = Environment.getExternalStorageDirectory().getAbsolutePath(); + // VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true); + // Style style = JeoTest.getStyle(); + // mMap.layers().add(new JeoVectorLayer(mMap, data, style)); + } + + void loadJson(InputStream is) { + showToast("got data"); + + VectorDataset data = JeoTest.readGeoJson(is); + Style style = JeoTest.getStyle(); + float scale = getResources().getDisplayMetrics().density; + TextStyle textStyle = TextStyle.builder() + .isCaption(true) + .fontSize(16 * scale).color(Color.BLACK) + .strokeWidth(2.2f * scale).strokeColor(Color.WHITE) + .build(); + mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle); + mMap.layers().add(mIndoorLayer); + + showToast("data ready"); + mMap.updateMap(true); + + mIndoorLayer.activeLevels[0] = true; + shift(); + } + + public void showToast(final String text) { + final Context ctx = this; + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT); + toast.show(); + } + }); + } + + boolean mShift = true; + + public void shift() { + if (!mShift) + return; + + mMap.postDelayed(new Runnable() { + + @Override + public void run() { + for (int i = 0; i < 10; i++) { + if (mIndoorLayer.activeLevels[i]) { + mIndoorLayer.activeLevels[i] = false; + mIndoorLayer.activeLevels[(i + 1) % 9] = true; + mIndoorLayer.update(); + break; + } + } + shift(); + } + }, 200); + + } + + public void onClick(View v) { + mShift = false; + + if (mIndoorLayer == null) + return; + + int i = 0; + + if (v instanceof ToggleButton) { + ToggleButton b = (ToggleButton) v; + i = (b.getTextOn().charAt(0) - '0') + 1; + } + + if (i < 0 || i > 9) + i = 0; + + mIndoorLayer.activeLevels[i] ^= true; + if (v instanceof ToggleButton) + ((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]); + log.debug(Arrays.toString(mIndoorLayer.activeLevels)); + mIndoorLayer.update(); + } + + @Override + protected void onStop() { + super.onStop(); + } + + @Override + protected void onResume() { + super.onResume(); + + /* ignore saved position */ + //mMap.setMapPosition(49.417, 8.673, 1 << 17); + mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16); + } +} diff --git a/vtm-android-example/src/org/oscim/android/test/Samples.java b/vtm-android-example/src/org/oscim/android/test/Samples.java index d3d4ca3f..5772f820 100644 --- a/vtm-android-example/src/org/oscim/android/test/Samples.java +++ b/vtm-android-example/src/org/oscim/android/test/Samples.java @@ -78,7 +78,7 @@ public class Samples extends Activity { linearLayout.addView(createButton(MapPositionActivity.class)); linearLayout.addView(createButton(S3DBMapActivity.class)); linearLayout.addView(createButton(ThemeStylerActivity.class)); - //linearLayout.addView(createButton(JeoIndoorMapActivity.class)); + linearLayout.addView(createButton(JeoIndoorMapActivity.class)); } private Button createButton(final Class clazz) { diff --git a/vtm-playground/build.gradle b/vtm-playground/build.gradle index 3a1e02b7..52f2d203 100644 --- a/vtm-playground/build.gradle +++ b/vtm-playground/build.gradle @@ -4,7 +4,7 @@ dependencies { compile project(':vtm-desktop') compile project(':vtm-extras') compile project(':vtm-http') - //compile project(':vtm-jeo') + compile project(':vtm-jeo') compile project(':vtm-json') compile project(':vtm-jts') compile "org.slf4j:slf4j-simple:$slf4jVersion" diff --git a/vtm-playground/src/org/oscim/test/jeo/LayerTest.java b/vtm-playground/src/org/oscim/test/jeo/LayerTest.java index c1f1ee8b..97ace9d6 100644 --- a/vtm-playground/src/org/oscim/test/jeo/LayerTest.java +++ b/vtm-playground/src/org/oscim/test/jeo/LayerTest.java @@ -1,93 +1,93 @@ -///* -// * Copyright 2014 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 . -// */ -//package org.oscim.test.jeo; -// -//import org.jeo.map.Style; -//import org.jeo.vector.VectorDataset; -//import org.oscim.backend.canvas.Color; -//import org.oscim.gdx.GdxMap; -//import org.oscim.gdx.GdxMapApp; -//import org.oscim.layers.JeoVectorLayer; -//import org.oscim.layers.OSMIndoorLayer; -//import org.oscim.layers.tile.bitmap.BitmapTileLayer; -//import org.oscim.test.JeoTest; -//import org.oscim.theme.styles.TextStyle; -// -//import java.io.IOException; -//import java.io.InputStream; -//import java.net.URL; -//import java.net.URLConnection; -// -//import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER; -// -//public class LayerTest extends GdxMap { -// -// // from http://overpass-turbo.eu/s/2vp -// String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson"; -// -// private OSMIndoorLayer mIndoorLayer; -// -// @Override -// public void createLayers() { -// mMap.setBaseMap(new BitmapTileLayer(mMap, STAMEN_TONER.build())); -// -// mMap.addTask(new Runnable() { -// @Override -// public void run() { -// try { -// URL url = new URL(PATH); -// URLConnection conn = url.openConnection(); -// InputStream is = conn.getInputStream(); -// -// VectorDataset data = JeoTest.readGeoJson(is); -// Style style = JeoTest.getStyle(); -// TextStyle textStyle = TextStyle.builder() -// .isCaption(true) -// .fontSize(16).color(Color.BLACK) -// .strokeWidth(2.2f).strokeColor(Color.WHITE) -// .build(); -// mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle); -// mIndoorLayer.activeLevels[0] = true; -// mIndoorLayer.activeLevels[1] = true; -// mIndoorLayer.activeLevels[2] = true; -// mIndoorLayer.activeLevels[3] = true; -// -// mMap.layers().add(new JeoVectorLayer(mMap, data, style)); -// mMap.layers().add(mIndoorLayer); -// -// mMap.updateMap(true); -// -// } catch (IOException e) { -// e.printStackTrace(); -// } -// } -// }); -// -// mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16); -// -// //VectorDataset data = (VectorDataset) JeoTest.getJsonData("states.json", true); -// //Style style = JeoTest.getStyle(); -// //mMap.layers().add(new JeoVectorLayer(mMap, data, style)); -// -// } -// -// public static void main(String[] args) { -// GdxMapApp.init(); -// GdxMapApp.run(new LayerTest(), null, 256); -// } -//} +/* + * Copyright 2014 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 . + */ +package org.oscim.test.jeo; + +import org.jeo.map.Style; +import org.jeo.vector.VectorDataset; +import org.oscim.backend.canvas.Color; +import org.oscim.gdx.GdxMap; +import org.oscim.gdx.GdxMapApp; +import org.oscim.layers.JeoVectorLayer; +import org.oscim.layers.OSMIndoorLayer; +import org.oscim.layers.tile.bitmap.BitmapTileLayer; +import org.oscim.test.JeoTest; +import org.oscim.theme.styles.TextStyle; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER; + +public class LayerTest extends GdxMap { + + // from http://overpass-turbo.eu/s/2vp + String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson"; + + private OSMIndoorLayer mIndoorLayer; + + @Override + public void createLayers() { + mMap.setBaseMap(new BitmapTileLayer(mMap, STAMEN_TONER.build())); + + mMap.addTask(new Runnable() { + @Override + public void run() { + try { + URL url = new URL(PATH); + URLConnection conn = url.openConnection(); + InputStream is = conn.getInputStream(); + + VectorDataset data = JeoTest.readGeoJson(is); + Style style = JeoTest.getStyle(); + TextStyle textStyle = TextStyle.builder() + .isCaption(true) + .fontSize(16).color(Color.BLACK) + .strokeWidth(2.2f).strokeColor(Color.WHITE) + .build(); + mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle); + mIndoorLayer.activeLevels[0] = true; + mIndoorLayer.activeLevels[1] = true; + mIndoorLayer.activeLevels[2] = true; + mIndoorLayer.activeLevels[3] = true; + + mMap.layers().add(new JeoVectorLayer(mMap, data, style)); + mMap.layers().add(mIndoorLayer); + + mMap.updateMap(true); + + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16); + + //VectorDataset data = (VectorDataset) JeoTest.getJsonData("states.json", true); + //Style style = JeoTest.getStyle(); + //mMap.layers().add(new JeoVectorLayer(mMap, data, style)); + + } + + public static void main(String[] args) { + GdxMapApp.init(); + GdxMapApp.run(new LayerTest(), null, 256); + } +} diff --git a/vtm-playground/src/org/oscim/test/jeo/ThemeTest.java b/vtm-playground/src/org/oscim/test/jeo/ThemeTest.java index 8b3e615b..3778d730 100644 --- a/vtm-playground/src/org/oscim/test/jeo/ThemeTest.java +++ b/vtm-playground/src/org/oscim/test/jeo/ThemeTest.java @@ -1,47 +1,47 @@ -///* -// * 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 . -// */ -//package org.oscim.test.jeo; -// -//import org.oscim.gdx.GdxMapApp; -//import org.oscim.layers.tile.vector.VectorTileLayer; -//import org.oscim.renderer.MapRenderer; -//import org.oscim.theme.carto.RenderTheme; -//import org.oscim.tiling.source.UrlTileSource; -//import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; -// -//public class ThemeTest extends GdxMapApp { -// -// public static void main(String[] args) { -// GdxMapApp.init(); -// GdxMapApp.run(new ThemeTest(), null, 256); -// } -// -// @Override -// public void createLayers() { -// UrlTileSource ts = new OSciMap4TileSource(); -// -// VectorTileLayer l = mMap.setBaseMap(ts); -// -// l.setRenderTheme(new RenderTheme()); -// -// MapRenderer.setBackgroundColor(0xffcccccc); -// -// // mMap.getLayers().add(new LabelLayer(mMap, -// // mMapLayer.getTileLayer())); -// // mMap.getLayers().add(new JeoMapLayer(mMap)); -// } -//} +/* + * 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 . + */ +package org.oscim.test.jeo; + +import org.oscim.gdx.GdxMapApp; +import org.oscim.layers.tile.vector.VectorTileLayer; +import org.oscim.renderer.MapRenderer; +import org.oscim.theme.carto.RenderTheme; +import org.oscim.tiling.source.UrlTileSource; +import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; + +public class ThemeTest extends GdxMapApp { + + public static void main(String[] args) { + GdxMapApp.init(); + GdxMapApp.run(new ThemeTest(), null, 256); + } + + @Override + public void createLayers() { + UrlTileSource ts = new OSciMap4TileSource(); + + VectorTileLayer l = mMap.setBaseMap(ts); + + l.setRenderTheme(new RenderTheme()); + + MapRenderer.setBackgroundColor(0xffcccccc); + + // mMap.getLayers().add(new LabelLayer(mMap, + // mMapLayer.getTileLayer())); + // mMap.getLayers().add(new JeoMapLayer(mMap)); + } +}