GMap Asynchronous Loading

View this example full screen.

JavaScript of GMap Asynchronous Loading

function initialize()
{
    var oMapOptions = {
        coStrType: zhupiter.CoStr.CoStrType.GMAP,
        center: new google.maps.LatLng(24.880650, 121.065427),
        zoom: 12
    };
    var oCoStrMap = new zhupiter.CoStr.Map(document.getElementById('map_canvas'), oMapOptions);
}

/*
//@ Method 2 - Alternate method by JavaScript program codes.
function asyncLoadScript()
{
    var oScript = document.createElement('script');
    oScript.type = 'text/javascript';
    oScript.src = 'http://costr.zhupiter.com/js/' +
                  '?callback=initialize';
    document.body.appendChild(oScript);
}

window.onload = asyncLoadScript;
*/

JavaScript + HTML of GMap Asynchronous Loading

<!DOCTYPE html>
<html>
    <head>
        <meta name='viewport' content='initial-scale=1.0, user-scalable=no'>
        <meta charset='utf-8'>
        <title>GMap Asynchronous Loading</title>
        <style>
        html, body, #map_canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
        }
        </style>
        <script src='https://maps.googleapis.com/maps/api/js'></script>
        <script async src='http://costr.zhupiter.com/js/?callback=initialize'></script>
        <script>
function initialize()
{
    var oMapOptions = {
        coStrType: zhupiter.CoStr.CoStrType.GMAP,
        center: new google.maps.LatLng(24.880650, 121.065427),
        zoom: 12
    };
    var oCoStrMap = new zhupiter.CoStr.Map(document.getElementById('map_canvas'), oMapOptions);
}

/*
//@ Method 2 - Alternate method by JavaScript program codes.
function asyncLoadScript()
{
    var oScript = document.createElement('script');
    oScript.type = 'text/javascript';
    oScript.src = 'http://costr.zhupiter.com/js/' +
                  '?callback=initialize';
    document.body.appendChild(oScript);
}

window.onload = asyncLoadScript;
*/
        </script>
    </head>
    <body>
        <div id='map_canvas'></div>
    </body>
</html>

CoString | Donate bitcoin: 1LX5KC19tXCPK8y72Z6LVoZjoSaCp9P6K