toGeoJsonFeatures method

GeoJsonFeatureCollection toGeoJsonFeatures()

Export all the map assets to a GeoJsonFeatureCollection

Implementation

GeoJsonFeatureCollection toGeoJsonFeatures() {
  final featureCollection = GeoJsonFeatureCollection()
    ..collection = <GeoJsonFeature>[];
  final markersFeature = _markersState.toGeoJsonFeatures();
  final linesFeature = _linesState.toGeoJsonFeatures();
  final polygonsFeature = _polygonsState.toGeoJsonFeatures();
  if (markersFeature != null) {
    featureCollection.collection.add(markersFeature);
  }
  if (linesFeature != null) {
    featureCollection.collection.add(linesFeature);
  }
  if (polygonsFeature != null) {
    featureCollection.collection.add(polygonsFeature);
  }
  return featureCollection;
}