Skip to content

Commit

Permalink
Merge pull request #44 from busroutemap/dev
Browse files Browse the repository at this point in the history
v1.9.1
  • Loading branch information
kotodu authored Mar 14, 2020
2 parents 07f7ff9 + 18a27e0 commit 5e50bfd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@
- 主要地表示レイヤーの追加検討中
### Changed
- ちょっと地図が重い気がするので修正したい
- geojsonとかにしたい気もするけど作業未定
### Deprecated
- 将来的にバス停の元データをjsからjsonまたはgeojsonへ移行予定
- 問題なければjsデータを削除予定
### Removed
### Fixed

## [1.9.1] 2020/03/14
### Changed
- バス停データ形式をjsからjsonに変更
- 色々あり変更してなかった

## [1.9.0] 2020/03/07
### Added
- 狭域タイルを新規作成
Expand Down
38 changes: 33 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
<!-- 上のhash.jsは外部プラグイン -->
<!-- ここから独自 -->
<link rel="stylesheet" href="add/main.css">
<script src="stopinfo/js/data11.js"></script>
<script src="stopinfo/js/data12.js"></script>
<script src="stopinfo/js/data21.js"></script>
<script src="stopinfo/js/data22.js"></script>
<style>
.icon1 {
width: 30px;
Expand Down Expand Up @@ -68,8 +64,40 @@
className: 'icon1',
iconAnchor: [13, 13]
});
const loadjson = (addURL)=>{
const baseURL = "https://busroutemap.github.io/ttrmap/";
// var data;
return fetch(baseURL+addURL)
.then(response=> {
if (response.ok){
// httpレスポンスからjsonを抽出
return response.json();
} else{
Promise.reject(new Error("error"))
}
})
.catch(e=>{
console.log(e.message);
});
}
//---------------------------------------------
function init() {
const init = async()=> {
let pAll = [];
pAll.push(loadjson("stopinfo/data_11.json"));
pAll.push(loadjson("stopinfo/data_12.json"));
pAll.push(loadjson("stopinfo/data_21.json"));
pAll.push(loadjson("stopinfo/data_22.json"));
var data11,data12,data21,data22;
await Promise.all(pAll)
.catch(e=>{
console.log(e);
})
.then(r=>{
data11 = r[0];
data12 = r[1];
data21 = r[2];
data22 = r[3];
});
map = L.map('map01', {
zoomControl: false,
minZoom: 11,
Expand Down

0 comments on commit 5e50bfd

Please sign in to comment.