Google Map not showing on old J 2.5.28 site

  • Judy Akers
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
3 weeks 3 days ago #129150 by Judy Akers
I have already read the messages in the other thread Google Map not showing.

The site is an old Joomla 2.5.28 that is currently being redesigned, and it is running EB 2.1.2. So there is no place in the configuration screens to set an API key. So unless an more current version of EB can run on J 2.5.x I can not update the software.

Currently the template is set with a script tag of:
script src="//maps.googleapis.com/maps/api/js?key=AIzaSyD8fY0wvoA2SZ8YFJU1aMlVs2eJSygOBp4&callback=initMap"

This key is working for another map on the site: www.hesc.ny.gov/directions-to-hesc.html
The page that is getting the issue: www.hesc.ny.gov/2019-nys-financial-aid-conference

So where or how would I set an API key to prevent the website from showing a darkened map, or 'negative' Street View image, watermarked with the text "for development purposes only"?

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #129153 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Google Map not showing on old J 2.5.28 site
Hello Judy

In that very old version of Events Booking, we don't support that config option because at that time, Google does not require an API key to show the map

So for this, I guess you will have to edit code to load the map with valid key. The file you need to edit is components/com_eventbooking/view/map/tmpl/default.php

Tuan

Please Log in or Create an account to join the conversation.

  • Judy Akers
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
3 weeks 1 day ago #129208 by Judy Akers
Replied by Judy Akers on topic Google Map not showing on old J 2.5.28 site
I found the template override file.

I have replaced the line
$doc->addScript($protocol . '://maps.google.com/maps/api/js?sensor=true');

with
$doc->addScript($protocol . '://maps.google.com/maps/api/js?key=AIzaSyAN29HNRvNx8XB8wAc810nV2O4sxtvVizA&callback=initMap');

without any change to the map display. Is this the correct line and syntax?

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #129209 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Google Map not showing on old J 2.5.28 site
It should be $doc->addScript(' maps.google.com/maps/api/js?key=AIzaSyAN...8wAc810nV2O4sxtvVizA ');

But I'm unsure. You need to compare the code in the current version with the code latest version. See the code in the attached file from latest version

Tuan
Attachments:

Please Log in or Create an account to join the conversation.

  • Judy Akers
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 weeks 3 days ago #129288 by Judy Akers
Replied by Judy Akers on topic Google Map not showing on old J 2.5.28 site
I have updated the template override for the map/default.php but that doesn't seem to be the answer.

Using the Google Maps Platform API Checker, it gives an error of ERROR: This site doesn't seem to be using an API key. Keyless usage will soon be deprecated. Please set up and secure a key for your project.

JS API Call:
maps.google.com/maps/api/js?sensor=false

I have traced that script tag to \administrator\components\com_eventbooking\view\location\tmpl\default.php. While the setting of the sensor attribute should be skipped by Google Maps, apparently it is not being done in this case.

How should I proceed?

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago #129298 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Google Map not showing on old J 2.5.28 site
That code is wrong. I don't remember the code for Joomla 2.5 as we stopped the development for Joomla 2.5 few years ago.

In this case, you can submit a support ticket sending us:

- Super admin account
- Link to that map page

We will try to modify code to make it works with that Joomla version you are using. Note that we might have to charge you some fee if you don't have active subscription or if the modification takes long time. We will let you know via ticket after working on the modification (should not cost more than 20$)

Tuan

Please Log in or Create an account to join the conversation.

  • Judy Akers
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 weeks 3 days ago #129309 by Judy Akers
Replied by Judy Akers on topic Google Map not showing on old J 2.5.28 site
I am working to give you access to our site - the server has firewall rules to restrict administrator access to only specific IP addresses (internal to our agency). I am not sure how long it would take to get the approval to open up access for a new IP.

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago #129314 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Google Map not showing on old J 2.5.28 site
OK. Without accessing to the site, there is no way we can help because we don't have Joomla 2.5 available here for testing

As soon as you get approval, please submit a support ticket so that we can work on it

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc