Co-authored-by: Cledwyn Lew <me@trangle.top>
This commit is contained in:
co-authored by
Cledwyn Lew
parent
4ac248a512
commit
0a104cc0ed
@@ -45,10 +45,11 @@ export const carto: MapLayerRegistryItem<CartoConfig> = {
|
||||
} else {
|
||||
style += '_nolabels';
|
||||
}
|
||||
const scale = window.devicePixelRatio > 1 ? '@2x' : '';
|
||||
return new TileLayer({
|
||||
source: new XYZ({
|
||||
attributions: `<a href="https://carto.com/attribution/">©CARTO</a> <a href="https://www.openstreetmap.org/copyright">©OpenStreetMap</a> contributors`,
|
||||
url: `https://{1-4}.basemaps.cartocdn.com/${style}/{z}/{x}/{y}.png`,
|
||||
url: `https://{1-4}.basemaps.cartocdn.com/${style}/{z}/{x}/{y}${scale}.png`,
|
||||
}),
|
||||
});
|
||||
},
|
||||
|
||||
@@ -99,7 +99,7 @@ export const getNewOpenLayersMap = (panel: GeomapPanel, options: Options, div: H
|
||||
const view = panel.initMapView(options.view);
|
||||
return (panel.map = new OpenLayersMap({
|
||||
view: view,
|
||||
pixelRatio: 1, // or zoom?
|
||||
pixelRatio: window.devicePixelRatio, // or zoom?
|
||||
layers: [], // loaded explicitly below
|
||||
controls: [],
|
||||
target: div,
|
||||
|
||||
Reference in New Issue
Block a user