informations for the reviewer:
Mapbox GL JS itself doesn't have a built-in API specifically for detecting features within an area. However, you can achieve this functionality in a couple of ways:
using screen coordinates in pixels: link. but this solution is not usable in our case.
Leveraging Turf.js: Turf.js is a JavaScript library for geospatial analysis. It offers various functions for working with geographical data. we use pointsWithinPolygon function from Turf.js to identify features that lie within a defined polygon.
Turf.js: More suited for pre-processing data or performing more complex spatial analysis. It offers a wider range of geospatial functions.
New dependencies: https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/ http://turfjs.org/
informations for the reviewer: Mapbox GL JS itself doesn't have a built-in API specifically for detecting features within an area. However, you can achieve this functionality in a couple of ways:
Turf.js: More suited for pre-processing data or performing more complex spatial analysis. It offers a wider range of geospatial functions.
MapBox gl draw demo itself use truf.js : https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?