Geographic Information Systems Asked by Alexis_A on February 23, 2021
I’m trying to add a CartoDB basemap to my OpenLayers map but I can’t get it to work. Here is the code I use to declare the basemap variable:
const carto = new ol.layer.Tile({
source: new ol.source.XYZ({
url:'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
})
});
Any idea where the problem comes from?
const carto = new ol.layer.Tile({
source: new ol.source.XYZ({
url:'http://{1-4}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
})
});
Correct answer by Alexis_A on February 23, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP