Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
linkevery2s committed Sep 13, 2024
1 parent 21df54e commit c2715b7
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified docs/.DS_Store
Binary file not shown.
92 changes: 92 additions & 0 deletions docs/data/refuge.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
const refuge = {
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
"136.95669",
"35.19793"
]
},
"properties": {
"Name": "守山生涯学習センター",
"Jusho": "愛知県名古屋市守山区守山3-2-6",
"kouzui": "",
"gake": "",
"takashio": "×",
"jishin": "×",
"tsunami": "×",
"kaji": "×",
"naisui": "",
"kazan": "×"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
"136.96932",
"35.20258"
]
},
"properties": {
"Name": "守山会館",
"Jusho": "愛知県名古屋市守山区西島町19-14",
"kouzui": "",
"gake": "",
"takashio": "×",
"jishin": "×",
"tsunami": "×",
"kaji": "×",
"naisui": "",
"kazan": "×"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
"136.96462",
"35.20142"
]
},
"properties": {
"Name": "守山小学校",
"Jusho": "愛知県名古屋市守山区西島町6-27",
"kouzui": "",
"gake": "",
"takashio": "×",
"jishin": "",
"tsunami": "×",
"kaji": "×",
"naisui": "",
"kazan": "×"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
"136.9667959",
"35.20343716"
]
},
"properties": {
"Name": "守山中学校",
"Jusho": "愛知県名古屋市守山区大屋敷13-63",
"kouzui": "",
"gake": "",
"takashio": "×",
"jishin": "",
"tsunami": "×",
"kaji": "×",
"naisui": "",
"kazan": "×"
}
}
]
};
75 changes: 74 additions & 1 deletion docs/moriyamaku_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<script src="./data/toilet.geojson"></script>
<script src="./data/warehouse.geojson"></script>
<script src="./data/office.geojson"></script>
<script src="./data/refuge.geojson"></script>

<style>
html,
Expand Down Expand Up @@ -115,6 +116,10 @@
color: #aa4c8f;
}

.color_refuge {
color: #006e54;
}

#cross {
position: fixed;
top: 50%;
Expand Down Expand Up @@ -150,7 +155,7 @@
border-radius: .3em;
}

#gl{
#gl {
height: 100%;
width: 100%;
padding: 0;
Expand All @@ -175,6 +180,12 @@
color: #9d5b8b;
border: 1px solid #9d5b8b;
}

#pop_moji {
color: #ff0000;
font-size: 16px !important;
}

</style>

<script type="module">
Expand Down Expand Up @@ -275,13 +286,18 @@
let office_add = L.geoJSON(office, { onEachFeature: popup_office, pointToLayer: office_point });
map.addLayer(office_add);

// 避難場所
let refuge_add = L.geoJSON(refuge, { onEachFeature: popup_refuge, pointToLayer: refuge_point });
map.addLayer(refuge_add);

/* レイヤー選択メニュー追加*/
const hazardmaps = {
"土砂災害(特別)警戒区域": dosya,
"洪水浸水想定区域(想定最大規模)": shinsui
};

const pin = {
"指定緊急避難場所": refuge_add,
"AED設置箇所": aed_add,
"下水道直結式仮設トイレ": toilet_add,
"給水拠点": water_add,
Expand Down Expand Up @@ -427,6 +443,63 @@
layer.bindPopup(popup);
}

/* 避難場所 */
let refuge_point = (feature, latlng) => {
return L.marker(latlng, {
icon: L.divIcon({
/*Font Awesomeの埋め込みコード*/
html: '<i class="fa-solid fa-person-running fa-flip-horizontal fa-2x"></i>',
className: 'color_refuge solid_icon',
iconSize: [0, 0]
}),
});
}

let popup_refuge = (feature, layer) => {
let popup;
if (feature.properties && feature.properties.Name) {
popup = "名称:" + feature.properties.Name;
}

if (feature.properties && feature.properties.Jusho) {
popup += '<br>住所:' + feature.properties.Jusho;
}

if (feature.properties && feature.properties.kouzui) {
popup += '<br>洪水:<span id = "pop_moji">' + feature.properties.kouzui + '</span>';
}

if (feature.properties && feature.properties.gake) {
popup += ' がけ崩れ、土石流及び地滑り:<span id = "pop_moji">' + feature.properties.gake + '</span> ';
}

if (feature.properties && feature.properties.takashio) {
popup += '高潮:<span id = "pop_moji">' + feature.properties.takashio + '</span>';
}

if (feature.properties && feature.properties.jishin) {
popup += ' 地震:<span id = "pop_moji">' + feature.properties.jishin + '</span>';
}

if (feature.properties && feature.properties.tsunami) {
popup += ' 津波:<span id = "pop_moji">' + feature.properties.tsunami + '</span><br>';
}

if (feature.properties && feature.properties.kaji) {
popup += '大規模な火事:<span id = "pop_moji">' + feature.properties.kaji + '</span>';
}

if (feature.properties && feature.properties.naisui) {
popup += ' 内水氾濫:<span id = "pop_moji">' + feature.properties.naisui + '</span>';
}

if (feature.properties && feature.properties.kazan) {
popup += '<br>火山:<span id = "pop_moji">' + feature.properties.kazan + '</span>';
}

layer.bindPopup(popup);
}

const closed_btn = document.querySelector("#closed-btn");

closed_btn.addEventListener('click', () => {
Expand Down

0 comments on commit c2715b7

Please sign in to comment.