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

Switch to grayscale tiles

Select the grayscale style in the tile URL to change the background map.

Back to web application examples

Map

What it does

Leaflet displays our grayscale street map as its base layer. The roads and place names remain visible as landmarks, while a feature you add in color, such as a cycle route, stands out against the gray background.

How it works

style.grayscale selects the grayscale style on the server. Use the same XYZ coordinates and tile size as for the standard color map.

L.Browser.retina selects high-resolution grayscale tiles when the device pixel ratio is greater than 1. The attribution option supplies the credits shown on the map.

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 type='text/javascript'>
      function initMap() {
        const host = 'https://maps.omniscale.net/v2/{id}/style.grayscale/{z}/{x}/{y}.png?hq={hq}';

        const attribution = '© 2026 <a href="https://maps.omniscale.com/">Omniscale</a> · ' +
            "Map data:" + ' <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> (ODbL)';

        const map = L.map('map').setView([53.14, 8.22], 13);
        L.tileLayer(host, {
            id: 'your-api-key',
            hq: L.Browser.retina,
            attribution: attribution
        }).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.