Sorry that's not very technically elegant...that's part of the problem...I'm not sure what class of functionality this fits into.
We have a collection of nodes with one location each.
On an overview map, we want to show all nodes and provide a couple of filters that users can set.
The idea is that when the overview reloads with the filter applied we get the filtered nodes displayed in a distinct style. A slight complication is that these filters are contextual: so we can't set and forget in the View itself.
Now, Views wants to run a query and return *only a found set*. I don't think I know how to tell Views: go get all the rows, but for those which match this filter, rewrite the row in some way so we can style it differently"...afaik, Views runs a filter and returns *only those matching rows*. So we lose the rest of the data.
To get the whole set od points back into the map I would have to duplicate the data layer: one layer of data to show all points, and a layer on top of that to show the currently filtered points.
This sort of works (popups don't seem to like it at all, which is a show stopper for us), but it feels techncially inelegant.
Can anyone clue me in as to the sweet and nartrow path for doing this sort of thing?
Thanks in advance!

Comments

ifrik’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not quite sure whether I really understand what you want users to see:
- All points should be shown on the map
- Some points should have a different marker, depending on one or several filters that the user sets.
- Pop-ups for all the points - or only for the filtered points?

Markers are assigned by layer, so you will have to make several layers to get different markers. I don't think there is a way around at that at the moment - even if that means that the filtered points also show up in layer with all points.

About the popups: What do you mean with "popups don't seem to like it at all"? Do you not get any popups? Do you get the filtered points with two popups?
Do you actually have popups enabled for both layers? Are the layers in the correct order? And do you maybe have clustering enabled as well

boabjohn’s picture

Thanks for taking the time to ask for clarifications.
1. All points should be displayed
2. Some points are displayed differently based on the Views dynamic filter (ie, the results set is styled differently)
3. Pop-ups should be displayed for all points

So yes, I started by making multiple layers: one for all points, and then on top of that, the same data but now filtered by Views.
Since the data/display/and filters are hardwired into a single stack, this means creating *4* views just to get the end result:
- data overlay, unfiltered
- map display, unfiltered
- data overlay, filtered
- map display, filtered

Having done this, we now turn on popups for both layers. But in my case only one layer would react with popups, the bottom of the two layers (ie, unfiltered).

Clustering is not turned on.

If there's no smooth solution to this usecase, I'm content: will do it the hard way. I just wanted to check that I wasn't missing the obvious. It seems like a straightforward thing to want to do...so I thought it should be pretty well supported.

I've done some conditional styling with SLDs before, and this is good to create a simple "distinction" amongst a set of points by putting the conditions into the SLD markup.

But in this case using an SLD to do the conditional styling would basically mean leaving the huge power and flexibility of Views untapped.

Thanks again for your insights and guidance.

basvredeling’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Cleaning up the issue queue for #2670484: Stable 7.x-2.0 release.

If I understand correctly the trick would be to make 2 layers:
One with all points except the filtered points and a second with only the filtered points.
Views argument based filtering can be applied both inclusively and exclusively.