Intro to CSVLayer
The CSVLayer allows you to add features from a comma-separated values text file (.csv) or delimited text file (.txt) that include latitude and longitude information. The file is referenced as a hosted file on the web. Because of this, the file must be publicly accessible. The file needs to include at least one pair of coordinate fields as these fields are used to locate the features on the map.
This sample shows how to add an instance of CSVLayer to aMap in a SceneView. The resulting point features can be queried via the API and then subsequently used as input for other operations.
If CSV files are not on the same domain as your website, a CORS-enabled server or a proxy is required.
How it works
This sample uses data from USGS.
Create a new CSVLayer and set the properties within its constructor. In this specific example, the url to the USGS earthquakes csv file is added in addition to the copyright
and popup
properties.
A SimpleRenderer is then set on the layer and the layer added to the map.