Documentation

OSM Buildings

Leaflet Layer

Leaflet Layer

Brings 2.5D buildings to Leaflet web maps.
Best compatibility with all systems.

Source Code Leaflet Documentation

Getting started


<link href="https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" rel="stylesheet">
<script src="https://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="https://cdn.osmbuildings.org/classic/0.2.2b/OSMBuildings-Leaflet.js"></script>

<div id="map"></div>

<script>
var map = new L.Map('map');
map.setView([52.51836, 13.40438], 16, false);


new L.TileLayer('https://tile-a.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution: '© Data <a href="https://openstreetmap.org">OpenStreetMap</a>',
maxZoom: 18,
maxNativeZoom: 20
}).addTo(map);

var osmb = new OSMBuildings(map).load('https://{s}.data.osmbuildings.org/0.2/59fcc2e8/tile/{z}/{x}/{y}.json');
</script>

Example