How do I show the Swedish basemap in MapLibre?
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.kart-api.se/v1/styles/ljus.json',
center: [18.07, 59.33], zoom: 11
});The style carries vector tiles, fonts, sprites and attribution. Map tiles don't count against the quota, so you need no key just to leave a map on screen.
Why not the default OpenStreetMap style?
Because it is global, and Sweden is a corner of it. Our style is built for Swedish surfaces: warm Apple-Maps-like tones, Swedish place names from Lantmäteriet's gazetteer in the labels, road classes that follow the Swedish road network, and a palette that stays readable on a phone in sunlight. It drives the maps in 290 local news sites, so it is polished against real readers.
Dark mode
style: 'https://api.kart-api.se/v1/styles/morker.json'Or switch on the fly with prefers-color-scheme — map.setStyle(...) keeps the camera.
Attribution
Leave MapLibre's attribution control in place. If you build your own style on our tiles you must write the sources into attribution yourself — the requirement follows the data, not the map.