{"id":9684,"date":"2021-11-08T07:00:49","date_gmt":"2021-11-07T22:00:49","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=9684"},"modified":"2021-10-13T17:46:06","modified_gmt":"2021-10-13T08:46:06","slug":"laravel-geometry-%e5%9e%8b%e3%82%ab%e3%83%a9%e3%83%a0%e3%81%a7%e8%ba%ab%e8%bf%91%e3%81%aa%e5%a4%9c%e6%99%af%e3%82%b9%e3%83%9d%e3%83%83%e3%83%88%e3%82%92%e3%83%9e%e3%83%83%e3%83%97%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=9684","title":{"rendered":"Laravel + Geometry \u578b\u30ab\u30e9\u30e0\u3067\u8eab\u8fd1\u306a\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3092\u30de\u30c3\u30d7\u8868\u793a\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u305d\u306e\u6614\u3068\u3042\u308b\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u672c\u3092\u3088\u304f\u8aad\u3093\u3067\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u306b\u306f\u300c<strong>\u4eba\u306f\u8eab\u8fd1\u306a\u60c5\u5831\u307b\u3069\u77e5\u308a\u305f\u304c\u308b<\/strong>\u300d\u3068\u3044\u3046\u30eb\u30fc\u30eb\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u4f8b\u3048\u3070\u5730\u65b9\u306b\u4f4f\u3093\u3067\u308b\u4eba\u9593\u304b\u3089\u3059\u308b\u3068\u3001<\/p>\n<p><strong>\u300c\u6771\u4eac\u306e\u30aa\u30b7\u30e3\u30ec\u3067\u7f8e\u5473\u3057\u3044\u3001\u5b89\u3044\u5e97\u300d<\/strong><\/p>\n<p>\u3088\u308a\u3082<\/p>\n<p><strong>\u300c\u305d\u3093\u306a\u306b\u30aa\u30b7\u30e3\u30ec\u3058\u3083\u306a\u3044\u3057\u3001\u5b89\u304f\u3082\u306a\u3044\u3051\u3069\u3001\u3046\u307e\u3044\u3068\u8a55\u5224\u306e\u3059\u3050\u8fd1\u304f\u306e\u5e97\u300d<\/strong><\/p>\n<p>\u306e\u65b9\u304c\u3059\u3050\u884c\u3051\u308b\u306e\u3067\u3001\u3088\u308a\u8208\u5473\u3092\u6301\u3061\u3084\u3059\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n<p>\u307e\u305f\u3001\u3053\u306e\u672c\u306b\u306f\u300c<strong>\u591a\u304f\u306e\u4eba\u306f\u30e1\u30b8\u30e3\u30fc\u30ea\u30fc\u30b0\u3088\u308a\u5730\u5143\u306e\u8a66\u5408\u306e\u65b9\u304c\u8208\u5473\u304c\u3042\u3063\u305f<\/strong>\u300d\u3068\u3044\u3046\u4f8b\u3082\u66f8\u304b\u308c\u3066\u3044\u3066\u3001\u300c\u8ddd\u96e2\u300d\u3068\u3044\u3046\u306e\u306f\u4eba\u9593\u306b\u3068\u3063\u3066\u91cd\u8981\u306a\u6761\u4ef6\u306e\u3072\u3068\u3064\u3060\u3068\u8a00\u3063\u3066\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u2757<\/p>\n<p>\u305b\u3063\u304b\u304f\u3053\u306e\u91cd\u8981\u306a\u30eb\u30fc\u30eb\u3092\u5b66\u3093\u3060\u306e\u3060\u304b\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u3068\u3057\u3066\u6709\u52b9\u6d3b\u7528\u3057\u305f\u3044\u306a\u3068\u601d\u3044\u3001\u4eca\u56de\u3042\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u307f\u305f\u304f\u306a\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;\">\u73fe\u5728\u5730\u306b\u8fd1\u3044\u30b9\u30dd\u30c3\u30c8\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30de\u30c3\u30d7\u8868\u793a\u3059\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<strong>\u30de\u30c3\u30d7\u3092\u79fb\u52d5\u3059\u308b\u3068\u305d\u306e\u7def\u5ea6\uff0f\u7d4c\u5ea6\u304b\u3089\u8fd1\u3044\u9806\u306b\u30b9\u30dd\u30c3\u30c8\u3092\u898b\u3064\u3051\u51fa\u3057\u3001<\/strong>\u305d\u306e\u30de\u30c3\u30d7\u306b\u8868\u793a\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\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\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><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\" \/>\u300c\u3046\u307e\u3044\u30af\u30e9\u30d5\u30c8\u30d3\u30fc\u30eb\u304c\u8fd1\u304f\u306b\u3042\u308b\u306e\u2757\u2753\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x\u3001Vue 2\u3001MySQL 8<\/p>\n<h1>\u4f4d\u7f6e\u30c7\u30fc\u30bf\u306e\u6e96\u5099<\/h1>\n<p>\u307e\u305a\u6700\u521d\u306b\u300c<strong>\u3069\u3053\u306b\u4f55\u304c\u3042\u308b<\/strong>\u300d\u3068\u3044\u3046\u7def\u5ea6\uff0f\u7d4c\u5ea6\u3068\u3072\u3082\u3065\u3044\u305f\u30c7\u30fc\u30bf\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u3044\u308d\u3044\u308d\u63a2\u3057\u305f\u7d50\u679c\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304b\u3089\u300c<strong>\u591c\u666f100\u9078<\/strong>\u300d\u306e<code>CSV<\/code>\uff08<code>yakei02.csv<\/code>\uff09\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3055\u306b\u3053\u3046\u3044\u3063\u305f\u30c7\u30fc\u30bf\u3092\u63a2\u3057\u3066\u307e\u3057\u305f\u3002<br \/>\n\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\ud83d\ude0a\u2728<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003URL\uff1a<\/strong>\u00a0<a href=\"http:\/\/100sen.cyber-ninja.jp\/\" target=\"_blank\" rel=\"noopener\">\u65e5\u672c\u767e\u9078\u3068\u5ea7\u6a19\u5024\uff08\u7d4c\u7def\u5ea6\u6570\u5024\uff09<\/a><\/p>\n<p>\u203b \u4ed6\u306b\u3082\u300c\u5915\u65e5\u300d\u3084\u300c\u540d\u6c34\u300d\u306e\u30c7\u30fc\u30bf\u3082\u3042\u308a\u307e\u3059\u3002\u30ca\u30a4\u30b9\u3067\u3059\u306d\ud83d\udc4d<\/p>\n<p>\u306a\u304a\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f<code>zip<\/code>\u30d5\u30a1\u30a4\u30eb\u306f\u5c55\u958b\u3057\u3066<code>storage\/app\/csv<\/code>\u30d5\u30a9\u30eb\u30c0\u3078\u79fb\u52d5\u3055\u305b\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9685\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_1.png\" alt=\"\" width=\"416\" height=\"193\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_1.png 416w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_1-300x139.png 300w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><\/p>\n<h1>\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001<code>Laravel<\/code>\u3067\u5fc5\u8981\u306a\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\uff1a DB\u30c6\u30fc\u30d6\u30eb\u69cb\u6210<\/li>\n<li>\u30e2\u30c7\u30eb\uff1a DB\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/li>\n<li>Seeder\uff1a \u591c\u666f\u30c7\u30fc\u30bf\u3092\u30c6\u30fc\u30d6\u30eb\u3078\u5165\u308c\u308b<\/li>\n<li>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\uff1a \u30d6\u30e9\u30a6\u30b6\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u7528<\/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>php artisan make:model NightView -msc<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u4e00\u6c17\u306b\u30d5\u30a1\u30a4\u30eb\u304c\uff14\u3064\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30e2\u30c7\u30eb\u306e\u8a2d\u5b9a<\/h2>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30e2\u30c7\u30eb\u3067\u3059\u3002<\/p>\n<p><strong>app\/Models\/NightView.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n<strong>use Illuminate\\Support\\Facades\\DB;<\/strong>\r\n\r\nclass NightView extends Model\r\n{\r\n    <strong>use HasFactory;<\/strong>\r\n\r\n<strong>    protected $appends = ['map_url'];<\/strong>\r\n\r\n<strong>    \/\/ Scope<\/strong>\r\n<strong>    public function scopeSelectDistance($query, $longitude, $latitude) \/\/ \u73fe\u5728\u5730\u3068\u306e\u8ddd\u96e2\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307e\u3059<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $query-&gt;selectRaw(<\/strong>\r\n<strong>            'id, name, address, '.<\/strong>\r\n<strong>            'ST_Y(location) AS longitude, ST_X(location) AS latitude, '.<\/strong>\r\n<strong>            'st_distance_sphere(POINT(?, ?), POINT(ST_Y(location), ST_X(location)))  AS distance',<\/strong>\r\n<strong>            [ $longitude, $latitude,]<\/strong>\r\n<strong>        );<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/\/ Accessor<\/strong>\r\n<strong>    public function getMapUrlAttribute()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return 'https:\/\/www.google.com\/maps\/search\/?api=1&amp;query='. $this-&gt;latitude .','. $this-&gt;longitude;<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/\/ Mutator<\/strong>\r\n<strong>    public function setLocationAttribute($values)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $point = 'POINT('. $values['latitude'] .' '. $values['longitude'] .')';<\/strong>\r\n<strong>        $this-&gt;attributes['location'] = DB::raw('ST_GeomFromText(\"'. $point .'\")');<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u304c\u3001<code>scopeSelectDistance()<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u73fe\u5728\u8868\u793a\u3057\u3066\u3044\u308b\u4f4d\u7f6e\u3068\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3068\u306e\u8ddd\u96e2\u3092\u8a08\u7b97\u3057<code>distance<\/code>\u3068\u3057\u3066\u53d6\u5f97\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<code>geometry<\/code>\u578b\u306e\u30ab\u30e9\u30e0\u304b\u3089\u7def\u5ea6\u30fb\u7d4c\u5ea6\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b<code>ST_X()<\/code>\u3001<code>ST_Y()<\/code>\u3068\u3044\u3046<code>MySql<\/code>\u306e\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a<\/h2>\n<p><strong>database\/migrations\/****_**_**_******_create_night_views_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('night_views', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u5834\u6240\u540d');<\/strong>\r\n<strong>        $table-&gt;string('address')-&gt;comment('\u6240\u5728\u5730');<\/strong>\r\n<strong>        $table-&gt;geometry('location')-&gt;comment('\u7def\u5ea6\u30fb\u7d4c\u5ea6');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;spatialIndex('location');<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u304c<code>geometry<\/code>\u578b\u306e\u30ab\u30e9\u30e0<code>location<\/code>\u3067\u3001\u3053\u306e\uff11\u3064\u306e\u30ab\u30e9\u30e0\u306b\u7def\u5ea6\u30fb\u7d4c\u5ea6\uff12\u3064\u306e\u60c5\u5831\u3092\u3082\u305f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<code>spatialIndex<\/code>\u306f\u300c\u7a7a\u9593\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3067\u3001\u4f4d\u7f6e\u30c7\u30fc\u30bf\u7528\u306b\u691c\u7d22\u306e\u52b9\u7387\u5316\u304c\u3067\u304d\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3059\u3002<\/p>\n<h2>Seeder\u306e\u8a2d\u5b9a<\/h2>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u305f\u300c\u591c\u666f\u30c7\u30fc\u30bf\u300d\u3092\u305d\u3063\u304f\u308aDB\u30c6\u30fc\u30d6\u30eb<code>night_views<\/code>\u30c6\u30fc\u30d6\u30eb\u3078\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b<code>Seeder<\/code>\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/NightViewSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\NightView;<\/strong>\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass NightViewSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        <strong>$csv_path = storage_path('app\/csv\/yakei02.csv');<\/strong>\r\n<strong>        $lines = new \\SplFileObject($csv_path);<\/strong>\r\n\r\n<strong>        foreach ($lines as $index =&gt; $line) {<\/strong>\r\n\r\n<strong>            if($index &gt; 0) {<\/strong>\r\n\r\n<strong>                $line = mb_convert_encoding($line, 'UTF-8', 'SJIS-win'); \/\/ \ud83d\udc48 \u6587\u5b57\u30b3\u30fc\u30c9\u3092 UTF-8 \u3078\u5909\u63db\u3057\u3066\u307e\u3059<\/strong>\r\n<strong>                $values = str_getcsv($line);<\/strong>\r\n\r\n<strong>                if(!is_null($values[0])) {<\/strong>\r\n\r\n<strong>                    $night_view = new NightView();<\/strong>\r\n<strong>                    $night_view-&gt;name = $values[1];<\/strong>\r\n<strong>                    $night_view-&gt;location = [<\/strong>\r\n<strong>                        'latitude' =&gt; $values[2],<\/strong>\r\n<strong>                        'longitude' =&gt; $values[3]<\/strong>\r\n<strong>                    ];<\/strong>\r\n<strong>                    $night_view-&gt;address = $values[4];<\/strong>\r\n<strong>                    $night_view-&gt;save();<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n    }\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3001\u6c17\u3092\u3064\u3051\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u304c\u300c<strong>\u6587\u5b57\u30b3\u30fc\u30c9<\/strong>\u300d\u3067\u3059\u3002<br \/>\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u305f\u30c7\u30fc\u30bf\u306f<code>Shift_JIS<\/code>\u3067\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u5909\u63db\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>Seeder<\/code>\u306f\u4f5c\u6210\u3057\u305f\u3060\u3051\u3067\u306f\u6709\u52b9\u306b\u306a\u308a\u307e\u305b\u3093\u306e\u3067\u3001<code>Laravel<\/code>\u5074\u3078\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass DatabaseSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Seed the application's database.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        \/\/ \u7701\u7565\r\n\r\n        <strong>$this-&gt;call(NightViewSeeder::class);<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001DB\u307e\u308f\u308a\u306e\u6e96\u5099\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066DB\u3092\u518d\u69cb\u7bc9\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9688\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_2.png\" alt=\"\" width=\"602\" height=\"458\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_2.png 602w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_2-300x228.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8a2d\u5b9a<\/h2>\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u5fc5\u8981\u306a\u306e\u306f\u4ee5\u4e0b\u306e\uff12\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<ul>\n<li>index\uff1a \u30d6\u30e9\u30a6\u30b6\u304b\u3089\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3059\u308b\u90e8\u5206<\/li>\n<li>list\uff1a Ajax \u3067\u591c\u666f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u90e8\u5206<\/li>\n<\/ul>\n<p><strong>app\/Http\/Controllers\/NightViewController.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\n<strong>use App\\Models\\NightView;<\/strong>\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass NightViewController extends Controller\r\n{\r\n    <strong>public function index()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return view('night_view.index');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function list(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        \/\/ TODO: \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u307e\u3059<\/strong>\r\n\r\n<strong>        $latitude = $request-&gt;latitude;   \/\/ \u7def\u5ea6<\/strong>\r\n<strong>        $longitude = $request-&gt;longitude; \/\/ \u7d4c\u5ea6<\/strong>\r\n<strong>        $night_views = [];<\/strong>\r\n\r\n<strong>        try {<\/strong>\r\n\r\n<strong>            $night_views = NightView::selectDistance($longitude, $latitude)<\/strong>\r\n<strong>                -&gt;orderBy('distance', 'asc')<\/strong>\r\n<strong>                -&gt;take(10)<\/strong>\r\n<strong>                -&gt;get();<\/strong>\r\n\r\n<strong>        } catch(\\Exception $e) {}<\/strong>\r\n\r\n<strong>        return [<\/strong>\r\n<strong>            'result' =&gt; true,<\/strong>\r\n<strong>            'night_views' =&gt; $night_views<\/strong>\r\n<strong>        ];<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u306a\u305c<code>try ~ catch<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u9001\u4fe1\u3055\u308c\u3066\u304f\u308b\u4f4d\u7f6e\u60c5\u5831\u306b\u3088\u3063\u3066\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u3002\uff08\u3069\u3046\u3084\u3089\u9060\u304f\u306e\u5834\u6240\u3092\u8868\u793a\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3088\u3046\u3067\u3057\u305f\uff09<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u306e<code>index()<\/code>\u3067\u6307\u5b9a\u3057\u305f\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/views\/night_view\/index.blade.php<\/strong><\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.1\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/unpkg.com\/leaflet@1.7.1\/dist\/leaflet.css\" \/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div id=\"app\" class=\"p-4\"&gt;\r\n    &lt;h3&gt;\u8fd1\u304f\u306e\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3092\u30de\u30c3\u30d7\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb&lt;\/h3&gt;\r\n    &lt;div class=\"text-secondary mb-1\"&gt;\r\n        &lt;small&gt;\u73fe\u5728\u5730\u304b\u3089\u8fd1\u3044\u9806\u306b\u6700\u592710\u4ef6\u306e\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\uff08\u73fe\u5728\u5730\u3092\u79fb\u52d5\u3055\u305b\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff09&lt;\/small&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div id=\"map\" style=\"width:100%;height:500px;border:1px solid #000;\"&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.14\/dist\/vue.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.21.1\/axios.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/unpkg.com\/leaflet@1.7.1\/dist\/leaflet.js\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n\r\n    <strong>new Vue({<\/strong>\r\n<strong>        el: '#app',<\/strong>\r\n<strong>        data() {<\/strong>\r\n<strong>            return {<\/strong>\r\n<strong>                nightViews: [],<\/strong>\r\n<strong>                markers: [],<\/strong>\r\n<strong>                location: {<\/strong>\r\n<strong>                    longitude: '135.18671362704455',<\/strong>\r\n<strong>                    latitude: '34.68422333531551',<\/strong>\r\n<strong>                },<\/strong>\r\n<strong>                map: null<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        methods: {<\/strong>\r\n<strong>            getNightViews() {<\/strong>\r\n\r\n<strong>                const url = '{{ route('night_view.list') }}';<\/strong>\r\n<strong>                const params = {<\/strong>\r\n<strong>                    params: this.location<\/strong>\r\n<strong>                };<\/strong>\r\n<strong>                axios.get(url, params)<\/strong>\r\n<strong>                    .then(response =&gt; {<\/strong>\r\n\r\n<strong>                        if(response.data.result === true) {<\/strong>\r\n\r\n<strong>                            this.nightViews = response.data.night_views;<\/strong>\r\n<strong>                            this.setMarkers();<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    })<\/strong><strong>;<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            setMarkers() {<\/strong>\r\n\r\n<strong>                this.markers.forEach(marker =&gt; this.map.removeLayer(marker));<\/strong>\r\n<strong>                this.markers = [];<\/strong>\r\n\r\n<strong>                this.nightViews.forEach(nightView =&gt; {<\/strong>\r\n\r\n<strong>                    const location = [nightView.latitude, nightView.longitude];<\/strong>\r\n<strong>                    const marker = L.marker(location).addTo(this.map)<\/strong>\r\n<strong>                        .bindPopup(`&lt;a href=\"${nightView.map_url}\" target=\"_blank\"&gt;Google\u30de\u30c3\u30d7\u3067\u8868\u793a&lt;\/a&gt;`)<\/strong>\r\n<strong>                        .bindTooltip(`${nightView.name}\uff08${nightView.address}\uff09`);<\/strong>\r\n<strong>                    this.markers.push(marker);<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            setCenter(e) {<\/strong>\r\n\r\n<strong>                const center = e.target.getCenter();<\/strong>\r\n<strong>                this.location = {<\/strong>\r\n<strong>                    latitude: center.lat,<\/strong>\r\n<strong>                    longitude: center.lng<\/strong>\r\n<strong>                };<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        watch: {<\/strong>\r\n<strong>            location: {<\/strong>\r\n<strong>                deep: true,<\/strong>\r\n<strong>                immediate: true,<\/strong>\r\n<strong>                handler() {<\/strong>\r\n\r\n<strong>                    Vue.nextTick(() =&gt; {<\/strong>\r\n\r\n<strong>                        this.getNightViews();<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        mounted() {<\/strong>\r\n\r\n<strong>            \/\/ \u30de\u30c3\u30d7\u3092\u7528\u610f<\/strong>\r\n<strong>            this.map = L.map('map', {<\/strong>\r\n<strong>                zoomAnimation: false<\/strong>\r\n<strong>            }).setView([ this.location.latitude, this.location.longitude ], 8);<\/strong>\r\n<strong>            const layerUrl = 'https:\/\/cyberjapandata.gsi.go.jp\/xyz\/pale\/{z}\/{x}\/{y}.png';<\/strong>\r\n<strong>            const attribution = '&lt;a href=\"https:\/\/www.gsi.go.jp\/kikakuchousei\/kikakuchousei40182.html\" target=\"_blank\" rel=\"noopener\"&gt;\u56fd\u571f\u5730\u7406\u9662&lt;\/a&gt;';<\/strong>\r\n<strong>            L.tileLayer(layerUrl, { attribution: attribution }).addTo(this.map);<\/strong>\r\n<strong>            this.map<\/strong>\r\n<strong>                .on('moveend', e =&gt; {<\/strong>\r\n\r\n<strong>                    this.setCenter(e);<\/strong>\r\n\r\n<strong>                })<\/strong>\r\n<strong>                .on('zoomend', e =&gt; {<\/strong>\r\n\r\n<strong>                    this.setCenter(e);<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    });<\/strong>\r\n\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u30de\u30c3\u30d7\u4e0a\u306b\u30de\u30fc\u30ab\u30fc\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u5730\u56f3\u3092\u8868\u793a<\/li>\n<li>\u73fe\u5728\u306e\u4f4d\u7f6e\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u3001\u8fd1\u304f\u306e\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u30fb\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/li>\n<li>\u305d\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7def\u5ea6\u30fb\u7d4c\u5ea6\u3092\u53d6\u5f97\u3057\u30de\u30fc\u30ab\u30fc\u8868\u793a<\/li>\n<\/ol>\n<p>\u203b \u3061\u306a\u307f\u306b\u3001\u4eca\u56de\u306f\u521d\u671f\u306e\u4f4d\u7f6e\u306f\u79c1\u306e\u5730\u5143\u30fb\u795e\u6238\u306b\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u304a\u597d\u307f\u3067<code>data()<\/code>\u5185\u306e<code>location<\/code>\u3092\u5909\u66f4\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u5b9f\u306f<code>Vue<\/code>\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\uff12\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30d0\u30fc\u30b8\u30e7\u30f3\uff13\u3092\u4f7f\u3063\u3066\u3082\u8868\u793a\u306f\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3084\u3089\u5730\u56f3\u30e9\u30a4\u30d6\u30e9\u30ea<code>leaflet<\/code>\u3068\u306e\u76f8\u6027\u304c\u60aa\u3044\u3088\u3046\u3067\u30ba\u30fc\u30e0\u3092\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u3001\u6025\u907d\u30d0\u30fc\u30b8\u30e7\u30f3\uff12\u3092\u4f7f\u3046\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\ud83d\ude2b<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong> <a href=\"https:\/\/stackoverflow.com\/questions\/65981712\/uncaught-typeerror-this-map-is-null-vue-js-3-leaflet\">https:\/\/stackoverflow.com\/questions\/65981712\/uncaught-typeerror-this-map-is-null-vue-js-3-leaflet<\/a><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>use \\App\\Http\\Controllers\\NightViewController;<\/strong>\r\n\r\n<strong>\/\/ \u7701\u7565<\/strong>\r\n\r\n<strong>Route::get('night_view', [NightViewController::class, 'index'])-&gt;name('night_view.index');<\/strong>\r\n<strong>Route::get('night_view\/list', [NightViewController::class, 'list'])-&gt;name('night_view.list');<\/strong><\/pre>\n<p>\u3055\u3041\u3001\u3053\u308c\u3067\u3059\u3079\u3066\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a\u300c<strong>http:\/\/******\/night_view<\/strong>\u300d\u306b\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9697\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_3.png\" alt=\"\" width=\"640\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_3-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_3-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_3-100x100.png 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u795e\u6238\u5468\u8fba\u306e\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u3067\u306f\u3001\u30de\u30c3\u30d7\u3092\u30c9\u30e9\u30c3\u30b0\u30fb\u30a2\u30f3\u30c9\u30fb\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u5c11\u3057\u540d\u53e4\u5c4b\u306e\u65b9\u3078\u79fb\u52d5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9694\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_4.png\" alt=\"\" width=\"625\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_4.png 625w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_4-293x300.png 293w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u30de\u30c3\u30d7\u306e\u79fb\u52d5\u306b\u5408\u308f\u305b\u3066\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u306e\u5834\u6240\u3082\u79fb\u52d5\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u30de\u30fc\u30ab\u30fc\u306b\u30bb\u30c3\u30c8\u3057\u305f\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u304c\u3046\u307e\u304f\u52d5\u304f\u304b\u306e\u30c1\u30a7\u30c3\u30af\u3067\u3059\u3002<br \/>\n\u30de\u30fc\u30ab\u30fc\u306e\u4e0a\u306b\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u5408\u308f\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9695\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_5.png\" alt=\"\" width=\"640\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_5-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_5-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_5-100x100.png 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u306e\u540d\u524d\u3068\u6240\u5728\u5730\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u2757<\/p>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b\u30de\u30fc\u30ab\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066 Google\u30de\u30c3\u30d7\u3078\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u2193\u3000\u2193\u3000\u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9696\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_6.png\" alt=\"\" width=\"640\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_6-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_6-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/10\/laravel_near_location_6-100x100.png 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3046\u307e\u304f\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u5168\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u203b \u78ba\u304bGoogle\u30de\u30c3\u30d7\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u3063\u3066\u516c\u958b\u3057\u3066\u306f\u3044\u3051\u306a\u304b\u3063\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u79fb\u52d5\u5148\u306f\u7701\u7565\u3057\u307e\u3059\u3002<\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u2757<\/p>\n<h1>\u30c7\u30e2\u3092\u3064\u304f\u308a\u307e\u3057\u305f<\/h1>\n<p>\u30de\u30c3\u30d7\u306f\u5b9f\u969b\u306b\u89e6\u3063\u3066\u3082\u3089\u3063\u305f\u65b9\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u304b\u3068\u601d\u3044\u307e\u3057\u305f\u306e\u3067\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u3054\u7528\u610f\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u304a\u6c17\u8efd\u306b\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002\u2728\ud83d\ude0a\ud83d\udc4d<\/p>\n<p><strong>\ud83d\udcdd \u30c7\u30e2\u30da\u30fc\u30b8\uff1a<\/strong> <a href=\"https:\/\/demo-laravel8x.capilano-fw.com\/night_view\" target=\"_blank\" rel=\"noopener\">\u8fd1\u304f\u306e\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3092\u30de\u30c3\u30d7\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb<\/a><\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u5229\u7528\u3057\u305f\u5730\u56f3\u30e9\u30a4\u30d6\u30e9\u30ea<code>Leaflet<\/code>\uff08\uff06\u5730\u7406\u9662\u5730\u56f3\uff09\u306f\u7121\u6599\u3067\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u7cbe\u5ea6\u3067\u8a00\u3046\u3068Google\u30de\u30c3\u30d7\u306e\u65b9\u304c\u4e0a\u3067\u3059\u304c\u3001\u6709\u6599\uff08\u3057\u304b\u3082\u4ed6\u306eAPI\u3068\u6bd4\u3079\u3066\u3082\u5272\u9ad8\uff09\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u306e\u3067\u3001\u3082\u3057\u305d\u308c\u307b\u3069\u7cbe\u5ea6\u306f\u4e0d\u8981\u3068\u306e\u3053\u3068\u3067\u3057\u305f\u3089\u30e9\u30f3\u30cb\u30f3\u30b0\u30fb\u30b3\u30b9\u30c8\u3092\u30ab\u30c3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<code>geometry<\/code>\u578b\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u7a7a\u9593\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3088\u308a\u9ad8\u901f\u306b\u8fd1\u304f\u306e\u30b9\u30dd\u30c3\u30c8\u3092\u63a2\u3057\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u3044\u3063\u305f\u6a5f\u80fd\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u3001\u305c\u3072\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3001\u300c<strong>\u8fd1\u304f\u306b\u3042\u308b\u591c\u666f\u30b9\u30dd\u30c3\u30c8<\/strong>\u300d\u304c\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u308c\u307e\u3067\u5730\u7406\u9662\u5730\u56f3\u306f\u4e2d\u8eab\u304c\u30b9\u30ab\u30b9\u30ab\u306a\u306e\u304b\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u4f7f\u3063\u3066\u307f\u308b\u3068\u306a\u304b\u306a\u304b\u5730\u56f3\u3082\u304d\u308c\u3044\u3067\u3059\u3057\u3001\u4e3b\u8981\u306a\u30e9\u30f3\u30c9\u30de\u30fc\u30af\u306f\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u4f01\u696d\u6848\u4ef6\u3067\u3082\u4f7f\u3044\u3069\u3053\u308d\u306f\u3042\u308b\u3060\u308d\u3046\u306a\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3082\u3001\u5730\u7406\u9662\u5730\u56f3\u306b\u306f\u6700\u8fd1\u306e\u3082\u306e\u3060\u3051\u3067\u306a\u304f\u3001\u904e\u53bb\u306e\u822a\u7a7a\u5199\u771f\u307e\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u3066\u30db\u30f3\u30c8\u306b\u4fbf\u5229\u306a\u4e16\u306e\u4e2d\u3092\u5b9f\u611f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u6642\u9593\u3092\u3082\u3066\u3042\u307e\u3057\u305f\u3068\u304d\u306b\u306f\u30d0\u30fc\u30c1\u30e3\u30eb\u3067\u300c\u6642\u9593\u65c5\u884c\u300d\u304c\u3067\u304d\u308b\u3093\u3067\u3059\u306d\u3002\uff08\u79c1\u306f\u5730\u56f3\u3092\u898b\u308b\u306e\u304c\u597d\u304d\u306a\u306e\u3067\u3001\u3042\u3063\u3068\u3044\u3046\u9593\u306b\u6642\u9593\u304c\u904e\u304e\u3061\u3083\u3063\u305f\u308a\u3057\u307e\u3059\ud83d\ude02\uff09<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u5730\u56f3\u3092\u4f7f\u3063\u305f\u958b\u767a\u3092\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u5948\u826f\u3067\u304a\u3044\u3057\u3044\u30af\u30e9\u30d5\u30c8\u30d3\u30fc\u30eb\u898b\u3064\u3051\u307e\u3057\u305f\ud83c\udf7a\u2728\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u305d\u306e\u6614\u3068\u3042\u308b\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u672c\u3092\u3088\u304f\u8aad\u3093\u3067\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u306b\u306f\u300c\u4eba\u306f\u8eab\u8fd1\u306a\u60c5\u5831\u307b\u3069\u77e5\u308a\u305f\u304c\u308b\u300d\u3068\u3044\u3046\u30eb\u30fc\u30eb\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u3001\u4f8b\u3048\u3070\u5730\u65b9\u306b\u4f4f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=9684\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Geometry \u578b\u30ab\u30e9\u30e0\u3067\u8eab\u8fd1\u306a\u591c\u666f\u30b9\u30dd\u30c3\u30c8\u3092\u30de\u30c3\u30d7\u8868\u793a\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":9703,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[20],"class_list":["post-9684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-20"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9684","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=9684"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9684\/revisions"}],"predecessor-version":[{"id":9705,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9684\/revisions\/9705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/9703"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}