geo_triangle_grid 1.0.1 copy "geo_triangle_grid: ^1.0.1" to clipboard
geo_triangle_grid: ^1.0.1 copied to clipboard

outdated

A package for creating a triangle grid on a map. The grid is created by dividing the map into icosphere with 20 triangles and each triangle is divided into 4 smaller triangles and so on.

example/geo_triangle_grid_example.dart

import 'package:geo_triangle_grid/geo_triangle_grid.dart';

void main() {
  latLngToHash();
  latLngToHashWithDepth();
  hashToLatLng();
}

void latLngToHash() {
  // Converting location into a triangle hash string
  final location = LatLng(37.7749, -122.4194);
  final hash = TriangleGrid.latLngToHash(location);
  print(hash);
}

void latLngToHashWithDepth() {
  // Converting location into a triangle hash string with a specific depth
  final location = LatLng(37.7749, -122.4194);
  final hash = TriangleGrid.latLngToHash(location, 12);
  print(hash);
}

void hashToLatLng() {
  // Converting triangle hash string into a location
  final hash = 'G110302102';
  final location = TriangleGrid.hashToLatLng(hash);
  print(location);
}
2
likes
0
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

A package for creating a triangle grid on a map. The grid is created by dividing the map into icosphere with 20 triangles and each triangle is divided into 4 smaller triangles and so on.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on geo_triangle_grid