Changeset 30336 in osm


Ignore:
Timestamp:
2014-03-22T12:26:52+01:00 (11 years ago)
Author:
donvip
Message:

fix #josm9841 - HTTPS access to OSM tiles

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

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java

    r30223 r30336  
    1212   
    1313    /**
    14      * The OSM attribution. Must be always in line with <a href="http://www.openstreetmap.org/copyright/en">http://www.openstreetmap.org/copyright/en</a>
     14     * The OSM attribution. Must be always in line with <a href="https://www.openstreetmap.org/copyright/en">https://www.openstreetmap.org/copyright/en</a>
    1515     */
    1616    public static final String DEFAULT_OSM_ATTRIBUTION = "\u00a9 OpenStreetMap contributors";
     
    4141    @Override
    4242    public String getAttributionLinkURL() {
    43         return "http://openstreetmap.org/";
     43        return "https://openstreetmap.org/";
    4444    }
    4545
     
    6161    @Override
    6262    public String getTermsOfUseURL() {
    63         return "http://www.openstreetmap.org/copyright";
     63        return "https://www.openstreetmap.org/copyright";
    6464    }
    6565}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java

    r30242 r30336  
    88
    99    /**
    10      * The default "Mapnik" OSM tile source URL
    11      */
    12     public static final String MAP_MAPNIK = "http://tile.openstreetmap.org";
    13 
    14     /**
    1510     * The default "Mapnik" OSM tile source.
    1611     */
    1712    public static class Mapnik extends AbstractOsmTileSource {
     13
     14        private static final String PATTERN = "https://%s.tile.openstreetmap.org";
     15
     16        private static final String[] SERVER = { "a", "b", "c" };
     17
     18        private int SERVER_NUM = 0;
    1819       
    1920        /**
     
    2122         */
    2223        public Mapnik() {
    23             super("Mapnik", MAP_MAPNIK);
     24            super("Mapnik", PATTERN);
     25        }
     26
     27        @Override
     28        public String getBaseUrl() {
     29            String url = String.format(this.baseUrl, new Object[] { SERVER[SERVER_NUM] });
     30            SERVER_NUM = (SERVER_NUM + 1) % SERVER.length;
     31            return url;
     32        }
     33
     34        @Override
     35        public int getMaxZoom() {
     36            return 19;
    2437        }
    2538
Note: See TracChangeset for help on using the changeset viewer.