Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Minor fix in reactive api example
Browse files Browse the repository at this point in the history
  • Loading branch information
synw committed Aug 21, 2019
1 parent 1a71cdf commit f0d42b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ Example: add assets on a Flutter map:
final lines = <Polyline>[];
Future<void> parseAndDrawAssetsOnMap() async {
final data = await rootBundle
.loadString('assets/railroads_of_north_america.geojson');
final geojson = GeoJson();
geojson.processedLines.listen((GeoJsonLine line) {
/// when a line is parsed add it to the map right away
setState(() => lines.add(Polyline(
strokeWidth: 2.0, color: Colors.blue, points: line.geoSerie.toLatLng())));
});
geojson.endSignal.listen((_) => geojson.dispose());
final data = await rootBundle
.loadString('assets/railroads_of_north_america.geojson');
await geojson.parse(data, verbose: true);
}
```
Expand Down

0 comments on commit f0d42b8

Please sign in to comment.