[EHPweb] Google Maps (V3) HTTPS
Eric M Martinez
emartinez at usgs.gov
Tue Mar 22 15:13:00 UTC 2011
I added support in the Google Maps V3 widget "gmaps3" to use the newly
available SSL version of the API. Here is how it works:
<?php
$TITLE = 'Google Maps Page';
$WIDGETS = 'gmaps3'; // This is the only required line to use a
Google Map
// Can specify version number. Probably should not do this. Optional.
$GMAPS3_VERSION = 3;
/**
* Name of callback function to execute when Google Map script loads.
Setting this variable will force the
* script to load asynchronously and will also auto-detect the
current protocol (HTTP or HTTPS) to ensure
* the correct version of the application is loaded.
*
* Optional.
*/
$GMAPS3_CALLBACK = 'init_map'; // Name of callback function to
execute when google map script loads.
/**
* Boolean flag to indicate you prefer your page to use the HTTPS
version of the widget. Script will still load
* in-line (i.e. NOT asynchronously). Note: Specifying this in
addition to GMAPS3_CALLBACK will have no
* effect.
*
* Optional.
*/
$GMAPS3_HTTPS = true;
// Note: All GMAPS3_* variables must be set __BEFORE__ including the
template.
include_once $_SERVER['DOCUMENT_ROOT'] . '/template/template.inc.php';
?>
Current pages serving a Google Map will not need to be updated unless
you want to start using SSL. Also, Google is only supporting SSL on
version 3 of their API, consequently, if you want to use the new SSL
support feature, you will need to use V3 of the API.
Thanks,
~Eric.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://geohazards.usgs.gov/pipermail/ehpweb/attachments/20110322/1337d0a5/attachment.html>
More information about the EHPweb
mailing list