Jump to content

Recommended Posts

Posted

I am still getting the "oops something went wrong" on my live map after add the api code.

 

 

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
 *     STOP! HAMMER TIME!
 *
 * ====> READ THIS !!!!!
 *
 * I really really, REALLY suggest you don't edit this file.
 * Why? This is the "main header" file where I put changes for updates.
 * And you don't want to have to manually go through and figure those out.
 *
 * That equals headache for you, and headache for me to figure out what went wrong.
 *
 * BUT BUT WAIT, you say... I want to include more javascript, css, etc...!
 * Well - in your skin's header.tpl file, this file is included as:
 *
 * Template::Show('core_htmlhead.tpl');
 *
 * Just add your stuff under that line there. That way, it's in the proper
 * spot, and this file stays intact for the system (and me) to be able to
 * make clean updates whenever needed. Less bugs = happy users (and happy me)
 *
 * THANKS!
 */
?>
<script type="text/javascript">
var baseurl = "<?php echo SITE_URL;?>";
</script>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo fileurl('lib/css/phpvms.css')?>" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::Get('PAGE_ENCODING');?>" />

<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBorb_ELH8kXiXxDGpfbz1dgyQk5Gmo7NE&callback=initMap"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="<?php echo fileurl('lib/js/jquery.form.js');?>"></script>
<script type="text/javascript" src="<?php echo fileurl('lib/js/phpvms.js');?>"></script>

<?php
echo $MODULE_HEAD_INC;

  • Moderators
Posted

Ok, you have not edited the correct files so the google maps in your website are not called with the api key you got from google. I do not know where are the google maps includes location but for your frontpage there should be somewhere inside your frontpage_main.tpl/.php file. If you open this file, you will find this:

<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?libraries=weather&sensor=true">
</script>

You will have to replace it with this:

<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBorb_ELH8kXiXxDGpfbz1dgyQk5Gmo7NE&libraries=weather&sensor=true">
</script>

Could you please check it and let us know how it works?

  • 4 months later...
  • 4 weeks later...
Posted
On 1/26/2017 at 7:18 AM, servetas said:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBorb_ELH8kXiXxDGpfbz1dgyQk5Gmo7NE&libraries=weather&sensor=true"> </script>

For future references this seemed to have worked for me. I dont know why the key google was giving was just not working. Thanks Servetas;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...