ホーム へ       サンプルページ  Google Map 40  google_maps40.htm

ストリートビュー表示ポントをクリック、ストリートビューをダイレクト(ペグマン無し)に表示、ポイントをマーキング、左右分割DIV。       Google Maps API、DHTML。       初期表示ポイント(マップ中心)、サイズなどのカスタマイズはテキストエディターなどで可。    all 対応。     コピー、編集し、簡単にWebで応用できまっ、(^ ^)。            関連・詳細情報 : Google Developers.(サービス) > Google Maps JavaScript API > Code Samples

デモは、ストリートビュー表示ポントをクリック。 マーカーのクリックで再度表示。

 

< ご使用方法 >

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

 ・ このDHTMLの実装方法は、google_maps40.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 DevelopmentWeb開発IE10 互換性クックブック〃開発者向けガイド、IE API リファレンスIE 開発 > HTMLとCSS開発ツールでサイトを修正スクリプト デバッグの概要HTMLとCSSのサポートCSSの改良点XML〃リファレンスDHTML

 

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

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

シフトJIS使用(削除不可)

互換表示

ieなどに表示するアイコンファイル名(削除可)

<style type= </style>は(削除可)
(*1)〜(*3)表タイトル背景
body 文字色 背景色 下線
ハイパーリンク 〃
表示済みの〃
マウスオーバー時の〃
クリック中の〃
フォント

 

リンクを新しいWinで開くを標準(削除可)※:target= いろいろ
同じフレーム=_self、ページ全体=_top、親フレーム=_parent

お気に入り、タスクバーに表示するページ名(≠ファイル名)

ヘッダー

 

 

 

マップ

 

 

 

 

 

 

 

初期表示場所の緯度、経度

 

 

 

ズーム

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

<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 40</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%;
}
</STYLE>

<SCRIPT>
/*
* Click the map to set a new location for the Street View camera.
*/

var map;
var panorama;

function initMap() {
var berkeley = {lat: 40.78132686141025, lng: -73.96666302738595};
var sv = new google.maps.StreetViewService();

panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'));

// Set up the map.
map = new google.maps.Map(document.getElementById('map'), {
center: berkeley,
zoom: 16,
streetViewControl: false
});

// Set the initial Street View camera to the center of the map
sv.getPanorama({location: berkeley, radius: 50}, processSVData);

// Look for a nearby Street View panorama when the map is clicked.
// getPanoramaByLocation will return the nearest pano when the
// given radius is 50 meters or less.
map.addListener('click', function(event) {
sv.getPanorama({location: event.latLng, radius: 50}, processSVData);
});
}

function processSVData(data, status) {
if (status === google.maps.StreetViewStatus.OK) {
var marker = new google.maps.Marker({
position: data.location.latLng,
map: map,
title: data.location.description
});

panorama.setPano(data.location.pano);
panorama.setPov({
heading: 270,
pitch: 0
});
panorama.setVisible(true);

marker.addListener('click', function() {
var markerPanoID = data.location.pano;
// Set the Pano to use the passed panoID.
panorama.setPano(markerPanoID);
panorama.setPov({
heading: 270,
pitch: 0
});
panorama.setVisible(true);
});
} else {
console.error('Street View data not found for this location.');
}
}
</SCRIPT>
<SCRIPT src="https://maps.googleapis.com/maps/api/js?key=AIzaSy……PQ3E&amp;signed_in=true&amp;callback=initMap" defer="" async=""></SCRIPT>

<!-- ☆ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
</head>
 

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

 

 

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

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

ヘッダー
画像 タイトル
URL 吹き出し サイト名

以下、同様。

 

 

説明部分(〜〜)の位置

 


<body>
<!-- ★ ----------- ↓ この間をコピー&ペーストします。 ------------ -->
<DIV id="header"> <img src="../map.gif" alt="" width="20" height="20" border="0" align="absmiddle" /> <b>Directly accessing Street View</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_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_maps32.htm" target="_self">住所(PlaceID)検索</a> <a target="_self" href="./google_maps28.htm" target="_self">ホテル検索</a> <a target="_self" href="./google_maps30.htm" target="_self">ストリートビュー30</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/><br/>
<DIV id="map" style="position: relaqtive; top: 1px; left: 0px; width: 50%; height: 100%; float: left;"></DIV>
<DIV id="pano" style="position:relaqtive; top: 1px; left: 0px;width: 50%; height: 100%; float: left;"></DIV>
<div style="position: absolute; top:800px; margin: 10px; left:0px; font:normal 12px MS PGothic,Lucida Console,Arial; line-height:13px;">
<!-- ★ ----------- ↑ この間をコピー&ペーストします。 ------------ -->
====  この間、説明を省略。  ====

〜〜

</div>

 

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

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