Class Source
- java.lang.Object
-
- org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.Source
-
public class Source extends java.lang.Object
A source from a Mapbox Vector Style- Since:
- 17862
- See Also:
- https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSource.ZoomBoundFunctionA common function for zoom constraints
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringattributionThe attribution to display for the userprivate BoundsboundsThe bounds of the data.private intmaxZoomThe maximum zoom supportedprivate intminZoomThe minimum zoom supportedprivate java.lang.StringnameThe name of the sourceprivate static java.lang.String[]NO_URLSprivate java.lang.StringpromoteIdThe property to use as a feature id.private SchemeschemeThe tile schemeprivate SourceTypesourceTypeThe type of the sourceprivate inttileSizeThe tile sizeprivate java.lang.String[]tileUrlsThe tile urls.private booleanvolatileCachetrueif the tiles should not be cachedprivate static java.lang.StringWMS_BBOXWMS servers should contain a "{bbox-epsg-3857}" parameter for the bboxprivate static java.util.function.IntFunction<java.lang.Integer>ZOOM_BOUND_FUNCTIONConstrain the min/max zooms to be between 0 and 30, as per tilejson spec
-
Constructor Summary
Constructors Constructor Description Source(java.lang.String name, jakarta.json.JsonObject data)Create a new Source object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)java.lang.StringgetAttributionText()Get the attribution for this sourceBoundsgetBounds()Get the bounds for this sourceintgetMaxZoom()Get the max zoomintgetMinZoom()Get the minimum zoomjava.lang.StringgetName()Get the source namejava.util.List<java.lang.String>getUrls()Get the URLs that can be used to get vector datainthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
WMS_BBOX
private static final java.lang.String WMS_BBOX
WMS servers should contain a "{bbox-epsg-3857}" parameter for the bbox- See Also:
- Constant Field Values
-
NO_URLS
private static final java.lang.String[] NO_URLS
-
ZOOM_BOUND_FUNCTION
private static final java.util.function.IntFunction<java.lang.Integer> ZOOM_BOUND_FUNCTION
Constrain the min/max zooms to be between 0 and 30, as per tilejson spec
-
name
private final java.lang.String name
The name of the source
-
sourceType
private final SourceType sourceType
The type of the source
-
minZoom
private final int minZoom
The minimum zoom supported
-
maxZoom
private final int maxZoom
The maximum zoom supported
-
tileUrls
private final java.lang.String[] tileUrls
The tile urls. These usually have replaceable fields.
-
attribution
private final java.lang.String attribution
The attribution to display for the user
-
bounds
private final Bounds bounds
The bounds of the data. We should not request data outside of the bounds
-
promoteId
private final java.lang.String promoteId
The property to use as a feature id. Can be parameterized
-
volatileCache
private final boolean volatileCache
trueif the tiles should not be cached
-
tileSize
private final int tileSize
The tile size
-
-
Constructor Detail
-
Source
public Source(java.lang.String name, jakarta.json.JsonObject data)
Create a new Source object- Parameters:
name- The name of the source objectdata- The data to set the source information with
-
-
Method Detail
-
getBounds
public Bounds getBounds()
Get the bounds for this source- Returns:
- The bounds where this source can be used
-
getName
public java.lang.String getName()
Get the source name- Returns:
- the name
-
getUrls
public java.util.List<java.lang.String> getUrls()
Get the URLs that can be used to get vector data- Returns:
- The urls
-
getMinZoom
public int getMinZoom()
Get the minimum zoom- Returns:
- The min zoom (default
0)
-
getMaxZoom
public int getMaxZoom()
Get the max zoom- Returns:
- The max zoom (default
22)
-
getAttributionText
public java.lang.String getAttributionText()
Get the attribution for this source- Returns:
- The attribution text. May be
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-