@datagouv/components-next 1.0.1 → 1.0.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Control-BNCDn-8E.js → Control-DuZJdKV_.js} +1 -1
- package/dist/{Datafair.client-B5lBpOl8.js → Datafair.client-DpeBuzZZ.js} +1 -1
- package/dist/{Event-BOgJUhNR.js → Event--kp8kMdJ.js} +21 -21
- package/dist/{Image-BN-4XkIn.js → Image-34hvypZI.js} +114 -58
- package/dist/{JsonPreview.client-Doz1Z0BS.js → JsonPreview.client-B3sQR-rW.js} +1 -1
- package/dist/{Map-BdT3i2C4.js → Map-BjUnLyj8.js} +1534 -1466
- package/dist/{MapContainer.client-oiieO8H-.js → MapContainer.client-BA6GCqKX.js} +7 -7
- package/dist/{OSM-CamriM9b.js → OSM-s40W6sQ2.js} +22 -12
- package/dist/{PdfPreview.client-CdAhkDFJ.js → PdfPreview.client-CbeSChb8.js} +1 -1
- package/dist/Pmtiles.client-D8pFim1L.js +25190 -0
- package/dist/{ScaleLine-BiesrgOv.js → ScaleLine-KW-nXqp3.js} +2 -2
- package/dist/Swagger.client-B-2Q16qa.js +4 -0
- package/dist/{Tile-DCuqwNOI.js → Tile-DbNFNPfU.js} +189 -172
- package/dist/{TileImage-CmZf8EdU.js → TileImage-BsXBxMtq.js} +132 -102
- package/dist/{View-DcDc7N2K.js → View-BR92hTWP.js} +8 -8
- package/dist/{XmlPreview.client-CrjHf74q.js → XmlPreview.client-DWJt61wG.js} +2 -2
- package/dist/{common-C4rDcQpp.js → common-PJfpC179.js} +34 -33
- package/dist/components-next.css +4 -4
- package/dist/components-next.js +1 -1
- package/dist/components.css +1 -1
- package/dist/{index-Bbu9rOHt.js → index-DVp7Y0Xu.js} +11105 -6743
- package/dist/{main-CiH8ZmBI.js → main-CrSRA2X-.js} +22125 -22173
- package/dist/{proj-CKwYjU38.js → proj-DsetBcW7.js} +513 -498
- package/dist/{tilecoord-YW3qEH_j.js → tilecoord-Db24Px13.js} +242 -224
- package/dist/{vue3-xml-viewer.common-Bi_bsV6C.js → vue3-xml-viewer.common-BjA4LdSC.js} +1 -1
- package/package.json +2 -1
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +1 -50
- package/src/composables/useResourceCapabilities.ts +1 -15
- package/src/functions/api.ts +3 -11
- package/src/types/resources.ts +0 -10
- package/dist/Pmtiles.client-B0v8tGJQ.js +0 -22812
- package/dist/Swagger.client-CsK65JnG.js +0 -4
- package/src/functions/resourceCapabilities.ts +0 -55
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Resource, WfsMetadata, OgcLayerInfo } from '../types/resources'
|
|
2
|
-
|
|
3
|
-
const WFS_EXPORT_FORMATS = [
|
|
4
|
-
{
|
|
5
|
-
name: 'csv',
|
|
6
|
-
mimetype: 'csv',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'json',
|
|
10
|
-
mimetype: 'application/json',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'shp',
|
|
14
|
-
mimetype: 'SHAPE-ZIP',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: 'gml',
|
|
18
|
-
mimetype: 'application/gml+xml',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'kml',
|
|
22
|
-
mimetype: 'KML',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'gpkg',
|
|
26
|
-
mimetype: 'application/geopackage+sqlite3',
|
|
27
|
-
},
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
function buildWfsDownloadUrl(baseUrl: string, wfsMetadata: WfsMetadata, format: { name: string, mimetype: string }, layer: OgcLayerInfo) {
|
|
31
|
-
const version = wfsMetadata.version
|
|
32
|
-
const query = new URLSearchParams({
|
|
33
|
-
SERVICE: 'WFS',
|
|
34
|
-
REQUEST: 'GetFeature',
|
|
35
|
-
VERSION: version,
|
|
36
|
-
...(Number(version.split('.')[0]) >= 2 ? { TYPENAMES: layer.name } : { TYPENAME: layer.name }),
|
|
37
|
-
OUTPUTFORMAT: format.mimetype,
|
|
38
|
-
...(layer.default_crs ? { SRSNAME: layer.default_crs } : {}),
|
|
39
|
-
})
|
|
40
|
-
return `${baseUrl.split('?')[0]}?${query.toString()}`
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function getWfsExportFormats(resource: Pick<Resource, 'extras' | 'url'>) {
|
|
44
|
-
const wfsMetadata = resource.extras['analysis:parsing:ogc_metadata'] as WfsMetadata | null
|
|
45
|
-
if (!wfsMetadata || wfsMetadata.format !== `wfs`) return []
|
|
46
|
-
const outputFormats = wfsMetadata.output_formats.map((format: string) => format.toLowerCase())
|
|
47
|
-
const layer = wfsMetadata.detected_layer
|
|
48
|
-
if (!layer) return []
|
|
49
|
-
const formats = WFS_EXPORT_FORMATS.filter(format => outputFormats.includes(format.mimetype.toLowerCase()))
|
|
50
|
-
.map(format => ({
|
|
51
|
-
url: buildWfsDownloadUrl(resource.url, wfsMetadata, format, layer),
|
|
52
|
-
format: format.name,
|
|
53
|
-
}))
|
|
54
|
-
return formats
|
|
55
|
-
}
|