
Google Mapの新しいビジュアルをAPIで使用する
Google Map APIで新しい地図の外観を指定できるようになりました。
※ 新ビジュアルに完全に切り替わったため、旧ビジュアルの地図は表示できなくなりました。
旧ビジュアル(現在はみれません)
Full Size
新ビジュアル
Full Size
新しいビジュアルを使いたいときはURLパラメーターに「&visual_refresh=true」つけてGoogle Map Apiライブラリを読みこみ「google.maps.visualRefresh=true」を実行します。
サンプル
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <!DOCTYPE HTML> <html> <head> <title>Google Maps API New visual</title> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&visual_refresh=true"></script> <script type="text/javascript"> 	function initialize() { 		google.maps.visualRefresh=true; 		var mapDiv = document.getElementById("map_canvas"); 		var mapCanvas = new google.maps.Map(mapDiv, { 			center : new google.maps.LatLng(36.322356, 139.013057), 			zoom : 15, 			mapTypeId : google.maps.MapTypeId.ROADMAP 		}); 	} 	google.maps.event.addDomListener(window, "load", initialize); </script> <style type="text/css"> html, body{     margin: 0px;     padding: 0px; } html, body, #map_canvas { 	width: 100%; 	height: 100%; } </style> </head> <body> 	<div id="map_canvas"></div> </body> </html> |