CSV Layer (CSV)

The CSV layer type references a CSV or TXT file from a publically-accessible web server. It then dynamically loads into the map at run time. The CSV layer will maintain a reference to the CSV resource.

Properties

Property Details
columnDelimiter A string defining the character used to separate columns in a CSV file.
If property is present, must be one of the following values:
  • , (comma)
  • (space)
  • ; (semicolon)
  • | (pipe)
  • \t (tab)
id A unique identifying string for the layer.
layerDefinition An object that defines the attribute schema and drawing information for a layer drawn using client-side graphics.
See layerDefinition properties table.
layerType String indicating the layer type.
Value of this property must be CSV
locationInfo A locationInfo object defining how location information will be retrieved from a CSV file.
opacity The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.
popupInfo A popupInfo object defining the content of popup windows when you click or query a feature.
refreshInterval Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled.
showLegend Indicates whether to allow map authors the ability to control what layers should be shown in a client's legend.
title A user-friendly string title for the layer that can be used in a table of contents.
type Deprecated, use layerType instead.
url The URL to the layer.
visibility Boolean property determining whether the layer is initially visible in the web map.

layerDefinition properties

Property Details
capabilities A comma separated list of supported capabilities, e.g. Query,Editing.
definitionExpression SQL-based definition expression string that narrows the data to be displayed in the layer.
drawingInfo Contains the drawing and labeling information.
extent An object defining the rectangular area.
Must be one of the following values:
  • extent
    This object defines the bounding geometry given the lower-left and upper-right corners of the bounding box.
  • Null
fields An array of field objects containing information about the attribute fields for the feature collection or layer.
geometryType A string defining the type of geometry. Possible geometry types are: esriGeometryPoint, esriGeometryMultipoint, esriGeometryPolyline, esriGeometryPolygon, and esriGeometryEnvelope.
maxScale Represents the maximum scale at which the layer definition will be applied.
minScale Represents the minimum scale at which the layer definition will be applied.
name Contains a unique name for the layer that can be displayed in a legend.
objectIdField Indicates the name of the object ID field in the dataset.
templates A property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types.
type Indicates whether the layerDefinition applies to a Feature Layer or a Table.
If property is present, must be one of the following values:
  • Feature Layer
  • Table

Example

Live sample web map showing the CSV as operationalLayer

{
  "operationalLayers": [
    {
      "id": "csv_7927",
      "type": "CSV",
      "layerType": "CSV",
      "title": "Earthquakes",
      "visibility": true,
      "opacity": 1,
      "url": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month.csv",
      "layerDefinition": {
        "geometryType": "esriGeometryPoint",
        "objectIdField": "__OBJECTID",
        "type": "Feature Layer",
        "typeIdField": "",
        "fields": [],
        "types": [],
        "capabilities": "Query",
        "name": "csv",
        "extent": {
          "xmin": -20034970.25849882,
          "ymin": -9494815.985282788,
          "xmax": 20026086.963133518,
          "ymax": 14269743.874052156,
          "spatialReference": {
            "wkid": 102100
          }
        }
      },
      "popupInfo": {},
      "locationInfo": {
        "locationType": "coordinates",
        "latitudeFieldName": "latitude",
        "longitudeFieldName": "longitude"
      },
      "columnDelimiter": ","
    }
  ]
}

Feedback on this topic?