Skip to content

Commit

Permalink
Merge pull request #203 from Dataport/fix/geojson
Browse files Browse the repository at this point in the history
Fix/geojson
  • Loading branch information
dopenguin authored Nov 19, 2024
2 parents bd75e90 + ca22291 commit 53188e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
3 changes: 1 addition & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Whitelisted and confirmed parameters include:
- WMS: id, name, url, typ, format, version, transparent, layers, STYLES
- WFS: id, name, url, typ, outputFormat, version, featureType
- WMTS: id, name, urls, typ, capabilitiesUrl, optionsFromCapabilities, tileMatrixSet, layers, legendURL, format, coordinateSystem, origin, transparent, tileSize, minScale, maxScale, requestEncoding, resLength
- GeoJSON: id, name, url, typ, format, version, minScale, maxScale, legendURL
- GeoJSON: id, name, url, typ, version, minScale, maxScale, legendURL

###### Example services register

Expand Down Expand Up @@ -392,7 +392,6 @@ Whitelisted and confirmed parameters include:
"name": "My GeoJSON data",
"url": "Service url",
"typ": "GeoJSON",
"format": "XML",
"version": "1.0",
"minScale": "0",
"maxScale": "2500000",
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/Gfi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fix: Adjust documentation to properly describe optionality of configuration parameters.
- Fix: Add missing configuration parameters `featureList` and `maxFeatures` to the general documentation and `filterBy` and `format` to `gfi.gfiLayerConfiguration`
- Fix: Add missing entry of `gfiContentComponent` to `GfiGetters`.
- Fix: Fix issue rendering properties of a feature if a value is not a string.
- Refactor: Replace redundant prop-forwarding with `getters`.
- Refactor: Use core getter `clientWidth` instead of local computed value.
- Chore: expand on the description to `gfiContentComponent` in the Readme.md.
Expand Down
7 changes: 6 additions & 1 deletion packages/plugins/Gfi/src/components/FeatureTableBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
<tbody>
<tr v-for="[key, value] of Object.entries(filteredProperties)" :key="key">
<td>{{ key }}</td>
<td v-if="value.match(/\.(jpeg|jpg|gif|png)$/) !== null">
<td
v-if="
typeof value === 'string' &&
value.match(/\.(jpeg|jpg|gif|png)$/) !== null
"
>
<a :href="value" target="_blank">
<img
:src="value"
Expand Down
17 changes: 9 additions & 8 deletions packages/plugins/Gfi/src/utils/requestGfiGeoJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default ({
layer: VectorLayer<Feature>
}): Promise<GeoJsonFeature[]> =>
Promise.resolve(
coordinateOrExtent.length === 2
(coordinateOrExtent.length === 2
? map.getFeaturesAtPixel(map.getPixelFromCoordinate(coordinateOrExtent), {
layerFilter: (candidate) => candidate === layer,
})
Expand All @@ -38,11 +38,12 @@ export default ({
.getFeaturesInExtent(coordinateOrExtent)
.map(getNestedFeatures)
.flat(1)
.map((feature) =>
feature instanceof Feature
? JSON.parse(writer.writeFeature(feature))
: false
)
// remove FeatureLikes
.filter((x) => x)
)
.map((feature) =>
feature instanceof Feature
? JSON.parse(writer.writeFeature(feature))
: false
)
// remove FeatureLikes
.filter((x) => x)
)

0 comments on commit 53188e2

Please sign in to comment.