various bbox argument handler fixes:
- use real_field instead of field when constructing the field name for the query filters.
- use ensure_table instead of add_table to avoid unnecessary joins.
- Universally use 'bbox' as default for arg_id instead of 'BBOX' as described in the issue
- added a fix to the patch that declares arg_id option_definition of views_plugin_argument_default_bboxquery and therefore makes it exportable. (see #1859954: Views GeoJSON arg_id isn't exported
- also a bigger cleanup to views_geojson_bbox_argument that removes all $_GET handling, which from my point of view was duplicated and should only live in views_plugin_argument_default_bboxquery
background / original issue description:
1) while working on #1839462: BBox argument handler doesn't work with GROUP BY for geocluster, i realized that i don't need the bbox handler to support having but made some small changes which solve some problems for me.
2) to prevent cluttering into too many issues, i have merged the changes from #1859938: Universally use 'bbox' as default for arg_id instead of 'BBOX' into this patch.
Comments
Comment #1
dasjoComment #2
dasjoto prevent cluttering into too many issues, i have merged the changes from #1859938: Universally use 'bbox' as default for arg_id instead of 'BBOX' into this patch:
- Universally use 'bbox' as default for arg_id instead of 'BBOX' as described in the issue
- added a fix to the patch that declares arg_id option_definition of views_plugin_argument_default_bboxquery and therefore makes it exportable. (see #1859954: Views GeoJSON arg_id isn't exported
- also a bigger cleanup to views_geojson_bbox_argument that removes all $_GET handling, which from my point of view was duplicated and should only live in views_plugin_argument_default_bboxquery
Comment #3
clemens.tolboomIn #1877902: Tile based argument I've done some rewrite too but moved all argument handling out of ::query
What I miss in BBOX is the no argument found handling it dumps ALL nodes which is contrary to 'limiting nodes'. Not sure that's a feature or a bug.
Another point is do we need Views Geo JSON provide for BBOX or ZXY? Is a seperate project not better? See comment #2 in #1877072: Allow BBOX in other display format.
Comment #4
clemens.tolboomThe
function _get_fields($data_source) { .. }is never used so this patch also removed that.Nice catch for the duplicate table joins ... we were wondering where those came from.
Comment #5
clemens.tolboomXREF #1806048: BBOX filter not working
Comment #6
clemens.tolboomcommit c4216d961b45062910644dd5eac7143b2ce7df76
Comment #7
clemens.tolboomIt seems the
function get_argument() {is never called on my system.I continue through #1894494: $this->argument can contain value TRUE.
Comment #8
clemens.tolboomI've reverted this back.
Testing this with the views preview without the patch gives a query like
AND( (location.longitude >= '?bbox=4.6647254729841') AND (location.longitude <= '5.1062385270159')which is only explainable when $this->argument = ?bbox=4.6647254729841...
But running this from within a map $this->argument === TRUE
Comment #9
dasjoi don't really see what #7 and #8 have to do with this patch?
Comment #10
clemens.tolboomYou're probably right ... I'll retry the patch next week.
Trouble for me is the argument handling is almost untestable :(
Comment #11
dasjoi have rerolled the patch + updated the issue summary.
i'd be glad if i can help testing it. i'm using it in combination with http://drupal.org/project/leaflet_geojson + http://drupal.org/project/geocluster
Comment #12
dasjoups here's the patch
Comment #13
randallknutson commentedPatch worked for me. I'm using it in a recipe mentioned in #1641870: Bounding Box support with Search API views
Comment #14
batje commentedWhen I base a view on a search_api_views view, all the SQL magic in the arguments->query() function is not supposed to happen.
This version of the patch has a (ugly) check for that.
Comment #14.0
batje commentedupdated summary
Comment #15
mpgeek commentedIn #2170641: Strict warning in views_geojson_bbox_argument.inc there's a quick fix for the
query()method in the argument handler class. The patch there conflicts with the patches here in this issue. Here is an updated patch and interdiff that includes the patch from #2170641: Strict warning in views_geojson_bbox_argument.inc.Comment #16
polCommitted, thanks all !
Comment #18
clemens.tolboom(Never assign to myself)