Skip to content

Conversation

@ahocevar
Copy link
Member

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.

@ahocevar ahocevar merged commit 51520bc into master Nov 12, 2025
5 checks passed
@ahocevar ahocevar deleted the fix-projjson-def branch November 12, 2025 08:33
Copy link

@but0n but0n left a comment

Choose a reason for hiding this comment

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

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)) {
Copy link

Choose a reason for hiding this comment

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

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')

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. See #533

@ahocevar ahocevar mentioned this pull request Nov 17, 2025
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.

3 participants