/******************************************************************************** SYNCER 〜 知識、感動をみんなと同期(Sync)するブログ * 配布場所 https://syncer.jp/google-maps-javascript-api-matome * 最終更新日時 2015/11/26 14:09 * 作者 あらゆ ** 連絡先 Twitter: https://twitter.com/arayutw Facebook: https://www.facebook.com/arayutw Google+: https://plus.google.com/114918692417332410369/ E-mail: info@syncer.jp ※ バグ、不具合の報告、提案、ご要望など、お待ちしております。 ※ 申し訳ありませんが、ご利用者様、個々の環境における問題はサポートしていません。 ********************************************************************************/ // キャンパスの要素を取得する var canvas = document.getElementById( 'map-canvas' ) ; // 中心の位置座標を指定する var latlng = new google.maps.LatLng( 35.71065535994499 , 139.8088117248535 ); // 地図のオプションを設定する var mapOptions = { zoom: 18 , // ズーム値 center: latlng , // 中心座標 [latlng] }; // [canvas]に、[mapOptions]の内容の、地図のインスタンス([map])を作成する var map = new google.maps.Map( canvas , mapOptions ) ; // 多角形(Polygon)のインスタンスを格納する配列 var polygons = [] ; // ポリゴンのオプション var polygonOption = { // 位置座標 [LatLngクラスで指定] path: [ /* ポリゴンを結ぶ位置座標 */ new google.maps.LatLng( 35.71130001178331 , 139.80993825263977 ) , new google.maps.LatLng( 35.71065535994499 , 139.8088117248535 ) , new google.maps.LatLng( 35.709174383271474 , 139.8088439113617 ) , new google.maps.LatLng( 35.70886947289342 , 139.8107751018524 ) , new google.maps.LatLng( 35.710097819014884 , 139.81207329101562 ) , new google.maps.LatLng( 35.70939217568423 , 139.81357532806396 ) , new google.maps.LatLng( 35.711639758625964 , 139.8128994113922 ) , new google.maps.LatLng( 35.71099510953576 , 139.81208401985168 ) , ] , map: map , // 設置する地図キャンパス } ; // ポリゴンのインスタンスを作成する polygons[0] = new google.maps.Polygon( polygonOption ) ;