I may have an incorrect configuration, but it appears that if the "Search address" is not populated when a node is first created, the WKT field will populate with GEOMETRYCOLLECTION() and will not update even if "Search address" is later filled.

It causes the error in trying to present the map: Error during map rendering: TypeError: 'undefined' is null or not an object

For aggregate map displays, I was able to avoid display error by filtering out GEOMETRYCOLLECTION() but I do not know how to prevent the error on the node map.

May be related to this issue: http://drupal.org/node/773358

Comments

itserich’s picture

To force the WKT field to properly populate if it was not populated when the node was created (due to user error), directly entering WKT field values no longer created a map display. To populate WKT field post node creation this worked for me:

1- Show WKT filed and enter a random long/lat - format is (i think) GEOMETRYCOLLECTION(POINT(0 0))
2- Save node
3- Enter address as normal in the Search address box, and then it populates WKT field correctly, and save node.

ademarco’s picture

GEOMETRYCOLLECTION() appears to be the way the WTK field is populated when the field is empty, both using the geocoder or the default cck widget. A misbehavior occurs if:

1. I create a node with WTK untouched
2. I edit the same node and I look for an address using the geocoder

In this case the geocoder js does not replace GEOMETRYCOLLECTION() with the retrieved value. Could you confirm that?

ademarco’s picture

Ok after some tests I think I can confirm that it is not a Geocoder problem. I've been working with the default cck widget, if I don't populate the WTK field, it will get
GEOMETRYCOLLECTION() as value at the moment of submission (via js). This creates the following error to occur:

 TypeError: features[i] is undefined { message="features[i] is undefined",  more...}

in openlayers_behavior_drawfeatures.js line 61. This error also prevent the "Draw Feature" behavior from showing up when editing the node. I'll research a bit more before filing an issue for the Openlayers project.

ademarco’s picture

ademarco’s picture

Status: Active » Closed (works as designed)