Open danesfeder opened 5 years ago
Thanks @danesfeder for cutting this ticket.
The old JS Turf Buffer implementation used https://github.com/bjornharrtell/jsts which is in turn a port of the Java library https://github.com/locationtech/jts. The latest JS Turf buffer seems to use something different (d3-geo
?). I'd love to use this ticket to understand our options:
Particularly in terms of size implications. We're trying to keep MAS lightweight and this might require adding a separate artifact.
Based on https://github.com/Turfjs/turf/blob/master/packages/turf-buffer/index.js#L1, I believe we'll also need to port center()
before we can add the buffer method. buffer()
could also unlock cool visuals like 👇 (Off the top of my head, I'm not sure how they're creating the white FillLayer
area right now without buffer()
🤔 ). GIF is from the Flyover Country
app: https://play.google.com/store/apps/details?id=com.ionicframework.app303739&hl=en_US
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Based on https://github.com/Turfjs/turf/blob/master/packages/turf-buffer/index.js#L1, I believe we'll also need to port center() before we can add the buffer method
Porting the center method is moving at https://github.com/mapbox/mapbox-java/pull/1150
Having this buffer method would also help with detecting whether a line has been clicked on. For example, selecting an alternate route that the Mapbox Navigation SDK displays.
Rather than having to click exactly on the line, we could use the click lat/lng, the buffer Polygon
, and the Java SDK's TurfJoins.inside()
method.
@1ec5 @MaximAlien curious, how does iOS plan to support the UI to select an alternate route?
@1ec5 @MaximAlien curious, how does iOS plan to support the UI to select an alternate route?
Current implementation of alternative route selection involves conversion of tapped point to coordinate. Alternative routes are then sorted by distance to tapped coordinate (there is minimum threshold as well).
Turf.js has a
Turf#buffer
method that would be useful for defining offline map regions. An example use case in navigation would be defining a buffer around a route geometry for an offline download:@zugaldia mentioned that this may not be a straightforward port to java, possibly necessitating bringing in a third party library to get the job done. We need to look into this a bit further / discuss if that makes sense.
cc @osana @kevinkreiser