feat: added isochrone maps #1535
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new IsochroneMapProvider class to compute and draw isochrone polygons on a Google Map. It supports multiple durations, transport modes, and color schemas, with a loading indicator callback to track rendering progress.
Features
Isochrone computation:
Uses Google Directions API to estimate travel time for radial points around an origin, refining distances with a binary search to form accurate isochrone polygons.
Drawing order and colors:
Polygons are drawn from outermost to innermost with a green-to-red gradient (green = shortest duration, red = longest) for intuitive visualization.
Hole clipping between isochrones:
Inner polygons are added as holes inside outer polygons to prevent visual overlap and create distinct rings.
Loading listener:
Callbacks notify when loading starts and finishes, enabling UI feedback such as progress spinners.
Transport mode flexibility:
Supports bicycling, walking, driving, and transit modes via Google Directions API.
Smooth polygons:
Chaikin smoothing is applied to polygon edges for improved appearance.