Package org.geotools.mbstyle.source
Class GeoJsonMBSource
-
public class GeoJsonMBSource extends MBSource
Wrapper around aJSONObject
holding a Mapbox GeoJSON source. Data must be provided via a "data" property, whose value can be a URL or inline GeoJSON.
-
-
Constructor Summary
Constructors Constructor Description GeoJsonMBSource(JSONObject json)
GeoJsonMBSource(JSONObject json, MBObjectParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Number
getBuffer()
(Optional) Defaults to 128.Boolean
getCluster()
(Optional) Defaults to false.Number
getClusterMaxZoom()
(Optional) Max zoom on which to cluster points if clustering is enabled.Number
getClusterRadius()
(Optional) Defaults to 50.Object
getData()
(Optional) A URL to a GeoJSON file, or inline GeoJSON.Number
getMaxZoom()
(Optional) Defaults to 18.Number
getTolerance()
(Optional) Defaults to 0.375.String
getType()
Type of source.
-
-
-
Constructor Detail
-
GeoJsonMBSource
public GeoJsonMBSource(JSONObject json)
-
GeoJsonMBSource
public GeoJsonMBSource(JSONObject json, MBObjectParser parser)
-
-
Method Detail
-
getData
public Object getData()
(Optional) A URL to a GeoJSON file, or inline GeoJSON.- Returns:
- GeoJSON to draw, either inline or a URL.
-
getMaxZoom
public Number 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
public Number 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
public Number 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
public Boolean 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
public Number 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
public Number 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
-
-