');
document.write('');
document.write('');
document.write('');
//一覧メニュー
if(mp_dd[6]*1 == 1 || mp_dd[6]*1 == 2){
document.write(' | ');
if(mp_dd0[1]==""){
document.write('');
}else{
document.write(' ');
}
document.write(' ');
for(i=0;i ');
}
}
document.write(' ');
document.write(' | ');
//////////////
document.write(' | | ');
////
document.write('');
/////////
marker=new Array();
infoWindow=new Array();
function initMap() {
// 地図の作成
dd=map_win.split(",");
var mapLatLng = new google.maps.LatLng({
lat: (dd[2]*1), lng: (dd[3]*1)
}); // 緯度経度のデータ作成
map_size=dd[4]*1;
mty='roadmap';
if(mp_type==1){
mty='satellite';
}
map = new google.maps.Map(document.getElementById('map_table'), { // #sampleに地図を埋め込む
center: mapLatLng, // 地図の中心を指定
zoom: (map_size), // 地図のズームを指定
// mapTypeId: 'roadmap'
mapTypeId: mty
});
//satellite
// クリックイベントを追加
map.addListener('click', function(e) {
getClickLatLng(e.latLng, map);
});
// マーカー毎の処理
for (var i = 0; i < dt.length; i++) {
dd=(dt[i]+",,,,,").split(",");
dd0=(dd[0]+"?").split("?");
markerLatLng = new google.maps.LatLng({ lat: (dd[1]*1), lng: (dd[2]*1)}); // 緯度経度のデータ作成
ddp=dd0[0].indexOf(".");
if(dd0[1].length>2){
//イメージマーカー
marker[i] = new google.maps.Marker({ // マーカーの追加
icon:dd0[1],
position: markerLatLng, // マーカーを立てる位置を指定
map: map, // マーカーを立てる地図を指定
});
}else{
//標準マイカー
marker[i] = new google.maps.Marker({ // マーカーの追加
label:dd0[1], //マーカーのラベル
position: markerLatLng, // マーカーを立てる位置を指定
map: map // マーカーを立てる地図を指定
});
}
dd0=(dd[0]+"?").split("?");
dm = '';
if(dd[3]==""){
dm += '- '+dd0[0]+'
' ;
}else{
dm += ' - '+dd0[0]+'
' ;
}
dd4=(dd[4]).split(";");
for(ij=0;ij'+ dd4[ij]+' ';
}
dm += ' ';
dd42=(dd4[ij]+" ").split(" ");
dm += '';
dm += '';
dm += '';
// dm += '';
infoWindow[i] = new google.maps.InfoWindow({ // 吹き出しの追加
content: '' + dm + ' ' // 吹き出しに表示する内容
});
markerEvent(i); // マーカーにクリックイベントを追加
}
menu();
// sel_wright();
}
// マーカーにクリックイベントを追加
function markerEvent(i) {
marker[i].addListener('click', function() { // マーカーをクリックしたとき
infoWindow[i].open(map, marker[i]); // 吹き出しの表示
infoWindow[back_k].close(map, marker[back_k]); // 吹き出しの消去
back_k=i;//次に消すNO
dd=(dt[i]+",,,,").split(",");
document.getElementById("ido").value=dd[1];
document.getElementById("keido").value=dd[2];
document.getElementById("ido_text").innerHTML=dd[1];
document.getElementById("keido_text").innerHTML=dd[2];
initialize(i);//ストリートビュー
if(dd[8]!=""){yomu(dd[8]);}
sel_elements[i].selected = true ;//メニュー入替
});
}
//地図クリックイベント
function getClickLatLng(lat_lng, map) {
// 座標を表示
document.getElementById('ido').value = Math.floor(lat_lng.lat()*1000000)/1000000;
document.getElementById('keido').value = Math.floor(lat_lng.lng()*1000000)/1000000;
document.getElementById('ido_text').innerHTML = Math.floor(lat_lng.lat()*1000000)/1000000;
document.getElementById('keido_text').innerHTML = Math.floor(lat_lng.lng()*1000000)/1000000;
}
//////写真拡大////
function img_win(g){
dm="";
img_win=window.open(dm);
img_win.document.open();
//ww=('');
ww=('拡大ページテスト');
img_win.document.write=ww;
img_win.document.close();
}
function img_cls(){
img_win.cloce();
}
//////マウスダウンで地図移動/////
function ud(s1,s2){
rl_value=s1*30;
ud_value=s2*30;
ud_tim=setInterval(ud_sub,100);
}
function ud_sub(){
map.panBy(rl_value,ud_value);
}
function ud_cls(){
clearInterval(ud_tim);
}
function ud_false(){
return false;
}
////ズーム////
function kakudai(q){
map_size+=q;
//var map = new google.maps.Map(document.getElementById("map_table"), opts);
map.setZoom(map_size);
document.getElementById("kakudai_box").value=map_size;
}
/////移動///
back_k=0;
function mov(k){
k_no=k;
dd=(dt[k_no]+",,,,").split(",");
map.panTo(new google.maps.LatLng(dd[1],dd[2]));
document.getElementById("ido").value=dd[1];
document.getElementById("keido").value=dd[2];
document.getElementById("ido_text").innerHTML=dd[1];
document.getElementById("keido_text").innerHTMLe=dd[2];
infoWindow[back_k].close(map, marker[back_k]);//前の吹き出しを閉じる
infoWindow[k].open(map, marker[k]); // 吹き出しの表示
if(dd[5] !=""){map_size=dd[5]*1;kakudai(0);}
if(dd[6] !=""){map_tno=dd[6]*1;map_chg();}
if(dd[7]=="" && document.getElementById("v_check").checked==false){
//view_cls();
storyt_cls();
}else{
initialize(k_no);
}
if(dd[8]!=""){yomu(dd[8]);}
///
/*
// select要素を取得
var sel_element = document.getElementById( "sel_menu" ) ;
// option要素の集合を取得
var sel_elements = sel_element.options ;
*/
// 2つ目の項目を選択状態にする
sel_elements[k_no].selected = true ;
/*
if(k_no>0){
//map.addOverlay(new GPolyline(points,mp_dd7[1],mp_dd7[0],mp_dd7[2]*0.1));
//
var points = [
new GLatLng(back_dd1,back_dd2),
new GLatLng(dd[1],dd[2]),
];
var line = new GPolyline(points);
map.addOverlay(line);
}
*/
back_dd1=dd[1];back_dd2=dd[2];
back_k=k_no;
}
/////巡回//////
at_no=0;junkai_flg=0;
function junkai(){
if(mp_dd[8]*1<1 || mp_dd[8]==""){
alert("巡回秒が設定されていません");return;
}
if(junkai_flg==1){
document.kakudai_form.at_button.value="自動巡行開始";
junkai_flg=0;
clearInterval(ttt);
}else{
document.kakudai_form.at_button.value="自動巡行停止";
junkai_flg=1;
// junkai_sub();
ttt=setInterval(junkai_sub,(mp_dd[8]*1000));
junkai_sub();
}
}
//順路線
mp_dd7=(mp_dd[7]+";;;").split(";");
if(mp_dd7[1]==""){mp_dd7[1]="#ff0000";}
if(mp_dd7[2]==""){mp_dd7[2]="7";}
/*
function junro(){
var points = [];
for(i=0;i0){junro();}
*/
dm_no=0;
function junkai_sub(){
mov(at_no);
at_no++;
if(at_no>=nn){at_no=0;}
document.getElementById("test").innerHTML=at_no;
}
///地図変更
map_tno=1;
function map_chg(){
if(map_tno==0){
map.setMapTypeId('roadmap');
map_tno=1;
document.getElementById("typ_button").innerHTML="航空写真へ";
}else{
map.setMapTypeId('satellite');
map_tno=0;
document.getElementById("typ_button").innerHTML="道路地図へ";
}
}
///////////ストリートビュー////////////
function initialize(k) {
dd=(dt[k]+",,,,").split(",");
d1=dd[1]*1;//35.0898957;
d2=dd[2]*1;// 137.111994;
d7=dd[7]*1;
var fenway = {
lat: (d1), lng:(d2)
};
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('storyt_img'), {
position: fenway,
pov: {
heading: (d7),
pitch: 0
}
}
);
if(document.getElementById("v_check").checked==true){
document.getElementById("storyt").style.visibility="visible";
}else{
document.getElementById("storyt").style.visibility="hidden";
}
}
function storyt_cls(){
document.getElementById("storyt").style.visibility="hidden";
}
/////巡回//////
/////検索////
function search(){
var place = document.getElementById('address').value;
var geocoder = new google.maps.Geocoder();
// ジオコーディング 検索実行
//marker.setMap(null);
geocoder.geocode(
{"address" : place}, function(results, status) {
//marker.setMap(null);
if (status == google.maps.GeocoderStatus.OK) {
var lat = results[0].geometry.location.lat();//緯度を取得
var lng = results[0].geometry.location.lng();//経度を取得
var ido = document.getElementById('ido')
ido.innerHTML = lat;
var keido = document.getElementById('keido')
keido.innerHTML = lng;
var mark = {
lat: lat, // 緯度
lng: lng // 経度
};
marker = new google.maps.Marker({ // マーカーの追加
position: mark, // マーカーを立てる位置を指定
map: map, // マーカーを立てる地図を指定
icon:'http://maps.google.com/mapfiles/ms/icons/green-dot.png'
});
map.setCenter(results[0].geometry.location); // 地図の中心を移動
cnt =0;
// 座標を表示
document.getElementById('ido').value = Math.floor(lat*1000000)/1000000;
document.getElementById('keido').value = Math.floor(lng*1000000)/1000000;
document.getElementById('ido_text').innerHTML = Math.floor(lat*1000000)/1000000;
document.getElementById('keido_text').innerHTML = Math.floor(lng*1000000)/1000000;
}
}
);
}
////////ナレーション
function yomu(ym){
if(document.getElementById("yomi_check").checked==false){return;}
if(ym==""){return;}
speechSynthesis.cancel();//読みバッファーを空にする
speechSynthesis.speak(new SpeechSynthesisUtterance(ym));
}
onLoad=initMap();
|