Fix projjson when used with defs(code, projjson)#532
Merged
Conversation
29183d5 to
42cabe7
Compare
42cabe7 to
1a3b130
Compare
but0n
reviewed
Nov 17, 2025
but0n
left a comment
There was a problem hiding this comment.
How to delete an existing projection in the latest version? The second argument is no longer nullable.
| } else { | ||
| defs[/** @type {string} */ (name)] = wkt(arguments[1]); | ||
| } | ||
| } else if (typeof def === 'object' && !('projName' in def)) { |
There was a problem hiding this comment.
I think this will cause an error if def is null or undefined as typeof null = 'object'.
TypeError: def is not an Object. (evaluating '"projName" in def')
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When registering a projection code with a projjson definition using
proj4.defs(code, projjson), the projjson object is never converted into a projection definition.This pull request fixes that.