Core Concepts layers and Data (Part 2)

External data source layers are introduced

Data and files for external data sources are supported by different subclasses of the Layer class. Includes specific types of layers for processing external files (such as CSV or GeoJSON files) or loading external Maps (such as GeoQ, Autonavi, Bing Maps).

Common external data source layers are the following:

  • CSVLayer, data source is CSV file, data type is point vector graphics, support features including client geographic processing, popup window, support 2D and 3D symbol rendering. The main limitation is that a large amount of data may need to be downloaded according to the number of elements.
  • GeoJSONLayer, the data source of the GeoJSON file, the data type of points, polygons and vector graphics, mainly used to create layers from the GeoJSON file. The limitation is that each GeoJSON layer can only accept a single geometry type.
  • OGCFeatureLayer. Data types include points, lines, and polygons. It supports renderers, labels, pop-ups, and more.
  • WFSLayer, data source from WFS service, data type support point, multipoint, line and polygon, support renderer, label, popup window, but limited data must be GeoJSON format, support version 2.0.0 only.
  • WMSLayer, data source from WMS service, data type support raster data export single image, support OGC specification.
  • WMTSLayer, data source is WMTS slicing service, data type is slicing image, support OGC specification.
  • OpenStreetMapLayer, data source is OSM slicing service, data type is slice image, used to display the slice map of OpenStreetMap.

Each of the above layers requires different attributes when initialized, please refer to the documentation for each layer type for more information.

Example of creating CSVLayer:

const earthquakesLayer = new CSVLayer({
  url: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv".copyright: "USGS Earthquakes".latitudeField: "latitude".// Defaults to "latitude"
  longitudeField: "longitude" // Defaults to "longitude"
});

map.layers.add(earthquakesLayer)
Copy the code

Reproduction is introduced

The base map provides the geographical background for the map. Base images are usually provided in the form of sliced maps to speed up rendering. The grid base should be sliced in advance. The vector base map provides the data in compressed binary format and is rendered on the client side. ArcGIS comes with a series of base figure 1.

Custom map data can also be published as vector or raster slice base maps through ArcGIS Enterprise.

The basemap of a particular Map object can be controlled using a basemap property, which can be a string or a basemap object.

const Map = new Map({
  basemap: "streets-navigation-vector"
})
Copy the code

ArcGIS Server service introduction

MapImageLayer displays Map services published by ArcGIS Enterprise. Map Services typically contain multiple sublayers and complex drawings. The map service renders the data into a server-side image and displays it on the client side.

const layer = new MapImageLayer({
	url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer".sublayers: [{id: 1.visible: true
   	}, {
     id: 0.visible: true.definitionExpression: "pop2000 > 100000"}}]);Copy the code

The ImageryLayer is used to display images or other raster data from the Image Service published by ArcGIS Enterprise.

const layer = new ImageryLayer({
  // URL to the imagery service
  url: "https://landsat2.arcgis.com/arcgis/rest/services/Landsat8_Views/ImageServer"
});
Copy the code

  1. Some ArcGIS base maps are requiredAPI keyCall. The other part is directly called without configuration. For details, seeArcGIS developer website.↩