Is there any module I can use to display limited points on OpenLayers using bbox-filtering in Drupal?


try http://drupal.org/project/views_geojson

with the latest version of views_geojson and openlayers you can define a view (of type geojson) that accepts a bounding box as a parameter.

With openlayers you can set the layer to use a bbox strategy so when you drag the map around it will send the bbox coords to the geojson view and just return points within that area.

I am new to Drupal and Im not going to lie this was a bit of a bastard to setup because there is not much documentation. I couldn't get the bbox contextual filter to work so I setup a custom filter that used top,bottom,left,right then wrote a rewrite rule in an .htaccess file that split the default parameter passed from the openlayers front end (a GET variable like BBOX=42,124,43,125) into the four filter parameters. This will NOT work if you expect your map to cross the equator or 0 meridian. But it works for me and I still hope to get contextual filters working at somepoint.

  • The module has a BBOX contextual argument. It works like a charm using open layers.I needed to select 'provide default value' then 'Bound box from query string' as that's how open layers provide for it. – Clemens Tolboom Jan 2 '13 at 17:24

I would think you'd simply define this in the OpenLayers config admin/structure/openlayers/maps however, I didn't find it unfortunately. I think it's somewhere buried in the config options though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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