map_services 0.0.7 copy "map_services: ^0.0.7" to clipboard
map_services: ^0.0.7 copied to clipboard

A Flutter package for mapping services including distance calculation, reverse geocoding, and routing.

map_services is a Flutter package that provides easy-to-use services for common mapping tasks such as distance calculation, reverse geocoding, and route fetching.

Features #

  • Reverse Geocoding: Convert coordinates (Latitude/Longitude) into human-readable addresses using Nominatim (OSM).
  • Distance Calculation: Calculate the distance between two geographical points using the Haversine formula.
  • Radius Check: Easily determine if a point is within a specified radius of another point.
  • Route Fetching: Get route points between two locations using OSRM.
  • Address Search: Search for addresses using the Photon API.

Getting started #

Add map_services to your pubspec.yaml:

dependencies:
  map_services:  ^0.0.6

Usage #

Distance Calculation #

final mapServices = MapServices();
final pointA = LatLong(14.5995, 120.9842); // Manila
final pointB = LatLong(14.5547, 121.0244); // Makati

double distance = mapServices.getDistanceInKm(pointA: pointA, pointB: pointB);
print('Distance: $distance km');

bool isClose = mapServices.isWithinRadius(center: pointA, target: pointB, radiusKm: 10.0);
print('Is within 10km: $isClose');
final results = await MapServices.searchAddress('Manila');
for (var result in results) {
  print('Found: ${result.address} at ${result.latitude}, ${result.longitude}');
}

Detail examples can be found in the /example folder.

2
likes
130
points
17
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package for mapping services including distance calculation, reverse geocoding, and routing.

Repository (GitHub)

License

unknown (license)

Dependencies

flutter, flutter_dotenv, google_polyline_algorithm, http

More

Packages that depend on map_services