PHP & JavaScript Room :: 設置サンプル

実行結果


ソース

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAvABrzCnRluKK0Cj97fTMThTNR7aHVSEFb0WbViWwc6F-_w9PjBSogZu_7UgOTbx25ka46X-fnGmyvw" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var map;
function load() {
    if(GBrowserIsCompatible()){
        /* 地図インスタンス生成 */
        map=new GMap2(document.getElementById("map"));
        /* 中心地点 */
        map.setCenter(new GLatLng(35.665246,139.712319), 14);
        /* コントロール追加 */
        map.addControl(new GLargeMapControl());
    }
}
function fPanDirection(dx, dy) {
    map.panDirection(dx, dy);
}
window.onload=load;
window.unload=GUnload;
//]]>
</script>
<div id="map" style="width:425px;height:300px"></div><br>
<form action="#">
    <button type="button" onclick="fPanDirection(1,1)">左上に移動<br>(1,1)</button>
    <button type="button" onclick="fPanDirection(1,-1)">左下に移動<br>(1,-1)</button>
    <button type="button" onclick="fPanDirection(-1,1)">右上に移動<br>(-1,1)</button>
    <button type="button" onclick="fPanDirection(-1,-1)">右下に移動<br>(-1,-1)</button>
</form>

polarized women