-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw hexagon on top of maps and make interaction with user location #956
Comments
Do the vertices of the hexagons need to point to an actual point on earth or are they just randomly placed all over the map? |
they just randomly placed all over the map but initially they will cover all earth, and my point is that so when I at Kuala Lumpur, Hexagon on top of my location will disappear like picture on top.. and if I move from Kuala Lumpur to Malacca, hexagon on top of Malacca also will disappear.. |
My first thought would be
You can also have a source and layer for each hexagon it depends how you would like to structure your code. |
oh, I see.. thanks @nitaliano for the assist! I will try first to generate featureCollection with geojson-random :-) really appreciate your help and sorry for taking your time. Hope you have a wonderful day! |
@MrHazimAli we have a gitter setup https://gitter.im/react-native-mapbox-gl/Lobby?source=orgpage that's the best way to get in touch with me besides posting issues here. Going to close this out feel free to ping me with any questions |
@MrHazimAli I'm looking to do something very similar. Did you manage to do it in the end? Since I'm a total novice in this regard, could you point to some resource where I could learn how to generate the hexagons? |
@maciej-gurban , yes I did based on what @nitaliano described.. if you want only some hexagon you can create the features collection by yourself using geojson.io.
but for my cases, I need a leaflet hexagon.. thus there is no easy way that I could find to generate the hexagon. So, I ended up writing a script to generate edge of hexagon by calculation and append it to get the structure of features collection. here is my sample code that I could share: and I used is inside ShapeSource component some other reference that I think was helping:
hope it helps! |
@MrHazimAli Thanks a lot! This will be very useful! |
Hello, I hope everyone is doing well. |
Hye, I have some question if that is possible using the package, I have been playing around with this package and wondering if I can make flooded area using vector and remove the specific vector layer for that specific location when user around the area.
something like this one..
initially user in first hexagon, and after walking and cross second hexagon, it will remove the layer.. currently I can only drawe shape to specific location inside mapbox studio and doesnt have interaction with user location right ?
Thank you @nitaliano ! :-)
The text was updated successfully, but these errors were encountered: