Closed (fixed)
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 May 2012 at 13:47 UTC
Updated:
19 Jul 2012 at 14:47 UTC
Jump to comment: Most recent file
Subissue of #1469956: [Meta] - Improve Views-powered Geofield proximity searches
We currently have 2 sets of views handlers to do proximity searches (found in 'views/handlers' and 'modules/geofield_proximity/views/handlers'). These really shouldn't be separate since they're basically doing the same thing, but with different input methods.
Part of the reason geofield_proximity is a separate submodule is detailed here (tl;dr - didn't want a geofield dependence on geocoder). We should be able to adjust our code to only display/use the geocoder-related stuff if geocoder is enabled, much like how we currently support OpenLayers.
Other stray observations:
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 20120515-n852hfr4xj77c3g9nhcbmuqu9c.jpg | 46.21 KB | Brandonian |
Comments
Comment #1
Brandonian commentedWork is in progress on the proximity branch (checkout instructions at http://drupal.org/node/1087170/git-instructions/proximity). Work is more or less complete on the field handler, pending rigorous testing.
The filter handler will be the most complex of the 3 handlers (field, filter and sort) due to the handler's unique ability to be exposed to an end user. In an attempt to a) simplify views integration and b) make non-views powered distance filtering easier to build, we've created a custom FormAPI element (geofield_proximity) which takes 3 values, origin, distance and units (i.e., "[distance] [units] from [origin]." We'll use this element to handle passing data back and forth to the views handler.
Comment #2
Brandonian commentedMade some more progress on the filter. At this point, you can create a simple filter (i.e., not searching between 2 distances) with the geocoder option enabled. The filter also works as an exposed filter.
Comment #3
jimiobrien commentedGreat work on this Brandonian. After installing the proximity branch I get a lot of "cannot redeclare" errors for geofield_proximity sub module, as they're already declared in the geofield main module, in the elements.inc. I'm assuming that since geofield_proximity is staying as a sub module the "geofield_proximity" functions in geofield.elements.inc are no longer required?
That is the roadmap isn't it. Keep proximity as a submodule?
Comment #4
Brandonian commented@JimmyO, The opposite actually. geofield_proximity was originally built separately in order to ensure that geofield itself didn't need a hard requirement for geocoder, but the code I'm writing takes advantage of module_exists calls in order to ensure we don't accidentally use something from geocoder without it being present. You should be able to disable geofield_proximity.
Comment #5
giorgio79 commentedFantastic stuff, will be testing it now.
Could we add an HTML5 Geolocation "Locate me" button next to the proximity fields? Most users would be interested in stuff near them.The HTML5 Geolocation widget is already available for input, and having it as a filter would be great. Perhaps a button like this:
http://openlayers.org/dev/examples/geolocation.html Or should this be a separate filter?
WOW, I missed on the screenshot the geocode option, yeeehaa
1. Would be great to optionally set the geocode to auto prompt the user for their location when the page loads? Without them having to click on the Apply filter button?
2. Could we have the visible map view itself as a bounding box filter? Similar to Panoramio, or on my site at http://clipglobe.com I built a few years ago. If you zoom you can see the videos being repopulated depending on what is visible on the map.
PS Raising this 2nd question as a feature request for geo facet to integrate with http://drupal.org/project/facetapi
Comment #6
Brandonian commentedFixed. geofield_proximity is no longer a submodule, and it's functionality is superseded by geofield's proximity filters.
This happened over lots of different commits, just listing the removal of geofield_proximity.
http://drupalcode.org/project/geofield.git/commit/ec6ddad6fb7bb5d91f6c68...
Comment #8
IWasBornToWin commentedI can't find any way to do any type of proximity search or to add anything with the word proximity in views. I've installed addressfield, geofield, and geocoder. I was about to install geolocation proximity but it said that was for geolocation not geofield. So how do I go about sorting and/or viewing distances between two locations?
Thanks