Google Maps

Morning;

I am using the Ocean Blue Skin for my VA.

Can anyone tell me how to find and add an API Key for the Google Map?

I have looked around in php files inside this skin and cannot find anything to where this can be edited.

Thanks

 

What version of phpVMS are you using?

In 5.5.2.72, there are comments in local.config on where the Google map keys go.

Add the key to core_htmlhead - in the skin folder if that file is there. Otherwise add it to core_htmlhead in /core/templates.

Thanks!!

Will take a look at it.

I have looked around and cannot find anything within the skin or else where to enter an API Key.

This is my local.config:

<?php

/**
 * This is the phpVMS Main Configuration File
 *
 * This file won’t be modified/touched by future versions
 * of phpVMS, you can change your settings here
 *
 * There may also be additional settings in app.config.php
 * To change it, copy the line into this file here, for the
 * settings to take effect
 *
 */
Config::Set(‘DEBUG_MODE’, false);
Config::Set(‘DEBUG_LEVEL’, 1); // 1 logs query errors, 2 logs all queries
Config::Set(‘ERROR_LEVEL’, E_ALL ^ E_NOTICE);

define(‘DBASE_USER’, );
define(‘DBASE_PASS’, );
define(‘DBASE_NAME’, );
define(‘DBASE_SERVER’, ‘localhost’);
define(‘DBASE_TYPE’, ‘mysqli’);

define(‘TABLE_PREFIX’, ‘phpvms_’);

