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

Using a named pane will cause default renderer to not be used #9213

Open
nemosmithasf opened this issue Jan 13, 2024 · 1 comment
Open

Using a named pane will cause default renderer to not be used #9213

nemosmithasf opened this issue Jan 13, 2024 · 1 comment
Labels
docs Improvements or additions to documentation needs triage Triage pending

Comments

@nemosmithasf
Copy link

nemosmithasf commented Jan 13, 2024

I'm pretty sure this is a bug, but I don't know enough about the codebase, so I'll file this as "needing documentation".

Here is the relevant snippet in the codebase:

if (!renderer) {
// @namespace Map; @option preferCanvas: Boolean = false
// Whether `Path`s should be rendered on a `Canvas` renderer.
// By default, all `Path`s are rendered in a `SVG` renderer.
renderer = this._renderer = (this.options.preferCanvas && L.canvas()) || L.svg();
}

The problem

If the layer is a named pane, then the code will automatically create a renderer for the pane if none exists.

This is a problem however, because if we added a default renderer (i.e. during Map creation), it will get ignored.

Suggested changes

Fill in the documentation.

@nemosmithasf nemosmithasf added docs Improvements or additions to documentation needs triage Triage pending labels Jan 13, 2024
@syonfox
Copy link

syonfox commented Mar 6, 2024

https://leafletjs.com/reference.html#path-renderer

Just a random idea also not an expert. but the wording here sounds like

renderer 	[Renderer](https://leafletjs.com/reference.html#renderer) 		

Use this specific instance of [Renderer](https://leafletjs.com/reference.html#renderer) for this path. Takes precedence over the map's [default renderer](https://leafletjs.com/reference.html#map-renderer).

I suppose you could override the render after map creation on a path by path basis. this would allow control of layers as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation needs triage Triage pending
Projects
None yet
Development

No branches or pull requests

2 participants