I am not quite sure if this is a views problem? A WKT CCK filed problem? Simply not possible by design. Or a configuration problem on my side.

What did I do:

  • Created a new content type with only one OpenLayers WKT field. In global settings I am allowing anything. (Point, Path, Polygon)
  • Created a few nodes of this content type. Filling the WKT field with points, lines etc.
  • Created a view with the introduction how-to on http://drupal.org/node/627816. Only one difference I used the WKT field in the view.
  • Activated the view as overlay style in the "Layers & Styles" configuration of the map I want to show with the results of the view. (everything like in the tutorial - I skip the rest)
  • Working fine
  • NOW! I wanted to store multiple values per node. So I set "Number of values" in the WKT field configuration to unlimited. This makes all the overlay elements from the view disappear. No matter if there is one or more values in it. Setting it back to 1 - everything is back again.
  • There is no problem if I am viewing a single node with multiple values. It shows all points an lines that are there. And I can also switch the data layer on and off correctly. That's why I am thinking views has a problem with handling the multivalue field.

Comments

tmcw’s picture

Category: bug » support

What is your intent for storing multiple values? The pattern within OpenLayers is to allow multiple features in a single field, rather than doing CCK-style multiple values.

marcusx’s picture

StatusFileSize
new141.18 KB
new74.62 KB
new122.62 KB

You are quite right I don't want to store data like allowing uploading several images into a CCK field where I get an "Add another" button. But this is not happening with the WKT field. The option works right from my opinion (It changes the amount of values I can store in one single field). If I set the value to unlimeted I can store several features in on single field. If I leave it to 1 I can store only one feature in still this on single field. If I add a second point on the input map the point entered before is erased.

I also tried to trick it. I tried to copy a string with several features (2 Points, 1 Line) into a field where only one feature is allowed, thinking its only a stupid string. Haha, not with me says Drupal, this is recognised and the string is not saved.

I try to explain with some screenshots:

http://drupal.org/files/multivalue_map_problem_2.jpg - My Testnode with one WKT field. There I change the value from 1 to unlimeted.

http://drupal.org/files/multivalue_map_problem_3.jpg - Case one, and default. Number of values is 1. You can put only one Pin into the map.

http://drupal.org/files/multivalue_map_problem_5.jpg - Case two, and that what I need. I can put more than one pin into the map. And an additional line or something.

Hope this clears things up, and explains why I think this is a bug and not a support case. But anyway - I am very happy for all your quick help and response. Thanks a lot, again!

zzolo’s picture

Hi @marcusx, many thanks for the screenshots and the full explanation. I am still confused on what you are trying to do.

Do you want to configure a single WKT field to have a certain number of specific features, like X Points, Y Lines, and Z Polygons?

marcusx’s picture

StatusFileSize
new93.86 KB

I want to store n-lines in one single WKT field.

The exact use case is as follows.

I am building a site for a communal distance heat project. They want a map where you can see the progress of the pipe construction work. So I need to mark several streets per phase. So I build a node type called construction phase and wan't to store several paths inside the WKT field. Several paths because I have lots of T-crossings in each phase. My view should bring all the different phases on one layer or on a layer that depends on some filters inside the view. For example show me only the streets from phase 2,3 and 4.

In the attached image you can have a quick look what I got as raw material for a single construction phase. Theoretical I could create a node for each single path on this map and than bring it back together in the views again, maybe with an additional taxonomie field that groups the nodes that belong to one phase. But practical this is nearly immpossible for the user who has to put in the data. How could the user easily know which lines he has already painted? How to hit exactly the already existing path if you need to build a T-crossing if you can't see the existing one? There would be about 40 nodes per phase to create. My users wouldn't like to do that. Also it is very hard to find the node for a specific line if you need to correct something.

zzolo’s picture

@marcusx, do get only N-lines, You have to set two things in the field config:

* Type of features (only allow lines)
* Number of values

marcusx’s picture

