GeoJsonLayer class

Creates a layer that displays contents of a GeoJSON source.

Inheritance

Constructors

GeoJsonLayer.new({Key? key, required GeoJsonProvider data, OnPointCallback? onPoint, OnPolylineCallback? onPolyline, OnPolygonCallback? onPolygon, FeatureFilterCallback? filter, GeoJsonStyleDefaults? styleDefaults, LayerHitNotifier<Object>? hitNotifier, double polylineHitbox = 10})
Creates a layer instance. You might be better off using a specialized constructor:
const
GeoJsonLayer.asset(String name, {Key? key, AssetBundle? bundle, OnPointCallback? onPoint, OnPolylineCallback? onPolyline, OnPolygonCallback? onPolygon, FeatureFilterCallback? filter, GeoJsonStyleDefaults? styleDefaults, LayerHitNotifier<Object>? hitNotifier, double polylineHitbox = 10})
GeoJsonLayer.file(File file, {Key? key, OnPointCallback? onPoint, OnPolylineCallback? onPolyline, OnPolygonCallback? onPolygon, FeatureFilterCallback? filter, GeoJsonStyleDefaults? styleDefaults, LayerHitNotifier<Object>? hitNotifier, double polylineHitbox = 10})
GeoJsonLayer.memory(Map<String, dynamic> data, {Key? key, OnPointCallback? onPoint, OnPolylineCallback? onPolyline, OnPolygonCallback? onPolygon, FeatureFilterCallback? filter, GeoJsonStyleDefaults? styleDefaults, LayerHitNotifier<Object>? hitNotifier, double polylineHitbox = 10})
GeoJsonLayer.network(String url, {Key? key, OnPointCallback? onPoint, OnPolylineCallback? onPolyline, OnPolygonCallback? onPolygon, FeatureFilterCallback? filter, GeoJsonStyleDefaults? styleDefaults, LayerHitNotifier<Object>? hitNotifier, double polylineHitbox = 10})

Properties

data GeoJsonProvider
GeoJSON data source. Just like with ImageProvider, it's possible to do network calls or use an asset-bundled file. Use MemoryGeoJson to supply a Map if you don't need any of that.
final
filter FeatureFilterCallback?
A function to exclude some features from the GeoJSON. It takes a geometryType and feature properties to make that decision. Return false when you don't need the feature.
final
hashCode int
The hash code for this object.
no setterinherited
hitNotifier → LayerHitNotifier<Object>?
Hit notifier for polylines and polygons. See LayerHitNotifier documentation for explanations and an example.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPoint OnPointCallback?
This function receives a marker location and feature properties, and builds a flutter_map Marker. See defaultOnPoint for an example. You can call that function first to process styles, and then adjust the returned marker.
final
onPolygon OnPolygonCallback?
This function takes feature properties and some other parameters to build a flutter_map Polygon. See defaultOnPolygon for an example.
final
onPolyline OnPolylineCallback?
This function takes a list of points and feature properties to build a flutter_map Polyline. See defaultOnPolyline for an example.
final
polylineHitbox double
For a polyline, a change to adjust its hit box. The default is the same as in Polyline, 10 pixels.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
styleDefaults GeoJsonStyleDefaults?
When not overriding callbacks, this layer uses the default builders. Those use object properties to determine colors and dimensions. To change default values, use this property.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GeoJsonLayer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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