Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion confd/production.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}',
Expand Down
1 change: 1 addition & 0 deletions confd/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ env:
showDebuggerTool: true
showActiveLayersTool: true
showGeocoderTool: true
enableModelDraping: true
baseMaps: ''
defaultTerrainProviderUrl: ''
webToolsUrl: ''
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/__mocks__/confEnvShim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/common/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const InternalService: React.FC<InternalServiceProps> = ({

const svcList = (services as Services[] | undefined)?.map((service) => {
return (
<Box className="internalService">
<Box className="internalService" key={`${service.uid}-${service.name}`}>
<Box
className="statusIndicator"
style={{
Expand Down
20 changes: 20 additions & 0 deletions src/discrete-layer/views/discrete-layer-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import {
ILayerManagerMetaMapping,
GeocoderOptions,
IMapLegend,
DrapingLayerPredicate,
ICesiumImageryLayerMeta,
} from '@map-colonies/react-components';
import { getTextDirection, isRtl } from '../../common/i18n/helpers';
import { AutoDirectionBox } from '../../common/components/auto-direction-box/auto-direction-box.component';
Expand Down Expand Up @@ -78,6 +80,7 @@ import { SystemCoreInfoDialog } from '../components/system-status/system-core-in
import { JobModelType, LayerMetadataMixedUnion, LinkModelType, RecordType } from '../models';
import { IDispatchAction } from '../models/actionDispatcherStore';
import { ILayerImage } from '../models/layerImage';
import { ProductType } from '../models/ProductTypeEnum';
import { useStore } from '../models/RootStore';
import { FilterField } from '../models/RootStore.base';
import { UserAction, UserRole } from '../models/userStore';
Expand Down Expand Up @@ -1013,6 +1016,22 @@ const DiscreteLayerView: React.FC = observer(() => {
};
}, []);

const drapingLayerPredicate = useMemo<DrapingLayerPredicate | undefined>(() => {
Comment thread
EllaMartirosyan marked this conversation as resolved.
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) => {
Expand Down Expand Up @@ -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 && (
<CesiumDrawingsDataSource
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2467,10 +2467,10 @@
lodash "^4.17.21"
ngeohash "^0.6.3"

"@map-colonies/react-components@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@map-colonies/react-components/-/react-components-4.15.1.tgz#3c845ef57260b6efd323763eac3f0c3d52a9edd9"
integrity sha512-CnlsjllLnStqG5DyG+FnYmERe323VCVFC64+iQpdEG/pWnGZTybgkW6qX5tN5CZbade8hycKvvNEdOluIdpOnw==
"@map-colonies/react-components@^4.16.0":
version "4.16.0"
resolved "https://registry.yarnpkg.com/@map-colonies/react-components/-/react-components-4.16.0.tgz#52ecafb462e769cb4ce7ebcab22818018cc232d2"
integrity sha512-hXg41bO5h+heKmGNP3IFn0iNRmibskeqyFrZhs+MuQIPvKZTC53ywpDWCdjZogXOmtyJ4sxB31Cku2W2ETNs3A==
dependencies:
"@cmcleese/cesium-navigation" "^4.0.7"
"@date-io/date-fns" "^1.3.13"
Expand Down
Loading