diff --git a/confd/production.tmpl b/confd/production.tmpl index 544713f52..625c301d0 100644 --- a/confd/production.tmpl +++ b/confd/production.tmpl @@ -28,9 +28,10 @@ window._env_ = { center: {{ getv "/configuration/map/center" "[34.811, 31.908]" }}, zoom: {{ getv "/configuration/map/zoom" "14" }}, mapMode2D: '{{ getv "/configuration/map/mapmode2d" "INFINITE_SCROLL" }}', - showDebuggerTool: {{ getv "/configuration/map/show/debugger/tool" "false" }}, + showDebuggerTool: {{ getv "/configuration/map/show/debugger/tool" "true" }}, showActiveLayersTool: {{ getv "/configuration/map/show/active/layers/tool" "true" }}, showGeocoderTool: {{ getv "/configuration/map/show/geocoder/tool" "true" }}, + enableModelDraping: {{ getv "/configuration/map/enable/model/draping" "true" }}, }, LOGGER: { level: '{{ getv "/configuration/logger/level" "warn" }}', diff --git a/confd/production.toml b/confd/production.toml index 5a05544bc..1a06f350a 100644 --- a/confd/production.toml +++ b/confd/production.toml @@ -29,6 +29,7 @@ keys = [ "/configuration/map/show/debugger/tool", "/configuration/map/show/active/layers/tool", "/configuration/map/show/geocoder/tool", + "/configuration/map/enable/model/draping", "/configuration/logger/http/host", "/configuration/logger/http/port", "/configuration/logger/http/path", diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml index 265839391..f0cb25132 100644 --- a/helm/templates/configmap.yaml +++ b/helm/templates/configmap.yaml @@ -48,6 +48,7 @@ CONFIGURATION_MAP_SHOW_DEBUGGER_TOOL: {{ quote .Values.env.map.showDebuggerTool }} CONFIGURATION_MAP_SHOW_ACTIVE_LAYERS_TOOL: {{ quote .Values.env.map.showActiveLayersTool }} CONFIGURATION_MAP_SHOW_GEOCODER_TOOL: {{ quote .Values.env.map.showGeocoderTool }} + CONFIGURATION_MAP_ENABLE_MODEL_DRAPING: {{ quote .Values.env.map.enableModelDraping }} CONFIGURATION_BASEMAPS: {{ quote .Values.env.baseMaps }} CONFIGURATION_DEFAULT_TERRAIN_PROVIDER_URL: {{ quote .Values.env.defaultTerrainProviderUrl }} CONFIGURATION_WEB_TOOLS_URL: {{ quote .Values.env.webToolsUrl }} diff --git a/helm/values.yaml b/helm/values.yaml index bad3d1bd8..253d1f43c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -141,6 +141,7 @@ env: showDebuggerTool: true showActiveLayersTool: true showGeocoderTool: true + enableModelDraping: true baseMaps: '' defaultTerrainProviderUrl: '' webToolsUrl: '' diff --git a/package.json b/package.json index 6b1bb476d..53c704f5b 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@formatjs/icu-messageformat-parser": "^2.6.0", "@map-colonies/error-types": "^1.1.5", "@map-colonies/mc-utils": "^1.6.1", - "@map-colonies/react-components": "4.15.1", + "@map-colonies/react-components": "^4.16.0", "@map-colonies/react-core": "^4.2.1", "@map-colonies/static-assets": "^0.5.1", "@map-colonies/types": "1.6.0", diff --git a/src/__mocks__/confEnvShim.js b/src/__mocks__/confEnvShim.js index d96394c57..6bdccf136 100644 --- a/src/__mocks__/confEnvShim.js +++ b/src/__mocks__/confEnvShim.js @@ -32,9 +32,10 @@ if (!window._env_) { center: [34.811, 31.908], zoom: 14, mapMode2D: 'ROTATE', - showDebuggerTool: false, + showDebuggerTool: true, showActiveLayersTool: true, showGeocoderTool: true, + enableModelDraping: true, }, LOGGER: { level: 'warn', diff --git a/src/common/config/index.ts b/src/common/config/index.ts index 7b141f220..5f679a72b 100644 --- a/src/common/config/index.ts +++ b/src/common/config/index.ts @@ -155,6 +155,7 @@ const APP_CONFIG = { SHOW_DEBUGGER_TOOL: MAP.showDebuggerTool, SHOW_ACTIVE_LAYERS_TOOL: MAP.showActiveLayersTool, SHOW_GEOCODER_TOOL: MAP.showGeocoderTool, + ENABLE_MODEL_DRAPING: MAP.enableModelDraping, }, ACTIVE_LAYER: ACTIVE_LAYER, // | 'WMTS_LAYER' | 'WMS_LAYER' | 'XYZ_LAYER' | 'OSM_LAYER' ACTIVE_LAYER_PROPERTIES: ACTIVE_LAYER_PROPERTIES, diff --git a/src/discrete-layer/components/system-status/system-core-info/internal-service/internal-service.tsx b/src/discrete-layer/components/system-status/system-core-info/internal-service/internal-service.tsx index bf447ea90..06cbecd99 100644 --- a/src/discrete-layer/components/system-status/system-core-info/internal-service/internal-service.tsx +++ b/src/discrete-layer/components/system-status/system-core-info/internal-service/internal-service.tsx @@ -22,7 +22,7 @@ export const InternalService: React.FC = ({ const svcList = (services as Services[] | undefined)?.map((service) => { return ( - + { }; }, []); + const drapingLayerPredicate = useMemo(() => { + if (!CONFIG.MAP.ENABLE_MODEL_DRAPING) { + return undefined; + } + return (layerMeta: ICesiumImageryLayerMeta): boolean => { + const productType = get(layerMeta, 'layerRecord.productType'); + if ( + productType === ProductType.RASTER_VECTOR || + productType === ProductType.RASTER_VECTOR_BEST + ) { + return true; + } + return layerMeta.shouldBeUsedInModelDraping === true; + }; + }, []); + const site = useMemo(() => currentSite(), []); const triggerCallbackFunc = (data: Feature, options: GeocoderOptions, i: number) => { @@ -1368,6 +1387,7 @@ const DiscreteLayerView: React.FC = observer(() => { showDebuggerTool={CONFIG.MAP.SHOW_DEBUGGER_TOOL === true && isAdminUser} showActiveLayersTool={CONFIG.MAP.SHOW_ACTIVE_LAYERS_TOOL} {...(CONFIG.MAP.SHOW_GEOCODER_TOOL ? { geocoderPanel: GEOCODER_OPTIONS } : {})} + {...(drapingLayerPredicate !== undefined ? { drapingLayerPredicate } : {})} > {activeTabView !== TabViews.EXPORT_LAYER && (