Changeset 34765 in osm for applications/viewer


Ignore:
Timestamp:
2018-12-04T08:23:41+01:00 (6 years ago)
Author:
stoecker
Message:

fix default layers

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java

    r34669 r34765  
    9292     * @param la2 latitude of second point
    9393     * @param lo2 longitude of second point
    94      * @return the distance betwen first and second point, in m.
     94     * @return the distance between first and second point, in m.
    9595     */
    9696    double getDistance(double la1, double lo1, double la2, double lo2);
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java

    r33973 r34765  
    2626         */
    2727        public Mapnik() {
    28             super("Mapnik", PATTERN, "MAPNIK");
     28            super("OpenStreetMap Carto", PATTERN, "standard");
    2929            modTileFeatures = true;
    3030        }
     
    4141     * The "Cycle Map" OSM tile source.
    4242     */
    43     public static class CycleMap extends AbstractOsmTileSource {
     43    public abstract static class CycleMap extends AbstractOsmTileSource {
    4444
    45         private static final String PATTERN = "http://%s.tile.opencyclemap.org/cycle";
     45        private static final String PATTERN = "https://%s.tile.thunderforest.com/cycle";
    4646
    4747        private static final String[] SERVER = {"a", "b", "c"};
     
    5353         */
    5454        public CycleMap() {
    55             super("Cyclemap", PATTERN, "opencyclemap");
     55            super("OpenCycleMap", PATTERN, "opencyclemap");
    5656        }
    5757
     
    6363        }
    6464
    65         @Override
    66         public int getMaxZoom() {
    67             return 18;
    68         }
    69     }
    70 
    71     /**
    72      * The "Transport Map" OSM tile source.
    73      *
    74      * Template for thunderforest.com.
    75      */
    76     public abstract static class TransportMap extends AbstractOsmTileSource {
    77 
    78         private static final String PATTERN = "https://%s.tile.thunderforest.com/transport";
    79 
    80         private static final String[] SERVER = {"a", "b", "c"};
    81 
    82         private int serverNum;
    83 
    84         /**
    85          * Constructs a new {@code TransportMap} tile source.
    86          */
    87         public TransportMap() {
    88             super("OSM Transport Map", PATTERN, "osmtransportmap");
    89         }
    90 
    9165        /**
    9266         * Get the thunderforest API key.
     
    9670         */
    9771        protected abstract String getApiKey();
    98 
    99         @Override
    100         public String getBaseUrl() {
    101             String url = String.format(this.baseUrl, new Object[] {SERVER[serverNum]});
    102             serverNum = (serverNum + 1) % SERVER.length;
    103             return url;
    104         }
    10572
    10673        @Override
     
    11582
    11683        @Override
     84        public String getTermsOfUseText() {
     85            return "Maps © Thunderforest";
     86        }
     87
     88        @Override
     89        public String getTermsOfUseURL() {
     90            return "https://thunderforest.com/terms/";
     91        }
     92    }
     93
     94    /**
     95     * The "Transport Map" OSM tile source.
     96     *
     97     * Template for thunderforest.com.
     98     */
     99    public static class TransportMap extends AbstractOsmTileSource {
     100
     101        /**
     102         * Constructs a new {@code TransportMap} tile source.
     103         */
     104        public TransportMap() {
     105            super("Public Transport", "https://tile.memomaps.de/tilegen", "public_transport_oepnv");
     106        }
     107
     108        @Override
     109        public int getMaxZoom() {
     110            return 18;
     111        }
     112
     113        @Override
    117114        public String getAttributionText(int zoom, ICoordinate topLeft, ICoordinate botRight) {
    118             return "Maps © Thunderforest, Data © OpenStreetMap contributors";
     115            return "© OpenStreetMap contributors, CC-BY-SA";
    119116        }
    120117
    121118        @Override
    122119        public String getAttributionLinkURL() {
    123             return "http://www.thunderforest.com/";
     120            return "https://öpnvkarte.de/<";
    124121        }
    125122    }
    126 
    127123}
Note: See TracChangeset for help on using the changeset viewer.