This patch adds another Views filter plugin which extends (subclasses) the existing geofieldProximityGeocoder class, so that instead of inputting a postal address the visitor may leave the field blank to filter the View on locations within the entered distance from the visitor's CURRENT LOCATION.
See the screenshot, where the filter was used to filter a View Page (map) + View Attachment (the table underneath, reflecting the map).
in the map the green marker represents the visitor's current location, while the remaining markers are the locations after the filter was applied, with a radius (distance) of 1.5 km.
For HTML5 location retrieval this patch relies on IP Geolocation Views and Maps.
The module uses Smart IP as a fallback, executing an IP address lookup, if the HTML5 (satellite and WiFi) based location retrieval fails.
That same module also produces the map in the screen shot and the configurable markers.
Apply the patch against the 7.x-2.x branch, using the attached .patch file as normal.
Then also drop the new file geofieldProximityGeocoderWithHTML5.txt in sites/all/geofield/views/proximity_plugins, changing its extension from .txt to .inc
Don't forget to execute /update.php before configuring your VIew.
Comment | File | Size | Author |
---|---|---|---|
#65 | adopt1.jpg | 120.69 KB | artatum |
#64 | Screen Shot 2015-07-03 at 12.08.03 am.png | 175.06 KB | RdeBoer |
#59 | 2011340-views-proximity-filter-59.diff | 7.9 KB | heshanlk |
geofieldProximityGeocoderWithHTML5.txt | 811 bytes | RdeBoer | |
geofield_proximity_with_HTML5-1901750.patch | 2.4 KB | RdeBoer | |
Comments
Comment #0.0
RdeBoerformatting
Comment #1
RdeBoerPS1: naturally, if in addition to a distance figure (the 1.5 km in the example above) the user DOES type a street address or partial street address (e.g. just "Melbourne"), then this new plugin falls back to the old geofieldProximityGeocoder behaviour.
PS2: the above setup requires the Geocoder module
PS3: You can use the "Refine location via street address" block from the "IP Geolocation Views and Maps" module to display the visitor's reverse geocoded HTML5 position. That is the street address where the system believes the visitor is located, based on the latitude/longitude coordinates the browser/device received via satellite and/or WiFi.
Comment #2
pixelsweatshop CreditAttribution: pixelsweatshop commentedI have done some testing and it seems to be working really well so far. Rik, I have PM'd you with a link so you can see your work out there in the wild.
Comment #3
Brandonian CreditAttribution: Brandonian commentedNice! At a glance, looks good, I'll take a look later to provide notes/commit.
Comment #4
RdeBoer@Brandonian #3:
Some notes from me:
The plugin as it is has a conditional dependency on "IP Geolocation Views and Maps", via
if (module_exists('ip_geoloc')) { ...
.This is a quick fix that works, but isn't great architecturally.
This could be improved by having Geofield expose a hook that allows other modules to pass in lat/lon of the default point of interest, be it the visitor's current location or an externally geocoded street address. That hook may also be used in existing or future sections of Geofield code. I for one would love to take advantage of it in a proximity CONTEXTUAL filter for Geofield, which could then be driven by Views Global Filter. This is functionality that already exists between Views Global Filter and the Location module.
Alternatively, using a hook or CTools plugin approach the proximity plugin system in Geofield could be made more extensible, so that the above
geofieldProximityGeocoderWithHTML5.inc
plugin could live in the IPGV&M module. This is pretty much what was requested here also: #1991828: Provide a hook_proximity_views_handlers such that other modules can implement a proximity_views_handler.Rik
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedafter applying this, I did as the filter config picture says.
I get this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'A' in 'where clause'
part of the views query:
AND (( A * ACOS( COS( RADIANS(45.3101717) ) * COS( RADIANS(field_data_field_geofield.field_geofield_lat) ) * COS( RADIANS(field_data_field_geofield.field_geofield_lon) - RADIANS(-89.0166135) ) + SIN( RADIANS(45.3101717) ) * SIN( RADIANS(field_data_field_geofield.field_geofield_lat) ) ) ) <= A) ))
Comment #6
RdeBoer@SocualNicheGuru:
Have you run update.php?
Comment #7
pixelsweatshop CreditAttribution: pixelsweatshop commentedI have to say that we have been running this patch for the last few weeks without issue. @SocialNicheGuru when you get a chance, can you follow up to see if running update.php fixes your issue, so we can push this patch along?
Comment #8
aliciatheduff CreditAttribution: aliciatheduff commentedThis patch worked great for me as well, it threw an error until I ran update.php, so that might be @SocualNicheGuru issue.
Comment #9
GBain22 CreditAttribution: GBain22 commentedI have tried this recently and I keep getting "Visitor Location not available" - I can see this is called from the new .inc file - does this suggest something wrong with the geolocating?
Comment #10
pixelsweatshop CreditAttribution: pixelsweatshop commentedgo to admin/config/system/ip_geoloc and make sure you select some user roles for which the HTML5 location may be sampled and reverse-geocoded to a street address
Comment #11
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedthe above works. I re-installed and applied.
Comment #12
pixelsweatshop CreditAttribution: pixelsweatshop commentedComment #13
funature CreditAttribution: funature commentedmaybe it is better to put a "my location" button there, so that the user can easily locate to the current position anytime. just like the geolocation field widget.
Comment #14
mgiffordAgreed that a "My location" button would be a good prompt.
Comment #14.0
mgiffordmention branch to use
Comment #15
bneil CreditAttribution: bneil commentedRe #4 RdeBoer-
I think that's what is being requested in #2134777: Allow other modules to define their own proximity plugins which would then make it easy for this to live in IPGV&M.
Comment #16
camoa CreditAttribution: camoa commentedI really need the "My location" Option, anyone has any idea or can point me where and how to modify the code to accomplish this?
Thanks!
Comment #17
JayShoe CreditAttribution: JayShoe commentedHello,
Thanks RdeBoer this is going to help my site shine.
Jay
Comment #18
RdeBoerRe #17:
That's sweet of you to say Jay!
Rik
Comment #19
JayShoe CreditAttribution: JayShoe commentedRik,
Is this going to get committed?
Jay
Comment #20
RdeBoerHi Jay,
I don't know. It's not up to me, as I'm not the maintainer of Geofield and do not have the permissions.
Brandonian may know.
Rik
Comment #21
jsibley CreditAttribution: jsibley commentedThis seems like a really helpful enhancement.
Are we at all close to getting this committed?
Thanks.
Comment #22
jsibley CreditAttribution: jsibley commentedI have tried the patch, and it seems quite good but I have 2 questions:
- When the user inputs an address, the proximity field seems to provide the distance from the user, not from the address that was input
- When the user inputs an address, the map is centered on the user's location, not the location that was input
Perhaps these issues are related, and perhaps there is some user error involved?
Is there something I should be doing differently on my end?
Comment #23
camoa CreditAttribution: camoa commentedI am getting a lot of this warning, Anyway to debug the reason for this or how to improve the location detection?
Thanks
Comment #24
rofsky CreditAttribution: rofsky commented@jsibley have you found a solution? I also need to center the map on the input location.
Comment #25
jsibley CreditAttribution: jsibley commented@rofsky, I haven't found a solution yet, but I might have a clue.
I don't know the internals of Drupal and of views well, but I think that the patch takes care of filters and sorting in views, but might not have patched where the actual field that gets displayed.
When I look at the SQL returned by the view and put in a location as an exposed filter, I see the values for the filter change, but the value of the field does not.
So, here is what I see for the field after I have put an address into the exposed filter:
( 3959 * ACOS( COS( RADIANS(40.813642200000004) ) * COS( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lat) ) * COS( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lon) - RADIANS(-74.21709899999999) ) + SIN( RADIANS(40.813642200000004) ) * SIN( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lat) ) ) ) AS field_collection_item_field_data_field_address_plus_phone__f
Here is what I see in the filter:
where ......(( 3959 * ACOS( COS( RADIANS(40.9792645) ) * COS( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lat) ) * COS( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lon) - RADIANS(-74.1165313) ) + SIN( RADIANS(40.9792645) ) * SIN( RADIANS(field_collection_item_field_data_field_address_plus_phone__field_data_field_geoaddress.field_geoaddress_lat) ) ) ) <= 10) ))
The sort uses a label from the field, so it will also be incorrect.
Unfortunately, I don't know where this would need to be changed in the code. Hope this helps, though.
Jonathan
Comment #26
RdeBoerA proper, maintainable solution should be built upon a proper maintainable framework.
The patch referred to above in #15, #2134777: Allow other modules to define their own proximity plugins, sounds like a great start. It's small, easy to apply and not likely to have any side-effects. With that in place I'm happy to re-roll the above functionality with any bits relying on third-party modules, e.g. http://drupal.org/project/ip_geoloc, located there.
Rik
Comment #27
jsibley CreditAttribution: jsibley commentedRik, are you saying that once the patch mentioned in #15 is committed, you would be willing to create a new patch with the HTML5 functionality? Would that potentially resolve the proximity field issue mentioned in #22 and #25, as well?
Also, in the meantime, do you know where the proximity calculation is defined?
Thanks!
Comment #28
RdeBoer@jsibley,
Well a new patch would not automagically solve the issue. I'd have to investigate first where the bug originates, then rewrite the code and include the fix.
But the great thing about doing #15/[2134777] is that the patch would no longer have to consist of code entangled with Geofield. With #15/[2134777] in place we'd have an even more extensible, maintainable Geofield framework. Geofield is already architected very well -- this last part (or a solution similar to it) would be the icing on the cake for all of us.
Any new functionality of this kind could then added as a stand-alone mini-module or a class, and reside inside Geofield (as a separate file), IPGV&M or another module, wherever it is best suited. #2134777: Allow other modules to define their own proximity plugins already contains a lovely example of such a mini-module.
This keeps Geofield clean while making any extensions separately maintainable, so it does not burden the Geofield maintainers.
Comment #29
MrPeanut CreditAttribution: MrPeanut commentedNot contributing anything other than to say that this patch works incredibly well for what I'm doing. Hope to see it incorporated in one way or another!
Comment #30
RdeBoerRe #22... just cross-referencing to #2117397: Map centering option in searched location of geofield proximity exposed filter
Comment #31
campbdy CreditAttribution: campbdy commentedI would love this functionality. Am not confident about applying any patches, so the sooner it gets implemented or a new module created the better. Great work folks. Will follow thread with interest.
Comment #32
RdeBoerJust to say that I'm about to do some more work on this, proceeding along the lines of #28.
In the mean time, a few observations and tips in response to some of the comments above, after applying the patch (which today, still applies cleanly against the Geofield 7.x-2.x branch)
Re #22, 25 (jsibley) and #24 (rofsky) "When the user inputs an address, the proximity field seems to provide the distance from the user, not from the address that was input."
I did not find this to be true. The distance in shown in the FIELD is with respect to the location typed in the Exposed filter provided you select "Exposed Geofield Proximity Filter" as the "Source of Origin Point" for the FIELD.
For the FILTER Source of Origin Point" should be Geocoded Location with HTML5 default".
Re #22: "When the user inputs an address, the map is centered on the user's location, not the location that was input"
Yes, but you can make them one and the same by using the "Refine your location" block (enabled for the same page as the map) from module IP Geolocation Views and Maps (7.x-1.25) and entering "me" for the the Exposed filter location. The "Refine your location" block has a location input field to override the HTML5 location, which is then picked up by the Geofield exposed filter.
You can take it a step further by pressing the "Grouped filters" radio button and entering a number of distances for a drop-down, all with "me" as the location. The exposed filter then reduces to a simple drop-down with filter distances, e.g 1, 5, 10, 100 miles. There will be no text field to enter location, as the location is taken automatically from the "Refine your location" block, which produces either the HTML5 location or a typed partial address.
See this screenshot and comments https://drupal.org/node/2176513#comment-8545667. There are some suggestions in that thread for improving the UX that I'm looking at also.
You can even switch on AJAX so that there's no "Apply" button and the map refreshes automatically the moment a new filter distance is selected.
Anyway, with all that in place and some reworking of some of the texts for the blocks and filter labels it can be made quite nice, but I feel it can be better still. I'm doing some work on this now, but not sure how far I get in the time I have.
Comment #33
RdeBoerFollowing on from the above. I've realised my ideas here: https://drupal.org/node/2176513#comment-8731579.
Requires this simple patch to Geofield: https://drupal.org/node/2134777#comment-8731227
I hope Brandonian or one of the other committers can apply it soon.
Comment #34
jsibley CreditAttribution: jsibley commentedThis seems great, but I'm confused about which versions (dev, patched, downloaded version of a customized module) of geofield and ip geolocation now represent the "latest and greatest" (html5 default, refine location block, etc.)
With the various issues and patches adding functionality, I'm unclear what I should be using now.
Thanks!
Comment #35
RdeBoer@jsibley, #34
Yes it has become confusing this thread, hasn't it?
Now that the dust has settled, go with:
o Geofield 7.x-2.x branch (https://drupal.org/node/1360636, 17 Nov 2013), with this patch applied: https://drupal.org/node/2134777#comment-8823463
o IPGV&M 7.x-1.x branch, e.g. 7.x-1.x-dev (https://drupal.org/node/1365582, 5 June 2014 or later).
Comment #36
jsibley CreditAttribution: jsibley commentedAre the above supposed to include the html5 default patch? I'm not seeing that option in my view, but maybe I'm not looking in the right place.
Thanks!
Comment #37
RdeBoer@jsibley, #36:
It should be. Have you run
/update.php
?The HTML5 default shows up when you specify the Source of Origin on Geofield proximity fields, filters and sorts.
Rik
Comment #38
jsibley CreditAttribution: jsibley commentedIt says I don't have any updates to run, so I think I'm up to date.
I think I'm also seeing the wrong "refine my location" block, as I only see a place to write an address, not the radio buttons.
Comment #39
RdeBoerYep, then you have the wrong version of IPGV&M 7.x-1.x-dev. In the latest version the block is called "Set my location".
Comment #40
jsibley CreditAttribution: jsibley commentedThanks. I must have made a mistake at some point, as I thought I was running the correct dev version but was not.
Is there something I need to do to recode existing addressfield values? I have them in a field collection in a profile2 profile.
I see geoaddress longitude and latitude but am getting this with a new view:
None of the 11 result rows in view maptest (Page) had their ip_geoloc_latitude set. Therefore those rows could not be displayed as locations on the map. Are you using the correct field names?
I have tried running update.php again but it says there is nothing to update.
Thanks.
Comment #41
RdeBoer@jsibley, #40
If they're in a field collection you could be in for a rough ride.
You may have to move them into Views PHP variables ((as in the Views PHP module) first and then map those.
See #2267015: unable to map on php field result (where the latitude is retrieved).
Comment #42
jsibley CreditAttribution: jsibley commentedWhen and where is ip_geoloc_latitude set and where is it required?
It appears that I can use these versions of geofield and ip_geolocation to create some maps. I'm not sure if it is the html5 option and/or the set my location that is creating the problem and am still running some tests.
Thanks.
Comment #43
jsibley CreditAttribution: jsibley commentedAlso, in case it helps, this is from the error message I am getting:
field_field_geoaddress = Array ( [0] => Array ( [rendered] => Array ( [#markup] => Latitude: 55.378051000000
Longitude: -3.435973000000 [#access] => 1 ) [raw] => Array ( [geom] => POINT (-3.435973 55.378051) [geo_type] => point [lat] => 55.378051000000 [lon] => -3.435973000000 [left] => -3.435973000000 [top] => 55.378051000000 [right] => -3.435973000000 [bottom] => 55.378051000000 [geohash] => gcve1c6080bv ) ) )
and in watchdog:
Notice: Undefined index: lon in geofieldProximityManual->getSourceValue() (line 39 of /srv/bindings/0c0af6161f58491a8df36a8322c62f11/code/sites/all/modules/geofield/views/proximity_plugins/geofieldProximityManual.inc).
Comment #44
jsibley CreditAttribution: jsibley commentedSo, the good news (I hope) is that while you were hopefully asleep I have made some significant progress.
ip_geoloc_latitude had been filled in automatically, somehow, in the text box below the name of latitude dropbox. It definitely isn't something that I had typed in.
It appears that, even though I have relationships in the views from user to profile to addressplusphone (the field collection allowing multiple addresses with corresponding phone numbers for each user), choosing field collection item: geoaddress for name of latitude field seems to provide a map.
However, selecting [type field name] and putting in field_geoaddress gives an error.
Also, I have a proximity field that shows when a user's icon is clicked on in the map. If use geocoded location (without html5), the distance always shows as 0. If I use geocoded location with html5 the distance appears to work.
Finally, if this isn't too much at one time, it seems that if I select the "here" radio button after "there" has already been selected, it doesn't switch to the current location with "apply".
Thanks!
Comment #45
jsibley CreditAttribution: jsibley commentedOops. As you probably realized, I was using the IPGV&M set my location block rather than the geofield proximity filter exposed as a block.
Comment #46
RdeBoer@jsibley #45:
"However, selecting [type field name] and putting in field_geoaddress gives an error." (IPGV&M)
Yes because Views creates its field names in mysterious ways. field_geoaddress is probably not the right name to use in the context of relationships.
" If use geocoded location (without html5), the distance always shows as 0."
It all depends which Source of Origin you use.
Finally.... it seems that if I select the "here" radio button after "there" has already been selected, it doesn't switch to the current location with "apply". (IPGV&M)
You need to have the auto-refresh on (a config option on the IPGV&M config page) or (re)load the same or another page. By the way, the button is called "Go", right? Or do you have an older version of IPGV&M ?
PS: this originally was a Geofield issue. Most of your post is about IPGV&M.... if you have more, maybe address it in the IPGV&M issue queue?
Comment #47
jsibley CreditAttribution: jsibley commentedI think I was confused about what was geofield functionality and what belonged to IPGV&M. Sorry about that.
So, the option to filter by proximity using html5 or a geocoded address comes from geofield, where one can select either "geocoded address" or "geocoded address with html5 default".
Then, one can use "exposed geocoded proximity filter" in Fields and/or Sort Criteria (and this is true whether using "with html5 default" or not), right?
And, this much is true whether showing a table or an IPGV&M map, right?
If using an IPGV&M map, when can then add, in addition to the exposed filter, the "IPGV&M set my location" block. I assume that this block doesn't do anything if just using a table, yes?
So, my map seems to be working now. I am using the map as a block, with the exposed filter as a block using the Views Block Filter Block module as well as the set my location block. It is still just a dev site or I would provide a link.
Where I think that I am still having an issue is on a different page of the website where a table view with an exposed filter seems to work properly when the proximity filter is set to "geocoded address". Distances seem to be correct and the sort seems to work. As soon as I switch the proximity filter to "geocoded address with html5 default" changing the "from" field in the proximity filter and hitting apply, even multiple times, seems to have no effect. All distances seem to be calculated from the current location, no matter what. The only change I make is from "geocoded address" to "geocoded address with html5 default" in the proximity filter. If I change back to "geocoded address", distances seem to work again. Any thoughts?
Thank you for all of your great work on both modules!
Comment #48
RdeBoer@jsibley, #47
The two are very close. Geofield offers the option for other modules to plug in and IPGV&M does just that with the "Geolocated Location with HTML5 default" Source of Origin Point
"I assume that this "Set my location" block doesn't do anything if just using a table, yes?"
With Geofield enabled, it does work on any Views format, including tables, when used in conjunction with the Geofield Proximity Fields/Filters/Sorts provided by Geofield, as it sets the "Source of Origin Point" for the distance calculation to be either the satellite/WiFi-retrieved visitor location (i.e. HTML5) or a geocoded address the visitor types into the "Set my location" block.
Regarding your final question, have you read this README section from IPGV&M:
PS: I haven't used VIews Block Exposed Filter Blocks, so don't know whether it throws a spanner in the works or not.
Comment #49
jsibley CreditAttribution: jsibley commentedThanks, it's great to know that "set my location" can work with a table view.
As for my last question in #47, I'm not sure that the IPGV&M readme applies, as I was using a table view without "set my location".
So, even creating a simple view page (not blocks) with only the proximity as an exposed filter, it seems like the "apply" button when I change the address isn't doing anything when I use the html5 as default proximity filter.
FWIW, if I do add the IPGV&M "set my location" block to the table view, even if I use the block-based view, I do see the changes. It's just without any IPGV&M stuff that the distances don't get updated.
If there is some way you would like me to troubleshoot this, let me know and I'll do my best.
Thanks.
Comment #50
RdeBoerRe #49:
Yes "Set my location" works for tables and maps. In fact that is a common setup: to have a Views Page display as a map and then add an Views Attachment display as a table showing details of the markers on the map.
"So, even creating a simple view page (not blocks) with only the proximity as an exposed filter, it seems like the "apply" button when I change the address isn't doing anything when I use the html5 as default proximity filter."
That would be a bug in IPGV&M. I've entered it for you here: #2287945: Geocoding of typed address doesn't happen in exposed Geofield Proximity Filter with HTML5 fallback.
You may want to "Follow" that issue for updates.
Rik
Comment #51
jsibley CreditAttribution: jsibley commentedThanks, Rik.
Just to be clear, even though it is a view that doesn't use IPGV&M (just a regular views table) and doesn't use the IPGV&M "set my location" block, it is still an IPGV&M bug? Is the option to use "geocoded address with html5 default" coming from IPGV&M and not from geofield?
Jonathan
Comment #52
RdeBoer@jsibley, #51
Yes Jonathan, that is 100% correct.
The plugin can be found here on your system:
sites/all/modules/ip_geoloc/views/proximity_plugins/geofieldProximityGeocoderWithHTML
For others reading only this part of the thread. The above IPGV&M plugin (in ip_geoloc 7.x-1.x-dev or future official releases) will only work if and when this patch is applied to the Geofield module, Geofield 7.x-2.x branch (https://drupal.org/node/1360636, 17 Nov 2013): https://drupal.org/node/2134777#comment-8823463
Rik
Comment #53
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI'm a little confused.
Is the patch and associated file at the top of this issue needed any longer?
Comment #54
RdeBoer@SocialNicheGuru, #53
No that patch is not required. In fact the patch at the top of this issue should NOT be applied, if you follow the steps in #52, using the alternative Geofield patch mentioned in #52 patch and IPGV&M 7.x-1.x-dev
Rik
Comment #55
Brandonian CreditAttribution: Brandonian commentedSo, @RdeBoer, since #2134777: Allow other modules to define their own proximity plugins was committed, can we close this issue, or am I missing a patch?
Comment #56
RdeBoerNo that is it I believe, Brandon.
Thanks so much!
Rik
Comment #57
Brandonian CreditAttribution: Brandonian commentedH'ok, marking as fixed.
Comment #59
heshanlkThis is an effort to add some functionality to use HTML5 geocoding for proximity search with views. This will introduce a new config to the Geocoded location to enable HTMl5 geocoding.
Comment #60
artatum CreditAttribution: artatum commentedHello
I need to display users around (into a radius defined in the exposed filter of a view) for anonymous users or logged in users as well.
(It's been one week, 15h/day I'm fighting against this geo proximity. I tried out locations, geofield, leaflet, smart ip, IPGM, openlayers etc etc, banging my head on the walls without any result.)
I followed up every single path on the web, and in this issue queue, I downloaded the dev modules required in #52, patching as asked... But ... "Geocoded location with HTML5" doesn't show up...
And my distance from user(if I choose this option) is always mesured from user logged in, whatever I type in 'from'. The kms works though. But only for logged in users ( :/ (My distance-proximity field keep on showing 0)
Could you add a little summary or step by step, or list of modules, and patches maybe, in order to display anonymous or logged in users around...
It would be very useful if we could do that in Drupal...
Thx
Comment #61
RdeBoerHi artatum,
That's so frustrating, banging your head against the wall for so long.
This thread and its patches date back a long time. The essential patches are already included in the official release.
If you use the current OFFICIAL versions of both IPGV&M and Geofield you should be in a good position -- I know for sure that many people use that combo successfully with Leaflet.
Example? This demo, http://regionbound.com/coffee-prices-across-melbourne , uses Geofield + IPGV&M and distance calculation for NOT-logged-in users.
Rik
Comment #62
artatum CreditAttribution: artatum commentedGorgeous site ! Just what I want. (and the little icon made me actually cry ...so nice, sob...;-)
Thx for the direction anyway.
I'm going to check it out.
cu
Comment #63
artatum CreditAttribution: artatum commentedI installed
- geofield 7 x 2.3
- IPGV&M 7.x-1.27
- geocoder 7.x-1.2
I added an addressfield and a geofield, (geocode from another field) on user profile. They are well displayed with Leaflet.
On my view :
I added a proximity field plugged on "...from exposed filter"
I added an exposed filter, but into origin I dont find 'Geocode location with HTML5'.
And I dont receive the html5 question in popup on my site, and nothing happens...
What did I miss please : it's on a fresh vanilla latest Drupal... No need to Smart IP or another ... option to set up ?
PS it's online if you wanna check...
Comment #64
RdeBoerOk, simple first....
For starters, enable the Leaflet module, but not the Leaflet Views submodule -- it may confuse. We're going to drive Leaflet via IPGV&M.
First, enable the "Set my location" block that comes with IPGV&M on the page where you are going to put your View.
This is the most versatile way to setting the reference location, as you saw in action here: http://regionbound.com/coffee-prices-across-melbourne.
Now, let's add to your View a "Geofield - proximity" field. If your View is rendered as a map then the proximity (to the reference location) will show in the balloon when you click a marker.
See screenshot for relevant setting: "Geocoded location or visitor's current position"
Once this works you could add an Exposed filter to let the visitor set the radius (like within 10 km).
You can add a second View display (an Attachment or Block) for a tabular display of the data with distances. It's all here: http://regionbound.com/Drupal-IPGVM-map-configuration
Rik
Comment #65
artatum CreditAttribution: artatum commentedThanks for your time Rik. I do appreciate.
But things dont improve. I uninstalled evreything : location, openlayers, leaflet, Smart IP, geofield, etc. Everything. I left only views and so...
Then I reinstalled everything, step by step.
But for the moment, my Users geocoded aren't geocoded anymore. I have an adressfield, and the 'geocoded address' field is set to "geocode from another field, which is plugged on the adressfield.
I saved each user, resaved, and... nothing. (See attachment adopt1.jpg). The field proximity should not display 0...
Geocoder is enabled....
Last but not least : under chrome logged or not, I dont get the question from the browser after clicking 'find me'. Under Firefox, I got the popup, but it never finds me .... The wheel keeps on rolling...
I dont copy :/
Comment #66
artatum CreditAttribution: artatum commentedI made another step forward : if I enable "Employ a free Google service..." then Google find me. But I got a yellow warning "my address cannot be geocoded"...
:/
I think there is something roten in my Kingdom.
I'm going to test the config in Melbourne-Coffee (i.e. with a new true Content Type, not with only users....)
Comment #67
RdeBoerHi Artatum,
Maybe we should end this discussion in this thread as this is a Geofield thread and it looks like we're now moving into IPGV&M territory.
If things don't improve, then open an issue in IPGV&M.
Rik
PS: the "Find me" button on www.jazz-miracles.com works fine for me in Melbourne.
Comment #68
artatum CreditAttribution: artatum commentedThx for the test !
I've found a strange behaviour in geocoding.
I re-built a fresh Drupal, and enhanced the basic article type with addressfield and geofield. I choosed as a display : WKT.
Then, as I mentioned previously (cf adopt1...), the geocoded address field is not filled when saving.
Then I enabled Leaflet, and in the content type, I choosed this display.
As Soon as I resave the articles, the map shows up. And a new View shows the field, filled up, and perfectly displayed in ... WKT if I want!
I'm not sure which module is involved, probably Geocoder...
Comment #69
artatum CreditAttribution: artatum commentedNow everything works ! (but I found another ... bug : when you enable IPVM, you can then choose Map(leaflet...) for your display in Views, although you didnt enable Leaflet. Of course this doesnt work until you enable Leaflet and Leaflet Views. )
Comment #70
RdeBoerHI artatum,
Glad it works. What was it you did, to make ti work?
Re #69: but in the Views UI it says "requires Leaflet" with that radio button, doesn't it?
It does in the latest dev, I believe.
I did this deliberately as too many people just use Google and are never prompted to take the next step to better maps!
Rik
Comment #71
artatum CreditAttribution: artatum commentedAs I tried to explain, if you dont enable leaflet (or another map system I think) the geocoder doesnt fire. Geocoded field from addressfield are NOT geocoded.(f.i. if you choose WKT in the content type display.(-> with only geofield + geocoder installed).
As soon as you enable Leaflet (IPGM alone didnt help), in the Content type Display, re-save each content, then you're geocoded.
I think nobody have seen this issue because you mainly set up the three module at once...
I hope I'm clear...
Comment #72
artatum CreditAttribution: artatum commentedbad news : I'm still unable to display this field on the user page. I set the same parameters for my Articles and my User : addressfield -> geocoding from anotherfield-> display leaflet map.
No map are displayed on users page. :/
When I set this field I used the same field instance than for articles.
I must add that on my previous devsite, I can see the map on users pages. With stictly the same modules.
After Leaflet, I tried the 'geofield map' for display : in vain.
Comment #73
nickBumgarner CreditAttribution: nickBumgarner at Inclind Inc commentedDoes anybody have a working solution to where I can output a view that automatically can detect a user's current position (after user allows site to access gps) and then sort listings based on that location? I've read many threads about how it should work and different methods to get it to work, but have not found a single working instance at all. I got it to kind of work with Smart IP, but it couldn't detect my location only the location of my ISP.
Comment #74
RdeBoer@nickBumgarner,
The patch supplied by the original poster has been included in Geofield, so without applying any patches you can create a map like you say and a shown at the top of this issue, simply by using the official releases of Geofield, Leaflet and IPGV&M, see #64 in this thread.
Comment #75
Anonymous (not verified) CreditAttribution: Anonymous commentedLosing my temper on this shit
Stil no solution????????????
Comment #76
RdeBoerSee #74.