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

Fix location string parsing regex in JS to allow for space before point field brackets. #39

Merged
merged 1 commit into from
Apr 27, 2019

Conversation

solarissmoke
Copy link
Contributor

Hi there!

The GeoPanel doesn't currently work with GeoDjango PointFields because of a small difference in how the string representation of the value is rendered. Django renders a PointField like so:

SRID=4326;POINT (36.803684 -1.271821)

There is a space after POINT and before the opening bracket.

The JS currently expects no space (POINT(36.803684 -1.271821)), and so parsing of the field fails. This patch modifies the regex to allow an optional space.

@marteinn
Copy link
Member

Hi @solarissmoke and thanks for the PR, I have tried your fix and it works great. Many thanks! Will try to do a release this afternoon.

@marteinn marteinn merged commit 6dc31e1 into Frojd:develop Apr 27, 2019
@marteinn
Copy link
Member

Its out now (https://github.com/Frojd/wagtail-geo-widget/releases/tag/v5.0.2), again, many thanks!

@solarissmoke solarissmoke deleted the fix/location-string-regex branch April 29, 2019 02:23
@solarissmoke
Copy link
Contributor Author

That was quick - thanks!

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