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

L.TileLayer.WMS support #45

Open
andrewgryan opened this issue Oct 24, 2024 · 1 comment
Open

L.TileLayer.WMS support #45

andrewgryan opened this issue Oct 24, 2024 · 1 comment

Comments

@andrewgryan
Copy link
Owner

andrewgryan commented Oct 24, 2024

Add support for <l-tile-layer-wms> Custom Element.

  • Use light DOM in accordance with existing Custom Elements.
  • Support non-WMS query parameters by leveraging the underlying L.TileLayer.WMS options object
  • Add unit tests to cover lifecycle events
  • Add API docs to instruct users to use attributes correctly

Useful links

@andrewgryan
Copy link
Owner Author

andrewgryan commented Oct 25, 2024

Potential design to support non-standard WMS parameters.
Use JSON in a dedicated options attribute.

<l-tile-layer-wms
    base-url="/wms/path"
    layers="wms_layer_name"
    styles="wms_style"
    options='{"key": "value"}'
></l-tile-layer-wms>

Internal to the component, the options and standard attributes can be parsed and combined.

// connectedCallback
// Error handling omitted

const layers = this.getAttribute("layers")
const styles = this.getAttribute("styles")
const options = JSON.parse(
    this.getAttribute("options")
)

this.layer = TileLayer.WMS(baseUrl,
    { layers, styles, ...options}
)

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

No branches or pull requests

1 participant