From 121f293a0537b8c6a4ca8370b74b6f7ffa7df5da Mon Sep 17 00:00:00 2001 From: peregin Date: Thu, 6 Jul 2023 19:52:53 +0200 Subject: [PATCH] remove unsupported map tile factories - maps --- .../peregin/gpv/gui/TelemetryPanel.scala | 4 ++-- .../gpv/gui/map/MapQuestTileFactory.scala | 24 ++++++++----------- .../peregin/gpv/gui/map/NasaTileFactory.scala | 13 ---------- .../gpv/gui/map/SwissTileFactory.scala | 13 ---------- 4 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 src/main/scala/peregin/gpv/gui/map/NasaTileFactory.scala delete mode 100644 src/main/scala/peregin/gpv/gui/map/SwissTileFactory.scala diff --git a/src/main/scala/peregin/gpv/gui/TelemetryPanel.scala b/src/main/scala/peregin/gpv/gui/TelemetryPanel.scala index b1d30db1..97d3bf0d 100644 --- a/src/main/scala/peregin/gpv/gui/TelemetryPanel.scala +++ b/src/main/scala/peregin/gpv/gui/TelemetryPanel.scala @@ -5,7 +5,7 @@ import java.io.File import javax.swing.ImageIcon import org.jdesktop.swingx.mapviewer.DefaultTileFactory import peregin.gpv.Setup -import peregin.gpv.gui.map.{AltitudePanel, MapPanel, MapQuestTileFactory, MicrosoftTileFactory, SwissTileFactory} +import peregin.gpv.gui.map.{AltitudePanel, MapPanel, MapQuestTileFactory, MicrosoftTileFactory} import peregin.gpv.model.{Mode, Telemetry} import peregin.gpv.util.{Io, Logging, Timed} @@ -26,7 +26,7 @@ class TelemetryPanel(openGpsData: File => Unit) extends MigPanel("ins 2", "", "[ } val mapChooser = new ComboBox(Seq( TileOption("Aerial (Microsoft)", new MicrosoftTileFactory), - TileOption("Open Street Map", new MapQuestTileFactory) + //TileOption("MapQuest", new MapQuestTileFactory), )) private val mapType = new MigPanel("ins 0", "", "[grow, fill]") { add(new Label("Map Type"), "wrap") diff --git a/src/main/scala/peregin/gpv/gui/map/MapQuestTileFactory.scala b/src/main/scala/peregin/gpv/gui/map/MapQuestTileFactory.scala index 22cf10c1..35386933 100644 --- a/src/main/scala/peregin/gpv/gui/map/MapQuestTileFactory.scala +++ b/src/main/scala/peregin/gpv/gui/map/MapQuestTileFactory.scala @@ -5,17 +5,13 @@ import org.jdesktop.swingx.mapviewer.{DefaultTileFactory, TileFactoryInfo} // open street map class MapQuestTileFactory extends DefaultTileFactory(new MapQuestTileInfo) -object MapQuestTileInfo { - val maxZoom = 17 -} -class MapQuestTileInfo extends TileFactoryInfo(1, - MapQuestTileInfo.maxZoom - 2, MapQuestTileInfo.maxZoom, 256, true, true, - "http://otile1.mqcdn.com/tiles/1.0.0/osm", - "x", "y", "z") { - - override def getTileUrl(x: Int, y: Int, zoom: Int): String = { - val z = MapQuestTileInfo.maxZoom - zoom - s"${this.baseURL}/$z/$x/$y.png" - } - -} +class MapQuestTileInfo extends TileFactoryInfo( + 0, // Minimum zoom level + 17, // Maximum zoom level + 2, // Total zoom level count + 256, // Tile size in pixels + true, // X axis is tiled + true, // Y axis is tiled + "https://otile1.mqcdn.com/tiles/1.0.0/osm/", // Base tile URL + "x", "y", "z" // Tile URL parameters +); diff --git a/src/main/scala/peregin/gpv/gui/map/NasaTileFactory.scala b/src/main/scala/peregin/gpv/gui/map/NasaTileFactory.scala deleted file mode 100644 index a1028c5d..00000000 --- a/src/main/scala/peregin/gpv/gui/map/NasaTileFactory.scala +++ /dev/null @@ -1,13 +0,0 @@ -package peregin.gpv.gui.map - -import org.jdesktop.swingx.mapviewer.wms.{WMSService, WMSTileFactory} - - -object NasaTileFactory { - val wms = new WMSService() - wms.setLayer("BMNG") - wms.setBaseUrl("http://wms.jpl.nasa.gov/wms.cgi?") -} - - -class NasaTileFactory extends WMSTileFactory(NasaTileFactory.wms) diff --git a/src/main/scala/peregin/gpv/gui/map/SwissTileFactory.scala b/src/main/scala/peregin/gpv/gui/map/SwissTileFactory.scala deleted file mode 100644 index edfa960a..00000000 --- a/src/main/scala/peregin/gpv/gui/map/SwissTileFactory.scala +++ /dev/null @@ -1,13 +0,0 @@ -package peregin.gpv.gui.map - -import org.jdesktop.swingx.mapviewer.wms.{WMSService, WMSTileFactory} - - -object SwissTileFactory { - val wms = new WMSService() - wms.setLayer("BMNG") - wms.setBaseUrl("https://wms.geo.admin.ch/") -} - - -class SwissTileFactory extends WMSTileFactory(SwissTileFactory.wms)