GeoJsonSource class

A GeoJSON data source. @see The online documentation

Inheritance

Constructors

GeoJsonSource({required String id, String? data, double? maxzoom, String? attribution, double? buffer, double? tolerance, bool? cluster, double? clusterRadius, double? clusterMaxZoom, Map<String, dynamic>? clusterProperties, bool? lineMetrics, bool? generateId, double? prefetchZoomDelta, TileCacheBudget? tileCacheBudget})

Properties

attribution Future<String?>
Contains an attribution to be displayed when the map is shown to a user.
no setter
buffer Future<double?>
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.
no setter
cluster Future<bool?>
If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point features in the source with additional properties:
no setter
clusterMaxZoom Future<double?>
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). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.
no setter
clusterProperties Future<Map<String, dynamic>?>
An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {"property_name": [operator, map_expression]}. operator is any expression function that accepts at least 2 operands (e.g. "+" or "max") — it accumulates the property value from clusters/points the cluster contains; map_expression produces the value of a single point.
no setter
clusterRadius Future<double?>
Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.
no setter
data Future<String?>
A URL to a GeoJSON file, or inline GeoJSON.
no setter
generateId Future<bool?>
Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.
no setter
hashCode int
The hash code for this object.
no setterinherited
id String
The ID of the Source.
getter/setter pairinherited
lineMetrics Future<bool?>
Whether to calculate line distance metrics. This is required for line layers that specify line-gradient values.
no setter
maxzoom Future<double?>
Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).
no setter
prefetchZoomDelta Future<double?>
When loading a map, if PrefetchZoomDelta is set to any number greater than 0, the map will first request a tile at zoom level lower than zoom - delta, but so that the zoom level is multiple of delta, in an attempt to display a full map at lower resolution as quick as possible. It will get clamped at the tile source minimum zoom. The default delta is 4.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tileCacheBudget Future<TileCacheBudget?>
This property defines a source-specific resource budget, either in tile units or in megabytes. Whenever the tile cache goes over the defined limit, the least recently used tile will be evicted from the in-memory cache. Note that the current implementation does not take into account resources allocated by the visible tiles.
no setter
tolerance Future<double?>
Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).
no setter

Methods

bind(StyleManager style) → void
inherited
getType() String
Get the type of the current source as a String.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateGeoJSON(String geoJson) Future<void>?
Update this GeojsonSource with a URL to a GeoJSON file, or inline GeoJSON.

Operators

operator ==(Object other) bool
The equality operator.
inherited