Skip to content

shadcn.io is an independent project built on shadcn/ui

Terrain 3D Map Block for Vue

The Tongariro Alpine Crossing raised into 3D from open elevation tiles: a draped trail, facing presets, a relief slider and a flyover you can pause.

On this page5 sections
UI library: Ark UI

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show a mountain as it stands, with this terrain 3D map for Vue with Ark UI. Screeline, a trail guide, raises the Tongariro Alpine Crossing in New Zealand into 3D on a live Map that follows your theme: the ground comes from the AWS Terrain Tiles, open elevation data added as a raster-dem source through useMap, shaded in the theme's own tokens under a sky that fades into the page. The trail, walked from OpenStreetMap paths, is draped on the ground with its seven stops numbered along it, and two triangles mark the cones of Ngauruhoe and Tongariro. A card at the start gives the length, the climb and the high point, lists the stops (pressing one flies the camera there and draws the trail solid as far as it), turns the view with a Facing Toggle Group and lifts the ground with a Relief Slider, from flat to three times its height. Fly the trail takes the camera from stop to stop, looking along the path, and stops at the end; Pause holds it, and dragging the map hands the camera to you. The compass, the zoom buttons and an overview button sit in the corner. Built from Map, Toggle Group, Slider, Button and Guides. For trail guides, outdoor brands, ski resorts and park visitor pages.

FAQ

Where does the 3D ground come from?

From the AWS Terrain Tiles, an open elevation dataset in Mapzen's Terrarium encoding, read straight from its public bucket with no key. A small Terrain part inside the map adds them through useMap as two raster-dem sources (one raises the ground, one shades it), sets a sky, and adds them again whenever a theme change swaps the basemap. They are the only tiles the block loads besides the basemap's, and their credit sits in the map's corner and the caption.

What does the Relief slider change?

How far the ground is raised: 0 lays it flat, 1 is true to life, and the default of 1.5 makes the slopes easier to read from above. It changes the drawing only; the heights in the list and the card stay the real ones, read from the same terrain tiles when the block was written.

How does the flyover work?

It is a fixed path of seven steps, one for each stop, a few seconds apart: the camera flies to the stop, tilted and turned to look along the trail ahead, and the trail fills in up to it. It ends at the last stop and never loops. Pause holds it where it is and Resume carries on; choosing a stop or a facing, or dragging the map, ends or pauses it. With reduced motion on, the camera jumps from stop to stop instead of flying.

Where do the trail and the figures come from, and what stays local?

The path was walked once from OpenStreetMap through a public routing service, simplified to 80 points and typed into the file, as were the stops, their heights and the climb (smoothed over 200 metres). Nothing is fetched while you use it except the map and terrain tiles, and nothing is sent or saved. Screeline is invented; check the weather and volcanic alerts before you walk it.

Can I use it without a mouse?

Yes. Every stop in the card is a button, Facing is a toggle group, Relief is a slider that takes the arrow keys, and the flyover, zoom, compass and overview are buttons. The map itself takes the arrow keys and plus and minus once focused. A polite message says where the camera is, and the relief, after each change.

How does it look on a phone?

The map comes first and the card docks under it, with the stops, the controls and the flyover in one column. Scrolling over the map scrolls the page: use two fingers to move, turn or tilt it, or hold Ctrl or ⌘ and scroll to zoom on a computer.