location_on_path 0.0.1
SDKdartflutter
Platformandroidioswindowslinuxmacosweb
Dart implementation of the bdccGeoDistanceAlgorithm
Dart implementation of the bdcc GeoDistanceAlgorithm. The algorithm calculates if a single coordinate is near a polyline path in a given radius. This can be used to detect when it is a good moment to recalculate a route in navigation.
Features
This package has the following method:
isLocationOnPathWithRadius(List<LatLng> polyline, LatLng point, int radius)returnstrueif the distance frompointtopolylineis at leastradiusmeters, andfalseif it is not.
Usage
if (isLocationOnPathWithRadius(ppoints, currentPosition, 20)) {
// continue
} else {
// recalculates the route
}