diff --git a/leaflet/domon.html b/leaflet/domon.html index 3fc11e8..e8000e4 100644 --- a/leaflet/domon.html +++ b/leaflet/domon.html @@ -1,7 +1,7 @@ -マップ: My First Map! +酒田MFまでの道のり @@ -13,7 +13,7 @@ -

My First Map!

+

酒田MFまでの道のり

diff --git a/leaflet/domon.js b/leaflet/domon.js index 30bfa2c..229e9c4 100644 --- a/leaflet/domon.js +++ b/leaflet/domon.js @@ -28,6 +28,7 @@ }; var plobj = L.polyline(pl, plProp).addTo(mymap); +// 酒田MFの方↓------------------------------------------- var pg = [ // Polygon: ポリゴン [38.920469,139.842106], [38.920444,139.842417], @@ -40,3 +41,34 @@ fillOpacity: 0.2 // 塗りつぶし部分の透明度 }; var pgobj = L.polygon(pg, pgOpt).addTo(mymap); + +var marker1 = pl[0], marker2 = pg[0]; // polylineとpolygon各々の始点 +var m1opt = {title: "その1"}, m2opt = {title: "その2"}; +var m1 = L.marker(marker1, m1opt).addTo(mymap); +var m2 = L.marker(marker2, m2opt).addTo(mymap); + +/* オブジェクトレイヤ.bindPopup() でクリック時のポップアップを定義できる */ +plobj.bindPopup("ポリラインですよ!"); +pgobj.bindPopup("ポリゴンですよ!"); +m1.bindPopup("すたーと"); +// 次のようにあらかじめ1つのポップアップを開いておくことも可能 +m2.bindPopup("酒田ミュージックファクトリーにつきました"); + +// 駐車場の方↓------------------------------------------------------------ +var pg = [ + [38.921252,139.844661], + [38.920593,139.845008], + [38.920949,139.845824], + [38.921469,139.845352], +]; +var pgOpt = { // polygonに与えるオプション + color: "pink", // 線分の色 + fillColor: "blue", // 塗りつぶし部分の色 + fillOpacity: 0.2 // 塗りつぶし部分の透明度 +}; +var pgobj = L.polygon(pg, pgOpt).addTo(mymap); + +var marker1 = pl[0], marker2 = pg[0]; // polylineとpolygon各々の始点 +var m1opt = {title: "その1"}, m2opt = {title: "その2"}; +var m3 = L.marker(marker2, m2opt).addTo(mymap); +m3.bindPopup("駐車場はここ"); \ No newline at end of file diff --git a/leaflet/images/layers-2x.png b/leaflet/images/layers-2x.png new file mode 100644 index 0000000..200c333 --- /dev/null +++ b/leaflet/images/layers-2x.png Binary files differ diff --git a/leaflet/images/layers.png b/leaflet/images/layers.png new file mode 100644 index 0000000..1a72e57 --- /dev/null +++ b/leaflet/images/layers.png Binary files differ diff --git a/leaflet/images/marker-icon-2x.png b/leaflet/images/marker-icon-2x.png new file mode 100644 index 0000000..88f9e50 --- /dev/null +++ b/leaflet/images/marker-icon-2x.png Binary files differ diff --git a/leaflet/images/marker-icon.png b/leaflet/images/marker-icon.png new file mode 100644 index 0000000..950edf2 --- /dev/null +++ b/leaflet/images/marker-icon.png Binary files differ diff --git a/leaflet/images/marker-shadow.png b/leaflet/images/marker-shadow.png new file mode 100644 index 0000000..9fd2979 --- /dev/null +++ b/leaflet/images/marker-shadow.png Binary files differ diff --git a/leaflet/layers-2x.png b/leaflet/layers-2x.png deleted file mode 100644 index 200c333..0000000 --- a/leaflet/layers-2x.png +++ /dev/null Binary files differ diff --git a/leaflet/layers.png b/leaflet/layers.png deleted file mode 100644 index 1a72e57..0000000 --- a/leaflet/layers.png +++ /dev/null Binary files differ diff --git a/leaflet/marker-icon-2x.png b/leaflet/marker-icon-2x.png deleted file mode 100644 index 88f9e50..0000000 --- a/leaflet/marker-icon-2x.png +++ /dev/null Binary files differ diff --git a/leaflet/marker-icon.png b/leaflet/marker-icon.png deleted file mode 100644 index 950edf2..0000000 --- a/leaflet/marker-icon.png +++ /dev/null Binary files differ diff --git a/leaflet/marker-shadow.png b/leaflet/marker-shadow.png deleted file mode 100644 index 9fd2979..0000000 --- a/leaflet/marker-shadow.png +++ /dev/null Binary files differ