1 year ago
#380771
LG3
Add EMODnet Bathymetry layer on the map
I have been testing OpenLayers and got already some layers working. Now I would like to add sea depths layer on the map. However following their example does not show any layers. Am I doing something wrong?
I have successfully added satellite layer using this code:
var satelliteLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
maxZoom: 19
})
});
After that I am just performing this map.addLayer(satelliteLayer);
Following EMODnet Bathymetry example, I have added this one:
var seaDepthLayer = new ol.layer.Image({
extent: [-36, 25, 43, 85],
source: new ol.source.ImageWMS({
url: 'https://ows.emodnet-bathymetry.eu/wms',
// refer to the section layer name to find the name of the layer
params: { 'LAYERS': 'mean_atlas_land' }
})
});
Adding their layer in addition to others does not produce any change in my existing maps:
map.addLayer(vectorLayer);
map.addLayer(seaDepthLayer);
map.addLayer(nauticLayer);
javascript
openlayers
0 Answers
Your Answer