PageSourceSearch

https://www.e29-matsumura.com/cmn/js/google_maps_display.js

js e29-matsumura.com collected 2026-10-05 03:40:56 UTC 2,926 bytes, 100 lines download raw bytes

1//<![CDATA[
2
3//mapとgeocoderオブジェクトを初期化
4var map = null;
5var geocoder = null;
6
7//MTから住所・緯度経度を読み込み
8
9//プロフィール : 住所
10var profileAddress = "東京都あきる野市小中野116";
11
12//プロフィール住所
13var accessAddress = "";
14
15var mapLatLon = "";
16
17
18var inputLat;
19var inputLon;
20
21
22//Google Maps読み込み
23window.onload = function(){
24
25	if (GBrowserIsCompatible()) {
26		////////// html の id名 map にGoogle Maps 読み込み //////////
27		map = new GMap2(document.getElementById("googleMapsArea"));
28		////////// 操作インターフェースの表示 //////////
29		map.addControl(new GLargeMapControl());//コントロールボタン
30		//map.addControl(new GMapTypeControl());//地図・航空写真切り替え
31		//map.addControl(new GOverviewMapControl());//縮小地図
32
33		//スケールを設定
34		ctrlObj = new GScaleControl();
35		map.addControl(ctrlObj);
36
37		//googleMapの初期位置を設定
38		map.setCenter(new GLatLng(39.095963, 136.933594), 4);
39
40		//geocoderオブジェクトを新規作成
41		geocoder = new GClientGeocoder();
42	}
43
44	if(mapLatLon != ""){
45		var mapLatLonAry = mapLatLon.split(",");
46		inputLat = mapLatLonAry[0];
47		inputLon = mapLatLonAry[1];
48		inputLat = inputLat.replace("\s", "");
49		inputLat = inputLat.replace(" ", "");
50		inputLon = inputLon.replace("\s", "");
51		inputLon = inputLon.replace(" ", "");
52		showLatLon(inputLat, inputLon);
53	}else if(accessAddress != ""){
54		showAddress(accessAddress);
55	}else if(profileAddress != ""){
56		showAddress(profileAddress);
57	}
58}
59
60////////// 緯度経度でマーカーを表示 //////////
61function showLatLon(lat, lon) {
62	//マーカーの操作
63
64	//前回のマーカーを全て消去
65	map.clearOverlays();
66
67	//マーカーの座標をに設定
68	var marker = new GMarker(new GLatLng( lat, lon));
69
70	//マーカーを表示
71	map.setCenter(new GLatLng(lat, lon), 14);//地図の中心を、対象の緯度経度に設定
72	map.addOverlay(marker);
73}
74
75////////// 地名でマーカーを表示 //////////
76function showAddress(address) {
77	if (geocoder) {
78		//geocoder オブジェクトが作成されていれば、 form の値を address に入力して実行
79		geocoder.getLatLng(
80			address,
81			function(point) {
82				if (!point) {
83					//対象の住所が見つからなかった場合
84					//マーカーを削除
85					map.clearOverlays();
86					//エラー文を表示
87					marker.openInfoWindowHtml("<strong>" + address + が見つかりません + "</strong>");//form で入力された値を、吹きだしに表示
88				} else {
89					//対象の住所が見つかった場合
90					map.clearOverlays();//前回のマーカーを全て消去
91					var marker = new GMarker(point);//マーカーを、対象の緯度経度に設定
92					map.setCenter(point, 14);//地図の中心を、対象の緯度経度に設定
93					map.addOverlay(marker);//マーカーを表示
94				}
95			}
96		);
97	}
98}
99
100//]]>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.