Reputation: 113
This cite uses tiles from here, but in the initial state they are gray.
How can I fill tiles to make them look like in the example?
I use this code:
map = L.map('map', {zoomControl: false}).setView([..., ...], 15);
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"', {}).addTo(map);
Images:
needful: original - light all:
Upvotes: 1
Views: 3842
Reputation: 1478
You can use the ColorFilter plug-in with ['grayscale:100%']
.
See some Demos.
Upvotes: 2
Reputation: 19049
There are a few approaches to this problem:
The map at coinmap.org (the site mentioned in the question) uses a CSS filter (filter:saturate(4)
) on all the tiles (on the CSS selector .map .leaflet-tile-pane
)
Upvotes: 4