Page 1 of 1

Map loads momentarily

Posted: 08 Aug 2016, 18:41
by qpidity
Hi,

We've are using the plugin code in an article like this:

Code: Select all

{phocamaps view=link|id=3|text=View Map}


It has always worked but now suddenly we have an issue whereby the map loads momentarily in the modal window and then a second later we get the error message:
Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.
I suspect this might be related to a change in google map policies but am not entirely sure. Would you have any ideas?

Joomla 2.5.28
Phocamaps component 2.0.6
Phocamaps plugin 2.0.5

I know J2.5 is out of date, we're almost ready to go with the J3.6 site but this has suddenly cropped up and we can't go for days without the map showing as it's very important for my client's business.

Thanks in advance and also for the brilliant extension.

Re: Map loads momentarily

Posted: 09 Aug 2016, 13:36
by qpidity
I see in the javascript error console that it's due to a missing API key.
Google Maps API error: MissingKeyMapError
Google Maps API warning: NoApiKeys https://developers.google.com/maps/docu ... o-api-keys
I can't see where to add this in phocamaps options.

Grateful for any help.

Re: Map loads momentarily

Posted: 10 Aug 2016, 14:20
by Jan
Hi, see this guide:
https://www.phoca.cz/documents/53-phoca- ... ps-api-key

The key then you add in Options of Phoca Maps.

Jan

Re: Map loads momentarily

Posted: 12 Aug 2016, 20:20
by qpidity
Hi,

I don't have that option in our version of phocamaps options. I explained earlier that our version doesnt have an API key field.

Can I add it manually in the code until we have our J3.6 version live?

Re: Map loads momentarily

Posted: 13 Aug 2016, 18:40
by qpidity
Hi again,

I've uploaded the new Joomla 3.6.0 site to my test server with latest phocamaps installed 3.0.4 and have added the API key to components > phocamaps > options. I created the new Browser API key here https://console.developers.google.com and that is the API key I added. I keep getting the same error with the map appearing and then disappearing almost as soon as it loads. In the javascript console I see the following errors:

Code: Select all

Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://mydomain.com/subdir/index.php?option=com_phocamaps&view=map&id=3:clonlea&tmpl=component
I added *.mydomain/* to the api key credentials.

Any idea why I keep getting this error? I can see the API callback but google just doesn't seem to associate it with the credentials I created in the console. This is actually starting to drive me a little nuts.

Any help appreciated.

Thanks in advance

Re: Map loads momentarily

Posted: 13 Aug 2016, 22:51
by Benno
Hi,
I added *.mydomain/* to the api key credentials.

Try to check your HTTP referrer again.
In my case the last asterisk (*) is missing, if I save the HTTP referrer, and I receive exactly your error message. (Till now, no idea why..)

Kind regards,
Benno

Re: Map loads momentarily

Posted: 17 Aug 2016, 00:16
by Benno
Hi,
some important steps to create the API key were added to the documentation:
https://www.phoca.cz/documents/53-phoca- ... ps-api-key

Kind regards,
Benno