Go Back   Mosets Community > Mosets Tree 3.x > Discussions, Troubleshooting & Problems

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-19-2016, 03:44 PM
Ray Ray is offline
Mosets'd
 
Join Date: Mar 2005
Posts: 58
Default Google Maps API error: MissingKeyMapError

Hi

On a new site I'm running Joomla! 3.6.0 with Mosets Tree 3.8.6

The issue I'm having is I cannot get Google maps to initialise.

I have in MT Configuration/Features
Clicked Show Map and filled in Default Country, Default State, Default City and Clicked Yes to show link to map

In administration Add Listing/Map it says

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.


In chrome inspect, I get the following 2 warnings

1. Google Maps API error: MissingKeyMapError
2. Google Maps API warning: NoApiKeys https://developers.google.com/maps/d...es#no-api-keys


On researching further the following statement is from Google

Usage of the Google Maps APIs now requires a key.
If you are using the Google Maps API on localhost or your domain was not active prior to June 22nd, 2016, it will require a key going forward.

I have since got a Google Maps API key
<script src="//maps.googleapis.com/maps/api/js?key=##############" async="" defer="defer" type="text/javascript"></script>

Can someone please advise me further on this issue

Thanks
Ray
Reply With Quote
  #2  
Old 07-19-2016, 08:44 PM
dknight dknight is offline
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 27,208
Default

Hi Ray,

This is indeed a bug due to the recent changes in Google Maps. You can make the following modification to insert your Google Key.

FILE: /components/com_mtree/templates/kinabalu/sub_map.tpl.php

Look for this line of codes:
PHP Code:
    <script src="//maps.googleapis.com/maps/api/js?v=3." type="text/javascript"></script> 
and replace with the following:
PHP Code:
    <script src="//maps.googleapis.com/maps/api/js?v=3.&key=xxx" type="text/javascript"></script> 
replace 'xxx' with your Google API key.

I'm working towards an update and that include this fix.
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
Reply With Quote
  #3  
Old 07-20-2016, 06:51 AM
Ray Ray is offline
Mosets'd
 
Join Date: Mar 2005
Posts: 58
Default

Hi Lee

I tried your fix and it didn't work(50% of the way there)

I found that the same change also needs to be made to

administrator/components/com_mtree/admin.mtree.html.php

Google Maps now works

Thank you for your help with this.

Regards

Ray
Reply With Quote
  #4  
Old 07-20-2016, 03:33 PM
dknight dknight is offline
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 27,208
Default

Yup, that's for the back-end. Glad it helps!
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
Reply With Quote
  #5  
Old 07-21-2016, 10:01 PM
fun4uskids fun4uskids is offline
Mosets'd
 
Join Date: Sep 2012
Posts: 35
Default

Thanks for this post it was very helpful.

I also had to fix /administrator/components/com_mtree/geocode.mtree.php
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +8. The time now is 11:11 AM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.