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

Add legend package to generate legends from WMS and WMTS layers #19

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

ronitjadhav
Copy link
Member

Description

This pull request introduces a new package @geospatial-sdk/legend that provides functionality for generating map layer legends. The changes include adding the core functionality, tests, configuration files, and necessary exports.

Key changes include:

Core Functionality:

  • Implemented createLegendFromLayer function to generate legends for WMS and WMTS layers in from-layer.ts. This includes handling different configurations and error cases.

Testing:

  • Added comprehensive tests for createLegendFromLayer in from-layer.test.ts to ensure correct functionality and error handling.

Copy link
Member

@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.

Looking great, thanks! I just made a comment on the doc and a suggestion on the return value of the createLegendFromLayer function, address as you see fit and then feel free to merge!

});
```

## API Documentation
Copy link
Member

Choose a reason for hiding this comment

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

The API documentation should be written in the code as jsdoc annotations; there's an automatic website generated from it :) you can try it using npm run docs:dev

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I remove the API documentation section from here? I kept it because it might be visible on the package page on npmjs.com

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think you can remove it and put a link to the online documentation. Otherwise we'll have to maintain it manually and it might become misleading/wrong in the future.

packages/legend/lib/create-legend/from-layer.ts Outdated Show resolved Hide resolved
@ronitjadhav ronitjadhav merged commit 6f70b18 into main Dec 17, 2024
1 check passed
@ronitjadhav ronitjadhav deleted the get-legend branch December 17, 2024 11:10
@jahow
Copy link
Member

jahow commented Dec 17, 2024

Good job 🙂

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.

2 participants