This cite使用tile from here,但在初始状态下它们是灰色的 .
如何填充瓷砖以使它们在示例中看起来像?
我用这个代码:
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:
需要:
原创 - 全部点亮:
1 回答
有几种方法可以解决这个问题:
搜索提供所需颜色方案的其他tile provider
creating your own rendering style后
Serve your own tiles
更改瓷砖的饱和度on the client side using 2d canvas
替换瓷砖中的颜色on the client side using 2d canvas
将CSS colour filters应用于图块(specifying a CSS class name for the tilelayer)
更改饱和度并替换瓷砖中的颜色on the client side using WebGL
coinmap.org上的 Map (问题中提到的网站)在所有图块上使用CSS过滤器(
filter:saturate(4)
)(在CSS选择器.map .leaflet-tile-pane
上)