X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fgui%2Fmap%2FMapSourceLibrary.java;h=eae105515fe7960c1024badaed908fea8777a970;hp=24833ce3e7be4ce8f7f288068768d155cf394ed6;hb=f1b92378a792131ac8fb33a869405851d5b2d1f7;hpb=649c5da6ee1bbc590699e11a92316ece2ea8512d diff --git a/tim/prune/gui/map/MapSourceLibrary.java b/tim/prune/gui/map/MapSourceLibrary.java index 24833ce..eae1055 100644 --- a/tim/prune/gui/map/MapSourceLibrary.java +++ b/tim/prune/gui/map/MapSourceLibrary.java @@ -39,12 +39,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("Cyclemap", "http://tile.opencyclemap.org/cycle/")); _sourceList.add(new OsmMapSource("Reitkarte", "http://wanderreitkarte.de/hills/", "http://topo2.wanderreitkarte.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 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 +91,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