source: osm/applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java@ 31122

Last change on this file since 31122 was 31122, checked in by bastik, 9 years ago

applied #josm10454 - Mapbox "empty" tile (imagery with zoom level > 17) (patch by wiktorn)

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. For details, see Readme.txt file.
2package org.openstreetmap.gui.jmapviewer.tilesources;
3
4import java.awt.Image;
5
6import org.openstreetmap.gui.jmapviewer.Coordinate;
7
8/**
9 * Abstract class for OSM Tile sources
10 */
11public abstract class AbstractOsmTileSource extends AbstractTMSTileSource {
12
13 /**
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>
15 */
16 public static final String DEFAULT_OSM_ATTRIBUTION = "\u00a9 OpenStreetMap contributors";
17
18 /**
19 * Constructs a new OSM tile source
20 * @param name Source name as displayed in GUI
21 * @param base_url Source URL
22 * @param id unique id for the tile source; contains only characters that
23 * are safe for file names; can be null
24 */
25 public AbstractOsmTileSource(String name, String base_url, String id) {
26 super(new TileSourceInfo(name, base_url, id));
27
28 }
29
30 @Override
31 public int getMaxZoom() {
32 return 19;
33 }
34
35 @Override
36 public boolean requiresAttribution() {
37 return true;
38 }
39
40 @Override
41 public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) {
42 return DEFAULT_OSM_ATTRIBUTION;
43 }
44
45 @Override
46 public String getAttributionLinkURL() {
47 return "https://openstreetmap.org/";
48 }
49
50 @Override
51 public Image getAttributionImage() {
52 return null;
53 }
54
55 @Override
56 public String getAttributionImageURL() {
57 return null;
58 }
59
60 @Override
61 public String getTermsOfUseText() {
62 return null;
63 }
64
65 @Override
66 public String getTermsOfUseURL() {
67 return "https://www.openstreetmap.org/copyright";
68 }
69}
Note: See TracBrowser for help on using the repository browser.