var view = new ol.View({
projection: 'EPSG:4326',
center: [10.70, 36.50],
zoom: 5,
});
var view_ov = new ol.View({
projection: 'EPSG:4326',
center: [10.70, 36.50],
zoom: 7,
});
var base_maps = new ol.layer.Group({
'title': 'Base maps',
layers: [
new ol.layer.Tile({
title: 'Satellite',
type: 'base',
visible: true,
source: new ol.source.XYZ({
attributions: ['Powered by Esri',
'Source: Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community'
],
attributionsCollapsible: false,
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
maxZoom: 23
})
}),
new ol.layer.Tile({
title: 'OSM',
type: 'base',
visible: true,
source: new ol.source.OSM()
})
]
});
var OSM = new ol.layer.Tile({
source: new ol.source.OSM(),
type: 'base',
title: 'OSM',
});
overlays = new ol.layer.Group({
'title': 'Overlays',
layers: []
});
var secteurs = new ol.layer.Image({
title: 'secteurs',
extent: [-180, -90, -180, 90],
source: new ol.source.ImageWMS({
url: 'http://localhost:8080/geoserver/wms',
params: {
'LAYERS': 'cc:batiment'
},
ratio: 1,
serverType: 'geoserver',
visible: true,
})
});
map = new ol.Map({
target: 'map',
view: view,
});
map.addLayer(base_maps);
map.addLayer(overlays);
overlays.getLayers().push(secteurs);
enter image description here
I tried changing the map visibility
tried changing its position in the code so the “secteurs” layer is added after the base map layers and any other overlay layers
ps: I can add it wfs?request=getCapabilities and it works properly
console log :
Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
Deprecated Feature Used