Hello

I kindly ask for guidelines on how to make Leaflet interact with Views in a sense that it updates Views results.

In other words - how to do solution like Foursquare has?
When you update map, then it should update the results listing on the left, based on visible area/markers on the map.

As an example, here is one image: http://limegrow.com/drupal_leaflet_views.png
Desired result is that if I move map and no markers are visible after move, then Results area on the left should be empty also - that means map should update Views results.

Should I build custom Ajax solution where after the map moving, JS collects all the markers from visible map area (if there are any), then feeds them into Views, gets back results and replaces results area HTML on the left?
Or is there more cleaner solution? :)

Any guidelines on how to approach are very appreciated.

Kind regards

Raido

Comments

paean99’s picture

This post implies that it may not be an easy problem Capture zoom and pan events and update view attachments via AJAX :(

adroid’s picture

Thank you paean99 for that link.

It seems bit complicated indeed.
Challenge accepted! :)

paean99’s picture

:)

paean99’s picture

Views Geofield BBOX argument module and Polygon draw sandbox could be of help.

adroid’s picture

Yup, Views Geofield BBOX argument helps a lot.
We recently created this module, to solve that challenge I was pointing out before. :)

We can now ask from Views to give us all nodes that fit into bounding box / visible area.

paean99’s picture

Nice :)

destinationsound’s picture

Thank you very much for the module!

Is there any documentation on how to set it up? or possibly a screencast?

I installed the module and saw the new option within my view. It even seems to be excluding map location pins that are off of the visible map, and loads them when i move the map.

However, i can't seem to get the corresponding list to update.

can you please help?