EN · DE · FR · IT · ES
  • Products
  • Pricing
  • Documentation
  • Log in Try for free

Overlay roads and labels on aerial tiles

Use Leaflet to display OpenStreetMap roads and labels over aerial imagery of Düsseldorf in Web Mercator (EPSG:3857).

Back to web application examples

Map

What it does

The map opens at zoom level 15 over the Rhine in Düsseldorf. Leaflet draws roads and labels over the aerial imagery using transparent PNG tiles.

How it works

In our tile URL, layers.roads,labels selects both layers. To show just the labels, use layers.labels.

Leaflet loads the aerial tiles from the Geobasis NRW tile service (WMTS). The example subtracts five from the Leaflet zoom level and uses two digits for {matrix}. Zoom levels 12 to 20 correspond to tile matrices 07 to 15.

On high-density screens, Leaflet requests 512 × 512 pixel overlay tiles with hq=true and displays them at 256 × 256 CSS pixels. The aerial tiles are 256 × 256 pixels.

Code

Replace your-api-key with your public raster API key. Save the code as an HTML file and serve it from the domain registered for that key.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
    <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
    <script>
      function initMap() {
        const map = L.map('map', {
            minZoom: 12,
            maxZoom: 20,
            maxBounds: [[50.85, 6.4], [51.54, 7.68]],
            maxBoundsViscosity: 1,
        }).setView([51.2297, 6.773], 15);

        L.tileLayer('https://www.wmts.nrw.de/geobasis/wmts_nw_dop/tiles/nw_dop/EPSG_3857_16/{matrix}/{x}/{y}', {
            matrix: ({z}) => String(z - 5).padStart(2, '0'),
            maxZoom: 20,
            attribution: '<a href="https://www.bezreg-koeln.nrw.de/geobasis-nrw">Geobasis NRW</a>',
        }).addTo(map);

        const host = 'https://maps.omniscale.net/v2/your-api-key/style.default';
        L.tileLayer(host + '/layers.roads,labels/{z}/{x}/{y}.png?hq={hq}', {
            pane: 'overlayPane',
            maxZoom: 20,
            hq: L.Browser.retina,
            attribution: '© 2026 <a href="https://maps.omniscale.com/">Omniscale</a> · ' +
                    "Map data:" + ' <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> (ODbL)',
        }).addTo(map);
        map.attributionControl.setPrefix(false);
      }
    </script>

  </head>
  <body onload='initMap()'>
    <div id='map' style='height: 400px; width: 400px;'></div>
  </body>
</html>

Documentation

  • Omniscale raster API documentation
  • Leaflet documentation

Help and Service

  • Register • Log in
  • Products & Functions
  • Plans and Pricing
  • Interactive map
  • Help, Documentation & API
  • Available projections

About us

  • Legal
  • Terms and Conditions
  • Privacy

Contact details

Omniscale GmbH & Co. KG
Moltkestraße 6a
26122 Oldenburg
Germany
Go to contact form ↝

Copyright © 2026 • Omniscale, Map data: OpenStreetMap (License: ODbL)

* For business customers only. We do not enter into contracts with consumers within the meaning of Section 13 of the German Civil Code (BGB). All prices are listed excluding VAT.