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
2 files
+ 7
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -34,7 +34,7 @@ var carrotLayer;
@@ -34,7 +34,7 @@ var carrotLayer;
* @param {int} zoom - the zoom level (1-15, 1 is world wide view, 15 is greatest zoom)
* @param {int} zoom - the zoom level (1-15, 1 is world wide view, 15 is greatest zoom)
* @param {string} mapAttribution - The text in the corner of the map giving credits where it's due
* @param {string} mapAttribution - The text in the corner of the map giving credits where it's due
*/
*/
function initSpatialMap(lonLat, zoomLevel, mapAttribution) {
function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) {
// ---------- Background layer is OpenStreetMap --------------
// ---------- Background layer is OpenStreetMap --------------
var backgroundLayer = new ol.layer.Tile({
var backgroundLayer = new ol.layer.Tile({
@@ -69,7 +69,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution) {
@@ -69,7 +69,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution) {
// Creating the map
// Creating the map
map = new ol.Map({
map = new ol.Map({
target: 'map',
target: mapId,
layers: [backgroundLayer, carrotLayer],
layers: [backgroundLayer, carrotLayer],
renderer: 'canvas'
renderer: 'canvas'
});
});
Loading