{"id":6431,"date":"2019-06-28T12:15:10","date_gmt":"2019-06-28T03:15:10","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=6431"},"modified":"2020-12-13T12:03:11","modified_gmt":"2020-12-13T03:03:11","slug":"deckgl%e3%81%a7mapbox%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e4%bb%a5%e5%a4%96%e3%81%ae%e3%83%99%e3%83%bc%e3%82%b9%e3%83%9e%e3%83%83%e3%83%97%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/deck-gl\/6431","title":{"rendered":"deck.gl\u3067mapbox\u30b5\u30fc\u30d3\u30b9\u4ee5\u5916\u306e\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u3092\u4f7f\u7528\u3059\u308b"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>\u305d\u3082\u305d\u3082deck.gl\u306b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8868\u793a\u3055\u308c\u308b\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u3068\u3044\u3063\u305f\u3082\u306e\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u516c\u5f0f\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u591a\u304f\u304cdeck.gl\u3068react-map-gl\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3063\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u591a\u3044\u305f\u3081\u3001deck.gl\u3067\u306f\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u3092\u4f7f\u3046\u305f\u3081\u306bMapbox\u30b5\u30fc\u30d3\u30b9\u3078\u306e\u767b\u9332\u304c\u5fc5\u9808\u3067\u3042\u308b\u3088\u3046\u306a\u8aa4\u89e3\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u00a0<\/p>\n<h2>\u4ed6\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u3092\u4f7f\u3046<\/h2>\n<p>deck.gl\u3067mapbox\u4ee5\u5916\u306e\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306f\u3044\u308d\u3044\u308d\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u306fTIleLayer\u3092\u5229\u7528\u3057\u305f\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3>TileLayer\u3068\u306f<\/h3>\n<p><a href=\"https:\/\/deck.gl\/docs\/api-reference\/geo-layers\/tile-layer\">TileLayer:Deck.gl API reference\u00a0<\/a><\/p>\n<p>TileLayer\u306f\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30e9\u30b9\u30bf\u30bf\u30a4\u30eb(\u5730\u56f3\u30bf\u30a4\u30eb)\u3092\u8aad\u307f\u8fbc\u3093\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30ec\u30a4\u30e4\u30fc\u3067\u3059\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n\n\n<iframe src=\"https:\/\/codesandbox.io\/embed\/deckgl-tilelayerosm-0r326?fontsize=14&amp;hidenavigation=1&amp;theme=dark&amp;&amp;view=split\" style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\" title=\"deck.gl TileLayer(OSM)\" allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\" sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"><\/iframe>\n\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u8aac<\/h3>\n\n\n\n<p>\u4ed6\u306e\u30de\u30c3\u30d7\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5916\u90e8\u306e\u5730\u56f3\u30bf\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3060\u3053\u3068\u304c\u3042\u308b\u65b9\u3067\u3042\u308c\u3070\u3042\u307e\u308a\u8ff7\u3046\u3053\u3068\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">    const tileLayer = new TileLayer({\n        data: 'https:\/\/c.tile.openstreetmap.org\/{z}\/{x}\/{y}.png',\n\n        minZoom: 0,\n        maxZoom: 19,\n        tileSize: 256,\n\n        renderSubLayers: props =&gt; {\n            const {\n                bbox: { west, south, east, north }\n            } = props.tile;\n\n            return new BitmapLayer(props, {\n                data: null,\n                image: props.data,\n                bounds: [west, south, east, north]\n            });\n        }\n    });<\/pre><\/div>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306fdata\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5730\u56f3\u30bf\u30a4\u30eb\u306eURL\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>renderSublayers\u306e\u90e8\u5206\u3060\u3051\u3061\u3087\u3063\u3068\u308f\u304b\u308a\u3065\u3089\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u7279\u306b\u89e6\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002\uff08\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306bBitmapLayer\u4ee5\u5916\u3092\u4f7f\u3044\u305f\u3044\u6642\u306a\u3069\u306b\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3067\u3066\u304d\u307e\u3059\uff09<\/p>\n\n\n\n<p>\u3072\u3068\u3064\u554f\u984c\u70b9\u3068\u3057\u3066\u306fTextLayer\u306b\u306f\u3001attribution\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u4ed5\u65b9\u304c\u306a\u3044\u306e\u3067\u81ea\u5206\u3067\u5730\u56f3\u306b\u30a8\u30ec\u30e1\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u3066attribution\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:js mark:10 decode:true \">  return (\n    &lt;div className=\"App\"&gt;\n        &lt;DeckGL\n          layers={renderLayers({\n            data: data\n          })}\n          controller={{ type: MapController, dragRotate: false }}\n          initialViewState={viewport}\n      \/&gt;\n      &lt;div className=\"attribution\"&gt;&lt;a href=\"http:\/\/www.openstreetmap.org\/about\/\" target=\"_blank\"&gt;\u00a9 OpenStreetMap&lt;\/a&gt;&lt;\/div&gt;\n    &lt;\/div&gt;\n  );<\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u3067\u5916\u90e8\u306e\u5730\u56f3\u30bf\u30a4\u30eb\u3092Deck.gl\u306b\u8aad\u307f\u8fbc\u3093\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5730\u7406\u9662\u5730\u56f3\u3092\u8aad\u307f\u8fbc\u3093\u3060\u30b5\u30f3\u30d7\u30eb\u3082\u63b2\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<iframe src=\"https:\/\/codesandbox.io\/embed\/deckgl-tilelayergsi-rg7uv?fontsize=14&amp;hidenavigation=1&amp;theme=dark&amp;view=split\" style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\" title=\"deck.gl TileLayer(GSI)\" allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\" sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u305d\u3082\u305d\u3082deck.gl\u306b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8868\u793a\u3055&hellip;<\/p>\n","protected":false},"author":1,"featured_media":6433,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"class_list":["post-6431","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deck-gl","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/6431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=6431"}],"version-history":[{"count":2,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/6431\/revisions"}],"predecessor-version":[{"id":7067,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/6431\/revisions\/7067"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/6433"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=6431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=6431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=6431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}