Better configure Carto Basemaps (#1267)

This commit is contained in:
Paulus Schoutsen 2018-06-07 17:16:08 -04:00 committed by GitHub
parent 673f769237
commit 0ae676d9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,12 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
this.$.map.parentNode.appendChild(style); this.$.map.parentNode.appendChild(style);
map.setView([51.505, -0.09], 13); map.setView([51.505, -0.09], 13);
Leaflet.tileLayer( Leaflet.tileLayer(
'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', `https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}${Leaflet.Browser.retina ? '@2x.png' : '.png'}`,
{ {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/attributions">CARTO</a>', attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>, &copy; <a href="https://carto.com/attributions">CARTO</a>',
maxZoom: 18, subdomains: 'abcd',
minZoom: 0,
maxZoom: 20,
} }
).addTo(map); ).addTo(map);