/*var mymap = L.map("mymap").setView([38.015583, 139.904966], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution:
  '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
   }).addTo(mymap); */
var mymap = L.map("mymap").setView([39.015916,139.905583], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution:
  '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
//L.marker(e.lating).addTo(mymap).bindPopup("現在地です")
var marker = L.marker([39.015916,139.905583]).addTo(mymap).bindPopup("遊佐駅です。")
marker;

marker.on('click', function(){
	location.replace("https://www.yuzachokai.jp/travel/yuzaekinogoriyouannnai/");

})
var pl = [			// Polyline: 連続線分
    [39.015916,139.905583],
    [39.015683,139.907024],
    [39.015578,139.907941],
    [39.014787,139.907823],
    [39.014857,139.908864]
];
var plProp = {			// polylineのプロパティを定義
    color: "red",		// 線分の色
    opacity: 0.4,		// 線分の透明度
    weight: 9			// 線分の太さ
};
var plobj = L.polyline(pl, plProp).addTo(mymap);
L.marker([39.014857,139.908864]).addTo(mymap).bindPopup("到着地です。遊佐役場です。")
function locateUser(){
	mymap.locate({setView: true, maxZoom: 16});
	mymap.on("locationfound",onLocationFound);
}
function onLocationFound(e){
	L.marker(e.lating).addTo(mymap).bindPopup("現在地です")
}
locateUser();

var marker = L.marker([39.014782237002,139.92907413327]).addTo(mymap).bindPopup("遊佐中です。")
marker;

marker.on('click', function(){
	//location.replace("https://yuzatyu.edumap.jp/");

var filename = "school+avater.html";

// ファイル名を元にURLを生成
var url = window.location.href.replace(/[^/]*$/, '') + filename;

// 生成したURLに移動
window.location.href = url;

})