Ok - but this is exactly what I did, and what causes my problem.

I quote myself from the beginning of this thread:

So I set "Number of values" in the WKT field configuration to unlimited.

After setting the number of values to something else than 1 - I can not aggregate the nodes in a view anymore.

zzolo’s picture

Category: support » bug
Priority: Normal » Critical

Ah. Sorry, my bad.

I just tested this out real quick and saw the same behavior. Not sure if this is an update to an existing field problem or if it exists for new fields. This seems like a pretty critical bug.

What version are you using, @marcusx? The issue says alpha10, but just want to make sure.

marcusx’s picture

alpha10 ist still correct. Is there much change to the dev version. Makes it sense to try?

marcusx’s picture

Just tested with the dev version. Same problem.

I used: 6.x-2.x-dev Download (105.65 KB) 2010-Oct-14

figs’s picture

Having the same problem, and agree it would be very if this worked :)

marcusx’s picture

Version: 6.x-2.0-alpha10 » 6.x-2.x-dev

I made a few more experiments whith the dev version. It seems that views can handle multiple vertics without problems and only doesn't like the field setting.

If I fill a WKT fields with multiple values by allowing multi values in the field settings and than changing the field settings back to 1 the views aggregated layer works as it should and shows all the vertics from all nodes in one layer no matter how many vertics are in the WKT field.

Is there anything I can do for helping getting this fixed? I really need it for my project. So if there is something I can do for tracking it further down, don't hesitate to give me some work.
If theres nothing I can do I will try to go with the workaround mentioned above, hopeing that my users doesn't want to change anything by themself. :-)

tommy kaneko’s picture

I can confirm that I also have this problem (duplicate here: http://drupal.org/node/822620#comment-3664028 ). I'm going to have a look at it today and see what I can do. Will give you a report soon. Bear in mind that I am not familiar with the code in this module, so I may well fail!

tommy kaneko’s picture

OK, I have solved it now. It happened to be one little thing with the views that feeds the data to OpenLayers (through the OpenLayers Data display). If you have more than one point/line/polygon on your OpenLayers CCK field, you have to make sure that the field (Content:xxx) with the WKT Value IS NOT GROUPED.

In short:
- Make sure "Group multiple values" checkbox for the WKT value field is unchecked when dealing with multiple points and polygons.

I feel stupid.

It took me 2 hours of diving into code to figure out that it was just a minor problem! If it still hasn't solved it for you, I seem to have learned a hell of a lot about the code, so it may be well worth asking me.

marcusx’s picture

StatusFileSize
new60.04 KB

Do you mean the grouping in the style options? See screenshot. That was always set to in my case. But I will give it another try whith the newest dev version.

looplog’s picture

Just confirming that unchecking "group multiple values" in the WKT field options (not the style options) fixes this issue.

adecampillo’s picture

Unchecking "group multiple values" in the WKT field options fix the issue but there is another problem. when you put 2 points and a line on the map are 3 points. In the map, line is changed by a point. I need points, lines and polygons in a cck but i can choose only one type. Any idea?

adecampillo’s picture

I solved my problem. If you configure a single WKT field to have a certain number or unlimited values (points,lines and polygons) you must unchek "group multiple values" in the WKT field options in views and unchek "cluster" in configure interactive map behaviors in preset.

zzolo’s picture

Priority: Critical » Minor

OL CCK field is deprecated for D7 and developer capacity on this module has significantly diminished. So, patches welcome.

mgifford’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Component: OpenLayers Views » OL API

Ok, so moving this up to D7.

@adecampillo - I didn't see the group multiple values field here:
admin/structure/types/manage/geogratis/fields/field_geofield

Should it be somewhere else?

zzolo’s picture

Version: 7.x-3.x-dev » 6.x-2.x-dev
Status: Active » Closed (won't fix)

Data input is no longer in the module. This is for Geofield if anything. Please move accordingly if it is still an issue.