{"id":2746,"date":"2023-02-25T23:21:05","date_gmt":"2023-02-25T14:21:05","guid":{"rendered":"https:\/\/mirror.boy.jp\/?p=2746"},"modified":"2023-03-03T00:25:25","modified_gmt":"2023-03-02T15:25:25","slug":"map-test","status":"publish","type":"post","link":"https:\/\/mirror.boy.jp\/?p=2746","title":{"rendered":"#Leaflet \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7528\u3044\u3066 #GeoJSON \u3092\u63cf\u753b\u3059\u308b\u30c6\u30b9\u30c8"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u7d50\u679c<\/h1>\n\n\n\n<!-- \u25bcLeaflet\u5730\u56f3\u8868\u793a\u7528 -->\n<link rel=\"stylesheet\" href=\"https:\/\/unpkg.com\/leaflet@1.9.3\/dist\/leaflet.css\" integrity=\"sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=\" crossorigin=\"\"\/>\n<!-- Make sure you put this AFTER Leaflet's CSS -->\n<script src=\"https:\/\/unpkg.com\/leaflet@1.9.3\/dist\/leaflet.js\" integrity=\"sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=\" crossorigin=\"\"><\/script>\n<style>\n#mapid { height: 640px; }\n<\/style>\n<!-- \u25b2Leaflet\u5730\u56f3\u8868\u793a\u7528 -->\n\n<div id=\"mapid\">\n<script>\n\nvar map = L.map('mapid').setView([35.626146,139.885482], 16);\nL.tileLayer('https:\/\/tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n\tmaxZoom: 20,\n\tattribution: \"<a href=\\\"http:\/\/www.openstreetmap.org\/copyright\\\">OpenStreetMap<\/a>\"\n}).addTo(map);\n\nfetch('.\/leaflet\/data\/sample.geojson')\n.then((res) => res.json())\n.then((data) => {\n  L.geoJSON(data, \n    {\n      onEachFeature: function onEachFeature(\n        feature,\n        layer\n      ){\n        if(feature.properties && feature.properties.popupContent){\n          layer.bindPopup(feature.properties.popupContent);\n        }\n      }\n    }\n  ).addTo(map);\n});\n\n<\/script>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">GeoJSON &amp; Leaflet<\/h1>\n\n\n\n<p>M5StickCPlus\u3067GPS\u30ed\u30ac\u30fc\u7684\u306a\u3082\u306e\u3092\u8a66\u4f5c\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u3067\u53d6\u5f97\u3057\u305fGPS\u30c7\u30fc\u30bf\u3092Wordpress\u4e0a\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306bLeaflet\u3068\u3044\u3046OpenSource\u306a\u5730\u56f3\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u81ea\u4f5c\u3057\u305fGPS\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u8aad\u307f\u8fbc\u307e\u305b\u308b\u306e\u306b\u4f55\u304c\u826f\u3044\u306e\u304b\u3082\u8abf\u67fb\u3057\u3001\u4e00\u5148\u305aM5StickCPlus\u3067\u5410\u304d\u51fa\u3057\u305fgps\u30c7\u30fc\u30bf\u3092geojson\u306b\u5909\u63db\u3057\u3001leaflet\u306b\u8aad\u307f\u8fbc\u3093\u3067\u4f7f\u3063\u3066\u307f\u308b\u4e8b\u306b\u3002\u3067\u3001\u3053\u3053\u3067\u554f\u984c\u304c\u767a\u751f\u3002\u5730\u56f3\u306b\u5bfe\u3057\u3066\u30ec\u30a4\u30e4\u30fc\u3067\u6b69\u3044\u305f\u90e8\u5206\u306e\u30dd\u30ea\u30b4\u30f3\u8868\u793a\u3092\u3057\u3066\u307f\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u4e00\u5411\u306b\u30dd\u30ea\u30b4\u30f3\u304c\u63cf\u753b\u3055\u308c\u306a\u3044\u3002\u5c0f\u4e00\u6642\u9593\u60a9\u3093\u3060\u672b\u3001\u7def\u5ea6\u7d4c\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u9806\u756a\u304c\u3001geojson\uff08\u7d4c\u5ea6\u30fb\u7def\u5ea6\uff09\u3068leaflet\uff08\u7def\u5ea6\u30fb\u7d4c\u5ea6\uff09\u3067\u9055\u3046\u3068\u3044\u3046\u4e8b\u306b\u6c17\u304c\u3064\u304d\u307e\u3057\u305f\u3002\u601d\u3044\u8fbc\u307f\u306f\u826f\u304f\u306a\u3044\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u4e0b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u52a0\u3048\u3066\u521d\u671f\u5316\u306a\u3069\u306eHTML\u5074\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u306f<a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/leafletjs.com\/examples\/quick-start\/');\"  href=\"https:\/\/leafletjs.com\/examples\/quick-start\/\">\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u53c2\u8003\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GeoJson<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"type\": \"FeatureCollection\",\n  \"features\": &#91;\n    {\n      \"type\": \"Feature\",\n        \"properties\": {\n          \"popupContent\": \"Tokyo Disney Sea\"\n        },\n        \"geometry\":{\n          \"type\": \"Polygon\",\n          \"coordinates\": &#91;\n            &#91;\n              &#91;\n                139.890216,\n                35.627036\n              ],\n              &#91;\n                139.886940,\n                35.625489\n              ],\n              &#91;\n                139.887106,\n                35.623635                \n              ],\n              &#91;\n                139.883258,\n                35.624767\n              ],\n              &#91;\n                139.881992,\n                35.626714\n              ],\n              &#91;\n                139.881450,\n                35.628433\n              ]\n            ]\n          ]\n        }\n      }    \n  ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Script<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"map\"&gt;\n&lt;script&gt;\n\nvar map = L.map('map').setView(&#91;139.885482, 35.626146], 16);\nL.tileLayer('https:\/\/tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n\tmaxZoom: 20,\n\tattribution: '&lt;a href=\\\"http:\/\/www.openstreetmap.org\/copyright\\\"&gt;OpenStreetMap&lt;\/a&gt;'\n}).addTo(map);\n\nfetch('.\/leaflet\/data\/sample.geojson')\n.then((res) =&gt; res.json())\n.then((json) =&gt; {\n  L.geoJSON(json, \n    {\n      onEachFeature: function onEachFeature(\n        feature,\n        layer\n      ){\n        if(feature.properties &amp;&amp; feature.properties.popupContent){\n          layer.bindPopup(feature.properties.popupContent);\n        }\n      }\n    }\n  ).addTo(map);\n});\n\n&lt;\/script&gt;\n&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f59\u8ac7<\/h2>\n\n\n\n<p>\u4f59\u8ac7\u3067\u3059\u304c\u3001\u30c7\u30a3\u30ba\u30cb\u30b7\u30fc\u306b\u5bb6\u65cf\u3067\u884c\u304f\u3053\u3068\u306b\u306a\u308a\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3064\u3044\u3067\u306b\u30c7\u30fc\u30bf\u53d6\u3063\u3066\u307f\u305f\u3093\u3067\u3059\u304c\u3001\u81ea\u4f5cM5StickCPlus\u30ed\u30ac\u30fc\u306e\u96fb\u6c60\u304c\u5373\u5207\u308c\u3066\u3057\u307e\u3063\u305f\u30fb\u30fb\u30fb\u7701\u96fb\u529b\u8a2d\u5b9a\u3068\u3057\u3066\u6db2\u6676\u306e\u8f1d\u5ea6\u3092\u4e0b\u3052\u305f\u308a\u3001CPU\u30af\u30ed\u30c3\u30af\u4e0b\u3052\u305f\u308a\u3068\u3084\u3063\u3066\u306f\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u6d41\u77f3\u306b\u5916\u4ed8\u3051\u96fb\u6c60\u4f7f\u308f\u306a\u3044\u3068\uff11\u65e5\u4e2d\u4f7f\u3046\u3068\u304b\u306f\u7121\u7406\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u679c GeoJSON &amp; Leaflet M5StickCPlus\u3067GPS\u30ed\u30ac\u30fc\u7684\u306a\u3082\u306e\u3092\u8a66\u4f5c\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u3067\u53d6\u5f97\u3057\u305fGPS\u30c7\u30fc\u30bf\u3092Wordpress\u4e0a\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306bLeaflet\u3068\u3044\u3046OpenSour &hellip; <a href=\"https:\/\/mirror.boy.jp\/?p=2746\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">#Leaflet \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7528\u3044\u3066 #GeoJSON \u3092\u63cf\u753b\u3059\u308b\u30c6\u30b9\u30c8<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,28,140],"tags":[],"_links":{"self":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/2746"}],"collection":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2746"}],"version-history":[{"count":108,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/2746\/revisions"}],"predecessor-version":[{"id":2889,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/2746\/revisions\/2889"}],"wp:attachment":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}