X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fgui%2Fmap%2FMapSourceLibrary.java;h=5c20eacf9ba9fdc8a2da4bc4b76cf77e8f46b263;hb=8c8868ae29b3252f02e094c02307384cf61ba667;hp=df30219b9f944a21b438cc1e71f8ed51720c18f1;hpb=c0387c124840c9407e040600fda88f3c3e8f6aa6;p=GpsPrune.git diff --git a/tim/prune/gui/map/MapSourceLibrary.java b/tim/prune/gui/map/MapSourceLibrary.java index df30219..5c20eac 100644 --- a/tim/prune/gui/map/MapSourceLibrary.java +++ b/tim/prune/gui/map/MapSourceLibrary.java @@ -38,13 +38,15 @@ public abstract class MapSourceLibrary */ private static void addFixedSources() { - _sourceList.add(new OsmMapSource("Mapnik", "http://tile.openstreetmap.org/")); - _sourceList.add(new OsmMapSource("Osma", "http://tah.openstreetmap.org/Tiles/tile/")); - _sourceList.add(new OsmMapSource("Cyclemap", "http://andy.sandbox.cloudmade.com/tiles/cycle/")); - _sourceList.add(new OsmMapSource("Reitkarte", "http://topo.geofabrik.de/hills/", - "http://topo.openstreetmap.de/topo/", 18)); - _sourceList.add(new MffMapSource("Mapsforfree", "http://maps-for-free.com/layer/relief/", ".jpg", - "http://maps-for-free.com/layer/water/", ".gif", 11)); + _sourceList.add(new OsmMapSource("Mapnik", "http://[abc].tile.openstreetmap.org/")); + _sourceList.add(new OsmMapSource("Cyclemap", "http://[abc].tile.opencyclemap.org/cycle/")); + _sourceList.add(new OsmMapSource("Reitkarte", "http://topo[234].wanderreitkarte.de/topo/")); + _sourceList.add(new MffMapSource("Mapsforfree", "http://maps-for-free.com/layer/relief/", "jpg", + "http://maps-for-free.com/layer/water/", "gif", 11)); + _sourceList.add(new OsmMapSource("Hikebikemap", "http://toolserver.org/tiles/hikebike/", + "http://toolserver.org/~cmarqu/hill/", 18)); + _sourceList.add(new OsmMapSource("Openseamap", "http://tile.openstreetmap.org/", + "http://tiles.openseamap.org/seamark/", 18)); _sourceList.add(new CloudmadeMapSource("Pale Dawn", "998", 18)); } @@ -88,6 +90,23 @@ public abstract class MapSourceLibrary _sourceList.add(inSource); } + /** + * Edit the given MapSource object by replacing with a new one + * @param inOriginal existing MapSource object + * @param inNewSource new MapSource object + */ + public static void editSource(MapSource inOriginal, MapSource inNewSource) + { + // Check whether original source is still there + int origPos = _sourceList.indexOf(inOriginal); + if (origPos < 0) { + addSource(inNewSource); + } + else { + _sourceList.set(origPos, inNewSource); + } + } + /** * @param inIndex source index number * @return corresponding map source object