In CCK module, if you create a polygon on a map, then use the cool, new edit ability, the data saved is all the separate vertices and the polygon. I haven't looked into it yet, but obviously when editing, the movable vertices get sent to the textfield as well.

Here is a screesnhot of the saved map:
http://skitch.com/zzolo/ddsqn/asfasdf-openlayers-2

Here is the saved geometry:

GEOMETRYCOLLECTION(POINT(34.628906248617 17.644022027191),POLYGON((85.253906246596 31.653381398529,59.238281247635 1.406108835379,70.839843747172 -16.636191877752,65.917968747368 2.108898659159,65.917968747368 2.108898659159,103.18359374588 4.5654735505284,110.47851562059 22.593726063074,84.726562496615 14.264383087005,85.253906246596 31.653381398529)),POINT(72.246093747116 17.140790392653),POINT(65.039062497403 -7.7109916551272),POINT(68.37890624727 -7.3624668652434),POINT(65.917968747368 2.108898659159),POINT(84.550781246622 3.3379539612834),POINT(106.83105468323 13.752724663858),POINT(97.602539058604 18.47960905512),POINT(84.990234371606 23.241346101509),POINT(85.253906246596 31.653381398529),POINT(59.238281247635 1.406108835379),POINT(70.839843747172 -16.636191877752),POINT(65.917968747368 2.108898659159),POINT(65.917968747368 2.108898659159),POINT(103.18359374588 4.5654735505284),POINT(110.47851562059 22.593726063074),POINT(84.726562496615 14.264383087005),POLYGON((41.660156248337 48.224672648097,25.312499998989 51.28940590122,7.5585937496982 44.087585026834,7.5585937496982 33.431441334392,26.718749998933 33.137551191171,41.660156248337 48.224672648097)),POINT(33.486328123663 49.781264056694),POINT(16.435546874344 47.813154516064),POINT(7.5585937496982 38.959408791139),POINT(17.138671874316 33.284619967708),POINT(34.189453123635 41.112468787822),POINT(41.660156248337 48.224672648097),POINT(25.312499998989 51.28940590122),POINT(7.5585937496982 44.087585026834),POINT(7.5585937496982 33.431441334392),POINT(26.718749998933 33.137551191171))
CommentFileSizeAuthor
#6 openlayers-800022-6.patch2.1 KBronan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zzolo’s picture

Priority: Normal » Critical
strk’s picture

I confirm the bug, just happened here too...

tmcw’s picture

Okay; basically I'd see the solution for this being a lock so that the wkt textfield is not updated while the drawfeature controls are active, and that submitting the form if either restricted while drawing or drawing is automatically turned off before the form contents are submitted. Should be a simple patch.

tmcw’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ronan’s picture

Status: Closed (fixed) » Needs review
FileSize
2.1 KB

This solution removes the ability to edit the WKT field by hand. I'm not sure how important this functionality is to others but it is really nice for pasting features from node to node or from external sources. With the fix in this commit any changes made to the WKT field are wiped out when the node is saved.

The attached patch solves the extra vertices issue by simply excluding from from the array that is sent to the WKT writer function. This means that the temporary features are never written to WKT and there is no need to rewrite the field on submit.

Thanks
Ronan

zzolo’s picture

Hi @ronan, many thanks for the patch. This does indeed seem like a better solution. My basic testing says this work. Can anyone else confirm?

strk’s picture

Status: Needs review » Reviewed & tested by the community

I just tested this and looks fine to me.

strk’s picture

Status: Reviewed & tested by the community » Fixed
carlosg2’s picture

Status: Fixed » Needs review

#6: openlayers-800022-6.patch queued for re-testing.

strk’s picture

Status: Needs review » Fixed

The patch is in the branch already... no need to test it here

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.