ホーム へ       サンプルページ  Google Map 47  google_maps47.htm
Webページ に、Place Autocomplete(施設や住所から検索)を実装したGoogle Mapsを表示。  ラジオボタンは、検索タイプの指定。 StrictBounds オプションは、現在のビューポート内の領域に検索を制限します。    Maps API、DHTML。      初期表示場所、ズームなどのカスタマイズはテキストエディターなどで可。    all 対応。     コピー、編集し、簡単にWebで応用できまっ、(^ ^)。    関連・詳細情報 :Google Maps Platform  > ドキュメント >  Maps JavaScript API > SAMPLES > Places  ・Place Autocomplete
デモは、ラジオボタンなどを指定、建物や住所を入力。  頭文字列入力からの候補から選択。
 
< ご使用方法 >
 ・ ローカル(=PC)への保存は、google_maps47.htm を右クリック、[対象をファイルに保存] - 【ファイルのダウンロード】、【ファイル名を付けて保存】 - <保存する場所>: ……、などで。    ※:  変わってしまった、ファイル名や、*.html 中のパスは要修正。
 ・ このDHTMLの実装方法は、google_maps47.htm をテキストエディターで開き、ホームページ作成ソフトなどのHTML挿入/編集メニューなどを使って、新しいページ 1 や hogehoge.html(=任意の挿入先ファイル名) の、 <head> 〜 </head> の任意の行間に (*1)を、さらに 
<body> 〜 </body>の任意の行間に (*2) をペーストします。
 ・ 編集方法は、hogehoge.html を WordPad や SmipleTextなどのテキストエディター、あるいは ”FrontPage Express” などのホームページ制作ソフトのHTMLタグ挿入/編集メニュー で開き編集します。    下記の(例) (*1) と、(*2)、(*3) を参考に太字部分の編集を任意に行います。   
 ※: テキストエディターによる編集は、HP制作ソフトとの互換性の問題を生じません(HP制作ソフト間は少し生じる)。
 ・ 作動テストは、ローカル(PC)に保存し、 Internet Explorer 10.x〜 などで開いて。    
更新の確認は、[F5]キー を押し、最新データ読み込み、で。    あるいは、Internet Explorerを全て閉じ、再起動を行い、閲覧履歴の削除後や、【Internet Explorer】- [ツール] - [インターネット オプション] - 
[閲覧の履歴] - [削除] などでも。
 ・ アップロードや作動テストは、hogehoge.html と同じ階層〔ホルダー/ディレクトリー〕に、使用する画像なども転送/配置し実施。  ※:別ディレクトリーに配置時は、*.html 中のパスは要修正。   FTPなどで変わってしまったファイル名は要修正。    スクリプト構文中への改行混入は非作動原因。
 ・ 関連情報 : 
色記号5、〃6、スタイルシートリファレンス、ホームページ開設入門。   Web Development、Web開発、IE10 
互換性クックブック、〃開発者向けガイド、IE 
API リファレンス、IE 開発 
> HTMLとCSS、開発ツールでサイトを修正、スクリプト デバッグの概要、HTMLとCSSのサポート、CSSの改良点、XML、〃リファレンス、DHTML。
 
