ホーム へ       サンプルページ  Google Map 33  google_maps33.htm

Webページに 世界の”地下鉄路線”(デフォルト : ニューヨーク) Transit laye 付きGoogle Mapを実装する。   東京版大阪版     Google Maps API、DHTML。       初期表示ポイント(マップ中心)、サイズなどのカスタマイズはテキストエディターなどで可。    all 対応。     コピー、編集し、簡単にWebで応用できまっ、(^ ^)。        関連・詳細情報 : Google Developers.(サービス) > Google Maps JavaScript API > Code Samples > Transit laye

デモは、マップのドラッグ、マウススクロールボタンでズーミングを!。

 

< ご使用方法 >

 ・ ローカル(=PC)への保存は、google_maps33.htm を右クリック、[対象をファイルに保存] - 【ファイルのダウンロード】、【ファイル名を付けて保存】 - <保存する場所>: ……、などで。    ※:  変わってしまった、ファイル名や、*.html 中のパスは要修正。

 ・ このDHTMLの実装方法は、google_maps33.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スタイルシートリファレンスホームページ開設入門

 

(*1) : google_maps33.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 33</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 {
top: 13px;
height: 100%;
}
</STYLE>
<SCRIPT>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: {lat: 40.680566707734314, lng: 286.0937435925007}
});

var transitLayer = new google.maps.TransitLayer();
transitLayer.setMap(map);
}
</SCRIPT>

<SCRIPT src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD …… gPQ3E&amp;signed_in=true&amp;libraries=places&amp;callback=initMap" defer="" async=""></SCRIPT>
<!-- ☆ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
 

 

(*2) : google_maps33.htm (例)        挿入先の  <body> 〜 </body> の、 部分にペーストします。

 HTMLの編集方法   (*2)をテキストエディターで開き、下記↓のHTMLを挿入先ファイルにペースト、太字部分を編集し使用。
〔この列ペースト不要〕

ヘッダーアイコン(任意)
タイトル ORL 吹き出し サイト名
以下、同様。

 

Google Maps APIキー    ※:キーを取得

説明部分の位置 フォント


<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<DIV id="header"> <img src="./map.gif" alt="" width="20" height="20" border="0" align="absmiddle" /> <b>世界の都市交通路線</b>    ⇒ <a href="http://www.pat.hi-ho.ne.jp/oka_tosho/google_map/google_map3p/google_map3p.htm" target="_blank" title="ここをクリック">東京地下鉄</a> <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_maps43.htm" target="_self" title="”徒歩/路線/車”の手段を選択、発/着ポイントをタイプイン(頭文字から選択可)。">世界のルート表示</a> <a target="_self" href="./google_maps34.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><br/>
<DIV id="map"></DIV>
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
<div style="position: absolute; top:950px; margin: 10px; left:0px; font:normal 12px MS PGothic,Lucida Console,Arial; line-height:13px;">

====  この間、説明を省略。  ====

</div>

</body> 

< 補足 >    適時参照あれ!。

 ・ メモ帳によるHTMLソース(タグ)を見ながらの直接編集方法。

ハロー(^. ^)