java.lang.Object | ||
↳ | com.carto.datasources.TileDataSource | |
↳ | com.carto.datasources.GeoJSONVectorTileDataSource |
A tile data source that builds vector tiles from GeoJSON inputs.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeoJSONVectorTileDataSource(int minZoom, int maxZoom)
Constructs a GeoJSONVectorTileDataSource object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
createLayer(String name)
Creates a new layer with specified name.
| ||||||||||
synchronized void | delete() | ||||||||||
void |
deleteLayer(int layerIndex)
Deletes an existing layer.
| ||||||||||
MapBounds |
getDataExtent()
Returns the extent of the tiles in this data source.
| ||||||||||
TileData |
loadTile(MapTile mapTile)
Loads the specified tile.
| ||||||||||
void |
setLayerFeatureCollection(int layerIndex, Projection projection, FeatureCollection featureCollection)
Sets the feature collection of the specified layer.
| ||||||||||
void |
setLayerGeoJSON(int layerIndex, Variant geoJSON)
Sets the features of the specified layer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a GeoJSONVectorTileDataSource object.
Note: EPSG3857 projection is used.
minZoom | The minimum zoom level supported by this data source. |
---|---|
maxZoom | The maximum zoom level supported by this data source. |
Creates a new layer with specified name.
name | The name for the layer. |
---|
Exception | If an error occured during creation of the layer. |
---|---|
IOException |
Deletes an existing layer.
layerIndex | The index of layer to delete. |
---|
Returns the extent of the tiles in this data source.
The bounds are in coordinate system of the projection of the data source.
Loads the specified tile.
Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.
mapTile | The tile to load. |
---|
Sets the feature collection of the specified layer.
layerIndex | The index of the layer. A layer with empty name will be created if it does not exist yet. |
---|---|
projection | Projection for the features in featureCollection. Can be null if the coordinates are based on WGS84. |
featureCollection | The feature collection for the specified layer. |
Exception | If an error occured during updating the layer. |
---|---|
IOException |
Sets the features of the specified layer.
layerIndex | The index of the layer. A layer with empty name will be created if it does not exist yet. |
---|---|
geoJSON | A geojson type variant that MUST contain single FeatureColletion element. |
Exception | If an error occured during updating the layer. |
---|---|
IOException |