From c031485e005ef89e7518632aad33e4185b111e66 Mon Sep 17 00:00:00 2001 From: raitis Date: Thu, 3 Mar 2022 11:14:31 +0200 Subject: [PATCH] feat: Demo of multiple hslayers-apps --- full/appexternal.js | 21 ++++++++++++++++++++- full/index_external.html | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/full/appexternal.js b/full/appexternal.js index 24c18d3..cffc786 100644 --- a/full/appexternal.js +++ b/full/appexternal.js @@ -1,6 +1,9 @@ -function hslayersNgConfig(ol) { +function hslayersNgConfig(ol, appId) { return { assetsPath: '../node_modules/hslayers-ng-app/assets/', + proxyPrefix: window.location.hostname.includes('localhost') + ? `${window.location.protocol}//${window.location.hostname}:8085/` + : '/proxy/', default_layers: [ new ol.layer.Tile({ source: new ol.source.OSM(), @@ -9,6 +12,22 @@ function hslayersNgConfig(ol) { visible: true, removable: false, }), + appId == 'app-2' + ? new ol.layer.Tile({ + properties: { + title: 'Latvian municipalities (parent layer)', + }, + source: new ol.source.TileWMS({ + url: 'https://lvmgeoserver.lvm.lv/geoserver/ows', + params: { + LAYERS: 'publicwfs:LV_admin_vienibas', + INFO_FORMAT: undefined, + FORMAT: 'image/png; mode=8bit', + }, + crossOrigin: 'anonymous', + }), + }) + : undefined, ], default_view: new ol.View({ diff --git a/full/index_external.html b/full/index_external.html index e29ab37..4a29f45 100644 --- a/full/index_external.html +++ b/full/index_external.html @@ -16,5 +16,6 @@ +