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

[Map-Viewer] Add layer from WFS service #776

Merged
merged 2 commits into from
Jan 23, 2024
Merged

[Map-Viewer] Add layer from WFS service #776

merged 2 commits into from
Jan 23, 2024

Conversation

ronitjadhav
Copy link
Collaborator

@ronitjadhav ronitjadhav commented Jan 18, 2024

This pull request adds the feature that allows users to add a layer from a Web Feature Service (WFS) to their map.

  • Added a new add-layer-from-wfs component in src/app/components/add-layer-from-wfs/add-layer-from-wfs.component.ts
  • Updated the map-context.service.ts and map-context.model.ts to add an option which limits WFS features count

Task List:

  • Ensure the initial display includes a text input for the WFS URL entry.
  • Implement a loading indicator upon URL submission.
  • Display a list of layers post-load, with each layer featuring a title and an "Add" button.
  • Enable layer addition to the map while keeping the panel open.
  • Apply default OL styling for added layers.
  • Enforce a maximum of 10,000 features per layer to prevent browser overload.

Screenshots:

image

image

#756

@ronitjadhav ronitjadhav requested a review from jahow January 18, 2024 11:52
Copy link
Contributor

github-actions bot commented Jan 18, 2024

Affected libs: feature-map, feature-dataviz, feature-record, feature-router,
Affected apps: metadata-editor, datahub, demo, webcomponents, search, map-viewer,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

@coveralls
Copy link

coveralls commented Jan 18, 2024

Coverage Status

coverage: 85.787% (-14.2%) from 100.0%
when pulling 78bfee8 on mv-add-from-wfs
into 725d837 on main.

Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, simple and clean, good job!

I made a comment about always applying the features count limit to WFS layers, feel free to merge once this is addressed.

Comment on lines 114 to 119
if ('featureCount' in layerModel && layerModel.featureCount) {
urlObj.searchParams.set(
'maxFeatures',
layerModel.featureCount.toString()
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add this limit every time without having it specified in the context, because having too many objects on the map is always going to be a problem.

@@ -32,6 +32,7 @@ interface MapContextLayerWfsModel {
type: 'wfs'
url: string
name: string
featureCount?: number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment, this shouldn't be necessary


this.wfsEndpoint = await new WfsEndpoint(this.wfsUrl).isReady()
this.layers = this.wfsEndpoint.getFeatureTypes()
console.log(this.layers)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed I think 🙂 did we forget a console.log in WMS as well?

@ronitjadhav ronitjadhav force-pushed the mv-add-from-wfs branch 2 times, most recently from d19b555 to 80decb8 Compare January 23, 2024 15:30
@ronitjadhav ronitjadhav merged commit 05d3ea3 into main Jan 23, 2024
7 of 8 checks passed
@ronitjadhav ronitjadhav deleted the mv-add-from-wfs branch January 23, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants