Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(context/vector): fix wfs layer in context / vector layer source #934

Merged
merged 3 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/src/app/geo/hover/hover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class AppHoverComponent {
featureTypes: 'CASERNE',
fieldNameGeometry: 'geometry',
maxFeatures: 10000,
version: '3.0.0',
version: '2.0.0',
outputFormat: undefined,
outputFormatDownload: 'shp'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export class ContextService {
)
.sort((a, b) => a.zIndex - b.zIndex);
} else {
layers = igoMap.layers$.getValue().sort((a, b) => a.zIndex - b.zIndex);
layers = igoMap.layers$.getValue().filter(lay => !lay.id.includes('WfsWorkspaceTableDest')).sort((a, b) => a.zIndex - b.zIndex);
}

let i = 0;
Expand Down Expand Up @@ -569,13 +569,14 @@ export class ContextService {
}
);
} else {
// features = writer.writeFeatures(
// layer.ol.getSource().getFeatures(),
// {
// dataProjection: 'EPSG:4326',
// featureProjection: 'EPSG:3857'
// }
// );
const source = layer.ol.getSource() as any;
features = writer.writeFeatures(
source.getFeatures(),
{
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
}
);
}
features = JSON.parse(features);
features.name = layer.options.title;
Expand Down
3 changes: 0 additions & 3 deletions packages/geo/src/lib/layer/shared/layers/vector-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ export class VectorLayer extends Layer {
}

const vector = new olLayerVector(olOptions);
// const vectorSource = (this.dataSource instanceof ClusterDataSource
// ? vector.getSource().
// : vector.getSource()) as olSourceVector<OlGeometry>;
const vectorSource = vector.getSource() as olSourceVector<OlGeometry>;
const url = vectorSource.getUrl();
if (url) {
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/lib/map/shared/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class IgoMap {

getLayerByOlUId(olUId: string): Layer {
return this.layers.find(
(layer: Layer) => layer.ol.get('ol_uid') && layer.ol.get('ol_uid') === olUId
(layer: Layer) => (layer.ol as any).ol_uid && (layer.ol as any).ol_uid === olUId
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export class MeasurerComponent implements OnInit, OnDestroy {
source: new FeatureDataSource(),
style: createMeasureLayerStyle(),
showInLayerList: true,
exportable: false,
exportable: true,
browsable: false,
workspace: { enabled: false }
});
Expand Down