Class MapboxVectorStyle
java.lang.Object
org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.MapboxVectorStyle
Create a mapping for a Mapbox Vector Style
- Since:
- 17862
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe optional URL for glyphs.private final StringThe optional name for the vector styleprivate final Map<Source,ElemStyles> The required collection of sources with a list of layers that are applicable for that sourceprivate final StringThe optional URL for sprites.private static final ConcurrentHashMap<String,MapboxVectorStyle> private final intThe version for the style specification -
Constructor Summary
ConstructorsConstructorDescriptionMapboxVectorStyle(jakarta.json.JsonObject jsonObject) Create a new MapboxVector style. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate voidFetch sprites.static MapboxVectorStyleGet a MapboxVector style for a URLGet the generated layer → style mappingGet the sprite url for the styleinthashCode()private booleanparseSprites(CachedFile spriteJson, CachedFile spritePng) private voidtoString()
-
Field Details
-
STYLE_MAPPING
-
version
The version for the style specification -
name
The optional name for the vector style -
spriteUrl
The optional URL for sprites. This mush be absolute (so it must contain the scheme, authority, and path). -
glyphUrl
The optional URL for glyphs. This may have replaceable values in it. -
sources
The required collection of sources with a list of layers that are applicable for that source
-
-
Constructor Details
-
MapboxVectorStyle
Create a new MapboxVector style. You should prefergetMapboxVectorStyle(String)for deduplication purposes.- Parameters:
jsonObject- The object to create the style from- See Also:
-
-
Method Details
-
getMapboxVectorStyle
Get a MapboxVector style for a URL- Parameters:
url- The url to get- Returns:
- The Mapbox Vector Style. May be
nullif there was an error.
-
fetchSprites
Fetch sprites. Please note that this is (literally) only png. Unfortunately. -
parseSprites
-
save
-
getSources
Get the generated layer → style mapping- Returns:
- The mapping (use to enable/disable a paint style)
-
getSpriteUrl
Get the sprite url for the style- Returns:
- The base sprite url
-
equals
-
hashCode
-
toString
-