I'm using an exposed Geofield Proximity filter to limit results to a certain range of a given location. This works fine, but I want to show the precise location of the search location. For example, when I enter a zipcode, the markers are filtered correctly, autobox zooms/center to show all the markers, but I can't see where the actual point is that I was searching for (and thus the proximity, without checking the markers).

It would be nice that the exposed filter could be used to act (or set?) the visitor location and possibly also to center.

I know this sort of things should also be possible with the 'Set location' block, but that option doesn't work wel for me for some reason. (Can't get it to work as supposed).

Is there anything I can do to make this work (eg. hook in somewhere) or would it possible to add? It would also work if I could set the current visitor location when a search is performed I guess.

Comments

rdeboer’s picture

Hi Barry,
As you mention yourself, the "Set my location" block of IPGV&M is the supported way of doing this.

IPGV&M just had a new release 7.x-1.26. I did fix an issue with the "Set my location" block, which was that under certain circumstances the "Move" me option would NOT work unless you had used "Find me" previously. Maybe it was that issue you ran into? In that case it is worth trying 7.x-1.26 together with the latest version of the Geofield module, currently 7.x-2.3.

Best,
Rik

ivoandriessen’s picture

I would like to see this feature also.

What I understand from the initial question is that it should be possible to center the map around the exposed filter content when there are no results.

When a visitor from another country wants to search for a location near a specific city, it isn't user friendly to show the map around the current visitor position. You expect to see the searched location as the center of the map.

rdeboer’s picture

That is what the "Set my location" block does.
If you type, say, Manhattan, it puts the visitor marker there regardless of where in the world the visitor really is.
Use it in combination with Geofield Exposed Proximity filter.
Rik

barryvdh’s picture

It's working pretty much as expexted now with the updated versions :)

Only thing is that the client didn't want a 'detect my location' block (because it isn't always correct), so they'd rather just have no location, or a manually given location. I've just hidden the detection choice and pre-selected the manual option with javascript, but that isn't the cleanest way.

rdeboer’s picture

StatusFileSize
new157.03 KB
new16.87 KB

Hi Barry,
Thanks for confirming!
Are you sure you have the latest version? What you did in Javascript you could have done though the UI. See attached screenshot with configuration options and the resulting block configured for a cycling enthusiasts web site.
Rik
Set my location config

Set my location for cyclists

barryvdh’s picture

I have set it like that. That indeed removes the option to find yourself. But I also wanted to remove the radio button, which is a bit useless with just 1 option. And it doesn't get selected automatically, I have to click the radiobutton first. Tested with latest dev version.

Imho, wanted behaviour would be:
- when just 1 option, no radiobuttons. Instead a hidden field with that 1 option.

rdeboer’s picture

I agree.
Will do that when I am next in the 'hood.
Rik

rdeboer’s picture

PS: the "Set my location" block works best when used in combination with the Views format "Map (Leaflet, via IPGV&M)"

rdeboer’s picture

Status: Active » Closed (works as designed)
jlongbottom’s picture

It would be nice if the "set my location" block could be integrated into Views.

Currently, the user has to pick a location in the block and submit that. Then after the page reloads, they can change any exposed filters on the view and submit that.

It should really just be 1 form that does both

rdeboer’s picture

@jlongbottom

True. It would would save 1 submit for cases where you have exposed filters and you want to change location at the same time.

We still need the current set up with "Set my location" as a separate block as well, as a common use case is that the visitor sets their location somewhere on the site ONCE (using the block) and then experiences this being re-used automatically multiple times on multiple pages/Views.
Very much like a Global Filter, http://drupal.org/project/global_filter.

Rik

jlongbottom’s picture

Ok ya that makes sense too.

My issue is that I would like the user to be promoted for HTML5 Location as soon as they land on my view. After accepting the location info request, the view should refresh with proximity-based search results.

Right now, they need to do the "set my location" step, then give the website permission to access location, then submit the view. It should be 1 click for the user, not 3.

jgardezi’s picture

Hi @jlongbottom, did you achieved promoted for HTML5 Location functionality as visitors land on the view?

If yes, can please let me know. I am having similar sort of issues.

jgardezi’s picture