| I built an open-source React map drawing library because I got tired of fighting drawing controls that wanted to own the UI. react-map-annotate lets your application control the drawing session. Put the toolbar in your sidebar, header, or command palette. Select tools, finish shapes, edit labels and colors, undo/redo, and persist annotations through React state. It supports Mapbox, MapLibre, Google Maps, Leaflet, and ArcGIS through separate adapters, with a shared annotation model. The goal is simple: the map should render the drawing, not dictate how your application works. It includes freehand drawing, polygons, rectangles, circles, arrows, markers, text, and measurement tools, along with editing handles and a headless API. The project is MIT licensed and available on npm. I’d love feedback from developers building GIS, field-service, site-planning, or other map-heavy applications—especially anyone who has had to work around existing drawing controls. GitHub: https://github.com/orange-groove/react-map-annotate npm: https://www.npmjs.com/package/@orange-groove/react-map-annotate What would you need from a drawing library before using it in a production application? [link] [comments] |
Reading view
NavCN: My New Project for Navigation UI Components Please Share Your Feedback and Suggestions!
Hi everyone! 👋 I’m excited to introduce NavCN, a project I’ve been building to provide a collection of beautiful, customizable, and ready-to-use navigation UI components. The goal is to help developers build modern interfaces faster without creating navigation elements from scratch. Components are built with Nextjs, Tailwind CSS, Motion, and Lucide, with a focus on customization and developer experience. You can browse, preview, install it via shadcn command line, and adapt components to your project. I’m also improving the installation and distribution experience. I’d genuinely love your honest feedback and suggestions!
(currently supports nextjs only.)
project link:- https://navcn-phi.vercel.app/
[link] [comments]
I've been working on virtual scrolling in React and found a weird issue in Safari.
I've been working on virtual scrolling in React and found a weird issue in Safari.
When scrolling normally, everything was fine. But if I scroll very fast, sometimes I could see a white empty area for a very short moment before the next rows appeared.
First I thought React rendering was just too slow.
So I increased overscan and kept more rows above and below the viewport. It helped a lot, but I could still see the problem sometimes.
After looking into it more, I found that Safari's scroll/compositor layer can move before React finishes rendering the next virtual rows.
So basically Safari was already showing the next position, but React was still catching up.
I kept trying to make React faster, but then I tried something a little different.
Instead of trying to always win the race, I put a simple CSS background behind the real rows.
It's just a repeating-linear-gradient with the same row height, background and border.
Something like:
Safari scrolls ↓ CSS row background is already there ↓ React renders next rows ↓ Real rows cover it There is no real data in the background. No cells, no events. It's just visual. I also set pointer-events: none and aria-hidden.
With this + extra overscan above and below, the flicker was almost gone.
I thought it was interesting because at first I was trying to solve a React performance problem.
But maybe it wasn't only about making React faster.
Sometimes it's enough to make those few milliseconds invisible. :)
Anyone had a similar problem with Safari and virtual scrolling?
I'm curious how you solved it.
[link] [comments]