toMap method

  1. @override
Map<String, dynamic> toMap()
override

Converts GeoJSON object to a Map.

Implementation

@override
Map<String, dynamic> toMap() {
  return {
    'type': type.value,
    if (id != null) 'id': id,
    if (title != null) 'title': title,
    'properties': properties ?? {},
    'geometry': geometry.toMap(),
    if (bbox != null) 'bbox': bbox,
  };
}