1

I'm facing a problem with geofield map and I can't find a solution. So I have a view with a geofield map format. There I show all nodes from one node type as markers. Under my map I have an attachment also with all nodes, but as a list with more details.

Now the problem: I want to filter the attachment when I click on a marker from the map. For example - I have 10 markers on my map. These 10 markers represent 10 nodes which are also shown in the attachment beneath. When I click on one marker on the map I want the attachment to show only one node in the results. It would also be great if the result would be updated via ajax.

enter image description here

I hope somebody can help me. :)

1
  • Could you find an unique id for each location (maybe nid), and use it as a data attribute and then use javascript to handle the filter functionality? Ajax can be done in js too.
    – cchen
    Commented Jan 31, 2018 at 2:44

1 Answer 1

0

So You have 2 views on the Page 1 view is the Map and another view is the "attachment"

You need to look in to how to use Contextual filters look at the Url Arguments in A view (see https://www.youtube.com/watch?v=aVwclF9TfBo | and https://www.youtube.com/watch?v=zbdQghFj0lU)

A Very Quick Way to get this done is, in your Map View add 2 new fields Content id and a Global: Custom text field then in your new custom field view add

 <a href="/map?show={{ nid }}" class="use-ajax btn">Quick View</a>

where /map is the path to your map page,

Then open your Map FORMAT Settings and scroll until you see

"MAP MARKER AND INFOWINDOW" in Marker Infowindow Content from select your new field

Then save the map view.

Open Your "attachment" view and add a CONTEXTUAL FILTERS

selecting "ID" in the Content Category.

config like

tick Provide default value

Type = Query parameter

Query parameter = show

this will give you

enter image description here

this is not 100% exactly what you want but then you can start to add a custom js file to target the marker click event and auto trigger the window link - good luck !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.