ArcGIS JS 4加載第三方矢量切片

    如今矢量切片愈來愈普及,對於地圖渲染能更輕更快。ArcGIS JS 4.13能夠實現加載第三方矢量切片,如下爲代碼示例,最下方是我以前切的建築物數據。

    當切片大小在1M左右,加載效果仍是能夠。不過跟mapbox gl相比仍是有些遜色,mapbox gl能夠加載6M大小的切片,但ArcGIS JS 4卻不行。矢量切片仍是須要控制好大小,這樣才能快速傳輸和渲染。dom

var style = {
  "version": 8,
  "sources": {
   "osm": {
     "tiles": ["https://osm-lambda.tegola.io/v1/maps/osm/{z}/{x}/{y}.pbf"],
      "type": "vector"
    }
  },
  "layers": [
   {
     id: "land",
      type: "fill",
      source: "osm",
      "source-layer": "land",
      minzoom: 0,
      maxzoom: 24,
      paint: {
       "fill-color": "rgba(150, 150, 150, 1)"
     }
   }
  ],
  "id": "test"
}

require([
 "esri/Map",
 "esri/views/MapView",
 "esri/layers/VectorTileLayer",
 "dojo/domReady!"
], function(Map, MapView, VectorTileLayer) {
 var map = new Map();
  var view = new MapView({
   container: "map",
    map: map,
    center: [-98.5795, 39.8283],
   zoom: 2,
 });
  var tileLyr = new VectorTileLayer({
   style: style
  });
  map.add(tileLyr);
});


參考資料:

https://gis.stackexchange.com/questions/300398/is-it-possible-to-add-vector-tile-layer-published-by-geoserver-layer-using-arcgiui

相關文章
相關標籤/搜索