Page 1 of 2

Google Maps JavaScript API warning: NoApiKeys

Posted: 18 Aug 2018, 10:53
by jordiblanchcarles
Hello everybody,

since yesterday, my Joomla web that uses Phoca Maps is complaining with "Google Maps JavaScript API warning: NoApiKeys" and the map is showed grayed and with a "For development purposes only" watermark on it.

I'm using Joomla 2.5 and Phoca Maps 2.0.6. According to the Phoca Maps documentation, Google API keys are not necessary to use Phoca Maps since v1.1.0.

Does anybody know where's the problem and how to solve it?

Thank you!

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 18 Aug 2018, 11:15
by christine
Hi,

see here please: https://www.phoca.cz/download/category/ ... -component
Maps are not more working in Joomla! 1.5 or 2.5 (because of API key) - update your Joomla! and Phoca Maps component to the latest version and use the latest version of Phoca Maps
Kind regards
Christine

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 18 Aug 2018, 16:48
by jordiblanchcarles
Hello Christine,

thank you for your feedback.

In my case, updating both Joomla and Phoca Maps would lead to a lot of work, and I didn't program my web myself and there are a lot of custom modules, so I found a workaround.

The workaround has been to include the Google API key to the paramenters on the calls to Phoca Maps. So if anyone else faces the same problem and doesn't want to use the "official" solution and update everything, the solution is "as easy as" creating the Google API key (Google for it and follow instructions) and inserting the the "key=your_google_api_key" everywhere in the code. I just needed to insert the key in 3 files in my Joomla installation:

1.- /components/com_phocamaps/views/route/view.html.php
2.- /components/com_phocamaps/views/map/view.html.php
3.- /administrator/components/com_phocamaps/views/phocamapsgmap/tmpl/default.php

In fact, I've replaced the parameters "sensor=false" to "key=your_google_api_key" because Google Maps no longer needs the "sensor" parameter.

Hope this helps somebody else.

Regards.

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 21 Aug 2018, 15:32
by Dausto
Something for me is wrong yet.
I've detected the problem on my site (yesterday) that was already in Joomla 3.8.8, but my PhocaMaps was outdated (3.0.3 I believe, or minor), so I've updated Phoca COM e PLG to 3.0.5, updating also Joomla to last 3.8.11, but problem persists.
I've already cleaned site cache, browser temp and cache, but on Google Maps Java warning is steal there with different warning "This page does not load Google Maps correctly." and map is grey with "For development purposes only" in the background.

Please, any idea?
Thank you.

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 22 Aug 2018, 13:00
by Benno
@Dausto,
did you create the required API key and did you copy the key into the corresponding field of Phoca Maps Component??
See: https://www.phoca.cz/documents/53-phoca ... ps-api-key

Kind regards,
Benno

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 25 Oct 2018, 21:01
by SteeveClark
Hi,
I have the same error, i just updated the component and pluggin to 3.0.5 over Joomla Joomla! 3.8.5, and i just created the key api, but i dont cant find the just field where to configure the google map key.

At the new version of phocamaps, only have two new fields : Custom Options and Map Styles.

I just tried at Custom Option like this : key:'AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
but dont worked for me

How to configure the Google api key in phocamaps configuration?

Thank you very much for spend time on this

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 26 Oct 2018, 10:01
by Benno
@SteeveClark
backend --> Components --> Phoca Maps --> Control Panel --> Options --> Google Maps --> Google Maps API Key

See screenshot:
Image

Kind regards,
Benno

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 26 Oct 2018, 10:42
by christine
@SteeveClark,

in addition: Current actual Joomla version is: 3.8.13

Kind regards
Christine

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 29 Oct 2018, 10:51
by SteeveClark
Thank you so much Benno, i can't found the right place. Now it is work!
By the way i just update the joomla version, thank you Christine.

Re: Google Maps JavaScript API warning: NoApiKeys

Posted: 29 Oct 2018, 12:39
by Benno
You're welcome!

Kind regards,
Benno