define(‘SITE_URL’, ‘http://www.panamericanva.com/phpvms’);

Page encoding options

Config::Set(‘PAGE_ENCODING’, ‘ISO-8859-1’);

Clean URLs - set this to true, and then uncomment

the lines indicated in the .htaccess file

Config::Set(‘URL_REWRITE’, false);

Maintenance mode - this disables the site to non-admins

Config::Set(‘MAINTENANCE_MODE’, false);
Config::Set(‘MAINTENANCE_MESSAGE’, ‘We are currently down for maintenance, please check back soon.’);

/* Whether you have the /admin/maintenance.php script added into cron.
 If you do, set this to true. This saves many DB calls since phpVMS will
 have to ‘fake’ a cron-job
 */
Config::Set(‘USE_CRON’, false);

Config::Set(‘CHECK_RELEASE_VERSION’, true);
Config::Set(‘CHECK_BETA_VERSION’, false);

See more details about these in the docs

Config::Set(‘PAGE_EXT’, ‘.htm’); # .htm is fine. You can still run PHP
Config::Set(‘PILOTID_OFFSET’, 0); # What # to start pilot ID’s from
Config::Set(‘PILOTID_LENGTH’, 4); # Length of the Pilot ID
Config::Set(‘UNITS’, ‘nm’);   # Your units: nm, mi or km
Config::Set(‘LOAD_FACTOR’, ‘82’); # %age load factor
Config::Set(‘CARGO_UNITS’, ‘lbs’);

After how long to mark a pilot inactive, in days

Config::Set(‘PILOT_AUTO_RETIRE’, false);
Config::Set(‘PILOT_INACTIVE_TIME’, 90);

Automatically confirm pilots?

Config::Set(‘PILOT_AUTO_CONFIRM’, false);

Automatically calculate ranks?

Config::Set(‘RANKS_AUTOCALCULATE’, true);

For how many hours a pilot can edit their submitted PIREP (custom fields only)

Config::Set(‘PIREP_CUSTOM_FIELD_EDIT’, ‘24’);

If someone places a bid, whether to disable that or not

Config::Set(‘DISABLE_SCHED_ON_BID’, true);
Config::Set(‘DISABLE_BIDS_ON_BID’, false);

If you want to count transfer hours in rank calculations

Config::Set(‘TRANSFER_HOURS_IN_RANKS’, true);

The StatsData::UserOnline() function - how many minutes to check

Config::Set(‘USERS_ONLINE_TIME’, 20);

Google Map Options

Config::Set(‘MAP_WIDTH’, ‘800px’);
Config::Set(‘MAP_HEIGHT’, ‘600px’);

Valid types are G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP

Config::Set(‘MAP_TYPE’, ‘G_PHYSICAL_MAP’);
Config::Set(‘MAP_LINE_COLOR’, ‘#ff0000’);
Config::Set(‘MAP_CENTER_LAT’, ‘45.484400’);
Config::Set(‘MAP_CENTER_LNG’, ‘-62.334821’);
Config::Set(‘MAP_ZOOM_LEVEL’, 12);

ACARS options

#  Minutes, flights to show on the ACARS
#  Default is 720 minutes (12 hours)
Config::Set(‘ACARS_LIVE_TIME’, 720);
Config::Set(‘ACARS_DEBUG’, false);

This is your airline’s twitter account, if it exists

Config::Set(‘TWITTER_AIRLINE_ACCOUNT’, ‘’);
Config::Set(‘TWITTER_ENABLE_PUSH’, false);
Config::Set(‘TWITTER_CONSUMER_KEY’, ‘’);
Config::Set(‘TWITTER_CONSUMER_SECRET’, ‘’);
Config::Set(‘TWITTER_OAUTH_TOKEN’, ‘’);
Config::Set(‘TWITTER_OAUTH_SECRET’, ‘’);

/*
  This is the unit of money. For non-dollars, use :
 Dollars ($), enter “$”
 Euro (
 
 /* Keys for recaptcha, you can change these if you want to your own but it’s
 a global key so it should just work */
Config::Set(‘RECAPTCHA_PUBLIC_KEY’, );
Config::Set(‘RECAPTCHA_PRIVATE_KEY’, );

 

This is the core_htmlhead.php inside the skin:

<?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 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;

 

This is in my core_htmlhead in /core/templates

<?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 type=“text/javascript” src=http://maps.google.com/maps/api/js?></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;

 

20 minutes ago, perryfincher said:

I have looked around and cannot find anything within the skin or else where to enter an API Key.

This is my local.config:

<?php

/**
 * This is the phpVMS Main Configuration File
 *
 * This file won’t be modified/touched by future versions
 * of phpVMS, you can change your settings here
 *
 * There may also be additional settings in app.config.php
 * To change it, copy the line into this file here, for the
 * settings to take effect
 *
 */
Config::Set(‘DEBUG_MODE’, false);
Config::Set(‘DEBUG_LEVEL’, 1); // 1 logs query errors, 2 logs all queries
Config::Set(‘ERROR_LEVEL’, E_ALL ^ E_NOTICE);

define(‘DBASE_USER’, );
define(‘DBASE_PASS’, );
define(‘DBASE_NAME’, );
define(‘DBASE_SERVER’, ‘localhost’);
define(‘DBASE_TYPE’, ‘mysqli’);

define(‘TABLE_PREFIX’, ‘phpvms_’);

define(‘SITE_URL’, ‘http://www.panamericanva.com/phpvms’);

Page encoding options

Config::Set(‘PAGE_ENCODING’, ‘ISO-8859-1’);

Clean URLs - set this to true, and then uncomment

the lines indicated in the .htaccess file

Config::Set(‘URL_REWRITE’, false);

Maintenance mode - this disables the site to non-admins

Config::Set(‘MAINTENANCE_MODE’, false);
Config::Set(‘MAINTENANCE_MESSAGE’, ‘We are currently down for maintenance, please check back soon.’);

/* Whether you have the /admin/maintenance.php script added into cron.
 If you do, set this to true. This saves many DB calls since phpVMS will
 have to ‘fake’ a cron-job
 */
Config::Set(‘USE_CRON’, false);

Config::Set(‘CHECK_RELEASE_VERSION’, true);
Config::Set(‘CHECK_BETA_VERSION’, false);

See more details about these in the docs

Config::Set(‘PAGE_EXT’, ‘.htm’); # .htm is fine. You can still run PHP
Config::Set(‘PILOTID_OFFSET’, 0); # What # to start pilot ID’s from
Config::Set(‘PILOTID_LENGTH’, 4); # Length of the Pilot ID
Config::Set(‘UNITS’, ‘nm’);   # Your units: nm, mi or km
Config::Set(‘LOAD_FACTOR’, ‘82’); # %age load factor
Config::Set(‘CARGO_UNITS’, ‘lbs’);

After how long to mark a pilot inactive, in days

Config::Set(‘PILOT_AUTO_RETIRE’, false);
Config::Set(‘PILOT_INACTIVE_TIME’, 90);

Automatically confirm pilots?

Config::Set(‘PILOT_AUTO_CONFIRM’, false);

Automatically calculate ranks?

Config::Set(‘RANKS_AUTOCALCULATE’, true);

For how many hours a pilot can edit their submitted PIREP (custom fields only)

Config::Set(‘PIREP_CUSTOM_FIELD_EDIT’, ‘24’);

If someone places a bid, whether to disable that or not

Config::Set(‘DISABLE_SCHED_ON_BID’, true);
Config::Set(‘DISABLE_BIDS_ON_BID’, false);

If you want to count transfer hours in rank calculations

Config::Set(‘TRANSFER_HOURS_IN_RANKS’, true);

The StatsData::UserOnline() function - how many minutes to check

Config::Set(‘USERS_ONLINE_TIME’, 20);

Google Map Options

Config::Set(‘MAP_WIDTH’, ‘800px’);
Config::Set(‘MAP_HEIGHT’, ‘600px’);

Valid types are G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP

Config::Set(‘MAP_TYPE’, ‘G_PHYSICAL_MAP’);
Config::Set(‘MAP_LINE_COLOR’, ‘#ff0000’);
Config::Set(‘MAP_CENTER_LAT’, ‘45.484400’);
Config::Set(‘MAP_CENTER_LNG’, ‘-62.334821’);
Config::Set(‘MAP_ZOOM_LEVEL’, 12);

ACARS options

#  Minutes, flights to show on the ACARS
#  Default is 720 minutes (12 hours)
Config::Set(‘ACARS_LIVE_TIME’, 720);
Config::Set(‘ACARS_DEBUG’, false);

This is your airline’s twitter account, if it exists

Config::Set(‘TWITTER_AIRLINE_ACCOUNT’, ‘’);
Config::Set(‘TWITTER_ENABLE_PUSH’, false);
Config::Set(‘TWITTER_CONSUMER_KEY’, ‘’);
Config::Set(‘TWITTER_CONSUMER_SECRET’, ‘’);
Config::Set(‘TWITTER_OAUTH_TOKEN’, ‘’);
Config::Set(‘TWITTER_OAUTH_SECRET’, ‘’);

/*
  This is the unit of money. For non-dollars, use :
 Dollars ($), enter “$”
 Euro (
 
 /* Keys for recaptcha, you can change these if you want to your own but it’s
 a global key so it should just work */
Config::Set(‘RECAPTCHA_PUBLIC_KEY’, );
Config::Set(‘RECAPTCHA_PRIVATE_KEY’, );

 

This is the core_htmlhead.php inside the skin:

<?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 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;

 

This is in my core_htmlhead in /core/templates

<?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 type=“text/javascript” src=http://maps.google.com/maps/api/js?></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;

 

search in lib/skins/*skin_name*/core_htmlhead the line:

\<script type="text/javascript" src=http://maps.google.com/maps/api/js?\>\</script\>

and replace with this:

\<script src="//maps.googleapis.com/maps/api/js?key=\*APIKEY\*&callback=initialize"\>\</script\>

change *APIKEY* with your API key and will work.

You may not necessarily need the ‘&callback=initialize’ part. I suggest you check your browser console for any errors.

 I would suggest adding https: to the line PSD suggested above.

Here is the code from version 5.5.2.72 - key goes where YOUR_API_KEY_HERE is.

\<!-- \* Add Google Maps API key to next line. https://developers.google.com/maps/documentation/javascript/get-api-key --\> \<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR\_API\_KEY\_HERE"\>\</script\>

 

Hmmmm

Thanks for replying ProAvia

It seems, every time I edit the line, I either get “Oops Something Went Wrong” or get the same previous message “For Developers Purposes Only” and asked if I own the website; which I do.

Must be doing something wrong.

4 minutes ago, perryfincher said:

Hmmmm

Thanks for replying ProAvia

It seems, every time I edit the line, I either get “Oops Something Went Wrong” or get the same previous message “For Developers Purposes Only” and asked if I own the website; which I do.

Must be doing something wrong.

Now Google API is a payware service (you will have some request for free but not for all), I suggest use OSM.

Go to the Google link inmy last post. You can register for an API key there. Youwill need toprovide credit card info, but they give you a $200 credit every month toward API usage. I have never used over $20 of that credit.

Your other option is to convert to OSM/Leaflet maps. There is a sticky post in this forum.

EDIT - here you go… 

//forum.phpvms.net/applications/core/interface/index.html

 

Okay, tried different things and even tried installing CrazyCreatives Flight Tracker and Partner Live Map.

Now, I get blank screen on home page of Ocean Blue Skin for the Live Flight Tracker and blank screen on the Live Map page.

Have no glue how to fix it.

Tried copying all default Ocean Blue files back in but can’t figure it out.

Am missing something somewhere.

Any help will be greatly appreciated.

Thanks

Never mind, closed out my browser then reopened it and the default acars map is in place with “For Development Purpose Only” on map.

Will leave it there.

Royal pain to get rid of.

 

Thanks