From 7d4dd37a7a6a0b177b89cd25ed14efbcf7f4e255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 13 Nov 2024 09:00:36 +0100 Subject: [PATCH] continue --- .python-version | 2 +- docker-compose-lib.yaml | 2 ++ mapserver/mapserver.map.tmpl | 9 +++---- tests/test_app.py | 12 +++++++++- ui/src/interfaces/ControllerDesktop.ts | 33 +++++++++++++++++++------- 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.python-version b/.python-version index 24ee5b1be..e4fba2183 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.13 +3.12 diff --git a/docker-compose-lib.yaml b/docker-compose-lib.yaml index 138196303..2e6853f8e 100644 --- a/docker-compose-lib.yaml +++ b/docker-compose-lib.yaml @@ -145,6 +145,8 @@ services: - QGIS_SERVER_API_WFS3_MAX_LIMIT - QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES - QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE + ports: + - 8091:8080 tinyows: image: camptocamp/tinyows:master diff --git a/mapserver/mapserver.map.tmpl b/mapserver/mapserver.map.tmpl index aec335511..794614e7c 100644 --- a/mapserver/mapserver.map.tmpl +++ b/mapserver/mapserver.map.tmpl @@ -69,14 +69,11 @@ MAP END WEB METADATA - "wms_title" "GeoMapFish demo" - "wms_abstract" "Some example layers" + "ows_enable_request" "*" + "ows_title" "GeoMapFish demo" + "ows_abstract" "Some example layers" "ows_srs" "EPSG:2056" - "wms_enable_request" "*" - "wfs_enable_request" "*" "wms_allow_getmap_without_styles" "true" - "ows_title" "GeoMapFish demo" - "oga_enable_request" "*" "oga_onlineresource" "${VISIBLE_WEB_PROTOCOL}://${VISIBLE_WEB_HOST}${VISIBLE_ENTRY_POINT}mapserv_proxy/mapserver/MainPNG/ogcapi" END END diff --git a/tests/test_app.py b/tests/test_app.py index fa124e97f..e72e7a35c 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -15,7 +15,17 @@ ("https://front/c2c/health_check", {}, 2), ("https://front/c2c/health_check", {"max_level": "1"}, 2), ("https://front/c2c/health_check", {"checker": "check_collector"}, 2), - ("http://mapserver:8080/mapserv_proxy", {"SERVICE": "WMS", "REQUEST": "GetCapabilities"}, 60), + ( + "http://mapserver:8080/mapserv_proxy/mapserver/", + {"SERVICE": "WMS", "REQUEST": "GetCapabilities", "MAP": "MainPNG"}, + 60, + ), + ( + "http://qgisserver:8080/mapserv_proxy/", + {"SERVICE": "WMS", "REQUEST": "GetCapabilities", "MAP": "/etc/qgisserver/project.qgs"}, + 60, + ), + # TODO adapt ( "https://front/mapserv_proxy", {"ogcserver": "Main PNG", "SERVICE": "WMS", "REQUEST": "GetCapabilities"}, diff --git a/ui/src/interfaces/ControllerDesktop.ts b/ui/src/interfaces/ControllerDesktop.ts index 347eabbe9..ecabc54d4 100644 --- a/ui/src/interfaces/ControllerDesktop.ts +++ b/ui/src/interfaces/ControllerDesktop.ts @@ -57,18 +57,35 @@ class Controller extends AbstractDesktopController { this.dimensions.FLOOR = '*'; } - const baseUrl = 'https://localhost:8090/mapserv_proxy/mapserver/MainPNG/ogcapi'; - const ogcAPIManager = new OgcApiEndpoint(baseUrl); + // const baseUrl = 'http://localhost:8090/mapserv_proxy/mapserver/MainPNG/ogcapi'; + // const ogcAPIManager = new OgcApiEndpoint(baseUrl); + // + // // features in the bbox + // const bbox: [number, number, number, number] = [-6.8824, 58.1736, -6.7937, 58.2042]; + // ogcAPIManager.getCollectionItems('osm_open', 100, 0, false, undefined, bbox).then((features) => { + // console.log(features); + // }); - // features in the bbox - const bbox: [number, number, number, number] = [-6.8824, 58.1736, -6.7937, 58.2042]; - ogcAPIManager.getCollectionItems('osm_open', 100, 0, false, undefined, bbox).then((features) => { - console.log(features); - }); + // MapServer route: /mapserv_proxy/mapserver//ogcapi/* + fetch( + 'https://localhost:8484/mapserv_proxy/mapserver//ogcapi/collections//items?bbox=6.0,46.0,7.0,47.0&limit=100&offset=0', + ); + fetch( + 'http://localhost:8090/mapserv_proxy/mapserver/MainPNG/ogcapi/collections/osm_open/items?bbox=6.0,46.0,7.0,47.0&limit=100&offset=0&ogcserver=MainPNG', + ); + // QGISServer route: /mapserv_proxy//wfs3/* fetch( - 'https://localhost:8484/mapserv_proxy/Main%20PNG/osm-open/?bbox=-6.8824,58.1736,-6.7937,58.2042&limit=100&offset=0', + 'https://localhost:8484/mapserv_proxy//wfs3/collections/