chuyentt / geojson_vi

An Open-Source Dart and Flutter Library for Efficiently Handling GeoJSON Data in Compliance with RFC 7946
https://pub.dev/packages/geojson_vi
MIT License
15 stars 10 forks source link

Create a set() for the feature's properties #3

Closed steinmetz closed 4 years ago

steinmetz commented 4 years ago

What do you think if there would be a setter for the properties or make the attribute public?

While I create a new feature, sometimes I already have a map of the properties or it would be easier to set them like this:

  final geom_point = GeoJSONPoint(pos);
  final feature_point = GeoJSONFeature(geom_point);
  feature_point.properties = {
      'key1': 'value1',
      'key2': 'value2',
      'key3': 'value3',
      ...
  }

What do you think?

steinmetz commented 4 years ago

I think I can use addAll for that...

feature.properties.addAll(
      {...} 
    );
chuyentt commented 4 years ago

What do you think if there would be a setter for the properties or make the attribute public?

While I create a new feature, sometimes I already have a map of the properties or it would be easier to set them like this:

  final geom_point = GeoJSONPoint(pos);
  final feature_point = GeoJSONFeature(geom_point);
  feature_point.properties = {
      'key1': 'value1',
      'key2': 'value2',
      'key3': 'value3',
      ...
  }

What do you think?

I think that's better, thank you! Please update package to geojson_vi: ^1.3.1+3 for this