Skip to content
Snippets Groups Projects

feat: Add test page (spatial) with mapserver layer in openlayers map

Merged Lene Wasskog requested to merge feature/gridv-6-mapserver-layer into develop
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
@@ -24,9 +24,9 @@
/* ----------------------- Global elements ------------------- */
var map;
var maxMapZoom = 10;
var carrotLayer;
/**
* Initializes the spatial map
@@ -35,6 +35,8 @@ var carrotLayer;
* @param {string} mapAttribution - The text in the corner of the map giving credits where it's due
*/
function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) {
var map;
var carrotLayer;
var featureInfo = document.getElementById(mapId + "Info");
@@ -58,7 +60,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) {
// Create wms source
var carrotLayerSource = new ol.source.ImageWMS({
url: 'https://testvips.nibio.no/cgi-bin/PSILARTEMP',
params: { 'LAYERS': 'PSILARTEMP_LAYER', 'TRANSPARENT': 'TRUE' },
params: { 'LAYERS': 'PSILARTEMP_' + (mapId=="mapToday" ? "TODAY":"TOMORROW"), 'TRANSPARENT': 'TRUE' },
serverType: 'mapserver',
ratio: 1,
projection: ol.proj.get('EPSG:25833')
Loading