True perspective over Curitiba. The ground is a WebGLTileLayer: tiles are
selected per frame against the camera frustum, so the far field near the horizon uses
coarser zoom levels — watch the street detail fade into district-level tiles as you
raise the pitch. The route and markers are ordinary DOM layers, kept aligned by the
same camera and billboarded so they stay upright and constant-size. Besides the
slider, you can fly the camera Mapbox-style: drag with the right pointer button
— or hold Ctrl and drag — moving vertically to tilt and horizontally
to rotate.
setPitch(deg) tilts the camera, clamped to [0, 60];
getPitch() reads it back, a pitch event fires on change,
and a pitch map option sets the initial tilt. It composes freely with
setBearing.
WebGLTileLayer is what makes the perspective correct: it
re-selects tiles every frame by descending a quadtree against the visible ground
area, so distant ground uses coarser tiles. A plain TileLayer under
pitch still renders, but at a single zoom level.
containerPointToLatLng unproject through the exact
camera — interaction is pixel-accurate at any pitch and bearing.
import {CargoMap, WebGLTileLayer, Marker, Polyline, Popup} from 'cargocanvas';