(*1) 
: google_maps47.htm (例)         挿入先の  <head> 〜 </head> の、〜 部分にペーストします。
  
    |  | HTMLの編集方法 | (*1) をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。 | 
  
    |  | 〔この列ペースト不要〕 シフトJIS使用(削除不可) ieなどに表示するアイコンファイル名(削除可) 
	<style type= 〜 
	 </style>は(削除可)(*1)〜(*3)表タイトル背景
 body 文字色 背景色 下線
 ハイパーリンク 〃
 表示済みの〃
 マウスオーバー時の〃
 クリック中の〃
 フォント
 
    リンクを新しいWinで開くを標準(削除可)※:target= いろいろ同じフレーム=_self、ページ全体=_top、親フレーム=_parent
 
 お気に入り、タスクバーに表示するページ名(≠ファイル名)
 | <meta http-equiv="Content-Type" content="text/html; charset=x-sjis"> <link REL="SHORTCUT ICON" href="favicon.ico"> <style type="text/css"><!-- 
    .xxx0 
	{ background: #F9F8F9 url('wttec.gif'); 
	}
 .xxx1 { background-color:#E3E0DC; }
 .xxx2 { background-color:#FFF; }
 body { color:#000000; background: #F9F8F9 
	url('wttec.gif'); text-decoration:none; 
	}
 a:link { color:#3C0055; background-color:#FBFAFE; text-decoration:none; }
 a:visited { color:#270037; background-color:#EDECEF; text-decoration:none; }
 a:hover { color:#1F002E; background-color:#D2F3F4; 
	text-decoration:underline; }
 a:active { color:#1F002E; background-color:#F5FFD2; 
	text-decoration:underline; }
 font {font-size:12px;
	line-height:13px;}
 body,tr,td,form{ font-family:MS PGothic,MS Gothic,Verdana; font-size: 12px}
 --></style>
 <base target="_blank"> <title>サンプルページ  Google Map 47</title> <!-- ☆ ----------- ↓ この間をコピー&ペーストします。 ------------ --><style>
 #header {position: absolute; top: 0px; left: 0px; width:100%; margin:2px; 
	padding: 0px; text-align: left; color:#2E0064; background: #FFF 
	url('bg_slva3r.jpg');border-left: 1px solid #F0F0F4; border-top: 1px solid 
	#F0F0F4; border-right: 1px solid #E2E2E7; border-bottom: 1px solid #E2E2E7;; 
	font-style:normal; font-variant:normal; font-weight:normal; font-size:13px; 
	font-family:Lucida Console;color:#2E0064;"}
 </style>
 <style>
 /* Always set the map height explicitly to define the size of the div
 * element that contains the map. */
 #map {
 height: 97%;
 }
 /* Optional: Makes the sample page fill the window. */
 html, body {
 height: 100%;
 margin: 0;
 padding: 0;
 }
 #description {
 ====  この間、説明を省略。  ==== #title {color: #fff;
 background-color: #4d90fe;
 font-size: 25px;
 font-weight: 500;
 padding: 6px 12px;
 }
 </style>
 
 <!-- ☆ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
 ====  この間、説明を省略。  ====   | 
 
(*2) 
: google_maps47.htm (例)        挿入先の  <body> 〜 
</body> の、〜 
部分にペーストします。
  
    |  | HTMLの編集方法 | (*2)をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。 | 
  
    |  | 〔この列ペースト不要〕                       初期表示場所                                        説明部分(〜〜)の位置 Google Maps APIキー | <body>
 <!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ --> <DIV id="header"> <img src="./map.gif" alt="" width="20" height="20" 
	border="0" align="a    ====  この間、説明を省略。  ====  get="_self" 
	href="./google_maps17/google_maps17.htm">世界の国々</a></DIV><div id="map" style="position: relaqtive; top: 25px; left: 0px;"></div>
 <div class="pac-card" id="pac-card">
 <div>
 <div id="type-selector" class="pac-controls">
 <input type="radio" name="type" id="changetype-all" checked="checked">
 <label for="changetype-all">All</label>
 ====  この間、説明を省略。  ==== <script>// This example requires the Places library. Include the libraries=places
 // parameter when you first load the API. For example:
 // <script 
	src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
 
 function initMap() {
 var map = new google.maps.Map(document.getElementById('map'), {
 center: {lat: 40.798637, lng: -73.954264},
 zoom: 13
 });
 var card = document.getElementById('pac-card');
 var input = document.getElementById('pac-input');
 var types = document.getElementById('type-selector');
 var strictBounds = document.getElementById('strict-bounds-selector');
 
 map.controls[google.maps.ControlPosition.TOP_LEFT].push(card);
 
 var autocomplete = new google.maps.places.Autocomplete(input);
 
 // Bind the map's bounds (viewport) property to the autocomplete object,
 // so that the autocomplete requests use the current map bounds for the
 // bounds option in the request.
 autocomplete.bindTo('bounds', map);
 
 // Set the data fields to return when the user selects a place.
 autocomplete.setFields(
 ['address_components', 'geometry', 'icon', 'name']);
 
 ====  この間、説明を省略。  ==== setupClickListener('changetype-all', []);
 setupClickListener('changetype-address', ['address']);
 setupClickListener('changetype-establishment', ['establishment']);
 setupClickListener('changetype-geocode', ['geocode']);
 
 document.getElementById('use-strict-bounds')
 .addEventListener('click', function() {
 console.log('Checkbox clicked! New state=' + this.checked);
 autocomplete.setOptions({strictBounds: this.checked});
 });
 }
 </script>
 <script src="https://maps.googleapis.com/maps/api/js?key=AIz …… Q3E&libraries=places&callback=initMap"
 async defer></script>
 </script>
 <!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
 <div style="margin: 10px; left:0px; font:normal 12px MS PGothic,Lucida 
	Console,Arial; line-height:13px;">
 
 
 ====  この間、説明を省略。  ====
 (〜〜) </div></body>
 | 
< 補足 >    適時参照あれ!。
 ・ Wordpad によるHTMLソース(タグ)を見ながらの直接編集方法。