i.color)
- .join(',')})`,
+ backgroundImage: `linear-gradient(to right, ${items.map((i) => i.color).join(',')})`,
}}
/>
- {items.items
+ {items
.filter(({ value }) => typeof value !== 'undefined' && value !== null)
.map(({ value }) => (
-
@@ -82,8 +99,8 @@ const LegendItems: FC = ({ items }) => {
);
default:
- return null;
+ return LEGEND_ITEM_COMPONENT;
}
};
-export default LegendItems;
+export default LegendItem;
diff --git a/frontend/src/containers/data-tool/content/map/sync-settings.ts b/frontend/src/containers/data-tool/content/map/sync-settings.ts
index e4f849c8..c16e0691 100644
--- a/frontend/src/containers/data-tool/content/map/sync-settings.ts
+++ b/frontend/src/containers/data-tool/content/map/sync-settings.ts
@@ -7,8 +7,10 @@ import { LayerSettings } from '@/types/layers';
const DEFAULT_SYNC_MAP_SETTINGS: {
bbox: LngLatBoundsLike;
+ labels: boolean;
} = {
bbox: null,
+ labels: true,
};
export const useSyncMapSettings = () => {
diff --git a/frontend/src/lib/json-converter/index.ts b/frontend/src/lib/json-converter/index.ts
index 5278e6fb..ce589aa4 100644
--- a/frontend/src/lib/json-converter/index.ts
+++ b/frontend/src/lib/json-converter/index.ts
@@ -8,6 +8,7 @@ import { JSONConfiguration, JSONConverter } from '@deck.gl/json/typed';
// LegendTypeChoropleth,
// LegendTypeGradient,
// } from '@/components/map/legend/item-types';
+import EEZLayerLegend from '@/containers/data-tool/content/map/layers-toolbox/legend/eez';
import EEZLayerPopup from '@/containers/data-tool/content/map/popup/eez';
import FUNCTIONS from '@/lib/utils';
import { ParamsConfig } from '@/types/layers';
@@ -24,6 +25,7 @@ export const JSON_CONFIGURATION = new JSONConfiguration({
enumerations: {},
reactComponents: {
EEZLayerPopup,
+ EEZLayerLegend,
// LegendTypeBasic,
// LegendTypeChoropleth,
// LegendTypeGradient,
diff --git a/frontend/src/styles/icons/arrow-down.svg b/frontend/src/styles/icons/arrow-down.svg
new file mode 100644
index 00000000..7bdae50a
--- /dev/null
+++ b/frontend/src/styles/icons/arrow-down.svg
@@ -0,0 +1,4 @@
+
diff --git a/frontend/src/styles/icons/arrow-top.svg b/frontend/src/styles/icons/arrow-top.svg
new file mode 100644
index 00000000..51f08c15
--- /dev/null
+++ b/frontend/src/styles/icons/arrow-top.svg
@@ -0,0 +1,4 @@
+
diff --git a/frontend/src/styles/icons/close.svg b/frontend/src/styles/icons/close.svg
new file mode 100644
index 00000000..e0c139e6
--- /dev/null
+++ b/frontend/src/styles/icons/close.svg
@@ -0,0 +1,6 @@
+
diff --git a/frontend/src/styles/icons/eez.svg b/frontend/src/styles/icons/eez.svg
new file mode 100644
index 00000000..60bf1bd8
--- /dev/null
+++ b/frontend/src/styles/icons/eez.svg
@@ -0,0 +1,18 @@
+
diff --git a/frontend/src/styles/icons/info.svg b/frontend/src/styles/icons/info.svg
new file mode 100644
index 00000000..f33215a5
--- /dev/null
+++ b/frontend/src/styles/icons/info.svg
@@ -0,0 +1,4 @@
+
diff --git a/frontend/src/styles/icons/opacity.svg b/frontend/src/styles/icons/opacity.svg
new file mode 100644
index 00000000..232ee68c
--- /dev/null
+++ b/frontend/src/styles/icons/opacity.svg
@@ -0,0 +1,3 @@
+
diff --git a/frontend/src/styles/icons/selected-eez.svg b/frontend/src/styles/icons/selected-eez.svg
new file mode 100644
index 00000000..abcfcb88
--- /dev/null
+++ b/frontend/src/styles/icons/selected-eez.svg
@@ -0,0 +1,4 @@
+
diff --git a/frontend/src/styles/icons/several-eez.svg b/frontend/src/styles/icons/several-eez.svg
new file mode 100644
index 00000000..4d260760
--- /dev/null
+++ b/frontend/src/styles/icons/several-eez.svg
@@ -0,0 +1,4 @@
+
diff --git a/frontend/src/types/generated/data-info.ts b/frontend/src/types/generated/data-info.ts
new file mode 100644
index 00000000..e00e5e3b
--- /dev/null
+++ b/frontend/src/types/generated/data-info.ts
@@ -0,0 +1,152 @@
+/**
+ * Generated by orval v6.18.1 🍺
+ * Do not edit manually.
+ * DOCUMENTATION
+ * OpenAPI spec version: 1.0.0
+ */
+import { useQuery } from '@tanstack/react-query';
+import type {
+ UseQueryOptions,
+ QueryFunction,
+ UseQueryResult,
+ QueryKey,
+} from '@tanstack/react-query';
+import type {
+ DataInfoListResponse,
+ Error,
+ GetDataInfosParams,
+ DataInfoResponse,
+ GetDataInfosIdParams,
+} from './strapi.schemas';
+import { API } from '../../services/api/index';
+import type { ErrorType } from '../../services/api/index';
+
+// eslint-disable-next-line
+type SecondParameter any> = T extends (
+ config: any,
+ args: infer P
+) => any
+ ? P
+ : never;
+
+export const getDataInfos = (
+ params?: GetDataInfosParams,
+ options?: SecondParameter,
+ signal?: AbortSignal
+) => {
+ return API({ url: `/data-infos`, method: 'get', params, signal }, options);
+};
+
+export const getGetDataInfosQueryKey = (params?: GetDataInfosParams) => {
+ return [`/data-infos`, ...(params ? [params] : [])] as const;
+};
+
+export const getGetDataInfosQueryOptions = <
+ TData = Awaited>,
+ TError = ErrorType
+>(
+ params?: GetDataInfosParams,
+ options?: {
+ query?: UseQueryOptions>, TError, TData>;
+ request?: SecondParameter;
+ }
+) => {
+ const { query: queryOptions, request: requestOptions } = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetDataInfosQueryKey(params);
+
+ const queryFn: QueryFunction>> = ({ signal }) =>
+ getDataInfos(params, requestOptions, signal);
+
+ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
+ Awaited>,
+ TError,
+ TData
+ > & { queryKey: QueryKey };
+};
+
+export type GetDataInfosQueryResult = NonNullable>>;
+export type GetDataInfosQueryError = ErrorType;
+
+export const useGetDataInfos = <
+ TData = Awaited>,
+ TError = ErrorType
+>(
+ params?: GetDataInfosParams,
+ options?: {
+ query?: UseQueryOptions>, TError, TData>;
+ request?: SecondParameter;
+ }
+): UseQueryResult & { queryKey: QueryKey } => {
+ const queryOptions = getGetDataInfosQueryOptions(params, options);
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey;
+
+ return query;
+};
+
+export const getDataInfosId = (
+ id: number,
+ params?: GetDataInfosIdParams,
+ options?: SecondParameter,
+ signal?: AbortSignal
+) => {
+ return API(
+ { url: `/data-infos/${id}`, method: 'get', params, signal },
+ options
+ );
+};
+
+export const getGetDataInfosIdQueryKey = (id: number, params?: GetDataInfosIdParams) => {
+ return [`/data-infos/${id}`, ...(params ? [params] : [])] as const;
+};
+
+export const getGetDataInfosIdQueryOptions = <
+ TData = Awaited>,
+ TError = ErrorType
+>(
+ id: number,
+ params?: GetDataInfosIdParams,
+ options?: {
+ query?: UseQueryOptions>, TError, TData>;
+ request?: SecondParameter;
+ }
+) => {
+ const { query: queryOptions, request: requestOptions } = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetDataInfosIdQueryKey(id, params);
+
+ const queryFn: QueryFunction>> = ({ signal }) =>
+ getDataInfosId(id, params, requestOptions, signal);
+
+ return { queryKey, queryFn, enabled: !!id, ...queryOptions } as UseQueryOptions<
+ Awaited>,
+ TError,
+ TData
+ > & { queryKey: QueryKey };
+};
+
+export type GetDataInfosIdQueryResult = NonNullable>>;
+export type GetDataInfosIdQueryError = ErrorType;
+
+export const useGetDataInfosId = <
+ TData = Awaited>,
+ TError = ErrorType
+>(
+ id: number,
+ params?: GetDataInfosIdParams,
+ options?: {
+ query?: UseQueryOptions>, TError, TData>;
+ request?: SecondParameter;
+ }
+): UseQueryResult & { queryKey: QueryKey } => {
+ const queryOptions = getGetDataInfosIdQueryOptions(id, params, options);
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey;
+
+ return query;
+};
diff --git a/frontend/src/types/generated/strapi.schemas.ts b/frontend/src/types/generated/strapi.schemas.ts
index ecb2eaee..6579283b 100644
--- a/frontend/src/types/generated/strapi.schemas.ts
+++ b/frontend/src/types/generated/strapi.schemas.ts
@@ -604,6 +604,56 @@ export type GetFishingProtectionLevelsParams = {
locale?: string;
};
+export type GetDataInfosIdParams = {
+ /**
+ * Relations to return
+ */
+ populate?: string;
+};
+
+export type GetDataInfosParams = {
+ /**
+ * Sort by attributes ascending (asc) or descending (desc)
+ */
+ sort?: string;
+ /**
+ * Return page/pageSize (default: true)
+ */
+ 'pagination[withCount]'?: boolean;
+ /**
+ * Page number (default: 0)
+ */
+ 'pagination[page]'?: number;
+ /**
+ * Page size (default: 25)
+ */
+ 'pagination[pageSize]'?: number;
+ /**
+ * Offset value (default: 0)
+ */
+ 'pagination[start]'?: number;
+ /**
+ * Number of entities to return (default: 25)
+ */
+ 'pagination[limit]'?: number;
+ /**
+ * Fields to return (ex: title,author)
+ */
+ fields?: string;
+ /**
+ * Relations to return
+ */
+ populate?: string;
+ /**
+ * Filters to apply
+ */
+ filters?: { [key: string]: any };
+ /**
+ * Locale to apply
+ */
+ locale?: string;
+};
+
/**
* every controller of the api
*/