From 6b330a56f4c0ec3f87842c94dc905fd93a36318d Mon Sep 17 00:00:00 2001 From: Pi Moll Date: Thu, 21 Nov 2024 10:58:14 +0100 Subject: [PATCH] Update config and themes. Reorder package.json devs --- app/package.json | 12 +- app/static/config.json | 404 +++++++++++++++++++++++++++++------------ app/static/themes.json | 120 ++++++++---- 3 files changed, 379 insertions(+), 157 deletions(-) diff --git a/app/package.json b/app/package.json index 4170017..d79cca1 100644 --- a/app/package.json +++ b/app/package.json @@ -11,21 +11,21 @@ ], "devDependencies": { "babel-loader": "^9.1.3", + "babel-plugin-transform-react-remove-prop-types": "^0.4.24", + "clean-webpack-plugin": "^4.0.0", + "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.8.1", "eslint": "^8.56.0", "eslint-plugin-react": "^7.33.2", + "html-webpack-plugin": "^5.5.4", + "react-docgen": "^5.4.3", "source-map-loader": "^4.0.1", "string-replace-loader": "^3.1.0", "style-loader": "^3.3.3", "webpack": "^5.89.0", "webpack-bundle-size-analyzer": "^3.1.0", "webpack-cli": "^5.1.4", - "webpack-dev-server": "^4.15.1", - "html-webpack-plugin": "^5.5.4", - "clean-webpack-plugin": "^4.0.0", - "copy-webpack-plugin": "^11.0.0", - "react-docgen": "^5.4.3", - "babel-plugin-transform-react-remove-prop-types": "^0.4.24" + "webpack-dev-server": "^4.15.1" }, "scripts": { "analyze": "/node_modules/webpack/bin/webpack.js --mode production --json | webpack-bundle-size-analyzer", diff --git a/app/static/config.json b/app/static/config.json index 88071eb..5bf2f7f 100644 --- a/app/static/config.json +++ b/app/static/config.json @@ -1,6 +1,16 @@ { + "searchServiceUrl": "http://localhost:8088/api/v2/search/", + "searchDataServiceUrl": "http://localhost:8088/api/v2/search/geom/", + "editServiceUrl": "http://localhost:8088/api/v1/data/", + "mapInfoService": "http://localhost:8088/api/v1/mapinfo/", + "permalinkServiceUrl": "http://localhost:8088/api/v1/permalink/", + "elevationServiceUrl": "http://localhost:8088/elevation/", + "featureReportService": "http://localhost:8088/api/v1/document/", + "authServiceUrl": "http://localhost:8088/api/v1/auth/", + "routingServiceUrl": "https://valhalla1.openstreetmap.de", "urlPositionFormat": "centerAndZoom", "urlPositionCrs": "", + "loadTranslationOverrides": false, "omitUrlParameterUpdates": false, "preserveExtentOnThemeSwitch": true, "preserveBackgroundOnThemeSwitch": true, @@ -9,16 +19,22 @@ "allowReorderingLayers": true, "preventSplittingGroupsWhenReordering": false, "allowLayerTreeSeparators": false, + "flattenLayerTreeGroups": false, "allowRemovingThemeLayers": true, "globallyDisableDockableDialogs": false, + "globallyDisableMaximizeableDialogs": false, "searchThemes": true, "allowAddingOtherThemes": true, "allowFractionalZoom": false, "localeAwareNumbers": false, + "geodesicMeasurements": true, + "trustWmsCapabilityURLs": false, "identifyTool": "Identify", "wmsDpi": 96, "wmsHidpi": false, + "wmsMaxGetUrlLength": 2048, "qgisServerVersion": 3, + "defaultColorScheme": "default", "username": "admin", "defaultFeatureStyle": { "strokeColor": [0, 0, 255, 1], @@ -34,89 +50,43 @@ {"label": "Swisstopo WMTS", "value": "https://wmts10.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml"} ], "projections": [ + { + "code": "EPSG:32632", + "proj": "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs", + "label": "WGS 84 / UTM zone 32N" + }, + { + "code": "EPSG:21781", + "proj": "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs", + "label": "CH1903 / LV03" + }, { "code": "EPSG:2056", "proj": "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs", "label": "CH1903+ / LV95" + }, + { + "code": "EPSG:25832", + "proj": "+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + "label": "ETRS89 / UTM 32N" + }, + { + "code": "EPSG:31983", + "proj": "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", + "label": "SIRGAS 2000 / UTM zone 23S" } ], "plugins": { - "mobile": [ - { - "name": "Map", - "cfg": { - "mapOptions": { - "zoomDuration": 250, - "enableRotation": true - }, - "toolsOptions": { - "OverviewSupport": { - "tipLabel": "Overview" - }, - "LocateSupport": { - "keepCurrentZoomLevel": true, - "startupMode": "DISABLED" - }, - "ScaleBarSupport": { - "units": "metric" - } - } - } - }, - { - "name": "BackgroundSwitcher", - "cfg": { - "position": 0 - } - }, - { - "name": "ThemeSwitcher", - "cfg": { - "collapsibleGroups": true - } - }, - { - "name": "BottomBar", - "cfg": { - "displayCoordinates": false, - "displayScales": false, - "viewertitleUrl": "http://qgis.org/", - "termsUrl": "http://qgis.org/" - } - }, - { - "name": "Print", - "cfg": { - "inlinePrintOutput": false, - "printExternalLayers": true, - "gridInitiallyEnabled": false - } - }, - { - "name": "LayerTree", - "cfg": { - "showLegendIcons": true, - "showRootEntry": true, - "showQueryableIcon": true, - "allowMapTips": true, - "allowCompare": true, - "allowImport": true, - "groupTogglesSublayers": false, - "grayUnchecked": false, - "layerInfoWindowSize": {"width": 480, "height": 400}, - "bboxDependentLegend": true, - "scaleDependentLegend": "theme" - }, - "mapClickAction": "unset" - } - ], - "desktop": [ + "common": [ { "name": "Map", "cfg": { "mapOptions": { "zoomDuration": 250, - "enableRotation": true + "enableRotation": true, + "panStepSize": 0.25, + "panPageSize": 0.1, + "constrainExtent": false }, "toolsOptions": { "OverviewSupport": { @@ -127,9 +97,6 @@ "stopFollowingOnDrag": true, "startupMode": "DISABLED" }, - "MeasurementSupport": { - "geodesic": true - }, "ScaleBarSupport": { "units": "metric" } @@ -138,14 +105,6 @@ "swipeLayerNameBlacklist": ["*_noswipe"] } }, - { - "name": "TaskButton", - "cfg": { - "position": 5, - "task": "LayerTree", - "icon": "list-alt" - } - }, { "name": "HomeButton", "cfg": { @@ -158,18 +117,6 @@ "position": 3 } }, - { - "name": "ZoomIn", - "cfg": { - "position": 2 - } - }, - { - "name": "ZoomOut", - "cfg": { - "position": 1 - } - }, { "name": "BackgroundSwitcher", "cfg": { @@ -180,11 +127,13 @@ "name": "TopBar", "cfg": { "menuItems": [ - {"key": "ThemeSwitcher", "icon": "themes"}, - {"key": "LayerTree", "icon": "layers"}, - {"key": "LayerCatalog", "icon": "catalog"}, - {"key": "Share", "icon": "share"}, - {"key": "Bookmark", "icon": "bookmark"}, + {"key": "ThemeSwitcher", "icon": "themes", "shortcut": "alt+shift+t"}, + {"key": "LayerTree", "icon": "layers", "shortcut": "alt+shift+l"}, + {"key": "MapLegend", "icon": "list-alt"}, + {"key": "LayerCatalog", "icon": "catalog", "shortcut": "alt+shift+c"}, + {"key": "FeatureSearch", "icon": "search"}, + {"key": "Share", "icon": "share", "shortcut": "alt+shift+s"}, + {"key": "Bookmark", "icon": "bookmark", "shortcut": "alt+shift+b"}, {"key": "Tools", "icon": "tools", "subitems": [ {"key": "Identify", "icon": "identify_region", "mode": "Region"}, {"key": "TimeManager", "icon": "clock"}, @@ -193,31 +142,59 @@ {"key": "Editing", "icon": "editing"}, {"key": "FeatureForm", "icon": "featureform"}, {"key": "AttributeTable", "icon": "editing"}, - {"key": "DxfExport", "icon": "dxfexport"}, - {"key": "RasterExport", "icon": "rasterexport"} + {"key": "MapExport", "icon": "rasterexport"}, + {"key": "Routing", "icon": "routing"} ]}, - {"key": "Print", "icon": "print"}, - {"key": "Help", "icon": "info"}, + {"key": "Print", "icon": "print", "shortcut": "alt+shift+p"}, + {"key": "Help", "icon": "info", "shortcut": "alt+shift+h"}, + {"key": "Settings", "icon": "cog"}, {"key": "ExternalLink", "icon": "link", "url": "http://example.com?extent=$e$", "target": "iframe"} ], - "toolbarItems": [ - {"key": "Measure", "mode": "LineString", "icon": "measure_line"}, - {"key": "Measure", "mode": "Polygon", "icon": "measure_polygon"}, - {"key": "Print", "icon": "print"}, - {"key": "Identify", "icon": "identify_region", "mode": "Region"}, - {"key": "FeatureForm", "icon": "featureform"} - ], "searchOptions": { + "allowSearchFilters": false, "minScaleDenom": 1000, - "showProviderSelection": true, - "providerSelectionAllowAll": true, "zoomToLayers": false, "showProvidersInPlaceholder": false }, "appMenuClearsTask": true, "appMenuFilterField": true, "appMenuVisibleOnStartup": false, - "logoUrl": "/" + "logoUrl": "/", + "appMenuShortcut": "alt+shift+m", + "toolbarItemsShortcutPrefix": "alt+shift" + } + }, + { + "name": "Settings", + "cfg": { + "languages": [ + { + "title": "English", + "value": "en-US" + }, + { + "title": "Deutsch", + "value": "de-CH" + }, + { + "title": "Italiano", + "value": "it-IT" + } + ], + "colorSchemes": [ + { + "titleMsgId": "colorschemes.default", + "value": "default" + }, + { + "titleMsgId": "colorschemes.highcontrast", + "value": "highcontrast" + }, + { + "titleMsgId": "colorschemes.dark", + "value": "dark" + } + ] } }, { @@ -254,7 +231,43 @@ "layerInfoWindowSize": {"width": 480, "height": 400}, "bboxDependentLegend": true, "scaleDependentLegend": "theme", - "showToggleAllLayersCheckbox": true + "showToggleAllLayersCheckbox": true, + "extraLegendParameters": "" + }, + "mapClickAction": "identify" + }, + { + "name": "Identify", + "cfg": { + "params": { + "FI_POINT_TOLERANCE": 16, + "FI_LINE_TOLERANCE": 8, + "FI_POLYGON_TOLERANCE": 4, + "feature_count": 20, + "region_feature_count": 100 + }, + "enableExport": true, + "longAttributesDisplay": "wrap", + "displayResultTree": false, + "featureInfoReturnsLayerName": true, + "clearResultsOnClose": true, + "geometry": { + "initialWidth": 480, + "initialHeight": 550, + "initialX": 0, + "initialY": 0 + } + } + }, + { + "name": "MapTip" + }, + { + "name": "Share", + "cfg": { + "showSocials": true, + "showLink": true, + "showQRCode": true }, "mapClickAction": "identify" }, @@ -263,12 +276,173 @@ "cfg": { "inlinePrintOutput": false, "printExternalLayers": true, - "gridInitiallyEnabled": false + "gridInitiallyEnabled": false, + "allowGeoPdfExport": true, + "hideAutopopulatedFields": false } }, { "name": "Help", "mapClickAction": "identify" + }, + { + "name": "MapCopyright", + "cfg": { + "showThemeCopyrightOnly": false, + "prefixCopyrightsWithLayerName": false + } + }, + { + "name": "MapExport", + "cfg": { + "dpis": [96, 300], + "exportExternalLayers": true, + "defaultFormat": "image/png", + "formatConfiguration": { + } + } + }, + { + "name": "Redlining" + }, + { + "name": "Editing", + "cfg": { + "allowCloneGeometry": true + } + }, + { + "name": "FeatureForm" + }, + { + "name": "MapCompare" + }, + { + "name": "HeightProfile", + "cfg": { + "heighProfilePrecision": 0 + } + }, + { + "name": "MapInfoTooltip", + "cfg": { + "elevationPrecision": 0, + "includeWGS84": true + } + }, + { + "name": "StartupMarker", + "cfg": { + "removeMode": "onclickonmarker" + } + }, + { + "name": "API" + }, + { + "name": "ScratchDrawing" + }, + { + "name": "LayerCatalog", + "cfg": { + "catalogUrl": "https://qwc2.sourcepole.ch/assets/catalog.json" + } + }, + { + "name": "Bookmark" + }, + { + "name": "AttributeTable" + }, + { + "name": "TimeManager", + "mapClickAction": "identify", + "cfg": { + "markerConfiguration": { + "markersAvailable": true, + "gradient": ["#f7af7d", "#eacc6e", "#fef89a", "#c5e09b", "#a3d29c", "#7cc096", "#79c8c5", "#34afce"], + "markerOffset": [0, 0], + "markerPins": true + }, + "cursorFormat": "datetime", + "dateFormat": "DD.MM.YYYY[\n]HH:mm:ss", + "defaultAnimationInterval": 1, + "defaultStepSize": 1, + "defaultStepUnit": "d", + "defaultTimelineMode": "infinite", + "stepUnits": ["s", "m", "h", "d", "M", "y", "10y", "100y"], + "defaultTimelineDisplay": "features" + } + }, + { + "name": "ProcessNotifications" + }, + { + "name": "MapLegend", + "cfg": { + "addGroupTitles": true, + "addLayerTitles": true, + "bboxDependentLegend": false, + "onlyVisibleLegend": false, + "scaleDependentLegend": false, + "extraLegendParameters": "LAYERTITLE=FALSE" + } + }, + { + "name": "Routing" + }, + { + "name": "FeatureSearch" + } + ], + "mobile": [ + { + "name": "BottomBar", + "cfg": { + "displayCoordinates": false, + "displayScales": false + } + } + ], + "desktop": [ + { + "name": "TaskButton", + "cfg": { + "position": 5, + "task": "LayerTree", + "icon": "layers" + } + }, + { + "name": "TaskButton", + "cfg": { + "position": 6, + "task": "Editing", + "icon": "editing" + } + }, + { + "name": "ZoomIn", + "cfg": { + "position": 2 + } + }, + { + "name": "ZoomOut", + "cfg": { + "position": 1 + } + }, + { + "name": "TopBar", + "cfg": { + "toolbarItems": [ + {"key": "Measure", "mode": "LineString", "icon": "measure_line"}, + {"key": "Measure", "mode": "Polygon", "icon": "measure_polygon"}, + {"key": "Print", "icon": "print"}, + {"key": "Identify", "icon": "identify_region", "mode": "Region"} + ] + } } ] } diff --git a/app/static/themes.json b/app/static/themes.json index 73fa68b..d426709 100644 --- a/app/static/themes.json +++ b/app/static/themes.json @@ -69,6 +69,7 @@ "name": "edit_demo", "title": "Edit Demo", "mutuallyExclusive": false, + "visibility": true, "sublayers": [ { "name": "edit_points", @@ -78,13 +79,17 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ - -4.16051, - -7.109603, - 77.999658, - 59.442792 + 8.540804, + 47.377738, + 8.540805, + 47.377739 ] }, "dimensions": [] @@ -97,13 +102,17 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ - -104.062275, - 20.280322, - 24.719663, - 59.367121 + 8.542115, + 47.377069, + 8.542278, + 47.377544 ] }, "dimensions": [] @@ -116,13 +125,17 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ - -179.536896, - -21.987341, - 175.711895, - 59.44345 + 8.541217, + 47.377464, + 8.541461, + 47.377751 ] }, "dimensions": [] @@ -138,6 +151,10 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ @@ -157,6 +174,10 @@ "queryable": true, "displayField": "z_name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "minScale": 0, "maxScale": 10000000, "bbox": { @@ -178,6 +199,10 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "minScale": 0, "maxScale": 5000000, "bbox": { @@ -199,6 +224,10 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ @@ -240,7 +269,8 @@ }, "labels": [ "user_text" - ] + ], + "default": false } ], "drawingOrder": [ @@ -255,6 +285,13 @@ "legendUrl": "http://qwc2.sourcepole.ch/api/v1/legend/qwc_demo?", "featureInfoUrl": "http://qwc2.sourcepole.ch/api/v1/featureinfo/qwc_demo?", "printUrl": "http://qwc2.sourcepole.ch/ows/qwc_demo?", + "themeInfoLinks": { + "title": "Info links", + "entries": [ + "example_link", + "example_link2" + ] + }, "skipEmptyFeatureAttributes": true, "editConfig": null, "thumbnail": "img/mapthumbs/default.jpg" @@ -361,9 +398,13 @@ "queryable": true, "displayField": "Name", "abstract": "TestZ", - "dataUrl": "http://qwc2.sourcepole.ch/ows/uster/bauprojekte", + "dataUrl": "www.xyz.org", "opacity": 255, "keywords": "XYZ", + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ @@ -383,6 +424,10 @@ "queryable": true, "displayField": "name", "opacity": 255, + "styles": { + "default": "default" + }, + "style": "default", "bbox": { "crs": "EPSG:4326", "bounds": [ @@ -393,23 +438,6 @@ ] }, "dimensions": [] - }, - { - "name": "PK und ÜP schwarz-weiss", - "title": "PK und ÜP schwarz-weiss", - "visibility": false, - "queryable": true, - "opacity": 255, - "bbox": { - "crs": "EPSG:4326", - "bounds": [ - -0.163874, - 44.890217, - -0.163873, - 44.890218 - ] - }, - "dimensions": [] } ], "expanded": true, @@ -445,7 +473,8 @@ "name": "map0", "width": 189, "height": 247 - } + }, + "default": false }, { "name": "A4-Quer", @@ -453,7 +482,8 @@ "name": "map0", "width": 276, "height": 159.5 - } + }, + "default": false }, { "name": "A3-Hoch", @@ -461,7 +491,8 @@ "name": "map0", "width": 276, "height": 369.5 - } + }, + "default": false }, { "name": "A3-Quer", @@ -469,7 +500,8 @@ "name": "map0", "width": 399, "height": 246.5 - } + }, + "default": false } ], "drawingOrder": [ @@ -484,6 +516,7 @@ } ], "defaultTheme": "qwc_demo", + "defaultMapCrs": "EPSG:3857", "defaultScales": [ 4000000, 2000000, @@ -520,6 +553,7 @@ "y": 10 } ], + "defaultBackgroundLayers": [], "externalLayers": [ { "name": "bauzonen", @@ -534,6 +568,20 @@ ] } ], + "themeInfoLinks": [ + { + "name": "example_link", + "title": "Example link", + "url": "https://example.com", + "target": "mydialogname" + }, + { + "name": "example_link2", + "title": "Example link 2", + "url": "https://example.com/", + "target": "_blank" + } + ], "backgroundLayers": [ { "name": "mapnik", @@ -811,4 +859,4 @@ ], "defaultWMSVersion": "1.3.0" } -} \ No newline at end of file +}