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

Fixed bug where null urlTemplate caused exception in TileLayer construction #1681

Merged
merged 1 commit into from
Oct 7, 2023

Conversation

JaffaKetchup
Copy link
Member

@JaffaKetchup JaffaKetchup commented Oct 7, 2023

It's not necessarily safe to assume a URL template will be provided when WMS options are missing.
Some plugins, for example, (*cough *cough FMTC) use TileLayer to transport other useful information, but not the URL itself.

Copy link
Collaborator

@mootw mootw left a comment

Choose a reason for hiding this comment

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

sure, though is it bad practice whatever fmtc is doing?? (i don't want to encourage bad practice by allowing something that should be avoided)

@JaffaKetchup
Copy link
Member Author

JaffaKetchup commented Oct 7, 2023

Well, it might be bad practise in some people's books, but it works just fine. If it is bad practise, then it needs a proper assertion. Maybe we also need to think about whether how we're expressing it is the best way - but I can't think of any alternatives off the top of my head.

One example is converting object A to B, which requires a TileLayer. B has two methods. One requires the TileLayer to have a URL, one doesn't care what's inside the TileLayer (but B must still have it), IYSWIM.
EDIT: just realised how nonsensical that is - it's a little hard to explain. But resolving it would require having a nullable field then enforcing via an assert. Maybe I should do that anyway.

Also used to access the default templating function, but that needs to change now I guess.

@JaffaKetchup JaffaKetchup merged commit 0a08527 into master Oct 7, 2023
7 checks passed
@JaffaKetchup JaffaKetchup deleted the fix-bug branch October 7, 2023 22: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.

2 participants