{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://maps.siemens-cdn.com/showcases/tours/tour.v1.schema.json",
  "title": "Map tour, version 1",
  "description": "An animated flight over the map through keyframes, each with a caption (ADR 0043). Zoom is in the Google scale of the embed's zoom parameter; durations are milliseconds. Unknown keys are not allowed.",
  "type": "object",
  "additionalProperties": false,
  "required": ["version", "title", "keyframes"],
  "properties": {
    "$schema": { "type": "string" },
    "version": { "const": 1 },
    "title": { "type": "string", "minLength": 1, "maxLength": 80 },
    "description": { "type": "string", "maxLength": 280 },
    "language": { "type": "string", "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8}){0,3}$", "description": "BCP 47 tag of the captions and map labels." },
    "projection": { "enum": ["mercator", "globe"], "description": "Players that cannot show it use mercator." },
    "loop": { "type": "boolean", "default": false },
    "keyframes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "items": { "$ref": "#/$defs/keyframe" },
      "description": "Durations and holds of all keyframes add up to at most 600000 ms (10 minutes)."
    }
  },
  "$defs": {
    "latLng": {
      "type": "object",
      "additionalProperties": false,
      "required": ["lat", "lng"],
      "properties": {
        "lat": { "type": "number", "minimum": -90, "maximum": 90 },
        "lng": { "type": "number", "minimum": -180, "maximum": 180 }
      }
    },
    "keyframe": {
      "type": "object",
      "additionalProperties": false,
      "required": ["center", "zoom", "caption"],
      "properties": {
        "center": { "$ref": "#/$defs/latLng" },
        "zoom": { "type": "number", "minimum": 0, "maximum": 21, "description": "Google zoom scale." },
        "pitch": { "type": "number", "minimum": 0, "maximum": 85, "default": 0, "description": "Degrees; players clamp it to what their map allows." },
        "bearing": { "type": "number", "minimum": -360, "maximum": 360, "default": 0, "description": "Degrees clockwise from north." },
        "duration": { "type": "integer", "minimum": 0, "maximum": 60000, "default": 4000, "description": "Milliseconds of the move into this keyframe; ignored on the first keyframe." },
        "hold": { "type": "integer", "minimum": 0, "maximum": 60000, "default": 3000, "description": "Milliseconds the view stays before the next move." },
        "easing": { "enum": ["fly", "ease-in-out", "ease-in", "ease-out", "linear"], "default": "fly" },
        "title": { "type": "string", "maxLength": 80 },
        "caption": { "type": "string", "minLength": 1, "maxLength": 280, "description": "Plain text, never markup." },
        "maptype": { "enum": ["roadmap", "satellite", "hybrid"], "description": "Switches the map type from this keyframe on." },
        "marker": {
          "type": "object",
          "additionalProperties": false,
          "required": ["label"],
          "properties": {
            "label": { "type": "string", "minLength": 1, "maxLength": 80 },
            "position": { "$ref": "#/$defs/latLng", "description": "The keyframe's center when left out." }
          }
        }
      }
    }
  }
}
