diff --git a/shuzai/trad/index.html b/shuzai/trad/index.html new file mode 100644 index 0000000..40d5d16 --- /dev/null +++ b/shuzai/trad/index.html @@ -0,0 +1,59 @@ + + + +CMDSmap + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shuzai/trad/new_late_geojson.js b/shuzai/trad/new_late_geojson.js new file mode 100644 index 0000000..2b34a0b --- /dev/null +++ b/shuzai/trad/new_late_geojson.js @@ -0,0 +1,360 @@ +//var ltlg= [38.72859248614108,139.82239320874214]; +var ltlg=[38.963092, 139.986249]; +//var ltlg=[39.019707,139.909754]; +//マップの中心にする座標 + +var M_info=document.getElementById("mak_info"); + +function Boxes(map,Icon,tenten,Name,id){ + + map.on('popupopen', function(o) { + var S_width=window.innerWidth; + var S_height=window.innerHeight; + + if(S_width"); + var Link=Pic.replace(/\[\[/g, "
"); + Link=Link.replace(/]]/g, ""); + + return [Link,Mov]; +}; + + +var osmTile = + L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: + '© OpenStreetMap \ +contributors' + }); + +var gsiTile = + L.tileLayer('//cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', { + attribution: + '国土地理院' + }); + +var haru=L.layerGroup([]); +var natu=L.layerGroup([]); +var akii=L.layerGroup([]); +var huyu=L.layerGroup([]); + +//var time= document.getElementById("time"); + +var baseLayers = {'OpenStreetMap': osmTile, '国土地理院': gsiTile}; +//レイヤーの内容 + +var kasyo=[],naiyo=[],iro=[],k_type=[],ten=[],coments=[],usepan=[],mkname=[]; +var nakami=[]; + +function M_Icon(CON,MOV,mcon,pan){ + if(MOV==undefined){ + var mkdIcon=L.divIcon({ + html:'', + className:'', + //if not class name marker has select box + iconAnchor: [22, 40], + popupAnchor: [-10,-30], + shadowUrl: '../../src/leaflet/images/marker-shadow.png', + shadowSize: [68, 95], + shadowAnchor: [22, 94], + tooltipAnchor:[0,-20] + }); + }else{ + var mkdIcon=L.divIcon({ + html:'', + className:'Movie', + //if not class name marker has select box + iconAnchor: [22, 40], + popupAnchor: [-10,-30], + shadowUrl: '../../src/leaflet/images/marker-shadow.png', + shadowSize: [68, 95], + shadowAnchor: [22, 94] + }); + } + mcon.setIcon(mkdIcon); +}; + +function mak_click(marker,map){ + marker.on('click', function(o){ + //map.closePopup(); + var pt=L.latLng(o.latlng); + map.flyTo(pt); + sidebar.open("home"); + id=o.originalEvent.explicitOriginalTarget.attributes.id; + val=document.getElementById(id.value); + point_id="Point"+val.id; + var target =document.getElementById(point_id); + target.style.backgroundColor="red"; + location.href="#"+point_id; + }); +}; + +var count=0; + +var customLayer=L.geoJson(null,{ + style: function(feature) { + if (feature.properties._storage_options && feature.properties._storage_options.color){ + switch (feature.properties._storage_options.color) { + //alert(feature.properties._storege_opions); + case 'Red': return {color: "red"}; + case 'brown': return {color: "brown"}; + case 'Cyan': return {color: "cyan"}; + case 'lime': return {color: "lime"}; + } + } + if (feature.properties._storage_options && feature.properties._storage_options.weight){ + var hutosa=feature.properties._storage_options.weight; + return {weight: hutosa}; + } + if (feature.properties._storage_options && feature.properties._storage_options.dashArray){ + var hakai=feature.properties._storage_options.dashArray; + return {dashArray: hakai}; + } + }, + onEachFeature: (function (feature, layer){ + var propert= feature.properties, geomet=feature.geometry; + // 予めfeature.propertisをletで宣言。(varでも可) + if (propert && geomet) { + if (propert.name){ + var name=propert.name + } else { + var name=""; + } + if (propert.description){ + var tose=propert.description; + } else { + var tose=""; + } + if (propert._storage_options){ + if (propert._storage_options.color){ + var color=propert._storage_options.color; + iro.push(color); + }else { + color=""; + iro.push(color); + } + if (propert._storage_options.iconClass){ + var katati=propert._storage_options.iconClass; + }else { + katati=""; + } + + } + + var season=propert.Season; + var period=propert.period; + var address=propert.address; + var type=geomet.type, pos=geomet.coordinates; + k_type.push(type); + + + if(type=="Point"){ + var Point_id=type+count; + if(tose==""){ + var coment='

'+name+'

'+tose+'

'; + usepan.push(pos); + var mak=layer.bindPopup(coment); + count++; + }else{ + + var SMC=Set_Contents(tose); + var coment='

'+name+'

'+SMC[0]+'

'; + var movie=SMC[1]; + coments.push(movie); + usepan.push(pos); + mkname.push(name); + var mak=layer.bindPopup(coment); + M_info.innerHTML+=coment; + mak.name=name; + M_Icon(count,movie,mak,pos); + count++; + mak_click(mak,mymap); + } + }else{ + + var coment='

'+name+'

'+tose+'

'; + //movie=undefined; + var mak=layer.bindPopup(coment); + M_info.innerHTML+=coment; + M_Icon(count,movie,mak,pos); + count++; + } + + layer.bindTooltip(name); + + + /* + if (color=="Red" && type=="Point" && katati==""){ + mak.setIcon(r_Icon); + }else if (color=="Yellow" && type=="Point" || color=="Gold" && type=="Point" ){ + mak.setIcon(y_Icon); + }else if (color=="lightpink" && type=="Point" || color=="LightPink" && type=="Point"){ + mak.setIcon(lp_Icon); + }else if (color=="lime" && type=="Point" || color=="Lime" && type=="Point"){ + mak.setIcon(lime_Icon); + }else if (color=="DarkSlateGray" && type=="Point" || color=="darkslategray" && type=="Point" ){ + mak.setIcon(DSG_Icon); + }else if (katati=="Drop"){ + mak.setIcon(hinanjo); + } + */ + + if(season=="Spring" || season=="spring"){ + haru.addLayer(mak); + }else if(season=="Summar" || season=="summar"){ + //console.log(layer); + natu.addLayer(mak); + //console.log(m); + }else if(season=="Fall" || season=="fall"){ + akii.addLayer(mak); + }else{ + huyu.addLayer(mak); + } + + //natu.addTo(mymap); + if (type=="LineString"){ + for(i=0; i