r/learnreactjs • u/fhqvvagads • Mar 15 '22
Question How to build a map-builder?
Hey gang!
I want to make a map-maker where:
- A user can drag and drop tiles to create a map.
- When they drop the tile they should be able to rotate it They should be able to add pinpoints on top of the map that will be unique.
- They should be able to save the map and edit later.
So for example I can make a river and some road, and then add a marker to the road. Save, And later add a mountain and another marker.
I've seen some interesting tools like leaflet but do you have any ideas where I can get started with a tile-based drag n drop build that can use my own PNG or SVC images?
Thanks so much!
6
Upvotes
View all comments
2
u/SoBoredAtWork Mar 15 '22
This is a pretty advanced project. Drag and drop, rotation, adding pinpoints, save for later are all things that are going to require a lot of work.
I think you'd start with some sort of drag and drop library (don't implement it yourself). Check out...
https://github.com/react-dnd/react-dnd/
or
https://github.com/atlassian/react-beautiful-dnd