I have seen many patches to get the proximity filter working from a users IP address, however I haven't seen any issues suggesting using the excellent new HTML5 Geolocation feature.
Basically any HTML5 compatible browser can send a users exact Long / Lat with just a simple request to the user.
It works especially well for GPS enabled smart phones.
Imagine creating a view for Iphone / Android visitors that showed their nearest restaurant etc.
Or for desktop users, no need to manually type their postcode into the search filter.
I'm happy to get working on this patch, but wanted to check first that no one else was working on it, or has a solution.
I think best way to implement it would be as a new drop down in the location-views distance proximity filter. Named "User location from HTML5 GeoLocation".
With maybe some fall back for users with older browsers.
Your thoughts and comments please.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | location-html5-geolocation-proximity-filter-1126894-13.patch | 3.58 KB | dnotes |
Comments
Comment #1
medden commentedThis html document shows just how simple it is to get the lang and long values from a visitors browser.
I believe Drupal.Org uses this approach already on it's user profile pages.
Would be really good to have it baked into the location module.
Comment #2
Anonymous (not verified) commented+1
Comment #3
hoomanb commented+1
Comment #4
gamelodge commentedhttp://drupal.org/node/820116
Comment #5
jucado commented+1
Comment #6
bsandor commentedSubscribe
Comment #7
liminu commentedSubscribe, some news?
Comment #8
chrylarson commented+1
Comment #9
poli commented+1
Comment #10
davycw commentedYou could try using the HTML5 geolocation widget from Geofield http://drupal.org/project/geofield and OpenLayers Proximity D7 sandbox https://github.com/jpstrikesback/proximity.
Comment #11
d3vo commentedI can get both modules working great. Not sure how to combine both to populate the proximity filter. Could you explain how it would even be possible to use the 2 modules to make this happen? Thanks
Comment #12
Stomper commentedDoes this mean we can capitalize on the GPS on a mobile device for geolocation too?
Comment #13
dnotes commentedAttached patch provides support for geolocation through the smart_ip module, which handles geolocation through html5 along with several other methods. I had been using geoip module before (I provided the patch for #820116: Proximity filter - Searching near a visitor's ip address, using the geoip api module) but I think this is a much better way to go. In fact, if you wanted to get rid of geoip module support at this point, I think it would be fine since smart_ip has much more traction, but I left it in there for this patch anyhow.
One important note related to this thread in particular: in order to use html5 geolocation, you must enable not only the smart_ip module but also the device_geolocation module that is included with it.
Comment #14
podarokNice addition #13
commited pushed to 7.x-3.x
Thanks!!
I`ll glad to see here a test coverage for Your work with feature testing for release and support stability in feature
For this look at *.test files at tests directory for examples