1 /*
2 * *************************************************************************************************************************************************************
3 *
4 * MapView: a JavaFX map renderer for tile-based servers
5 * http://tidalwave.it/projects/mapview
6 *
7 * Copyright (C) 2024 - 2025 by Tidalwave s.a.s. (http://tidalwave.it)
8 *
9 * *************************************************************************************************************************************************************
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
18 *
19 * *************************************************************************************************************************************************************
20 *
21 * git clone https://bitbucket.org/tidalwave/mapview-src
22 * git clone https://github.com/tidalwave-it/mapview-src
23 *
24 * *************************************************************************************************************************************************************
25 */
26 package it.tidalwave.mapviewer;
27
28 import jakarta.annotation.Nonnull;
29 import java.net.URI;
30 import it.tidalwave.mapviewer.javafx.impl.Tile;
31 import org.apiguardian.api.API;
32 import static org.apiguardian.api.API.Status.STABLE;
33
34 /***************************************************************************************************************************************************************
35 *
36 * This class represent a source for {@link Tile}s. A source is able to convert coordinates expressed as (latitude, longitude) into rectified (x,y)
37 * cartesian coordinates for a map, as well as to provide the URL for a map tile that contains a given pair of rectified coordinates.
38 *
39 * @author Fabrizio Giudici
40 *
41 **************************************************************************************************************************************************************/
42 @API(status = STABLE)
43 public interface TileSource extends Projection
44 {
45 /***********************************************************************************************************************************************************
46 * {@return the display name of this object}.
47 **********************************************************************************************************************************************************/
48 public String getDisplayName();
49
50 /***********************************************************************************************************************************************************
51 * {@return the URI for the tile at the given position with the given zoom level}.
52 * @param column the tile column
53 * @param row the tile row
54 * @param zoom the zoom level
55 **********************************************************************************************************************************************************/
56 @Nonnull
57 public URI getTileUri (int column, int row, int zoom);
58
59 /***********************************************************************************************************************************************************
60 * {@return the maximum zoom level of this source}.
61 **********************************************************************************************************************************************************/
62 public int getMaxZoomLevel();
63
64 /***********************************************************************************************************************************************************
65 * {@return the minimum zoom level of this source}.
66 **********************************************************************************************************************************************************/
67 public int getMinZoomLevel();
68
69 /***********************************************************************************************************************************************************
70 * {@return the default zoom level of this source}.
71 **********************************************************************************************************************************************************/
72 public int getDefaultZoomLevel();
73
74 /***********************************************************************************************************************************************************
75 * {@return a prefix unique to this source to be used by the local tile cache}.
76 **********************************************************************************************************************************************************/
77 @Nonnull
78 public String getCachePrefix();
79
80 /***********************************************************************************************************************************************************
81 * {@return the size of the tiles created by this source}.
82 **********************************************************************************************************************************************************/
83 public int getTileSize();
84 }