ArcGIS JS 4 slices vector load third-party

    Now slice vector is becoming increasingly popular for map rendering can be lighter and faster. ArcGIS JS 4.13 can be achieved load third-party vector slice, the following code example, the bottom is building data before I cut.

    When the slices about the size of 1M, the effect can still be loaded. But compared with the mapbox gl or some less, mapbox gl can be loaded slice 6M size, but ArcGIS JS 4 does not. Vector sliced still need to control the size, so as to quickly transfer and rendering.

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);
});


Reference:

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

Guess you like

Origin www.cnblogs.com/polong/p/12004605.html