GMap Rectangles

View this example full screen.

JavaScript of GMap Rectangles

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

    var oRectangle = new zhupiter.CoStr.Rectangle({
        coStrMap: oCoStrMap,
        strokeWeight: 2,
        strokeColor: '#ef1568',
        strokeOpacity: 0.8,
        fillColor: '#61ed04',
        fillOpacity: 0.3,
        bounds: new google.maps.LatLngBounds(
            new google.maps.LatLng(24.88227086962545, 121.05922937393188),
            new google.maps.LatLng(24.883789196412685, 121.06319904327393))
    });
}

zhupiter.CoStr.event.addDomListener(window, 'load', initialize);

JavaScript + HTML of GMap Rectangles

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

    var oRectangle = new zhupiter.CoStr.Rectangle({
        coStrMap: oCoStrMap,
        strokeWeight: 2,
        strokeColor: '#ef1568',
        strokeOpacity: 0.8,
        fillColor: '#61ed04',
        fillOpacity: 0.3,
        bounds: new google.maps.LatLngBounds(
            new google.maps.LatLng(24.88227086962545, 121.05922937393188),
            new google.maps.LatLng(24.883789196412685, 121.06319904327393))
    });
}

zhupiter.CoStr.event.addDomListener(window, 'load', initialize);
        </script>
    </head>
    <body>
        <div id='map_canvas'></div>
    </body>
</html>

座標物語 | 贊助比特幣: 1LX5KC19tXCPK8y72Z6LVoZjoSaCp9P6K