A map, a tile layer and a marker with a popup — the smallest useful map you can build. Centred on Praça Tiradentes, Curitiba.
[latitude, longitude]. Latitude first — the opposite
of GeoJSON's ordering.
new Marker(…), never
marker(…). Every class is a named export of the
cargocanvas module.
addTo(map) returns the layer, so calls chain. Here it chains straight
into openPopup().
#map has a height. A
<div> with no height is zero pixels tall and will render nothing,
with no error in the console.
This page is standalone — use View Source to read the whole thing, or copy
the file out of landing/examples/ and adjust the two paths in the
<head>.
import {CargoMap, TileLayer, Marker} from 'cargocanvas';