Select the grayscale style in the tile URL to change the background map.
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.
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.
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>