From 62015eee0bcfeda76c7a2e6d354059d529056e3b Mon Sep 17 00:00:00 2001 From: Thomas Theussing Date: Sat, 29 May 2021 16:33:33 +0200 Subject: [PATCH] MarkerLayerLabelsTest: switch to bitmap tile source (#849) --- .../org/oscim/test/MarkerLayerLabelsTest.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/vtm-playground/src/org/oscim/test/MarkerLayerLabelsTest.java b/vtm-playground/src/org/oscim/test/MarkerLayerLabelsTest.java index 1a6ed3a9..caa26e4f 100644 --- a/vtm-playground/src/org/oscim/test/MarkerLayerLabelsTest.java +++ b/vtm-playground/src/org/oscim/test/MarkerLayerLabelsTest.java @@ -28,16 +28,15 @@ import org.oscim.layers.marker.ItemizedLayer; import org.oscim.layers.marker.MarkerInterface; import org.oscim.layers.marker.MarkerItem; import org.oscim.layers.marker.MarkerSymbol; -import org.oscim.layers.tile.vector.VectorTileLayer; -import org.oscim.layers.tile.vector.labeling.LabelLayer; +import org.oscim.layers.tile.bitmap.BitmapTileLayer; import org.oscim.map.Map; -import org.oscim.theme.VtmThemes; -import org.oscim.tiling.TileSource; import org.oscim.tiling.source.OkHttpEngine; -import org.oscim.tiling.source.oscimap4.OSciMap4TileSource; +import org.oscim.tiling.source.UrlTileSource; +import org.oscim.tiling.source.bitmap.DefaultSources; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import static org.oscim.layers.marker.MarkerSymbol.HotspotPlace; @@ -53,14 +52,11 @@ public class MarkerLayerLabelsTest extends GdxMapApp implements ItemizedLayer.On // Map events receiver mMap.layers().add(new MapEventsReceiver(mMap)); - TileSource tileSource = OSciMap4TileSource.builder() + UrlTileSource tileSource = DefaultSources.OPENSTREETMAP .httpFactory(new OkHttpEngine.OkHttpFactory()) .build(); - VectorTileLayer l = mMap.setBaseMap(tileSource); - - mMap.layers().add(new LabelLayer(mMap, l)); - - mMap.setTheme(VtmThemes.DEFAULT); + tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-playground")); + mMap.layers().add(new BitmapTileLayer(mMap, tileSource)); // goto berlin mMap.setMapPosition(52.513452, 13.363791, 1 << 13);