Replies: 8 comments 2 replies
-
Hey, there is no built in tools for this. You'll need to make it yourself. If you are looking at iOS only, you can add a PanResponder to the map and be able to control things fairly well by stopping map interaction when you tap + drag on features. For Android, that doesn't work and I'd recommend using a transparent view on top of the MapView with pointerEvents |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips, I'll start working on this next week, I'll let you know how it goes. |
Beta Was this translation helpful? Give feedback.
-
Hi @kristfal Can you have any example for drawing polyline using MapBox |
Beta Was this translation helpful? Give feedback.
-
Hi @fvieira, could you make any progress in this regard? The easiest way to build this would be to use subsequent onPress events and combine the coordinates to a polygon. The best case would be to have a kind of a "freehand draw". I just had a glance at the documentation and saw that the PointAnnotation object has a |
Beta Was this translation helpful? Give feedback.
-
@jayhaluska @fvieira Either of you have any luck on this subject?? I'm currently looking to implement a similar feature where a user can define custom polygon areas or drop a resizable circle area on the map. Cant find much for either in ReactNative!! |
Beta Was this translation helpful? Give feedback.
-
If anyone is interested in implementing this, here is an example from the mapbox android SDK docs: |
Beta Was this translation helpful? Give feedback.
-
this might also help: https://docs.mapbox.com/android/maps/examples/draw-a-polygon/ |
Beta Was this translation helpful? Give feedback.
-
We have implemented a React Native library for drawing points, polylines, and polygons (currently without holes) here: https://github.com/newfarms/react-native-mapbox-geometry-editor As one of the authors, I can't comment on how good it is, but hopefully it helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First, I know this isn't a real issue, but I wasn't sure of a better place to ask this, so let me know if there's one and I'll move it there.
I have a React Native app and need to allow my users to pick areas in a map, essentially building polygons over a map. I know I can use this library to show polygons, but I'm not sure how to make this polygon builder except by doing it all myself. Does this library have something that can help me? Can you recommend another solution?
What I'm looking for is basically this: https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
Thanks in advance, and sorry for the non issue...
Beta Was this translation helpful? Give feedback.
All reactions