jazzband / django-floppyforms

Full control of form rendering in the templates.
http://django-floppyforms.readthedocs.org/
Other
839 stars 145 forks source link

Transformed Geometry sometimes lack spaces after commas #38

Closed adamhotz closed 12 years ago

adamhotz commented 12 years ago

Hi I encountered a bug where sometimes transformed geometries lack spaces after the commas, which causes the parsing regex to only split the first object

My suggested fix is to change the parsing regex in MapWidget.js as follows:

this.regExes.justComma = /\s,\ ?\s/;

Which allows 0 or 1 spaces after the comma.

Platform is Centos 6, Django 1.3, PostGIS 1.5.3, Geos 3.3.2

brutasse commented 12 years ago

The ultimate fix will be to switch to GeoJSON which makes parsing much more robust.

I'd simplify the regex to /\s*,\s*/ though.

adamhotz commented 12 years ago

Thank you, I agree that the simplified regex is better.