Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is interest to provide additional map providers. What holds this up mostly from my point of view right now, is geocoder. It's integrated on a number of objects and tied to Google Maps Geocoding API. So let's do sth about that.
And while we're at it: one could also write that Google Places API integration that some people are interested in.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2813509-16-geocoder-rework.patch | 80.49 KB | ChristianAdamski |
#10 | 2813509-10-geocoder-rework.patch | 81.6 KB | ChristianAdamski |
#2 | 2813509-2-pluggable-geocoder.patch | 24.54 KB | ChristianAdamski |
Comments
Comment #2
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and commentedThis is a proof of concept. Locally with superficial testing, it works. Changes
- geolocation Plugin type "Geocoder" added
- "Google Geocoding API" geolocation geocoder Plugin added
- altered Boundary views filter to use Plugin
- altered the generic geocoder JS behavior to use Plugin
- added setting to Geolocaiton settings which Geocoder to use
This will probably break right now. Also: is it worth it? Given people that want to bring up alternative providers, maybe yes. Let's see if there is actually any feedback here.
This if incomplete for two reasons:
- while pluggable, the JS still expects to get results exactly as Google hands them back to you. So if your provider delivers sth else, you will have to reformat it accordingly.
- there is still code depending on google stretched across files. Some of it would need to be moved around. Though I do not imagine that to be substantially difficult.
Comment #4
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and commentedComment #5
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedComment #6
veronicaSeveryn CreditAttribution: veronicaSeveryn commentedI have pulled in the most recent DEV version of Geolocation module, including this patch for Geocoder Manager, but now I have the error:
Tried clearing caches with drush cr, truncating DB cache tables - nothing. It's not seeing the GeocoderManager.php file ...
Any ideas what else can be done there ?
Comment #7
veronicaSeveryn CreditAttribution: veronicaSeveryn commentedComment #8
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedHey @veronicaSeveryn,
you most likely need to set the default geocoder in the geolocation settings.
I will add a better default selection mechanism shortly.
Comment #9
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedOkay, mostly there. Still missing:
- make sure geocoder can be used standalone. (Google present, dependecies, etc.)
- implement a second geocoder as proof of concept. This will be Google Place API.
Comment #10
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commented- major geocoder plugin rework
- adds server-side geocoding
- adds Google Places API additional geocoder
- allows per-views-filter geocoder settings
- remove general geocoder settings
- some minor fixes
Comment #11
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedMissing:
- tests
- FieldWidget based on geocoder plugins
- non-google geocoder?
Comment #15
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedHmm. We can't work around that issue. See #2830026: Allow views filters to alter exposed values.
Hmm.
Comment #16
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commented- do not attempt to alter retrieved input in views handler
This has the consequence, that the exposed form values are not updated to the server-side retrieved results.
Comment #18
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedWell. Let's see what breaks.
Comment #19
poniesI'm getting a couple of errors about the proximity fields.
I've got a view of locations and I get this error when I try to enter a location and filter by proximity with an exposed filter.
Comment #20
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer and at Wolters Kluwer commentedI created a new issue