Skip to content
Commits on Source (4)
......@@ -150,7 +150,7 @@
private="true"
linksource="true"
author="false">
<link href="http://docs.oracle.com/javase/8/docs/api"/>
<link href="https://docs.oracle.com/javase/8/docs/api"/>
<doctitle><![CDATA[<h2>JMapViewer - Javadoc</h2>]]></doctitle>
<bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JMapViewer</a>]]></bottom>
<arg value="-html5" if:set="isJava9" />
......
jmapviewer (2.8+dfsg-2) UNRELEASED; urgency=medium
jmapviewer (2.9+dfsg-1) unstable; urgency=medium
* New upstream release.
* Bump Standards-Version to 4.3.0, no changes.
-- Bas Couwenberg <sebastic@debian.org> Tue, 25 Dec 2018 22:25:57 +0100
-- Bas Couwenberg <sebastic@debian.org> Tue, 01 Jan 2019 10:16:40 +0100
jmapviewer (2.8+dfsg-1) unstable; urgency=medium
......
......@@ -80,7 +80,7 @@ public class Demo extends JFrame implements JMapViewerEventListener {
button.addActionListener(e -> map().setDisplayToFitMapMarkers());
JComboBox<TileSource> tileSourceSelector = new JComboBox<>(new TileSource[] {
new OsmTileSource.Mapnik(),
new OsmTileSource.CycleMap(),
new OsmTileSource.TransportMap(),
new BingAerialTileSource(),
});
tileSourceSelector.addItemListener(new ItemListener() {
......
// License: GPL. For details, see Readme.txt file.
package org.openstreetmap.gui.jmapviewer;
import static org.openstreetmap.gui.jmapviewer.FeatureAdapter.tr;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
......@@ -49,7 +51,7 @@ public class OsmTileLoader implements TileLoader {
}
loadTileMetadata(tile, conn);
if ("no-tile".equals(tile.getValue("tile-info"))) {
tile.setError("No tile at this zoom level");
tile.setError(tr("No tiles at this zoom level"));
} else {
input = conn.getInputStream();
try {
......
......@@ -9,8 +9,6 @@ import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
......
......@@ -91,7 +91,7 @@ public interface TileSource extends Attributed {
* @param lo1 longitude of first point
* @param la2 latitude of second point
* @param lo2 longitude of second point
* @return the distance betwen first and second point, in m.
* @return the distance between first and second point, in m.
*/
double getDistance(double la1, double lo1, double la2, double lo2);
......
......@@ -37,7 +37,8 @@ import org.xml.sax.SAXException;
/**
* Tile source for the Bing Maps REST Imagery API.
* @see <a href="https://msdn.microsoft.com/en-us/library/ff701724.aspx">MSDN</a>
* @see <a href="https://msdn.microsoft.com/en-us/library/bb259689.aspx">MSDN (1)</a>
* and <a href="https://msdn.microsoft.com/en-us/library/ff701724.aspx">MSDN (2)</a>
*/
public class BingAerialTileSource extends TMSTileSource {
......@@ -57,6 +58,7 @@ public class BingAerialTileSource extends TMSTileSource {
*/
public BingAerialTileSource() {
super(new TileSourceInfo("Bing", null, null));
minZoom = 1;
}
/**
......
......@@ -25,7 +25,7 @@ public class OsmTileSource {
* Constructs a new {@code "Mapnik"} tile source.
*/
public Mapnik() {
super("Mapnik", PATTERN, "MAPNIK");
super("OpenStreetMap Carto", PATTERN, "standard");
modTileFeatures = true;
}
......@@ -40,9 +40,9 @@ public class OsmTileSource {
/**
* The "Cycle Map" OSM tile source.
*/
public static class CycleMap extends AbstractOsmTileSource {
public abstract static class CycleMap extends AbstractOsmTileSource {
private static final String PATTERN = "http://%s.tile.opencyclemap.org/cycle";
private static final String PATTERN = "https://%s.tile.thunderforest.com/cycle";
private static final String[] SERVER = {"a", "b", "c"};
......@@ -52,7 +52,7 @@ public class OsmTileSource {
* Constructs a new {@code CycleMap} tile source.
*/
public CycleMap() {
super("Cyclemap", PATTERN, "opencyclemap");
super("OpenCycleMap", PATTERN, "opencyclemap");
}
@Override
......@@ -62,45 +62,45 @@ public class OsmTileSource {
return url;
}
/**
* Get the thunderforest API key.
*
* Needs to be registered at their web site.
* @return the API key
*/
protected abstract String getApiKey();
@Override
public int getMaxZoom() {
return 18;
}
@Override
public String getTileUrl(int zoom, int tilex, int tiley) throws IOException {
return this.getBaseUrl() + getTilePath(zoom, tilex, tiley) + "?apikey=" + getApiKey();
}
@Override
public String getTermsOfUseText() {
return "Maps © Thunderforest";
}
@Override
public String getTermsOfUseURL() {
return "https://thunderforest.com/terms/";
}
}
/**
* The "Transport Map" OSM tile source.
*
* Template for thunderforest.com.
*/
public abstract static class TransportMap extends AbstractOsmTileSource {
private static final String PATTERN = "https://%s.tile.thunderforest.com/transport";
private static final String[] SERVER = {"a", "b", "c"};
private int serverNum;
public static class TransportMap extends AbstractOsmTileSource {
/**
* Constructs a new {@code TransportMap} tile source.
*/
public TransportMap() {
super("OSM Transport Map", PATTERN, "osmtransportmap");
}
/**
* Get the thunderforest API key.
*
* Needs to be registered at their web site.
* @return the API key
*/
protected abstract String getApiKey();
@Override
public String getBaseUrl() {
String url = String.format(this.baseUrl, new Object[] {SERVER[serverNum]});
serverNum = (serverNum + 1) % SERVER.length;
return url;
super("Public Transport", "https://tile.memomaps.de/tilegen", "public_transport_oepnv");
}
@Override
......@@ -108,20 +108,14 @@ public class OsmTileSource {
return 18;
}
@Override
public String getTileUrl(int zoom, int tilex, int tiley) throws IOException {
return this.getBaseUrl() + getTilePath(zoom, tilex, tiley) + "?apikey=" + getApiKey();
}
@Override
public String getAttributionText(int zoom, ICoordinate topLeft, ICoordinate botRight) {
return "Maps © Thunderforest, Data © OpenStreetMap contributors";
return "© OpenStreetMap contributors, CC-BY-SA";
}
@Override
public String getAttributionLinkURL() {
return "http://www.thunderforest.com/";
return "https://öpnvkarte.de/<";
}
}
}
......@@ -28,8 +28,7 @@ public class ScanexTileSource extends TMSTileSource {
private static final String API_KEY = "4018C5A9AECAD8868ED5DEB2E41D09F7";
private enum ScanexLayer {
IRS("irs", "/TileSender.ashx?ModeKey=tile&MapName=F7B8CF651682420FA1749D894C8AD0F6&LayerName=BAC78D764F0443BD9AF93E7A998C9F5B"),
SPOT("spot", "/TileSender.ashx?ModeKey=tile&MapName=F7B8CF651682420FA1749D894C8AD0F6&LayerName=F51CE95441284AF6B2FC319B609C7DEC");
IRS("irs", "/TileSender.ashx?ModeKey=tile&MapName=F7B8CF651682420FA1749D894C8AD0F6&LayerName=BAC78D764F0443BD9AF93E7A998C9F5B");
private final String name;
private final String uri;
......
......@@ -107,7 +107,7 @@ public class TileSourceInfo {
}
/**
* Checkusm for empty tiles for servers delivering such tile types
* Checksum for empty tiles for servers delivering such tile types
* @return map of checksums, that when detected, means that this is "no tile at this zoom level" situation
* @since 32022
*/
......