Google Map Plugin - Geocode from Element not working

TGoodrich

New Member
I have 2 elements, one is a text field (called Business Address) used to enter an address and it is using Auto complete - Geocomplete which seems to work.

The second element uses the Google Map plugin. In the google map element parameters I have the Enable Geocode set to Use Element and the Formatted Address set to use the element above which is Business Address.

For some reason this is not working. Am I missing something?

I have entered my Google Maps Api Key in options and use the latest Fabrik and Joomla if it helps. I also use Focal Point with the same Google Maps API Key on my site with no issues.

Also of note, in Google Chrome I am getting the following errors when viewing the forms details page:
require js define jquery as (a,b){return new m.fn.init(a,b)}

InvalidValueError: not an instance of HTMLInputElement

_.bb @ js?&sensor=false&libraries=places&callback=Fabrik.mapCb:35

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required
 
I was able to get this working by using the Business Address element for each address field however all the errors I noted above still occur.

I banged my head on this for a while. For some reason I just didn't find the instructions very intuitive.

The way I read the instructions I thought all I needed to do was use the Business Address for the formated address. Since my users will be adding there formated address into the Business Address field I thought the map would geocode off that as they typed in their address.
 

All set, I have added the info per your request. Please be aware the page with the error is a work in progress and styling is not completed. Just append "/business-directory-testing" to the main URL

There is one error on the list page and the errors I listed in my original comments appear in google chrome dev tools when viewing the details page and the add form.

Please feel free to use the add form if you need to for testing.

--Thanks
 
It's geocoding without problem on typing into the "Business Address" element.
Did you try to clean your browser cache?

The googlemap API warnings are showing always.

About the other messages (they don't seem to hurt, the map is displayed in details view):
Which exact Fabrik version, Joomla version, php version are you running?
Which Joomla template (did you try with the standard Protostar template)?
What are your exact Googlemap element settings (screenshots)?
 
From what I can tell, you seem to have selected that Business Address element multiple times in the geocode element selection settings. So it's concatenating whatever you type 5 times. So instead of searching for (say) "123 Main Street", it's searching for "123 Main Street, 123 Main Street, 123 Main Street, 123 Main Street, 123 Main Street".

If you only have one address element, just select that as the "Address 1".

As a bit of defensive coding, I've committed a little fix to github, to remove any duplicates from the geocode fields.

-- hugh
 
Hi, thanks for looking into this.

I now have it almost working as I need it to after some trial and error. I think alot of the issue for me was that the tooltip instructions on the Google Maps element page were not easy for me to understand.

With that said I still have a couple of issues and a feature request.

For the feature request.. As I mentioned when I started this thread I use 2 elements, One is where the user would enter their Business Address and that element uses the Geo complete feature which works well. The second element is the Google map and I have set the map to GeoCode itself using Address 1 as suggested by Hugh. For Address 1 it is set to use the Business Address element to get the correct address. In the Google map element I have set "Trigger geocode with" to "As You Type" since the "button" option doesn't seem to work. I also have the "Geocode on load" set to "Always" but that doesn't seem to work either. It appears that the only way to Geocode the map is to fully type in the address. Since the "Business Address" element is set to "GeoComplete" the user only has to type in part of the address to get the correct address. If the GeoComplete suggest the correct address before the user finishes typing and they choose the correct address the Google Map will not display the proper address on the map. I would assume that having "Geocode on load" set to "Always" would fix this but it doesn't. Would it be possible for you to make the map GeoCode properly when having another element use GeoComplete? Perhaps I am still going about this all wrong so I welcome any suggestions.

For the issues, what could be causing the errors I am seeing in the Chrome developer console?

I am using Joomla v3.5.1, Fabrik v3.4.3, php v7.0.7, The latest Gantry 5 framework w/custom Hydrogen template. And no, I haven't tried the Protostar template.

Here are some screenshots of my settings:
business_address-1.gif googlemap_1.gif

EDIT: I tried changing the "Goecode on load" to "Button" and that now works. Could be it wasn't working due to my previous settings.
 
I fixed the issue with the field element's 'geocomplete' not playing nicely with the map element's geocoding, when using "as you type" ...

https://github.com/Fabrik/fabrik/commit/66e03ceb6726b1bd187623348435643c5a0cbc6d

I don't know why it's throwing that NoAPIKeys warning, but it's not fatal, as long as you don't go over the free limit on geocodes. I can't replicate the issue here. I'll have another look when I get some time.

Aaaaaand ... that's about it on Community support. If you need more assistance, you'll need to get a sub. :)

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top