ホーム へ       サンプルページ  Google Map 43  google_maps43.htm
世界のルート表示、”徒歩/路線/車”の手段を選択、発/着ポイントをタイプイン(頭文字から選択可)。       Google Maps API、DHTML。       初期表示ポイント(マップ中心)、サイズなどのカスタマイズはテキストエディターなどで可。    all 対応。     コピー、編集し、簡単にWebで応用できまっ、(^ 
^)。            関連・詳細情報 : Google Developers.(サービス) >
Google Maps JavaScript API >Code Samples >  
デモは、マウスホイールでズム、ドラッグなどで目的地域を表示、”徒歩/路線/車”の手段を選択、発/着ポイントをタイプイン(頭文字から選択可)。 リセット・再入力は、[F5]キーで。
 
< ご使用方法 >
 ・ ローカル(=PC)への保存は、google_maps43.htm を右クリック、[対象をファイルに保存] 
- 【ファイルのダウンロード】、【ファイル名を付けて保存】 - <保存する場所>: ……、などで。    ※:  
変わってしまった、ファイル名や、*.html 中のパスは要修正。
 ・ このDHTMLの実装方法は、google_maps43.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_maps43.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"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <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 43</title> <!-- ☆ ----------- ↓ この間をコピー&ペーストします。 ------------ --><style>
 #header {position: absolute; top: 0px; left: 0px; width:100%; margin:2px; 
	padding: 0px; text-align: left; color:#2E0064; background: #FFF 
	url('http://www.pat.hi-ho.ne.jp/oka_tosho/tab_menu12/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>
 html, body {
 height: 100%;
 margin: 0;
 padding: 0;
 }
 #map {
 height: 100%;
 }
 
	====  この間、説明を省略。  ==== #mode-selector {
 color: #fff;
 background-color: #4d90fe;
 margin-left: 12px;
 padding: 5px 11px 0px 11px;
 }
 
 #mode-selector label {
 font-family: Roboto;
 font-size: 13px;
 font-weight: 300;
 }
 </STYLE>
 <!-- ☆ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
 </head>
 
 | 
 
(*2) 
: google_maps43.htm (例)        挿入先の  <body> 
〜 </body> の、〜 
部分にペーストします。
  
    |  | HTMLの編集方法 | (*2)をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。 | 
  
    |  | 〔この列ペースト不要〕 
   ヘッダー(任意)画像 タイトル
 URL 吹き出し サイト名
 以下、同様。     入力フォーム 選択ボタン   マップ       初期表示場所の緯度、経度ズーム
                 
       Google Maps APIキー    ※:キーを取得説明部分(〜〜)の位置
   | <body> <!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ --><DIV id="header"> <img src="./map.gif" alt="" width="20" height="20" 
	border="0" align="absmiddle" /> <b>Place Autocomplete</b>    ⇒ <a 
	href="http://www.pat.hi-ho.ne.jp/oka_tosho/gmap_select/gmap_select1.htm" 
	target="_blank" title="ここをクリック">ストリートビューセレクト1</a> <a 
	target="_self" href="./google_maps40.htm" target="_self">Directly accessing 
	Street View</a> <a target="_self" href="./google_maps35.htm" target="_self" 
	title="最新のRSS Feed(Flickr: ”nature”)を毎回表示。">
 GeoRSS</a> <a target="_self" href="./google_maps34.htm" 
	target="_self">道路交通量</a> <a target="_self" href="./google_maps33.htm" 
	target="_self">都市交通路線</a> <a target="_self" href="./google_maps28.htm" 
	target="_self">ホテル検索</a> <a target="_self" 
	href="./google_maps16/google_maps16a.htm">新宿周辺コーヒー-2</a> <a 
	href="./google_maps18/google_maps18.htm" target="_self">スターバックス</a> <a 
	target="_self" href="./google_maps25/google_maps25.htm">日本百名山</a> <a 
	target="_self" href="./google_maps17/google_maps17.htm">世界の国々</a>  </DIV>
 <INPUT class="controls" id="origin-input" type="text" placeholder="Enter an 
	origin location" value="">
 <INPUT class="controls" id="destination-input" type="text" 
	placeholder="Enter a destination location" value="">
 
 <DIV class="controls" id="mode-selector"><INPUT name="type" 
	id="changemode-walking"
 type="radio"> <LABEL for="changemode-walking">徒歩</LABEL> <INPUT
 name="type" id="changemode-transit" type="radio"> <LABEL 
	for="changemode-transit">路線</LABEL>
 <INPUT name="type" id="changemode-driving" type="radio"> <LABEL 
	for="changemode-driving">車</LABEL>
 </DIV>
 <DIV id="map" style="position: relaqtive; top: 25px; left: 0px;"></DIV>
 <SCRIPT>
 function initMap() {
 var origin_place_id = null;
 var destination_place_id = null;
 var travel_mode = google.maps.TravelMode.WALKING;
 var map = new google.maps.Map(document.getElementById('map'), {
 mapTypeControl: false,
 center: {lat: 40.680566707734314, lng: 286.0937435925007},
 zoom: 9
 });
 var directionsService = new google.maps.DirectionsService;
 var directionsDisplay = new google.maps.DirectionsRenderer;
 directionsDisplay.setMap(map);
 
 
	====  この間、説明を省略。  ==== if (!origin_place_id || !destination_place_id) {return;
 }
 directionsService.route({
 origin: {'placeId': origin_place_id},
 destination: {'placeId': destination_place_id},
 travelMode: travel_mode
 }, function(response, status) {
 if (status === google.maps.DirectionsStatus.OK) {
 directionsDisplay.setDirections(response);
 } else {
 window.alert('Directions request failed due to ' + status);
 }
 });
 }
 }
 </SCRIPT>
 
 <SCRIPT src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD …… CgPQ3E&signed_in=true&libraries=places&callback=initMap" 
	defer="" async=""></SCRIPT>
 <div style="position: absolute; top:800px; margin: 10px; left:0px; 
	font:normal 12px MS PGothic,Lucida Console,Arial; line-height:13px;">
 <!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
 
 ====  この間、説明を省略。  ====
 〜〜 </div>   | 
< 補足 >    適時参照あれ!。
 ・ Wordpad によるHTMLソース(タグ)を見ながらの直接編集方法。