Skip to content

Commit

Permalink
Featureformats clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RobAndrewHurst committed Oct 28, 2024
1 parent ce598d8 commit 6afeb74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/layer/featureFormats.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function wkt(layer, features) {
const properties = {}

//To ensure that we know that id and geometry are first, and then additional params get added to the set.
let wkt_params_fields = Array.from(new Set(['id', 'geometry', ...layer.params.fields]));
const wkt_params_fields = Array.from(new Set(['id', 'wkt_geometry', ...layer.params.fields]));

// Populate featureFields values array with feature property values.
wkt_params_fields?.forEach((field, i) => {
Expand All @@ -93,11 +93,11 @@ export function wkt(layer, features) {

// Return feature from geometry with properties.
return new ol.Feature({
...properties,//Spread needs to happen before geometry assignment
geometry: formatWKT.readGeometry(feature[1], {
geometry: formatWKT.readGeometry(properties.wkt_geometry, {
dataProjection: 'EPSG:' + layer.srid,
featureProjection: 'EPSG:' + layer.mapview.srid,
})
}),
...properties,
})

})
Expand Down

0 comments on commit 6afeb74

Please sign in to comment.