Google Maps JavaScript API warning: NoApiKeys

jordiblanchcarles
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 18 Aug 2018, 10:42

Google Maps JavaScript API warning: NoApiKeys

Post by jordiblanchcarles » 18 Aug 2018, 10:53

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!

Tags:


christine
Phoca Hero
Phoca Hero
Posts: 1403
Joined: 28 Nov 2010, 17:20

Re: Google Maps JavaScript API warning: NoApiKeys

Post by christine » 18 Aug 2018, 11:15

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

jordiblanchcarles
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 18 Aug 2018, 10:42

Re: Google Maps JavaScript API warning: NoApiKeys

Post by jordiblanchcarles » 18 Aug 2018, 16:48

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.

Dausto
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 21 Aug 2018, 15:10

Re: Google Maps JavaScript API warning: NoApiKeys

Post by Dausto » 21 Aug 2018, 15:32

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.

User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 6842
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Google Maps JavaScript API warning: NoApiKeys

Post by Benno » 22 Aug 2018, 13:00

@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

SteeveClark
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 25 Oct 2018, 20:53

Re: Google Maps JavaScript API warning: NoApiKeys

Post by SteeveClark » 25 Oct 2018, 21:01

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

User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 6842
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Google Maps JavaScript API warning: NoApiKeys

Post by Benno » 26 Oct 2018, 10:01

@SteeveClark
backend --> Components --> Phoca Maps --> Control Panel --> Options --> Google Maps --> Google Maps API Key

See screenshot:
Image

Kind regards,
Benno

christine
Phoca Hero
Phoca Hero
Posts: 1403
Joined: 28 Nov 2010, 17:20

Re: Google Maps JavaScript API warning: NoApiKeys

Post by christine » 26 Oct 2018, 10:42

@SteeveClark,

in addition: Current actual Joomla version is: 3.8.13

Kind regards
Christine

SteeveClark
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 25 Oct 2018, 20:53

Re: Google Maps JavaScript API warning: NoApiKeys

Post by SteeveClark » 29 Oct 2018, 10:51

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.

User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 6842
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Google Maps JavaScript API warning: NoApiKeys

Post by Benno » 29 Oct 2018, 12:39

You're welcome!

Kind regards,
Benno

Post Reply