{"id":10345,"date":"2022-04-25T06:33:53","date_gmt":"2022-04-24T21:33:53","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=10345"},"modified":"2022-04-15T06:45:01","modified_gmt":"2022-04-14T21:45:01","slug":"laravel-leaflet-fullscreen-%e3%81%a7%e3%83%95%e3%83%ab%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e5%af%be%e5%bf%9c%e5%9c%b0%e5%9b%b3%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=10345","title":{"rendered":"Laravel + Leaflet.fullscreen \u3067\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5bfe\u5fdc\u5730\u56f3\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=9724\">Laravel + Leaflet \u5730\u56f3\u3067\u99c5\u540d\u691c\u7d22\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/a>\u300d\u3068\u3044\u3046\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u306f\u500b\u4eba\u958b\u767a\u306e\u30b5\u30a4\u30c8\u3067\u4f7f\u3046\u305f\u3081\u306b\u52c9\u5f37\u3057\u305f\u5185\u5bb9\u3067\u3082\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3001\u305d\u306e\u30b5\u30a4\u30c8\u306e<code>Leaflet<\/code>\u5730\u56f3\u3092\u898b\u3066\u3044\u3066\u3072\u3068\u3064\u601d\u3046\u3068\u3053\u308d\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u3046\u30fc\u3093\u3001\u5730\u56f3\u304c\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u306b\u306a\u3063\u3066\u307b\u3057\u3044\u2026\ud83d\ude05\u300d<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u5730\u56f3\u306f\u57cb\u3081\u8fbc\u3080\u3088\u3046\u306a\u5f62\u3067\u8868\u793a\u3057\u3066\u308b\u3093\u3067\u3059\u304c\u3001\u7279\u306b\u30b9\u30de\u30db\u3067\u898b\u3066\u3044\u308b\u3068\u30a8\u30ea\u30a2\u304c\u5c0f\u3055\u3059\u304e\u3066\u79fb\u52d5\u3057\u306b\u304f\u3044\u3093\u3067\u3059\u3088\u306d\u3002\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u30cd\u30c3\u30c8\u3067\u8abf\u67fb\u3092\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u300c<strong><a href=\"https:\/\/github.com\/Leaflet\/Leaflet.fullscreen\" target=\"_blank\" rel=\"noopener\">leaflet.fullscreen<\/a><\/strong>\u300d\u3068\u3044\u3046\u7d20\u6674\u3089\u3057\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001<code>CDN<\/code>\u3092\u4f7f\u3063\u305f\u65b9\u6cd5\u306f\u4ed6\u306e\u6709\u76ca\u30b5\u30a4\u30c8\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4eca\u56de\u306f<code>npm<\/code>\u3092\u4f7f\u3063\u3066\u30d3\u30eb\u30c9\u3059\u308b\uff08\uff1d<code>CDN<\/code>\u304c\u306a\u304f\u306a\u308b\u30ea\u30b9\u30af\u3092\u907f\u3051\u308b\uff09\u65b9\u6cd5\u3067\u5b9f\u88c5\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9470\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png\" alt=\"\" width=\"294\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png 294w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13-276x300.png 276w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/><br \/>\n\u300c\u713c\u304d\u8089\u30e9\u30a4\u30af \u3078\u884c\u3063\u3066\u307f\u305f\u3089\u3001<br \/>\n\u30e9\u30a4\u30af\u3058\u3083\u306a\u304f\u3066\u30e9\u30d6\u3067\u3057\u305f\u3002<br \/>\n\u6e80\u8179\u2728\u300d<\/p>\n<p>\u958b\u767a\u74b0\u5883\uff1a Laravel 9.x\u3001Vue 3<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4ee5\u4e0b\uff12\u3064\u3067\u3059\u306e\u3067\u3001<code>npm<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/leafletjs.com\/\" target=\"_blank\" rel=\"noopener\">leaflet<\/a>\uff1a\u5730\u56f3\u30d1\u30c3\u30b1\u30fc\u30b8\u672c\u4f53<\/li>\n<li><a href=\"https:\/\/leaflet.github.io\/Leaflet.fullscreen\/\" target=\"_blank\" rel=\"noopener\">leaflet.fullscreen<\/a>\uff1a leaflet \u306e\u30d7\u30e9\u30b0\u30a4\u30f3<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm i --save-dev leaflet leaflet-fullscreen<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\uff12\u3064\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u306e\u3067\u3001\u3053\u308c\u3092<code>Laravel Mix<\/code>\u3067\u30d3\u30eb\u30c9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>resources\/js\/app.js<\/strong><\/p>\n<pre>\/\/ \u7701\u7565<strong>\r\n\r\nwindow.L = require('leaflet'); \/\/ leaflet \u672c\u4f53<\/strong>\r\n<strong>require('leaflet-fullscreen'); \/\/ leaflet-fullscreen \u30d7\u30e9\u30b0\u30a4\u30f3<\/strong><\/pre>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001<code>\/js\/app.js<\/code>\u3092\u8aad\u307f\u8fbc\u3081\u3070\u3001<code>Leaflet<\/code>\u306e\u547c\u3073\u51fa\u3057\u306b\u5909\u6570<code>L<\/code>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b<code>CSS<\/code>\u306e\u90e8\u5206\u3067\u3059\u304c\u3001<code>JS<\/code>\u3068\u540c\u3058\u3088\u3046\u306b\u547c\u3073\u51fa\u3057\u3066\u3057\u307e\u3046\u3068\u3001<strong>\u753b\u50cf\u306e\u76f8\u5bfe\u30d1\u30b9\u304c\u5408\u308f\u305a\u3001\u4e0d\u6574\u5408\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305d\u306e\u305f\u3081\u3001<code>CSS<\/code>\u306b\u95a2\u3057\u3066\u306f\u3001<code>Laravel Mix<\/code>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08<strong>\u592a\u5b57<\/strong>\u306e\u90e8\u5206\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\uff09<\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nmix.js('resources\/js\/app.js', 'public\/js')\r\n    .postCss('resources\/css\/app.css', 'public\/css', [\r\n        require('postcss-import'),\r\n        require('tailwindcss'),\r\n        require('autoprefixer'),\r\n    ])\r\n    <strong>.copy('node_modules\/leaflet\/dist\/leaflet.css', 'public\/leaflet\/css')<\/strong>\r\n<strong>    .copy('node_modules\/leaflet\/dist\/images', 'public\/leaflet\/css\/images')<\/strong>\r\n<strong>    .copy('node_modules\/leaflet-fullscreen\/dist\/leaflet.fullscreen.css', 'public\/leaflet-fullscreen\/css')<\/strong>\r\n<strong>    .copy('node_modules\/leaflet-fullscreen\/dist\/fullscreen.png', 'public\/leaflet-fullscreen\/css')<\/strong>\r\n<strong>    .copy('node_modules\/leaflet-fullscreen\/dist\/fullscreen@2x.png', 'public\/leaflet-fullscreen\/css')\r\n    .sourceMaps();<\/strong><\/pre>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001<code>public<\/code>\u30d5\u30a9\u30eb\u30c0\u306e\u76f4\u4e0b\u306b\u300c<strong>leaflet<\/strong>\u300d\u3068\u300c<strong>leaflet-fullscreen<\/strong>\u300d\u3068\u3044\u3046\u30d5\u30a9\u30eb\u30c0\u304c\u4f5c\u6210\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u4ee5\u4e0b\u306e<code>URL<\/code>\u304b\u3089<code>CSS<\/code>\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>https:\/\/******\/leaflet\/css\/leaflet.css<\/li>\n<li>https:\/\/******\/leaflet-fullscreen\/css\/leaflet.fullscreen.css<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30d3\u30eb\u30c9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm run dev<\/strong><\/pre>\n<p>\u3082\u3057\u304f\u306f\u3001\u672c\u756a\u74b0\u5883\u306e\u5834\u5408\u306f\u3053\u3061\u3089\u3002<\/p>\n<pre><strong>npm run prod<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d3\u30eb\u30c9\u304c\u5b9f\u884c\u3055\u308c<code>JS<\/code>\u3001<code>CSS<\/code>\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h1>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\uff08\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b\uff09<\/h1>\n<p>\u3067\u306f\u3001<code>leaflet.fullscreen<\/code>\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>resources\/views\/leaflet_fullscreen.blade.php<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;link href=\"{{ asset('leaflet\/css\/leaflet.css') }}\" rel=\"stylesheet\"&gt;<\/strong>\r\n<strong>    &lt;link href=\"{{ asset('leaflet-fullscreen\/css\/leaflet.fullscreen.css') }}\" rel=\"stylesheet\"&gt;<\/strong>\r\n<strong>    &lt;style&gt;<\/strong>\r\n\r\n<strong>        #map {<\/strong>\r\n\r\n<strong>            width: 500px;<\/strong>\r\n<strong>            height: 500px;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    &lt;\/style&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>&lt;div id=\"app\"&gt;<\/strong>\r\n<strong>    &lt;div id=\"map\"&gt;&lt;\/div&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;script src=\"\/js\/app.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script&gt;<\/strong>\r\n\r\n<strong>    window.onload = () =&gt; {<\/strong>\r\n\r\n<strong>        \/\/ \u5730\u56f3\u672c\u4f53<\/strong>\r\n<strong>        const defaultCoordinates = [35.710097546437076, 139.8107004]; \/\/ \u6771\u4eac\u30b9\u30ab\u30a4\u30c4\u30ea\u30fc\u306e\u4f4d\u7f6e<\/strong>\r\n<strong>        const zoomLevel = 13;<\/strong>\r\n<strong>        const map = L.map('map').setView(defaultCoordinates, zoomLevel);<\/strong>\r\n\r\n<strong>        const tileLayerUrl = 'https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png';<\/strong>\r\n<strong>        const tileLayerAttribution = '&lt;a target=\"_blank\" href=\"https:\/\/www.openstreetmap.org\/copyright\"&gt;OpenStreetMap&lt;\/a&gt;'<\/strong>\r\n<strong>        const layer = L.tileLayer(tileLayerUrl, { attribute: tileLayerAttribution });<\/strong>\r\n<strong>        map.addLayer(layer);<\/strong>\r\n\r\n<strong>        \/\/ \u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3<\/strong>\r\n<strong>        const fullscreen = new L.Control.Fullscreen();<\/strong>\r\n<strong>        map.addControl(fullscreen);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>&lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u305f\u3063\u305f\uff12\u884c\u3067\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5bfe\u5fdc\u3067\u304d\u308b\u306e\u306f\u5b09\u3057\u3044\u3067\u3059\u306d\ud83d\ude04<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u305f\u306e\u3067\u3001\u30eb\u30fc\u30c8\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>\/\/ Leaflet fullscreen<\/strong>\r\n<strong>Route::get('leaflet_fullscreen', fn() =&gt; view('leaflet_fullscreen'));<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u7528\u306e\u30dc\u30bf\u30f3\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10351\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_5.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_5.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_5-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f<code>leaflet.fullscreen<\/code>\u306e\u5404\u7a2e\u30aa\u30d7\u30b7\u30e7\u30f3\u3084\u30a4\u30d9\u30f3\u30c8\u306e\u7d39\u4ecb\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h1>\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/h1>\n<p>\u521d\u671f\u72b6\u614b\u3067\u306f\u3001\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u30dc\u30bf\u30f3\u306b\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u82f1\u8a9e\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10348\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_3.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_3.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_3-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10347\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_4.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_4.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_4-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<p>\u3053\u308c\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b<code>title<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\r\n<strong>const options = {<\/strong>\r\n<strong>    title: {<\/strong>\r\n<strong>        'false': '\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u8868\u793a',<\/strong>\r\n<strong>        'true': '\u5143\u306b\u623b\u3059'<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>};<\/strong>\r\nconst fullscreen = new L.Control.Fullscreen(<strong>options<\/strong>);\r\nmap.addControl(fullscreen);<\/pre>\n<p>\u3053\u308c\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65e5\u672c\u8a9e\u5316\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10350\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_1.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_1.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_1-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10352\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_2.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_2.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_2-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<h1>\u8868\u793a\u4f4d\u7f6e\u306e\u5909\u66f4<\/h1>\n<p>\u521d\u671f\u72b6\u614b\u3067\u306f\u5730\u56f3\u306e\u5de6\u4e0a\u306b\u30dc\u30bf\u30f3\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001<code>position<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u4f4d\u7f6e\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>topright\uff1a \u53f3\u4e0a<\/li>\n<li>topleft\uff1a \u5de6\u4e0a<\/li>\n<li>bottomright\uff1a \u53f3\u4e0b<\/li>\n<li>bottomleft\uff1a \u5de6\u4e0b<\/li>\n<\/ul>\n<pre>const options = {\r\n    <strong>position: 'bottomleft', \/\/ topright, topleft, bottomright, bottomleft<\/strong>\r\n};\r\nconst fullscreen = new L.Control.Fullscreen(<strong>options<\/strong>);\r\nmap.addControl(fullscreen);<\/pre>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u306f\u300c<strong>\u5de6\u4e0b<\/strong>\u300d\u306b\u8a2d\u5b9a\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10354\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_7.png\" alt=\"\" width=\"350\" height=\"200\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_7.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/laravel_leaflet_fullscreen_7-300x171.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\n<h1>\u30d6\u30e9\u30a6\u30b6\u306e\u30b5\u30a4\u30ba\u306b\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3<\/h1>\n<p>\u521d\u671f\u72b6\u614b\u3067\u306f\u3001\u30d1\u30bd\u30b3\u30f3\u3084\u30b9\u30de\u30db\u306e\u5168\u753b\u9762\u3068\u3057\u3066\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u3055\u308c\u307e\u3059\u304c\u3001<code>pseudoFullscreen<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092<code>true<\/code>\u306b\u3059\u308b\u3068\u3001<strong>\u30d6\u30e9\u30a6\u30b6\u306e\u5927\u304d\u3055\u306b\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u3055\u308c\u307e\u3059\u3002<\/strong><\/p>\n<pre>const options = {\r\n    <strong>pseudoFullscreen: true, \/\/ \u30d6\u30e9\u30a6\u30b6\u30b5\u30a4\u30ba\u3078\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3<\/strong>\r\n};\r\nconst fullscreen = new L.Control.Fullscreen(<strong>options<\/strong>);\r\nmap.addControl(fullscreen);<\/pre>\n<h1>\u30a4\u30d9\u30f3\u30c8<\/h1>\n<p>\u300c<strong>\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5316\u3057\u305f\u3068\u304d<\/strong>\u300d\u3068\u300c<strong>\u5143\u306b\u623b\u3063\u305f\u3068\u304d<\/strong>\u300d\u306b\u5b9f\u884c\u3055\u308c\u308b\u30a4\u30d9\u30f3\u30c8\u306f<code>fullscreenchange<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u7701\u7565<strong>\r\n\r\nmap.on('fullscreenchange', () =&gt; {<\/strong>\r\n\r\n<strong>    if(map.isFullscreen()) {<\/strong>\r\n\r\n<strong>        console.log('\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u72b6\u614b\u3067\u3059');<\/strong>\r\n\r\n<strong>    } else {<\/strong>\r\n\r\n<strong>        console.log('\u30ce\u30fc\u30de\u30eb\u72b6\u614b\u3067\u3059');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5316\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306f<code>isFullscreen()<\/code>\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u72b6\u614b\u3067<code>alert()<\/code>\u306a\u3069\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306f\u5229\u7528\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u306e\u3067\u3001\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u3064\u304f\u308a\u307e\u3057\u305f<\/h1>\n<p>\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u3064\u304f\u308a\u307e\u3057\u305f\u3002<br \/>\n\u305c\u3072\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\ud83d\udc4d<\/p>\n<p>\ud83d\udcdd <a href=\"https:\/\/demo-laravel9x.capilano-fw.com\/leaflet_fullscreen\" target=\"_blank\" rel=\"noopener\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a><\/p>\n<h1>\u304a\u307e\u3051\uff1a\u306a\u305c\u30d3\u30eb\u30c9\u3059\u308b\u306e\u304b<\/h1>\n<p>\u4eca\u56de\u306f<code>npm<\/code>\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u30e1\u30ea\u30c3\u30c8\u306b\u3064\u3044\u3066\u300c\u304a\u307e\u3051\u7684\u300d\u306b\u3054\u7d39\u4ecb\u3057\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b63\u76f4\u306a\u3068\u3053\u308d\u3001<code>CDN<\/code>\u306f<code>URL<\/code>\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067OK\u306a\u306e\u3067\u500b\u4eba\u30b5\u30a4\u30c8\u3084\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u306f\u30d0\u30f3\u30d0\u30f3\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u624b\u8efd\u306a\u53cd\u9762\u3001<strong>CDN \u306f\u3044\u3064\u30b5\u30fc\u30d3\u30b9\u304c\u7d42\u4e86\u3059\u308b\u304b\u5206\u304b\u3089\u306a\u3044<\/strong>\u3068\u3044\u3046\u30ea\u30b9\u30af\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u3082\u3057\u304b\u3059\u308b\u3068\u660e\u65e5\u306b\u3067\u3082 <code>JS<\/code>\u3001<code>CSS<\/code>\u304c\u8aad\u307f\u8fbc\u3081\u306a\u304f\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u308f\u3051\u3067\u3059\uff09<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u304a\u4ed5\u4e8b\u3068\u3057\u3066\u3054\u4f9d\u983c\u3092\u3044\u305f\u3060\u3044\u305f\u5834\u5408\u306f\u3067\u304d\u308b\u3060\u3051<code>CDN<\/code>\u306f\u4f7f\u308f\u305a\u30d3\u30eb\u30c9\u3057\u3066\u81ea\u30b5\u30a4\u30c8\u3067\u7ba1\u7406\u3092\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u3082\u3061\u308d\u3093\u3001\u304a\u898b\u7a4d\u308a\u5185\u5bb9\u306a\u3069\u306b\u3088\u308a\u4f8b\u5916\u306f\u3042\u308a\u307e\u3059\u304c\uff09<\/p>\n<p>\u4f7f\u3044\u3069\u3053\u308d\u306f\u305c\u3072\u7686\u3055\u3093\u3067\u7814\u7a76\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\ud83d\udc4d<\/p>\n<h1>\u304a\u307e\u3051 2\uff1a\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u3064\u3044\u3066<\/h1>\n<p>\u4eca\u56de\u5229\u7528\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>leaflet: <a href=\"https:\/\/ja.wikipedia.org\/wiki\/BSD%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9\" target=\"_blank\" rel=\"noopener\">BSD 2-Clause License<\/a><\/li>\n<li>leaflet.fullscreen: <a href=\"https:\/\/ja.wikipedia.org\/wiki\/ISC%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9\" target=\"_blank\" rel=\"noopener\">ISC License<\/a><\/li>\n<\/ul>\n<p>\u3068\u3082\u306b\u5546\u7528\u5229\u7528\u3057\u3084\u3059\u3044\u30e9\u30a4\u30bb\u30f3\u30b9\u3067\u3059\u306d\u3002<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u5730\u56f3\u30b3\u30f3\u30c6\u30f3\u30c4\u3068\u3044\u3048\u3070\u3001Google \u30de\u30c3\u30d7\u304c\u30d9\u30b9\u30c8\u306a\u306e\u306f\u9593\u9055\u3044\u306a\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001Google \u30de\u30c3\u30d7\u306f\u3059\u3067\u306b\u6709\u6599\u5316\u3057\u3001\u305d\u306e\u91d1\u984d\u3082\u305d\u308c\u307b\u3069\u5b89\u3044\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\uff08\u8a73\u3057\u304f\u306f<a href=\"https:\/\/mapsplatform.google.com\/intl\/ja\/pricing\/\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\uff09<\/p>\n<p>\u9006\u306b\u3001\u7121\u6599\u3067\u4f7f\u3048\u308b<code>Leaflet + OpenStreetMap<\/code>\u306f\u904e\u53bb\u3068\u6bd4\u3079\u308b\u3068\u898b\u9055\u3048\u308b\u307b\u3069\u4e2d\u8eab\u304c\u8a73\u7d30\u306b\u306a\u308a\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u5730\u56f3\u30b3\u30f3\u30c6\u30f3\u30c4\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u306e\u3088\u3046\u306b\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5316\u3059\u308b\u3053\u3068\u3067\u793e\u5185\u306e\u307f\u3067\u4f7f\u3046\u5730\u56f3\u30a2\u30d7\u30ea\u3092\u30a6\u30a7\u30d6\u4e0a\u306b\u4f5c\u6210\u3067\u304d\u307e\u3059\u306e\u3067\u3001<code>iOS<\/code>\u3068<code>Android<\/code>\u306b\u4e00\u6c17\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3082\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u305c\u3072\u3053\u3046\u3044\u3063\u305f\u5730\u56f3\u3092\u4f7f\u3063\u305f\u793e\u5185\u30b7\u30b9\u30c6\u30e0\u3092\u958b\u767a\u3057\u305f\u3044\u5834\u5408\u306f\u304a\u6c17\u8efd\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Leaflet.fullscreen<\/code>\u3067\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5bfe\u5fdc\u3067\u304d\u308b\u5730\u56f3\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b<code>leaflet<\/code>\u306e\u3044\u3044\u3068\u3053\u308d\u3068\u3057\u3066\u3001\u300c\u7121\u6599\u3067\u4f7f\u3048\u308b\u300d\u3068\u3053\u308d\u3060\u3051\u3067\u306a\u304f\u300c<strong>\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5145\u5b9f\u3057\u3066\u3044\u308b<\/strong>\u300d\u3068\u3053\u308d\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u306f\u3001\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u3060\u3051\u3067\u306a\u304f\u3001\u524d\u56de\u7d39\u4ecb\u3057\u305f\u691c\u7d22\u6a5f\u80fd\u3084\u30ba\u30fc\u30e0\u30ec\u30d9\u30eb\u3092\u30b9\u30e9\u30a4\u30c0\u30fc\u3067\u5909\u66f4\u3059\u308b\u306a\u3069\u3044\u308d\u3093\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u8208\u5473\u304c\u3042\u308b\u65b9\u306f\u3001\u305c\u3072\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3067\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\ud83d\udcdd \u53c2\u8003URL\uff1a <a href=\"https:\/\/leafletjs.com\/SlavaUkraini\/plugins.html\" target=\"_blank\" rel=\"noopener\">Leaflet \u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u4e00\u89a7<\/a><\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6071 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u4ea4\u901a\u6a19\u8b58\u63a2\u3057\u4e2d\uff01<br \/>\n\u3053\u308c\u3001\u30db\u30f3\u30c8\u306b\u3042\u308b\u306e\u304b\u306a\u2026\u300d<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10355 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/23.png\" alt=\"\" width=\"160\" height=\"160\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/23.png 160w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/23-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/04\/23-100x100.png 100w\" sizes=\"auto, (max-width: 160px) 100vw, 160px\" \/>\u300e\u9053\u8def\u5de5\u4e8b\u4e2d\u300f<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u300cLaravel + Leaflet \u5730\u56f3\u3067\u99c5\u540d\u691c\u7d22\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u300d\u3068\u3044\u3046\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u306f\u500b\u4eba\u958b\u767a\u306e\u30b5\u30a4\u30c8\u3067\u4f7f\u3046\u305f\u3081\u306b\u52c9\u5f37\u3057\u305f\u5185 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=10345\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Leaflet.fullscreen \u3067\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u5bfe\u5fdc\u5730\u56f3\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":10357,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3],"tags":[],"class_list":["post-10345","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10345"}],"version-history":[{"count":6,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10345\/revisions"}],"predecessor-version":[{"id":10361,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10345\/revisions\/10361"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/10357"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}