@camptocamp/ogc-client
Advanced tools
Comparing version 1.1.1-dev.377887e to 1.1.1-dev.407854b
@@ -13,2 +13,6 @@ /** | ||
keywords: string[]; | ||
/** | ||
* Can contain the list of outputFormats from a WFS GetCapabilities, | ||
* or the list of 'Formats' from a WMS GetCapabilities | ||
*/ | ||
outputFormats?: MimeType[]; | ||
@@ -15,0 +19,0 @@ }; |
@@ -16,2 +16,3 @@ import { XmlDocument } from '@rgrove/parse-xml'; | ||
export declare function readLayersFromCapabilities(capabilitiesDoc: XmlDocument): WmsLayerFull[]; | ||
export declare function readOutputFormatsFromCapabilities(capabilitiesDoc: XmlDocument): string[]; | ||
/** | ||
@@ -18,0 +19,0 @@ * Will read service-related info from the capabilities doc |
@@ -22,4 +22,19 @@ import { | ||
} | ||
function readOutputFormatsFromCapabilities(capabilitiesDoc) { | ||
const capability = findChildElement( | ||
getRootElement(capabilitiesDoc), | ||
"Capability" | ||
); | ||
const getMap = findChildElement( | ||
findChildElement(capability, "Request"), | ||
"GetMap" | ||
); | ||
const outputFormats = findChildrenElement(getMap, "Format").map( | ||
getElementText | ||
); | ||
return outputFormats; | ||
} | ||
function readInfoFromCapabilities(capabilitiesDoc) { | ||
const service = findChildElement(getRootElement(capabilitiesDoc), "Service"); | ||
const formats = readOutputFormatsFromCapabilities(capabilitiesDoc); | ||
const keywords = findChildrenElement( | ||
@@ -33,2 +48,3 @@ findChildElement(service, "KeywordList"), | ||
abstract: getElementText(findChildElement(service, "Abstract")), | ||
outputFormats: formats, | ||
fees: getElementText(findChildElement(service, "Fees")), | ||
@@ -138,4 +154,5 @@ constraints: getElementText(findChildElement(service, "AccessConstraints")), | ||
readLayersFromCapabilities, | ||
readOutputFormatsFromCapabilities, | ||
readVersionFromCapabilities | ||
}; | ||
//# sourceMappingURL=capabilities.js.map |
{ | ||
"name": "@camptocamp/ogc-client", | ||
"version": "1.1.1-dev.377887e", | ||
"version": "1.1.1-dev.407854b", | ||
"description": "A pure JS library for interacting with geospatial services.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/dist-node.js", |
@@ -15,2 +15,6 @@ /** | ||
keywords: string[]; | ||
/** | ||
* Can contain the list of outputFormats from a WFS GetCapabilities, | ||
* or the list of 'Formats' from a WMS GetCapabilities | ||
*/ | ||
outputFormats?: MimeType[]; | ||
@@ -17,0 +21,0 @@ }; |
@@ -290,2 +290,12 @@ import { | ||
title: 'GéoServices : géologie, hydrogéologie et gravimétrie', | ||
outputFormats: [ | ||
'image/png', | ||
'image/gif', | ||
'image/jpeg', | ||
'image/ecw', | ||
'image/tiff', | ||
'image/png; mode=8bit', | ||
'application/x-pdf', | ||
'image/svg+xml', | ||
], | ||
keywords: [ | ||
@@ -292,0 +302,0 @@ 'Géologie', |
@@ -43,2 +43,19 @@ import { | ||
export function readOutputFormatsFromCapabilities( | ||
capabilitiesDoc: XmlDocument | ||
) { | ||
const capability = findChildElement( | ||
getRootElement(capabilitiesDoc), | ||
'Capability' | ||
); | ||
const getMap = findChildElement( | ||
findChildElement(capability, 'Request'), | ||
'GetMap' | ||
); | ||
const outputFormats = findChildrenElement(getMap, 'Format').map( | ||
getElementText | ||
); | ||
return outputFormats; | ||
} | ||
/** | ||
@@ -53,2 +70,3 @@ * Will read service-related info from the capabilities doc | ||
const service = findChildElement(getRootElement(capabilitiesDoc), 'Service'); | ||
const formats = readOutputFormatsFromCapabilities(capabilitiesDoc); | ||
const keywords = findChildrenElement( | ||
@@ -65,2 +83,3 @@ findChildElement(service, 'KeywordList'), | ||
abstract: getElementText(findChildElement(service, 'Abstract')), | ||
outputFormats: formats, | ||
fees: getElementText(findChildElement(service, 'Fees')), | ||
@@ -67,0 +86,0 @@ constraints: getElementText(findChildElement(service, 'AccessConstraints')), |
@@ -180,2 +180,12 @@ // @ts-expect-error ts-migrate(7016) | ||
title: 'GéoServices : géologie, hydrogéologie et gravimétrie', | ||
outputFormats: [ | ||
'image/png', | ||
'image/gif', | ||
'image/jpeg', | ||
'image/ecw', | ||
'image/tiff', | ||
'image/png; mode=8bit', | ||
'application/x-pdf', | ||
'image/svg+xml', | ||
], | ||
keywords: [ | ||
@@ -182,0 +192,0 @@ 'Géologie', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1281634
21333