{
  "title": "KML Layer (KML)",
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema",
  "description": "Keyhole Markup Language (KML) is an XML-based format for storing geographic data and associated content and is an official Open Geospatial Consortium (OGC) standard. KML is a common format for sharing geographic data with non-GIS users as it can be easily delivered on the Internet.",
  "properties": {
    "id": {
      "type": "string",
      "description": "A unique identifying string for the layer."
    },
    "itemId": {
      "type": "string",
      "description": "A string containing the item ID of the service if it's registered on ArcGIS Online or your organization's portal."
    },
    "layerType": {
      "type": "string",
      "description": "String indicating the layer type.",
      "enum": [
        "KML"
      ]
    },
    "listMode": {
      "type": "string",
      "description": "To show or hide the sublayer in the layer list.",
      "enum": [
        "hide",
        "show"
      ]
    },
    "maxScale": {
      "type": "number",
      "description": "A number representing the maximum scale at which the layer will be visible. The number is the scale's denominator.",
      "minimum": 0
    },
    "minScale": {
      "type": "number",
      "description": "A number representing the minimum scale at which the layer will be visible. The number is the scale's denominator.",
      "minimum": 0
    },
    "opacity": {
      "type": "number",
      "description": "The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",
      "minimum": 0,
      "maximum": 1,
      "default": 1
    },
    "path": {
      "type": "string",
      "description": "For offline data, a path to a KML file. A URI format is used, starting with `file:` followed by a file system path with an extension of `.kml` or `.kmz`.  A relative path must be from the file which defines the layer. For example `file:../commondata/kml/paris.kml`.",
      "pattern": "^file:.+\\.km[lz]$"
    },
    "refreshInterval": {
      "type": "number",
      "description": "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": {
      "type": "boolean",
      "description": "Indicates whether to allow scene authors the ability to control what layers should be shown in a client's legend.",
      "default": true
    },
    "title": {
      "type": "string",
      "description": "A user-friendly string title for the layer that can be used in a table of contents."
    },
    "url": {
      "type": "string",
      "description": "The URL to the layer.",
      "format": "uri"
    },
    "visibility": {
      "type": "boolean",
      "description": "Boolean property determining whether the layer is initially visible in the web scene.",
      "default": true
    },
    "visibleFolders": {
      "type": "array",
      "description": "Array of numeric IDs of folders that will be made visible.",
      "items": {
        "type": "integer"
      },
      "uniqueItems": true
    }
  },
  "anyOf": [
    {
      "required": [
        "id",
        "layerType",
        "title",
        "url"
      ]
    },
    {
      "required": [
        "id",
        "layerType",
        "path",
        "title"
      ]
    }
  ],
  "additionalProperties": false,
  "esriDocumentation": {
    "examples": [
      {
        "title": "KML Layer",
        "code": {
          "operationalLayers": [
            {
              "id": "87a5bcad920440f293a36ff3fea1a4f8",
              "title": "Paris",
              "visibility": true,
              "layerType": "KML",
              "path": "file:../commondata/kml/paris.kml"
            }
          ]
        }
      }
    ]
  }
}
