Open Maps Works GoogleMaps Does Not Joomla 4

Phoca Maps - displaying maps in Joomla! CMS
tinwistle
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Sep 2022, 04:17

Open Maps Works GoogleMaps Does Not Joomla 4

Post by tinwistle »

Hi I've tried multiple ways of trying to get it to work and I only get a white scree, I have the correct API info in the app and I have tried even turning off the restrictions in the google API.

I can also create a Google map in another page using the same template but with the template software I use.

Examples:
https://sesdevelopment.com/ Working OSM
https://sesdevelopment.com/index.php/home Working Google Map (Not using PHOCA)
However I can not getthe google map to work where the OSM map is and have put the proper credentials into the OPTONS of PHOCA for the API Key

Any idea what may be the problem?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by Jan »

Hi, do you have a link to not working map, so I can see javascript error console?

Jan
If you find Phoca extensions useful, please support the project
tinwistle
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Sep 2022, 04:17

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by tinwistle »

OK, I changed in your app from OSM to Google maps and it should display at https://sesdevelopment.com/
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by Jan »

Hi, which version of component do you use? Which plugin version? When you disable the cookie banner for test, do you get the same problem? When you display the map with help of component, do you get the same problem?

Jan
If you find Phoca extensions useful, please support the project
tinwistle
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Sep 2022, 04:17

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by tinwistle »

OK, I've turned off the cookie bar.

Using 4.0 version of component and plugin.

Joomla 4.2.2

I do not understand this:
When you display the map with help of component, do you get the same problem?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by Jan »

The map is displayed with help of plugin but it is even possible to create a menu link to Phoca Maps component and display the map in the component view (Try to test it so we know, the problem only occurs in plugin or for all maps).

Jan
If you find Phoca extensions useful, please support the project
tinwistle
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Sep 2022, 04:17

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by tinwistle »

As a component does not seem to make a difference.

https://www.sesdevelopment.com/index.ph ... w=map&id=1
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Maps Works GoogleMaps Does Not Joomla 4

Post by Jan »

Hi, on the website with component, there is following Javascript error:

Code: Select all

index.php:1 Refused to load the script 'http://maps.googleapis.com/maps/api/js?callback=initMaps&key=AIzaSyD5uwQ2nTQ3lNWn29rmpb9MvplZL-8KAR4' because it violates the following Content Security Policy directive: "default-src https: data: 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.
Do you use some specific security options on your site, or some system plugin which somehow changes the output of the website, etc? :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply