Skip to content
pubscout

flutter_map_geojson

1.0.8, released 3 years ago by dbprof.si

Parses GeoJSON spatial data into Flutter Map markers, polylines, and polygons.

$ flutter pub add flutter_map_geojson
Source repository

What it does

Parses GeoJSON formatted spatial data strings into lists of spatial objects like Markers, Polylines, Polygons, and CircleMarkers compatible with flutter_map. Supports custom callback functions for object creation and property filtering.

AI-written summary of version 1.0.8, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using flutter_map and need to display GeoJSON spatial data.
  • You need to convert points, lines, and polygons from GeoJSON into Flutter Map layers.

Skip it when

  • You are using Google Maps instead of flutter_map.
  • You need complex geographic data analysis or manipulation beyond simple rendering.

Strengths

  • Supports multiple geometry types including Point, LineString, Polygon, and Multi variants.
  • Allows custom callback functions for customized rendering of spatial objects.
  • Supports filtering functions based on properties.

Weaknesses

  • Tied specifically to the flutter_map ecosystem.
  • Limited to parsing data provided as Strings.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
GeoJsonParser myGeoJson = GeoJsonParser();
myGeoJson.parseGeoJsonAsString(testGeoJson);

FlutterMap(
  options: MapOptions(center: LatLng(45.993807, 14.483972), zoom: 14),
  children: [
    PolygonLayer(polygons: myGeoJson.polygons),
    PolylineLayer(polylines: myGeoJson.polylines),
    MarkerLayer(markers: myGeoJson.markers)
  ],
);

Alternatives

Packages that do the same job and could replace flutter_map_geojson.

Works with

Packages commonly used together with flutter_map_geojson: ones it builds on, ones built on it, and its own family.