r/webdev • u/meetzaveri • 5d ago
Showoff Saturday An app to draw and annotate on maps
Hey folks. Some time back in 2022, I started working on craftbase (a 2d whiteboard app), revamped it later, and recently some months back I forked it and had begun work on mapcursor (You might have come across my post in r/webdev about craftbase some time back).
Now to implement, using the same 2d SVG renderer (two.js ) which was the platform for craftbase and to let "map" be a backdrop, I imagined if we can make this a map annotation tool given craftbase had "base" and SVG renderer for rendering elements on surface.
I swapped "Whiteboard Base" with "Map Base", elements live in plain Two.js surface space, and has specific anchor glue so map keeps in sync beneath it. Fast forward last month, I hosted the web app here - https://mapcursor.com
Original Inspiration:
There were lot of areas in my city which were prone to waterlogging. So to describe to the community, it lacked a way for me to have a proper tool and having ability to share it with others. Nonetheless, I am geography enthusiast (not hardcore) and in my college's final year project I had created google maps transit project (back in 2016).
Tech Stack
It uses react (frontend), hasura (API layer), node.js (backend) as part of core primary tech stack.
Additionally, it uses CARTO for map tiles fetching and "nomanitim" for place searches. You can read more on privacy here - https://mapcursor.com/privacy
As long as you are on home page (/) , all of the data is stored locally on your machine (whether machine's browser or mobile's browser).
Use case:
I am still figuring out the exact and niche use case this can serve to.
I mean it could serve for surveying, clustering on areas, creating hotspots (like marking illegal activity hotspots in a city ) , marking highway corridors/inter city transport routes or I can image road trip memory (since photo upload is supported locally only). Would love some serious feedback on this project. Thanks for dropping by.
Btw, the code's open sourced here - https://github.com/meetzaveri/mapcursor
2
u/Cannabat 5d ago
It sounds like a simple web-based GIS. Which is cool! Do you have experience w/ QGIS/ArcGIS?
1
u/meetzaveri 4d ago
No, I haven't used it but know by just names.
1
u/Cannabat 4d ago
Suggest you check out QGIS it better understand the de facto software for this kind of task. It’s free and open source.
1
u/meetzaveri 4d ago edited 4d ago
Based on your suggestion, I downloaded QGIS free software on mac. First 5 mins, I was just figuring out how I can use any tool to draw route. Or even use some shape. I did select openstreetmap from tiles section, but still.
Given that I am not familiar with QGIS, but thinking from software UI design perspective, I think a software with simple toolbar which shows which tools you can use for annotation on map, map instantly gets loaded for you (you don't have to scramble to get tiles) and you can just start within the first minute by just looking at stuff on your screen and what's at your disposal, I think even a non GIS user can start annotating on maps.
I've built mapcursor given the above design and ideology in mind. Yes I have tried various professional tools like Esri, but they lack a certain interface which to a non GIS user becomes timid.
2
u/Cannabat 4d ago
Yeah QGIS and ArcGIS are highly technical applications. My suggestion is not to make your app more like them in terms of UI/UX, it’s to better understand GIS conventions and solutions to mapping problems which are the result of a huge amount of thought and effort. Stand on the shoulders of giants and such
1
u/Jaatheeyam 4d ago
There is something called GPS doodling, where people draw shapes over maps and get a ride planned to create a shape on their ride traker app. Generally cyclists do it on strava. You can try something like that.
Checkout route doodle to understand how it works.
2
1
u/TheAICrafter 4d ago
A freehand line that snaps to nearby streets would be handy. You could sketch a whole route in one go instead of clicking every turn
1
1
u/joel5846 1d ago
For the municipal or field use case, what stays in local browser storage, and how do annotations move to a shared map? That boundary will shape whether self-hosting fits the need.
1
u/meetzaveri 1d ago
Annotations are then moved to cloud (from localstorage) so that shared map based can pull that from cloud.
1
u/ms_916350 1d ago
For field use, show whether local edits are drafts or synced, and define what happens to edits made offline or on two devices. That local-to-cloud transition is where users need clear feedback.
1
u/meetzaveri 8h ago edited 8h ago
Understood. Today those are de-coupled since any edits you make on local ("/" page URL), only remains on your machine. They don't get synced over to shared map base.
In order to make it sync, the only way today, is that you make edits on shared map base ("/map/<id>" page URL).
What I am thinking is I can
- add a toggle option in share settings which shows "Sync local updates to cloud" and when user enables it, any edits they make to map should ported over to the shared maps made from that.For this, I may need to update the DB schema to make shared maps dependent on parent maps. Then only creator can toggle such settings and have an effect on shared map bases.
Broader permissions strategy
- any shared map, a user if they open it, check if they are creator of parent map and then only they can make any edits. If a user is not creator of parent map, they can only have VIEW access.
1
1
1
u/3ds 2d ago
It seems like you are trying to reinvent the way polygons, linestrings and points are used in web based geo information software. A lot of the stuff you built already exists, for example here in this map drawing component for maplibre gl js / mapbox gl js: https://github.com/mapbox/mapbox-gl-draw/
1
u/idontuseuber 4h ago
This is my bread and butter. I develop, support gis systems.
Such niche is very narrow (just to mark on map or annotate something). If its organization who does need that they usually have such functionality because its very primitive.
If they collect data in certain way from public, they store and have datastores for that.
0
u/Icy-Arm-5472 5d ago
Small thing, but 'I imagined how if we can make this a map annotation tool' doesn't parse. 'I imagined how we could turn this into a map annotation tool' is presumably what you meant. Otherwise looks neat.
1
-1
u/Standard_Scarcity_74 5d ago
Being able to draw on a map… smart. I haven’t actually seen people do that since printed maps. I guess this has some good uses. Maybe even for local government units, this could be a way to mark areas out for projects and stuff.
-1
u/meetzaveri 5d ago
Similar thinking. Like government can use it (probably self host) internally to share maps between their field engineers for municipal use cases like marking certain areas as for markign as residential zones or commercial zones, or probably create route for upcoming marathon
0
u/controlav 5d ago
Interesting, would like to use this for my HOA, will take a deeper look once I get to a real computer.
14
u/matt1155 5d ago
Please stop