latlng
2.0.7, released 3 years ago by pwa.ir
Geodesy and geographic calculations for Dart, offering LatLong and Mercator projection.
WASM-ready
What it does
Provides classes for latitude/longitude handling, coordinate system conversions (ECI/ECF, WGS84/72), Julian date utilities, ground‑track and tile‑index projections. All calculations are pure Dart with no external dependencies.
AI-written summary of version 2.0.7, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to perform geodetic calculations such as coordinate conversions or distance/angle computations in a Dart/Flutter app.
- You require a lightweight, dependency‑free library for handling lat/long, Julian dates, or projection to map tiles.
Skip it when
- You need full‑featured map widgets or UI components for displaying maps.
- You require platform‑specific geolocation services or real‑time tracking that need native plugins.
Strengths
- Pure Dart implementation with no external dependencies
- Supports a wide range of geodesy calculations (ECI/ECF, Julian dates, ground track)
- Simple API and easy to import
Weaknesses
- No UI or map rendering capabilities
- Limited to calculation utilities; no networking or storage features
- Documentation is minimal beyond basic README
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:latlng/latlng.dart';
void main() {
final latLng = LatLng(51.5074, -0.1278); // London
final mercator = latLng.toMercator();
print('Mercator X: ${mercator.x}, Y: ${mercator.y}');
}Works with
Packages commonly used together with latlng: ones it builds on, ones built on it, and its own family.
- mapBuilt on latlngGeographical Map widget for Flutter supporting different projections and tile providers.
- geoengineBuilt on latlngDart library for geospatial analysis, distance calculations, coordinate conversions and astronomy.
- geofence_foreground_serviceBuilt on latlngA Flutter plugin that handles geofencing using a foreground service on Android and Core Location on iOS.