geopoint 0.8.0
geopoint: ^0.8.0 copied to clipboard

Geospatial data structures. Provides GeoPoint and GeoSerie models.

example/main.dart

import 'package:geopoint/geopoint.dart';
import 'package:latlong/latlong.dart';

class Place {
  Place(this.name, this.point);

  final String name;
  final LatLng point;
}

final List<Place> places = [
  Place("Notre-Dame", LatLng(48.853831, 2.348722)),
  Place("Montmartre", LatLng(48.886463, 2.341169)),
  Place("Champs-Elysées", LatLng(48.873932, 2.294821)),
  Place("Chinatown", LatLng(48.827393, 2.361897)),
  Place("Tour Eiffel", LatLng(48.85801, 2.294713))
];

Future<void> main() async {
  final geoPoints = <GeoPoint>[];
  print("Places in Paris:");
  for (final place in places) {
    final geoPoint = GeoPoint.fromLatLng(name: place.name, point: place.point);
    print("${geoPoint.toMap()}");
    geoPoints.add(geoPoint);
  }
  print("Geoserie:");
  final geoSerie = GeoSerie(
      name: "Paris places", type: GeoSerieType.group, geoPoints: geoPoints);
  print("${geoSerie.toMap()}");
  for (final gp in geoSerie.geoPoints) {
    print("${gp.name}: ${gp.latitude}/${gp.longitude}");
  }
}
2
likes
100
pub points
91%
popularity

Geospatial data structures. Provides GeoPoint and GeoSerie models.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

ansterj@gmail.com

License

MIT (LICENSE)

Dependencies

extra_pedantic, latlong, meta, pedantic, slugify2

More

Packages that depend on geopoint