CargoCanvas / Examples / GeoJSON

GeoJSON

A distribution network across Curitiba, loaded from a FeatureCollection. Points become sized circles, the delivery zone is styled from its properties, and every feature gets a popup.

What to notice

Adding data later. Construct the layer empty and call addData(geojson) whenever your fetch resolves — the styling hooks apply to the new features too.
Why the UMD build? Loading it as a classic script is what lets this page work when opened straight from disk. In an application with a bundler, install the package and import the classes instead — everything after that line is identical:
import {CargoMap, TileLayer, GeoJSON, CircleMarker, Control, DomUtil} from 'cargocanvas';