2014年8月22日金曜日

MapOptions Properties disableDefaultUI


このプロパティはマップ上に表示されているズームや、
航空写真ボタンなどのコントローラー全ての表示・非表示
の設定を行います。
trueにすると全て非表示になり、
falseにすると全て表示になります。
デフォルトではfalseに設定されています。

また、このプロパティで一括設定しても、
zoomControl: true や
mapTypeControl: true など上書き可能です。

以下サンプルです。
サンプルでは全てのコントローラーが非表示になります。

<!DOCTYPE html> 
<html lang="ja"> 
<head> 
    <meta charset="utf-8" /> 
    <title>  google maps api v3</title> 
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">  </script> 
    <script type="text/javascript"> 
        google.maps.event.addDomListener(window, "load", function () {
            var map = document.getElementById("map_canvas");
            var latlng = new google.maps.LatLng(35.658580, 139.745433);
            var mapOptions = {
                zoom: 18,
                center: latlng,
                disableDefaultUI: true
            };
            var gmap = new google.maps.Map(map, mapOptions);
        });
    </script> 
</head> 
<body> 
    <div id="map_canvas" style="width: 400px; height: 400px">  </div> 
</body> 
</html> 

このエントリーをはてなブックマークに追加

0 件のコメント:

コメントを投稿