annotate shuzai/trad/new_late_geojson.js @ 3832:c7bc1cd00174

scrollzoom_on
author natto <earlgray_spring@aol.com>
date Tue, 05 Feb 2019 14:00:12 +0900
parents df9e13061fbe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
1 //var ltlg= [38.72859248614108,139.82239320874214];
3803
b9eca1af5ecb changed new_late_geojson.js(changed start point)
Fumiya SATO <c116092@h.koeki-u.ac.jp>
parents: 3773
diff changeset
2 var ltlg=[38.922825, 139.848747];
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
3 //var ltlg=[39.019707,139.909754];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
4 //マップの中心にする座標
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
5
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
6 var M_info=document.getElementById("mak_info");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
7
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
8 function Boxes(map,Icon,tenten,Name,id){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
9
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
10 map.on('popupopen', function(o) {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
11 var S_width=window.innerWidth;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
12 var S_height=window.innerHeight;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
13
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
14 if(S_width<S_height){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
15 var M_width=S_width;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
16 var M_height=S_height/2;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
17 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
18 var M_width=S_width/2;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
19 var M_height=S_height-200;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
20 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
21
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
22 //console.log(Name[0]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
23 //console.log(o);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
24
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
25 $(function(){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
26 var num=[];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
27 $('.movie').colorbox({
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
28 onOpen:function(){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
29 map.closePopup();
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
30 },
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
31 onLoad:function(){
3807
617c529dfabb changed new_late_geojson.js(zoom level 10)
Fumiya SATO <c116092@h.koeki-u.ac.jp>
parents: 3806
diff changeset
32 map.setZoom(17);
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
33 num.push($.colorbox.element().context.attributes.id.nodeValue);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
34 },
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
35 iframe: true,
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
36 // titleで祭の名前とレストランの名前を表示
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
37 width:M_width,
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
38 height: M_height,
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
39 rel:'movie', //同じクラス名のものをスライド表示
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
40 //width:s_width-100,
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
41 onClosed:function(){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
42 var pan=num[num.length-1];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
43 var pp=document.getElementById('Point'+pan);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
44 var lat=Icon[pan][1],lng=Icon[pan][0];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
45 var pan_to=[lat,lng];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
46 map.flyTo(pan_to);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
47 //sidebar.open('home')
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
48 //location.href="#"+pp;//"#Point"+pan;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
49 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
50
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
51 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
52
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
53 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
54 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
55 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
56
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
57 function Set_Contents(str){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
58 if(str.match(/{{{/)){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
59 var Mov_star=str.indexOf("{{{");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
60 var Mov_end=str.indexOf("}}}");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
61 var Mov=str.slice(Mov_star,Mov_end+3); //Mov_endがある位置を出すと}が含まれないため +3 している
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
62 str=str.replace(Mov,"");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
63 Mov=Mov.replace(/{{{/g, "");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
64 Mov=Mov.replace(/}}}/g, "");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
65 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
66 Mov="";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
67 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
68 var Pic=str.replace(/{{/g, "<img width='400' length='200' src=\"");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
69 Pic=Pic.replace(/}}/g, "\">");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
70 var Link=Pic.replace(/\[\[/g, "<br><a href=\"")
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
71 Link=Link.replace(/\|/g, "\">");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
72 Link=Link.replace(/]]/g, "</a>");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
73
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
74 return [Link,Mov];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
75 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
76
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
77
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
78 var osmTile =
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
79 L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
80 attribution:
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
81 '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> \
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
82 contributors'
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
83 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
84
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
85 var gsiTile =
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
86 L.tileLayer('//cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
87 attribution:
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
88 '<a href="http://maps.gsi.go.jp/development/ichiran.html">国土地理院</a>'
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
89 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
90
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
91 var haru=L.layerGroup([]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
92 var natu=L.layerGroup([]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
93 var akii=L.layerGroup([]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
94 var huyu=L.layerGroup([]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
95
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
96 //var time= document.getElementById("time");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
97
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
98 var baseLayers = {'OpenStreetMap': osmTile, '国土地理院': gsiTile};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
99 //レイヤーの内容
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
100
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
101 var kasyo=[],naiyo=[],iro=[],k_type=[],ten=[],coments=[],usepan=[],mkname=[];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
102 var nakami=[];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
103
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
104 function M_Icon(CON,MOV,mcon,pan){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
105 if(MOV==undefined){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
106 var mkdIcon=L.divIcon({
3773
d7b3942164d9 change_src
natto <earlgray_spring@aol.com>
parents: 3769
diff changeset
107 html:'<img id='+CON+' src="https://www.yatex.org/gitbucket/KoekiBrandingPJ/Loremap/raw/master/src/leaflet/images/marker-icon.png">',
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
108 className:'',
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
109 //if not class name marker has select box
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
110 iconAnchor: [22, 40],
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
111 popupAnchor: [-10,-30],
3773
d7b3942164d9 change_src
natto <earlgray_spring@aol.com>
parents: 3769
diff changeset
112 shadowUrl: 'https://www.yatex.org/gitbucket/KoekiBrandingPJ/Loremap/raw/master/src/leaflet/images/marker-shadow.png',
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
113 shadowSize: [68, 95],
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
114 shadowAnchor: [22, 94],
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
115 tooltipAnchor:[0,-20]
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
116 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
117 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
118 var mkdIcon=L.divIcon({
3773
d7b3942164d9 change_src
natto <earlgray_spring@aol.com>
parents: 3769
diff changeset
119 html:'<img id='+CON+' src="https://www.yatex.org/gitbucket/KoekiBrandingPJ/Loremap/raw/master/src/leaflet/images/marker-icon.png" href='+MOV+' class="movie">',
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
120 className:'Movie',
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
121 //if not class name marker has select box
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
122 iconAnchor: [22, 40],
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
123 popupAnchor: [-10,-30],
3773
d7b3942164d9 change_src
natto <earlgray_spring@aol.com>
parents: 3769
diff changeset
124 shadowUrl: 'https://www.yatex.org/gitbucket/KoekiBrandingPJ/Loremap/raw/master/src/leaflet/images/marker-shadow.png',
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
125 shadowSize: [68, 95],
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
126 shadowAnchor: [22, 94]
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
127 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
128 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
129 mcon.setIcon(mkdIcon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
130 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
131
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
132 function mak_click(marker,map){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
133 marker.on('click', function(o){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
134 //map.closePopup();
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
135 var pt=L.latLng(o.latlng);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
136 map.flyTo(pt);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
137 sidebar.open("home");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
138 id=o.originalEvent.explicitOriginalTarget.attributes.id;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
139 val=document.getElementById(id.value);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
140 point_id="Point"+val.id;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
141 var target =document.getElementById(point_id);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
142 target.style.backgroundColor="red";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
143 location.href="#"+point_id;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
144 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
145 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
146
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
147 var count=0;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
148
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
149 var customLayer=L.geoJson(null,{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
150 style: function(feature) {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
151 if (feature.properties._storage_options && feature.properties._storage_options.color){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
152 switch (feature.properties._storage_options.color) {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
153 //alert(feature.properties._storege_opions);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
154 case 'Red': return {color: "red"};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
155 case 'brown': return {color: "brown"};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
156 case 'Cyan': return {color: "cyan"};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
157 case 'lime': return {color: "lime"};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
158 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
159 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
160 if (feature.properties._storage_options && feature.properties._storage_options.weight){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
161 var hutosa=feature.properties._storage_options.weight;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
162 return {weight: hutosa};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
163 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
164 if (feature.properties._storage_options && feature.properties._storage_options.dashArray){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
165 var hakai=feature.properties._storage_options.dashArray;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
166 return {dashArray: hakai};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
167 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
168 },
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
169 onEachFeature: (function (feature, layer){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
170 var propert= feature.properties, geomet=feature.geometry;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
171 // 予めfeature.propertisをletで宣言。(varでも可)
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
172 if (propert && geomet) {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
173 if (propert.name){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
174 var name=propert.name
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
175 } else {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
176 var name="";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
177 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
178 if (propert.description){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
179 var tose=propert.description;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
180 } else {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
181 var tose="";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
182 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
183 if (propert._storage_options){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
184 if (propert._storage_options.color){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
185 var color=propert._storage_options.color;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
186 iro.push(color);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
187 }else {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
188 color="";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
189 iro.push(color);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
190 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
191 if (propert._storage_options.iconClass){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
192 var katati=propert._storage_options.iconClass;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
193 }else {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
194 katati="";
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
195 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
196
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
197 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
198
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
199 var season=propert.Season;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
200 var period=propert.period;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
201 var address=propert.address;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
202 var type=geomet.type, pos=geomet.coordinates;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
203 k_type.push(type);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
204
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
205
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
206 if(type=="Point"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
207 var Point_id=type+count;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
208 if(tose==""){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
209 var coment='<div><h1>'+name+'</h1><h3>'+tose+'</h3></div>';
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
210 usepan.push(pos);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
211 var mak=layer.bindPopup(coment);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
212 count++;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
213 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
214
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
215 var SMC=Set_Contents(tose);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
216 var coment='<div id="'+Point_id+'" class="mak"><h1>'+name+'</h1><h3>'+SMC[0]+'</h3></div>';
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
217 var movie=SMC[1];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
218 coments.push(movie);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
219 usepan.push(pos);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
220 mkname.push(name);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
221 var mak=layer.bindPopup(coment);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
222 M_info.innerHTML+=coment;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
223 mak.name=name;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
224 M_Icon(count,movie,mak,pos);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
225 count++;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
226 mak_click(mak,mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
227 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
228 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
229
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
230 var coment='<div id='+Point_id+' class="mak"><h1>'+name+'</h1><h3>'+tose+'</h3></div>';
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
231 //movie=undefined;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
232 var mak=layer.bindPopup(coment);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
233 M_info.innerHTML+=coment;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
234 M_Icon(count,movie,mak,pos);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
235 count++;
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
236 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
237
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
238 layer.bindTooltip(name);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
239
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
240
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
241 /*
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
242 if (color=="Red" && type=="Point" && katati==""){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
243 mak.setIcon(r_Icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
244 }else if (color=="Yellow" && type=="Point" || color=="Gold" && type=="Point" ){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
245 mak.setIcon(y_Icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
246 }else if (color=="lightpink" && type=="Point" || color=="LightPink" && type=="Point"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
247 mak.setIcon(lp_Icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
248 }else if (color=="lime" && type=="Point" || color=="Lime" && type=="Point"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
249 mak.setIcon(lime_Icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
250 }else if (color=="DarkSlateGray" && type=="Point" || color=="darkslategray" && type=="Point" ){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
251 mak.setIcon(DSG_Icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
252 }else if (katati=="Drop"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
253 mak.setIcon(hinanjo);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
254 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
255 */
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
256
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
257 if(season=="Spring" || season=="spring"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
258 haru.addLayer(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
259 }else if(season=="Summar" || season=="summar"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
260 //console.log(layer);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
261 natu.addLayer(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
262 //console.log(m);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
263 }else if(season=="Fall" || season=="fall"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
264 akii.addLayer(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
265 }else{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
266 huyu.addLayer(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
267 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
268
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
269 //natu.addTo(mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
270 if (type=="LineString"){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
271 for(i=0; i<pos.length; i++){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
272 //alert(m[i]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
273 kasyo.push(pos[i]);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
274 naiyo.push(tose);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
275 ten.push(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
276 //alert(naiyo);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
277 };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
278 // LineStringでの座標を細かくとる
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
279 }else {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
280 kasyo.push(pos); //この関数外に変数を持って行くために使用
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
281 naiyo.push(tose);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
282 ten.push(mak);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
283 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
284
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
285
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
286 }
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
287 })
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
288 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
289
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
290 //./flood-caution.geojson
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
291
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
292 //./wakimizu/yuza_wakimizu.geojson
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
293
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
294 var gpxLayer = omnivore.geojson('./dentou.geojson', null, customLayer).on('ready', function() {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
295
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
296 Boxes(mymap,usepan,ten,mkname);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
297 sidebar.on('content', function () {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
298 //location.
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
299 //location.href="#Point1"
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
300 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
301
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
302 });//.addTo(mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
303
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
304 var mymap= L.map("mymap", {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
305 layers: [osmTile,haru,natu,akii,huyu], //最初に指定するタイルレイヤー
3832
c7bc1cd00174 scrollzoom_on
natto <earlgray_spring@aol.com>
parents: 3831
diff changeset
306 center: ltlg, zoom: 11 , minZoom:11, //scrollWheelZoom: false
3769
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
307 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
308
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
309 gpxLayer.addTo(mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
310
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
311 //geojsonファイルを読みだし
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
312
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
313
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
314 //レイヤー変更オプション
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
315 var late_season={'SP':haru,'SM':natu,'FA':akii,'WI':huyu};
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
316 var C_layers=L.control.layers(baseLayers,late_season).addTo(mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
317
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
318 var sidebar = L.control.sidebar('sidebar',{
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
319 //position: 'left'
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
320 }).addTo(mymap);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
321
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
322 //var vits=C_layers.getContainer();
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
323 var l_info=document.getElementById("mak_info");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
324 //l_info.appendChild(vits);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
325
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
326
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
327 mymap.on("click", function(){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
328 sidebar.close();
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
329 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
330
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
331 sidebar.on('content', function(e) {
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
332 var fa_s=document.getElementById("FaW");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
333 fa_s.classList.remove("fa-map-marker");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
334 fa_s.classList.add("fa-times");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
335 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
336
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
337 sidebar.on("closing", function(e){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
338 var fa_s=document.getElementById("FaW");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
339 fa_s.classList.add("fa-map-marker");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
340 fa_s.classList.remove("fa-times");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
341 //color治したい
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
342 //var fa_ss=document.getElementsByClassName("active");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
343 //var fa_icon=fa_ss[0].firstChild.childNodes[0].classList[1];
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
344 //var fa_ss=document.getElementsByClassName(fa_icon);
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
345 //var iti=document.getElementById("home");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
346 //console.log("pop");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
347 });
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
348
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
349 // var ati=document.getElementById("aps");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
350
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
351 // function aaaa(){
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
352 // alert("deruyo");
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
353 // };
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
354
1632ee516a51 add map html&js
natto <earlgray_spring@aol.com>
parents:
diff changeset
355 // aps.addEventListener("click",aaaa,false);

yatex.org