Overview
latlong2 is a lightweight Dart library designed for efficient and accurate latitude and longitude calculations. It provides essential geospatial utilities such as distance computation, midpoint determination, and coordinate transformations. Built with performance and simplicity in mind, it supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The package is ideal for applications requiring basic geolocation operations without the overhead of larger mapping frameworks. Its clean API makes it easy to integrate into Flutter projects.
Use cases
- Calculating distances between two coordinates
- Finding midpoints between locations
- Converting between coordinate formats
- Geofencing and proximity detection
- Map-based app development
Key features
- Lightweight and fast
- Cross-platform support
- Simple and intuitive API
- Supports common geospatial operations
- No external dependencies
Suitable for
- Flutter apps needing geolocation math
- Developers building map features
- Projects requiring minimal geospatial logic
- Prototyping location-based services
- Apps targeting multiple platforms
Considerations
- Does not include full map rendering
- Limited to basic geospatial calculations
- No built-in geocoding or reverse geocoding
- Not suitable for complex GIS tasks
- Requires manual handling of edge cases like poles
