Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/common/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@

"active-layers.title": "Active Layers",
"active-layers.imagery": "Imagery",
"active-layers.service": "Service",
"active-layers.data": "Data",
"active-layers.3d": "3D",
"active-layers.remove": "Remove",

"geocoder-panel.show-feature-on-map": "Show on map",
Expand Down
2 changes: 2 additions & 0 deletions src/common/i18n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@

"active-layers.title": "שכבות פעילות",
"active-layers.imagery": "ראסטר",
"active-layers.service": "שירות",
"active-layers.data": "מידע",
"active-layers.3d": "תלת-מימד",
"active-layers.remove": "הסר",

"geocoder-panel.show-feature-on-map": "הראה על המפה",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,105 +181,108 @@ export const PolygonParts: React.FC = observer(() => {
const SHOW_PP_ZOOM_LEVEL = 7;

const metaPolygonParts = {
...activeLayer,
id: `virt-PP_${activeLayer?.id}`,
featureStructure: {
layerName: 'polygonParts:layer',
aliasLayerName: `${activeLayer?.productName} (${intl.formatMessage({
id: 'field-names.dem.layerPolygonParts',
})})`,
fields: [
// {
// fieldName: 'id',
// aliasFieldName: 'id',
// type: 'String',
// },
// {
// fieldName: 'catalogId',
// aliasFieldName: 'catalogId',
// type: 'String',
// },
// {
// fieldName: 'productId',
// aliasFieldName: 'productId',
// type: 'String',
// },
// {
// fieldName: 'productType',
// aliasFieldName: 'productType',
// type: 'String',
// },
{
fieldName: 'sourceId',
aliasFieldName: getFieldLabelTranslation('sourceId'),
type: 'String',
},
{
fieldName: 'sourceName',
aliasFieldName: getFieldLabelTranslation('sourceName'),
type: 'String',
},
{
fieldName: 'productVersion',
aliasFieldName: getFieldLabelTranslation('productVersion'),
type: 'String',
},
{
fieldName: 'ingestionDateUTC',
aliasFieldName: getFieldLabelTranslation('ingestionDateUTC'),
type: 'Date',
},
{
fieldName: 'imagingTimeBeginUTC',
aliasFieldName: getFieldLabelTranslation('imagingTimeBeginUTC'),
type: 'Date',
},
{
fieldName: 'imagingTimeEndUTC',
aliasFieldName: getFieldLabelTranslation('imagingTimeEndUTC'),
type: 'Date',
},
{
fieldName: 'resolutionDegree',
aliasFieldName: getFieldLabelTranslation('resolutionDegree'),
type: 'Number',
},
{
fieldName: 'resolutionMeter',
aliasFieldName: getFieldLabelTranslation('resolutionMeter'),
type: 'Number',
},
{
fieldName: 'sourceResolutionMeter',
aliasFieldName: getFieldLabelTranslation('sourceResolutionMeter'),
type: 'Number',
},
{
fieldName: 'horizontalAccuracyCe90',
aliasFieldName: getFieldLabelTranslation('horizontalAccuracyCe90'),
type: 'Number',
},
{
fieldName: 'sensors',
aliasFieldName: getFieldLabelTranslation('sensors'),
type: 'String',
},
{
fieldName: 'countries',
aliasFieldName: getFieldLabelTranslation('countries'),
type: 'String',
},
{
fieldName: 'cities',
aliasFieldName: getFieldLabelTranslation('cities'),
type: 'String',
},
{
fieldName: '_description',
aliasFieldName: getFieldLabelTranslation('description'),
type: 'String',
},
],
layerRecord: {
...activeLayer,
id: `virt-PP_${activeLayer?.id}`,
featureStructure: {
layerName: 'polygonParts:layer',
aliasLayerName: `${activeLayer?.productName} (${intl.formatMessage({
id: 'field-names.dem.layerPolygonParts',
})})`,
fields: [
// {
// fieldName: 'id',
// aliasFieldName: 'id',
// type: 'String',
// },
// {
// fieldName: 'catalogId',
// aliasFieldName: 'catalogId',
// type: 'String',
// },
// {
// fieldName: 'productId',
// aliasFieldName: 'productId',
// type: 'String',
// },
// {
// fieldName: 'productType',
// aliasFieldName: 'productType',
// type: 'String',
// },
{
fieldName: 'sourceId',
aliasFieldName: getFieldLabelTranslation('sourceId'),
type: 'String',
},
{
fieldName: 'sourceName',
aliasFieldName: getFieldLabelTranslation('sourceName'),
type: 'String',
},
{
fieldName: 'productVersion',
aliasFieldName: getFieldLabelTranslation('productVersion'),
type: 'String',
},
{
fieldName: 'ingestionDateUTC',
aliasFieldName: getFieldLabelTranslation('ingestionDateUTC'),
type: 'Date',
},
{
fieldName: 'imagingTimeBeginUTC',
aliasFieldName: getFieldLabelTranslation('imagingTimeBeginUTC'),
type: 'Date',
},
{
fieldName: 'imagingTimeEndUTC',
aliasFieldName: getFieldLabelTranslation('imagingTimeEndUTC'),
type: 'Date',
},
{
fieldName: 'resolutionDegree',
aliasFieldName: getFieldLabelTranslation('resolutionDegree'),
type: 'Number',
},
{
fieldName: 'resolutionMeter',
aliasFieldName: getFieldLabelTranslation('resolutionMeter'),
type: 'Number',
},
{
fieldName: 'sourceResolutionMeter',
aliasFieldName: getFieldLabelTranslation('sourceResolutionMeter'),
type: 'Number',
},
{
fieldName: 'horizontalAccuracyCe90',
aliasFieldName: getFieldLabelTranslation('horizontalAccuracyCe90'),
type: 'Number',
},
{
fieldName: 'sensors',
aliasFieldName: getFieldLabelTranslation('sensors'),
type: 'String',
},
{
fieldName: 'countries',
aliasFieldName: getFieldLabelTranslation('countries'),
type: 'String',
},
{
fieldName: 'cities',
aliasFieldName: getFieldLabelTranslation('cities'),
type: 'String',
},
{
fieldName: '_description',
aliasFieldName: getFieldLabelTranslation('description'),
type: 'String',
},
],
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
CesiumWFSLayer,
CesiumWMTSLayer,
CesiumXYZLayer,
getImageryProviderUrl,

Check failure on line 10 in src/discrete-layer/components/map-container/selected-layers-container.tsx

View workflow job for this annotation

GitHub Actions / build_and_test

Module '"@map-colonies/react-components"' has no exported member 'getImageryProviderUrl'.
ICesiumImageryLayer,
isBaseMapLayer,

Check failure on line 12 in src/discrete-layer/components/map-container/selected-layers-container.tsx

View workflow job for this annotation

GitHub Actions / build_and_test

Module '"@map-colonies/react-components"' has no exported member 'isBaseMapLayer'.
useCesiumMap,
} from '@map-colonies/react-components';
import CONFIG from '../../../common/config';
Expand Down Expand Up @@ -37,6 +39,13 @@
const cacheRef = useRef({} as CacheMap);
const mapViewer = useCesiumMap();

const getUrlWithoutQueryParams = (url?: string): string | undefined => {
if (!url) {
return undefined;
}
return url.split('?')[0];
};

useEffect(() => {
if (store.discreteLayersStore.layersImages) {
setlayersImages(
Expand Down Expand Up @@ -69,11 +78,14 @@
const correctLinkByProtocol = (layer.links as LinkModelType[]).find(
(link) => link.protocol === layerLink.protocol
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return (
correctLinkByProtocol?.url ===
(cesiumLayer as any)._imageryProvider._resource._url
const linkUrl = getUrlWithoutQueryParams(correctLinkByProtocol?.url);
const cesiumLayerLinkUrl = getUrlWithoutQueryParams(
getImageryProviderUrl(cesiumLayer)
);
if (!linkUrl || !cesiumLayerLinkUrl) {
return false;
}
return linkUrl === cesiumLayerLinkUrl;
}) as SearchLayerPredicate,
layerRecord: {
...layer,
Expand All @@ -100,6 +112,10 @@
layerLink.url as string,
(layer as Layer3DRecordModelType).productVersion as string
)}
meta={{

Check failure on line 115 in src/discrete-layer/components/map-container/selected-layers-container.tsx

View workflow job for this annotation

GitHub Actions / build_and_test

Type '{ maximumScreenSpaceError: number; cullRequestsWhileMovingMultiplier: number; preloadFlightDestinations: true; preferLeaves: true; skipLevelOfDetail: true; key: string; url: CesiumResource; meta: { ...; }; }' is not assignable to type 'IntrinsicAttributes & RCesium3DTilesetProps'.
id: layer.id,
layerRecord: { ...layer },
}}
/>
);
case LinkType.WMTS_LAYER:
Expand All @@ -120,14 +136,17 @@
meta={{
id: layer.id,
searchLayerPredicate: ((cesiumLayer, idx) => {
const linkUrl = (optionsWMTS.url as Record<string, any>)._url as string;
const cesiumLayerLinkUrl = get(
cesiumLayer,
'_imageryProvider._resource._url'
) as string;
const isBaseLayer = get(cesiumLayer, 'meta.parentBasetMapId') as string;
const linkUrl = getUrlWithoutQueryParams(
get(optionsWMTS, 'url._url') as string | undefined
);
const cesiumLayerLinkUrl = getUrlWithoutQueryParams(
getImageryProviderUrl(cesiumLayer)
);
if (!linkUrl || !cesiumLayerLinkUrl) {
return false;
}
const isLayerFound =
linkUrl.split('?')[0] === cesiumLayerLinkUrl.split('?')[0] && !isBaseLayer;
linkUrl === cesiumLayerLinkUrl && !isBaseMapLayer(cesiumLayer.meta);
return isLayerFound;
}) as SearchLayerPredicate,
layerRecord: {
Expand All @@ -154,7 +173,7 @@
<CesiumWFSLayer
key={layer.id}
options={options}
meta={layer as unknown as Record<string, unknown>}
meta={{ id: layer.id, layerRecord: { ...layer } }}
withGeometryValidation={true}
/>
);
Expand Down
6 changes: 6 additions & 0 deletions src/discrete-layer/views/discrete-layer-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@
NO_DATA_LAYERS: intl.formatMessage({ id: 'debug-panel.empty' }),
ACTIVE_LAYERS_TITLE: intl.formatMessage({ id: 'active-layers.title' }),
IMAGERY: intl.formatMessage({ id: 'active-layers.imagery' }),
SERVICE: intl.formatMessage({ id: 'active-layers.service' }),
DATA: intl.formatMessage({ id: 'active-layers.data' }),
'3D': intl.formatMessage({ id: 'active-layers.3d' }),
FLY_TO: intl.formatMessage({ id: 'action.flyTo.tooltip' }),
REMOVE: intl.formatMessage({ id: 'active-layers.remove' }),
BASE_MAP_TITLE: intl.formatMessage({ id: 'map-settings.base-map.title' }),
Expand Down Expand Up @@ -1336,7 +1338,11 @@
imageryProvider={false}
locale={mapSettingsLocale}
baseMaps={store.discreteLayersStore.baseMaps}
layerManagerLayerIdMetaFieldPath={'id'}

Check failure on line 1341 in src/discrete-layer/views/discrete-layer-view.tsx

View workflow job for this annotation

GitHub Actions / build_and_test

Type '{ children: (false | Element | undefined)[]; geocoderPanel?: { baseUrl: any; endPoint: string; method: "GET"; params: { dynamic: { queryText: string; geoContext: { name: string; relatedParams: [...][]; }; }; static: [...][]; }; title: string; callbackFunc: (data: Feature<...>, options: GeocoderOptions, i: number) =>...' is not assignable to type 'IntrinsicAttributes & CesiumMapProps'.
layerManagerLayerNameMetaFieldPath={'layerRecord.productName'}
layerManagerFootprintMetaFieldPath={'layerRecord.footprint'}
layerManagerDataLayerNameMetaFieldPath={'layerRecord.featureStructure.aliasLayerName'}
layerManagerDataLayerFieldsMetaFieldPath={'layerRecord.featureStructure.fields'}
// @ts-ignore
imageryContextMenu={<ContextMenuByTab />}
imageryContextMenuSize={contextMenuSizeByTab}
Expand Down
Loading