Hi, zzolo,

another question: I want to create the (fairly common) combination of a map view with an attached table view such that a zoom in the map restricts the table below the map to the items which are visible in the map, i.e. restrict the attached table to the bounding box of the (dynamically zoomed) map. Has that been done with Drupal7? How should I aproach it?

I understand that I need an AJAX / AJAH like behavior here. One idea would be to capture the OpenLayers event for a change in pan/zoom (I'm sure there is a suitable callback function?) and load a table view with GET parameters for the lat/long boundaries into an initially empty div in the footer of the map.

Would you agree to this approach, or do you see a better way?

Thanks in advance!
-Karsten

Comments

kathrynrtb’s picture

I also need to do this, but in Drupal 6. Is it possible?

nod_’s picture

The issue here is that there is no views filter for bounding boxes (that I know of).

You can listen to map event like zoom and move and get the bounding box quite easily with OpenLayers API. I can provide a couple of lines of JS to take care of that but I'm afraid you'll be on your own for the view filtering :)

jeffschuler’s picture

mgifford’s picture

@nod_ I'd be interested in getting the JS for the API. I can probably do another search to pull out the relationship between the bounding box & the nodes I'm creating.

I don't know how to do a query of any sort for a bounding box, but certainly am interested in hearing if this has been done for any other Drupal project.

zzolo’s picture

Status: Active » Closed (works as designed)

Hey @Karsten.S. This is out of the scope of this module at the moment. You can use the Behavior system in the module to access the map and its events, then use the OL library to make changes. http://dev.openlayers.org/docs/files/OpenLayers-js.html

There is work being done to utilize GeoJSON, Views, and bounding boxes which would help this sort of thing, but what you want is probably still needing custom code.
https://drupal.org/project/views_geojson

Closing for now. But feel free to re-open if you have more questions.