shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Turn a click into coordinates, with this coordinate picker map for Vue with Ark UI. Latwise, a location tool, puts a pin on a live Map of Greenwich that follows your theme, light or dark: click the map (the cursor is a crosshair), drag the pin, or focus it and move it with the arrow keys, and four cells under the map write the point four ways. Decimal degrees give latitude and longitude to five places, about a metre; degrees, minutes and seconds go to a tenth of a second with the hemisphere's letter; the geohash is shown with its cell shaded on the map and its size on the ground, and a Toggle Group sets its length to 5, 7 or 9 characters and flies the map to a zoom where that cell shows; the plus code (Open Location Code) has ten digits, a cell of about 14 by 9 metres here. Each cell has a Copy Button. The pin starts on the Royal Observatory's meridian line, and the dashed line is longitude 0 as GPS measures it, about 102 metres to the east: step across it and every W turns into an E and the geohash jumps from g… to u…. The crosshair button picks the map's centre. Built from Map, Toggle Group, Copy Button, Button and Guides. For delivery and field apps, admin tools that store places, developer tools and anyone who has to paste a location somewhere.
FAQ
How are the four formats worked out?
All in the file, with no library. Decimal degrees are the point rounded to five places. Degrees, minutes and seconds round the point to tenths of a second first, so 59.95 seconds never shows as 60. cellOf builds the geohash by halving longitude and latitude in turn, five halvings to a letter of its base-32 alphabet, and keeps the last box as the cell it shades. plusOf writes the plus code as five pairs of base-20 digits, latitude then longitude, from steps of 1/8000 of a degree, with the plus after the eighth digit.
Why isn't the meridian line at longitude 0?
The brass line at the Royal Observatory marks the Airy meridian, which old British maps measured from. GPS works on WGS 84, whose longitude 0 runs about 102 metres east of it (the dashed line), so the pin starts at 0°00′05.3″ W. Click east of the dashed line to see the longitude turn to E and the geohash start with u instead of g: the halving puts the two sides of longitude 0 in different first cells.
Can I pick a point without a mouse?
Yes. The pin is a draggable marker: tab to it and move it with the arrow keys, ten pixels a press or forty with Shift. Or move the map itself with its arrow keys and press the crosshair button to pick its centre. The length toggle, the copy buttons and the zoom buttons are all in the tab order, and a polite message reads the new point, its geohash and its plus code once it settles.
What does each copy button put on the clipboard?
Exactly what its cell shows, on one line: 51.47781, -0.00148 for decimal degrees, the two degrees-minutes-seconds values separated by a space, the geohash at the chosen length, or the plus code with its plus. The button's icon turns to a check and says so; where the browser refuses the clipboard (a page not served over HTTPS, a denied permission) it shows a cross instead.





