Moderators mark1million Posted April 30, 2016 Moderators Report Share Posted April 30, 2016 Hey guys this may seem odd but in the settings page of admin (/admin/index.php/settings) there should be a place to input your google maps api key, on the dev version my field is missing, can i add this in to the local congig directly or where does it go. By the way google maps work fine never had an issue but there is an error in the console of chrome stating about the api Cheers. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 30, 2016 Author Moderators Report Share Posted April 30, 2016 Ok i have figured it out for anyone wishing to comply with google here is the fix. open up your /core/templates/core_htmlhead.tpl or ,php depending if you have converted to php files, the line you are looking for is, <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script> You need to replace that with <script async defer src="https://maps.googleapis.com/maps/api/js?key=PLACE YOURKEY IN HERE&callback=initMap"></script> Replace PLACE YOURKEY IN HERE with your generated key To generate your API key from Google log in to your Google account and go to https://developers.g...get-api-key#key Remember this modification will get overwritten on any update as its in the core_htmlhead.tpl Quote Link to comment Share on other sites More sharing options...
flyalaska Posted August 26, 2016 Report Share Posted August 26, 2016 Thank you! I get this in my console now intended for developers. Do not paste any code here given to you by someone else. It may compromise your account or have other negative side effects. external.js:264 Object util.js:207 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys anything to worry about? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted August 26, 2016 Moderators Report Share Posted August 26, 2016 Did you add the api key? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted August 26, 2016 Report Share Posted August 26, 2016 yes Quote Link to comment Share on other sites More sharing options...
web541 Posted August 26, 2016 Report Share Posted August 26, 2016 Try changing your line to this <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script> Looks like you forgot to add the "key" part which is probably what's driving that message Quote Link to comment Share on other sites More sharing options...
flyalaska Posted August 26, 2016 Report Share Posted August 26, 2016 (edited) The key is there. Same error. http://www.flyaka.com/index.php Edited August 26, 2016 by flyalaska Quote Link to comment Share on other sites More sharing options...
web541 Posted August 27, 2016 Report Share Posted August 27, 2016 (edited) Yeah, but you still forgot the ?key= part, instead, you only specified the API Key itself What you've got <script async defer src="https://maps.googleapis.com/maps/api/js?YOUR_API_KEY&callback=initMap" type="text/javascript"></script> Try this <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script> And replace YOUR_API_KEY with the API Key. Note the ?key= Edited August 27, 2016 by web541 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted August 27, 2016 Report Share Posted August 27, 2016 I know where to put the key, that one didnt work at all. Map loaded with an error where the map should be. Oops! Something went wrong. This page didn't load Google Maps correctly. See the Javascript console for technical details. Quote Link to comment Share on other sites More sharing options...
gargamel Posted October 5, 2016 Report Share Posted October 5, 2016 Does anyone soled the problem ? I have the same error on my page Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted October 6, 2016 Author Moderators Report Share Posted October 6, 2016 Yes i have no problem at all. what do you need to know? You have to wait about 3 minutes for Google to recognise your site, sometimes you need to put specific url for them to recognise the page Quote Link to comment Share on other sites More sharing options...
lapw123 Posted October 22, 2016 Report Share Posted October 22, 2016 hello on the admin panel and stuff it is not working at all i tried that you said Quote Link to comment Share on other sites More sharing options...
OzFlyer Posted January 22, 2017 Report Share Posted January 22, 2017 Hi all, This has fixed the "my flights map" under pilot center. But I have not been able to get google maps to load the KMZ file with my routes. I have separate page for each area of the world we fly in (using the internal page function). Can some one that has gotten this to work please post sample code. Thank you I wait your reply. David Oz Flyer. Quote Link to comment Share on other sites More sharing options...
RafaelLetras Posted June 25, 2017 Report Share Posted June 25, 2017 Hi , I still have the keyapi missing , annyone? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted June 29, 2017 Moderators Report Share Posted June 29, 2017 What is your website url? Quote Link to comment Share on other sites More sharing options...
tim260 Posted July 5, 2017 Report Share Posted July 5, 2017 On 25-6-2017 at 11:47 AM, RafaelLetras said: Hi , I still have the keyapi missing , annyone? If you used the code suggested above, remove "&callback=initMap" Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 <?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 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 async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></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; I make change in /home/vapersia/ms.virtual-flights.ir/core/templates/core_htmlhead.php and still map not work what i must do ? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 As I can see, you are using a different template from the default phpVMS template. This means that you will have to update the core_htmlhead.php of the template that you are currently using. This can be found in your_phpvms_directory/lib/skins/ocean_blue/core_htmlhead.php. Update it and let us know if that solves the issues. Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 25 minutes ago, servetas said: As I can see, you are using a different template from the default phpVMS template. This means that you will have to update the core_htmlhead.php of the template that you are currently using. This can be found in your_phpvms_directory/lib/skins/ocean_blue/core_htmlhead.php. Update it and let us know if that solves the issues. <?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;?>"; var geourl = "<?php echo GEONAME_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 type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></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; now i change the Skin (Ocean Blue) file still not work Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 Remove the "async defer" tags from the google maps script. Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 (edited) 5 minutes ago, servetas said: Remove the "async defer" tags from the google maps script. removed still nothing i get code from google that's not work i dont know what i must do lol i pres ctrl+f5 and it work when i reload page again gone and error my site fu... up Edited November 26, 2017 by ayhan041 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 Check the source of your website using your browser. It seems that you include the google maps twice in your website (lines 21 and 24-25). I do not know what can cause this but you should only have line 21 from your website's page source. Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 (edited) 8 minutes ago, servetas said: Check the source of your website using your browser. It seems that you include the google maps twice in your website (lines 21 and 24-25). I do not know what can cause this but you should only have line 21 from your website's page source. your mean this section? <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></script> Edited November 26, 2017 by ayhan041 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 I do not understand your question but you will have to remove this: <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></script> and use only this: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor=true"></script> Check your page source that includes two different calls for the google maps api. Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 5 minutes ago, servetas said: I do not understand your question but you will have to remove this: <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&callback=initMap" type="text/javascript"></script> and use only this: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor=true"></script> Check your page source that includes two different calls for the google maps api. aha find that line sir and change it now my source changed to this <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 type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&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> i think my key has problem cuz still not work i do what google say step by step something goes wrong anyway let it go thanks for your help sir ♥ Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 You have included the google maps with the following code: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor&callback=true"></script> This is wrong. Replace it with this: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor=true"></script> Let me know if it works. Quote Link to comment Share on other sites More sharing options...
ayhan041 Posted November 26, 2017 Report Share Posted November 26, 2017 (edited) 5 hours ago, servetas said: You have included the google maps with the following code: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor&callback=true"></script> This is wrong. Replace it with this: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTq3EcPWYUMAJ27n-IzcnQMKBGIWlxjsE&sensor=true"></script> Let me know if it works. thank you sir i change api key and replace resource and now map work . but i got new problem with that Edited November 26, 2017 by ayhan041 Quote Link to comment Share on other sites More sharing options...
OzFlyer Posted December 30, 2017 Report Share Posted December 30, 2017 With help from WES on Discord I have now got all the map on the WEB site side working. But none of the map views from within the Admin side are working still get "Opps! Something went wrong" error. So far I have only changed the line to: <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=MY_KEY&sensor=true"></script> in the file /core/templates/core_htmlhead.tpl Is there any other changes to be made? If so which file and where do I find them? Thank you. I await your help. David. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.