Skip to content

Commit 79afd7f

Browse files
wip: add maritime categorie [not working]
1 parent 1100010 commit 79afd7f

2 files changed

Lines changed: 151 additions & 0 deletions

File tree

api/config/categories/maritime.cjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = function ({ domain }) {
2+
return [{
3+
name: 'Categories.MARITIME_LAYERS',
4+
i18n: {
5+
fr: {
6+
Categories: {
7+
MARITIME_LAYERS: 'Maritime'
8+
}
9+
},
10+
en: {
11+
Categories: {
12+
MARITIME_LAYERS: 'Maritime'
13+
}
14+
}
15+
},
16+
icon: 'las la-ship',
17+
options: { exclusive: false, filter: { type: 'OverlayLayer', tags: { $in: ['maritime'] } } }
18+
}]
19+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
module.exports = function ({ wmtsUrl, tmsUrl, wmsUrl, wcsUrl, k2Url, s3Url }) {
2+
return [
3+
{
4+
name: 'Layers.ESPACES_MARITIMES',
5+
description: 'Layers.ESPACES_MARITIMES_DESCRIPTION',
6+
i18n: {
7+
fr: {
8+
Layers: {
9+
ESPACES_MARITIMES: 'Espaces Maritimes',
10+
ESPACES_MARITIMES_DESCRIPTION: 'Délimitation des espaces maritimes (ZEE, mer territoriale, zone contiguë...)',
11+
ESPACES_MARITIMES_ZEE: 'Zone Économique Exclusive (ZEE)',
12+
ESPACES_MARITIMES_MER_TERRITORIALE: 'Mer territoriale (12 nm)',
13+
ESPACES_MARITIMES_ZONE_CONTIGUE: 'Zone contiguë (24 nm)',
14+
ESPACES_MARITIMES_PLATEAU_CONTINENTAL: 'Plateau continental'
15+
}
16+
},
17+
en: {
18+
Layers: {
19+
ESPACES_MARITIMES: 'Maritime Spaces',
20+
ESPACES_MARITIMES_DESCRIPTION: 'Delimitation of maritime spaces (EEZ, territorial sea, contiguous zone...)',
21+
ESPACES_MARITIMES_ZEE: 'Exclusive Economic Zone (EEZ)',
22+
ESPACES_MARITIMES_MER_TERRITORIALE: 'Territorial sea (12 nm)',
23+
ESPACES_MARITIMES_ZONE_CONTIGUE: 'Contiguous zone (24 nm)',
24+
ESPACES_MARITIMES_PLATEAU_CONTINENTAL: 'Continental shelf'
25+
}
26+
}
27+
},
28+
tags: ['maritime'],
29+
iconUrl: '',
30+
icon: 'las la-water',
31+
attribution: '© <a href="https://www.shom.fr">SHOM</a>',
32+
legend: [{
33+
type: 'symbols',
34+
label: 'Layers.ESPACES_MARITIMES_DESCRIPTION',
35+
content: {
36+
symbols: [
37+
{ symbol: { 'media/KShape': { options: { shape: 'rect', color: '#1565C0', opacity: 0.5 } } }, label: 'Layers.ESPACES_MARITIMES_ZEE' },
38+
{ symbol: { 'media/KShape': { options: { shape: 'rect', color: '#6A0DAD', opacity: 0.5 } } }, label: 'Layers.ESPACES_MARITIMES_MER_TERRITORIALE' },
39+
{ symbol: { 'media/KShape': { options: { shape: 'rect', color: '#0D1B6E', opacity: 0.5 } } }, label: 'Layers.ESPACES_MARITIMES_ZONE_CONTIGUE' },
40+
{ symbol: { 'media/KShape': { options: { shape: 'rect', color: '#FFD600', opacity: 0.5 } } }, label: 'Layers.ESPACES_MARITIMES_PLATEAU_CONTINENTAL' }
41+
]
42+
}
43+
}],
44+
type: 'OverlayLayer',
45+
leaflet: {
46+
type: 'tileLayer',
47+
source: `${tmsUrl}/espaces_maritimes@GLOBAL_WEBMERCATOR/{z}/{x}/{y}.png`,
48+
opacity: 0.6,
49+
minZoom: 3,
50+
maxZoom: 21,
51+
maxNativeZoom: 12,
52+
tms: true
53+
}
54+
},
55+
{
56+
name: 'Layers.DELIMITATIONS_MARITIMES',
57+
description: 'Layers.DELIMITATIONS_MARITIMES_DESCRIPTION',
58+
i18n: {
59+
fr: {
60+
Layers: {
61+
DELIMITATIONS_MARITIMES: 'Délimitations Maritimes',
62+
DELIMITATIONS_MARITIMES_DESCRIPTION: 'Lignes de délimitation des espaces maritimes (ligne de base, mer territoriale, ZEE...)',
63+
DELIMITATIONS_MARITIMES_LIGNE_BASE: 'Ligne de base droite',
64+
DELIMITATIONS_MARITIMES_MER_TERRITORIALE: 'Mer territoriale',
65+
DELIMITATIONS_MARITIMES_ZONE_CONTIGUE: 'Zone contiguë',
66+
DELIMITATIONS_MARITIMES_ZEE: 'Zone économique exclusive',
67+
DELIMITATIONS_MARITIMES_PLATEAU_CONTINENTAL: 'Plateau continental',
68+
DELIMITATIONS_MARITIMES_EAUX_INTERIEURES: 'Eaux intérieures',
69+
DELIMITATIONS_MARITIMES_ZPE: 'Zone de protection écologique'
70+
}
71+
},
72+
en: {
73+
Layers: {
74+
DELIMITATIONS_MARITIMES: 'Maritime Boundaries',
75+
DELIMITATIONS_MARITIMES_DESCRIPTION: 'Maritime boundary lines (baseline, territorial sea, EEZ...)',
76+
DELIMITATIONS_MARITIMES_LIGNE_BASE: 'Straight baseline',
77+
DELIMITATIONS_MARITIMES_MER_TERRITORIALE: 'Territorial sea',
78+
DELIMITATIONS_MARITIMES_ZONE_CONTIGUE: 'Contiguous zone',
79+
DELIMITATIONS_MARITIMES_ZEE: 'Exclusive Economic Zone',
80+
DELIMITATIONS_MARITIMES_PLATEAU_CONTINENTAL: 'Continental shelf',
81+
DELIMITATIONS_MARITIMES_EAUX_INTERIEURES: 'Internal waters',
82+
DELIMITATIONS_MARITIMES_ZPE: 'Ecological protection zone'
83+
}
84+
}
85+
},
86+
tags: ['maritime'],
87+
iconUrl: '',
88+
icon: 'las la-map-marked',
89+
attribution: '© <a href="https://www.shom.fr">SHOM</a>',
90+
legend: [{
91+
type: 'symbols',
92+
label: 'Layers.DELIMITATIONS_MARITIMES_DESCRIPTION',
93+
content: {
94+
symbols: [
95+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#e74c3c', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_LIGNE_BASE' },
96+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#2980b9', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_MER_TERRITORIALE' },
97+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#27ae60', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_ZONE_CONTIGUE' },
98+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#f39c12', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_ZEE' },
99+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#8e44ad', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_PLATEAU_CONTINENTAL' },
100+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#16a085', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_EAUX_INTERIEURES' },
101+
{ symbol: { 'media/KShape': { options: { shape: 'line', color: '#d35400', opacity: 1 } } }, label: 'Layers.DELIMITATIONS_MARITIMES_ZPE' }
102+
]
103+
}
104+
}],
105+
type: 'OverlayLayer',
106+
leaflet: {
107+
type: 'pmtiles',
108+
url: `${s3Url}/kargo/data/PMTiles/delmar.pmtiles`,
109+
devicePixelRatio: 3,
110+
style: {
111+
line: {
112+
dataLayer: 'delmar',
113+
symbolizer: {
114+
type: 'LineSymbolizer',
115+
color: `<% if (properties.nature === 'Ligne de base droite') { %>rgba(231, 76, 60, 1)<%
116+
} else if (properties.nature === 'Mer territoriale') { %>rgba( 41, 128, 185, 1)<%
117+
} else if (properties.nature === 'Zone contiguë') { %>rgba( 39, 174, 96, 1)<%
118+
} else if (properties.nature === 'Zone économique exclusive') { %>rgba(243, 156, 18, 1)<%
119+
} else if (properties.nature === 'Plateau continental') { %>rgba(142, 68, 173, 1)<%
120+
} else if (properties.nature === 'Eaux intérieures') { %>rgba( 22, 160, 133, 1)<%
121+
} else if (properties.nature === 'Zone de protection écologique') { %>rgba(211, 84, 0, 1)<%
122+
} else { %>rgba(153, 153, 153, 1)<% } %>`,
123+
width: 2,
124+
opacity: 1
125+
}
126+
}
127+
},
128+
template: ['style.line.symbolizer.color']
129+
}
130+
}
131+
]
132+
}

0 commit comments

Comments
 (0)