Package org.geotools.mbstyle.source
Class GeoJsonMBSource
Wrapper around a
JSONObject
holding a Mapbox GeoJSON source. Data must be provided via a "data" property,
whose value can be a URL or inline GeoJSON.-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGeoJsonMBSource
(JSONObject json) GeoJsonMBSource
(JSONObject json, MBObjectParser parser) -
Method Summary
Modifier and TypeMethodDescription(Optional) Defaults to 128.(Optional) Defaults to false.(Optional) Max zoom on which to cluster points if clustering is enabled.(Optional) Defaults to 50.getData()
(Optional) A URL to a GeoJSON file, or inline GeoJSON.(Optional) Defaults to 18.(Optional) Defaults to 0.375.getType()
Type of source.
-
Constructor Details
-
GeoJsonMBSource
public GeoJsonMBSource(JSONObject json) -
GeoJsonMBSource
-
-
Method Details
-
getData
(Optional) A URL to a GeoJSON file, or inline GeoJSON.- Returns:
- GeoJSON to draw, either inline or a URL.
-
getMaxZoom
(Optional) Defaults to 18. Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).- Returns:
- Number for the max zoom, defaulting to 18.
-
getBuffer
(Optional) Defaults to 128. Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.- Returns:
- Number for the size of the tile buffer
-
getTolerance
(Optional) Defaults to 0.375. Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).- Returns:
- Number for the simplification tolerance, defaulting to 0.375
-
getCluster
(Optional) Defaults to false. If the data is a collection of point features, setting this to true clusters the points by radius into groups.- Returns:
- Boolean, whether to cluster, defaulting to false
-
getClusterRadius
(Optional) Defaults to 50.Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.
- Returns:
- Number for the cluster radius, defaulting to 50
-
getClusterMaxZoom
(Optional) Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered).- Returns:
- Number for the cluster max zoom
-
getType
Description copied from class:MBSource
Type of source.
-