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
32 /***************************************************************************************************************************************************************
33 *
34 * This class represent a source for {@link Tile}s. A source is able to convert coordinates expressed as (latitude, longitude) into rectified (x,y)
35 * cartesian coordinates for a map, as well as to provide the URL for a map tile that contains a given pair of rectified coordinates.
36 *
37 * @author Fabrizio Giudici
38 *
39 **************************************************************************************************************************************************************/
40 public interface TileSource extends Projection
41 {
42 /***********************************************************************************************************************************************************
43 * {@return the display name of this object}.
44 **********************************************************************************************************************************************************/
45 public String getDisplayName();
46
47 /***********************************************************************************************************************************************************
48 * {@return the URI for the tile at the given position with the given zoom level}.
49 * @param column the tile column
50 * @param row the tile row
51 * @param zoom the zoom level
52 **********************************************************************************************************************************************************/
53 @Nonnull
54 public URI getTileUri (int column, int row, int zoom);
55
56 /***********************************************************************************************************************************************************
57 * {@return the maximum zoom level of this source}.
58 **********************************************************************************************************************************************************/
59 public int getMaxZoomLevel();
60
61 /***********************************************************************************************************************************************************
62 * {@return the minimum zoom level of this source}.
63 **********************************************************************************************************************************************************/
64 public int getMinZoomLevel();
65
66 /***********************************************************************************************************************************************************
67 * {@return the default zoom level of this source}.
68 **********************************************************************************************************************************************************/
69 public int getDefaultZoomLevel();
70
71 /***********************************************************************************************************************************************************
72 * {@return a prefix unique to this source to be used by the local tile cache}.
73 **********************************************************************************************************************************************************/
74 @Nonnull
75 public String getCachePrefix();
76
77 /***********************************************************************************************************************************************************
78 * {@return the size of the tiles created by this source}.
79 **********************************************************************************************************************************************************/
80 public int getTileSize();
81 }