{
  "version": 8,
  "id": "notams",
  "name": "Base NOTAMs Style",
  "metadata": {
    "maputnik:renderer": "mlgljs",
    "feature_inspector": "https://tiles.notam-cloud.ru/api/get_feature_info/{feature_id}",
    "feature_geometry": "https://tiles.notam-cloud.ru/api/get_feature_info/{feature_id}",
    "find_in_point": "https://tiles.notam-cloud.ru/api/find_in_point/{zoom}/{lat}/{lon}",
    "on_click_href": "",
    "popup_template": "<div class='title'>{properties.notam_num}</div>",
    "hover_template": "<div class='title'>{properties.notam_num}</div>",
    "filters": {
      "notams": [
        { "id": "prohibited_areas", "group_id": "notams" },
        { "id": "restricted_areas_active", "group_id": "notams" },
        { "id": "danger_areas_active", "group_id": "notams" },
        { "id": "notams_active", "group_id": "notams" },
        { "id": "notams_error_active", "group_id": "notams" },
        { "id": "restricted_areas_inactive", "group_id": "notams" },
        { "id": "danger_areas_inactive", "group_id": "notams" },
        { "id": "notams_inactive", "group_id": "notams" },
        { "id": "notams_error_inactive", "group_id": "notams" }
      ]
    },
    "locale": {
      "ru": {
        "notams": "НОТАМЫ",
        "prohibited_areas": {"title": "Запретные зоны", "description": "Постоянно действующие зоны ограничений, опубликованные в АИП (ARINC)"},
        "restricted_areas_active": {"title": "Активные зоны ограничений", "description": "Активные в текущий момент зоны ограничений, опубликованные в АИП. Активация может происходить по заданному в АИП расписанию, по НОТАМ, по Бюллетеню доступности"},
        "danger_areas_active":  {"title": "Активные опасные зоны", "description": "Активные в текущий момент зоны ограничений, опубликованные в АИП. Активация может происходить по заданному в АИП расписанию, по НОТАМ, по Бюллетеню доступности"},
        "notams_active": {"title": "Активные временные зоны ограничений", "description": "Зоны ограничений опубликованные НОТАМ. Отображаются в период действия НОТАМ"},
        "notams_error_active": {"title": "Активные неразобранные НОТАМ", "description": "Круги НОТАМ об установлении зон ограничений, которые не были разобраны. Отображаются в период действия НОТАМ"},
        "restricted_areas_inactive": "Неактивные зоны ограничений",
        "danger_areas_inactive": "Неактивные опасные зоны",
        "notams_inactive": {"title": "Неактивные временные зоны ограничений", "description": "Зоны ограничений опубликованные НОТАМ, но не вступившие в действие"},
        "notams_error_inactive": {"title": "Неактивные неразобранные НОТАМ", "description": "Круги НОТАМ об установлении зон ограничений, которые не были разобраны, не вступившие в действие"}
      },
      "en-US": {
        "notams": "Notams",
        "prohibited_areas": {"title": "Prohibited Areas", "description": "Permanently established restricted areas published in AIP (ARINC)"},
        "restricted_areas_active": {"title": "Active Restricted Areas", "description": "Restricted areas that are currently active, as published in the AIP. Activation can occur according to the schedule specified in the AIP, by NOTAM, or by the Availability Bulletin"},
        "danger_areas_active": {"title": "Active Danger Areas", "description": "Danger areas that are currently active, as published in the AIP. Activation can occur according to the schedule specified in the AIP, by NOTAM, or by the Availability Bulletin"},
        "notams_active": {"title": "Active Temporary Restricted Areas", "description": "Restricted areas published by NOTAM. Displayed for the duration of the NOTAM's validity"},
        "notams_error_active": {"title": "Active Unprocessed NOTAM Areas", "description": "NOTAM circles for the establishment of restricted areas that could not be parsed. Displayed for the duration of the NOTAM's validity"},
        "restricted_areas_inactive": "Inactive Restricted Areas",
        "danger_areas_inactive": "Inactive Danger Areas",
        "notams_inactive": {"title": "Inactive Temporary Restricted Areas", "description": "Restricted areas published by NOTAM that have not yet become active"},
        "notams_error_inactive": {"title": "Inactive Unprocessed NOTAM Areas", "description": "NOTAM circles for the establishment of restricted areas that could not be parsed and are not yet active"}
      }
    }
  },
  "sources": {
    "notams": { "type": "vector", "url": "https://tiles.notam-cloud.ru/sources/notams" },
    "restricted_areas": { "type": "vector", "url": "https://tiles.notam-cloud.ru/sources/restricted_areas" }
  },
  "sprite": "https://tiles.notam-cloud.ru/sprite/base",
  "glyphs": "https://tiles.notam-cloud.ru/font/{fontstack}/{range}",
  "layers": [
    {
      "metadata": { "filter_id": "prohibited_areas" ,"tooltip": "Zone: {properties.name}"},
      "id": "prohibited_areas_fill",
      "type": "fill",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["==", "status", "active"], ["==", "reason_type", "permanent"] ],
      "paint": { "fill-color": "rgba(170, 0, 0, 0.2)"}
    },
    {
      "metadata": { "filter_id": "prohibited_areas" },
      "id": "prohibited_areas_line",
      "type": "line",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["==", "status", "active"], ["==", "reason_type", "permanent"] ],
      "paint": {"line-color": "rgba(128, 30, 30, 0.32)"}
    },
    {
      "metadata": { "filter_id": "restricted_areas_active" ,"tooltip": "Zone: {properties.name}<br/>NOTAM: {properties.notam_num}"},
      "id": "restricted_areas_active_fill",
      "type": "fill",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all", ["==", "status", "active"], ["!=", "type", "D"], ["any", ["==", "reason_type", "notam"], ["==", "reason_type", "tra_bulletin"]] ],
      "paint": { "fill-color": "rgba(178, 0, 255, 0.2)"}
    },
    {
      "metadata": { "filter_id": "restricted_areas_active" },
      "id": "restricted_areas_active_line",
      "type": "line",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all", ["==", "status", "active"], ["!=", "type", "D"], ["any", ["==", "reason_type", "notam"], ["==", "reason_type", "tra_bulletin"]] ],
      "paint": {"line-color": "rgba(178, 0, 255, 1)"}
    },
    {
      "metadata": { "filter_id": "danger_areas_active" ,"tooltip": "Zone: {properties.name}<br/>NOTAM: {properties.notam_num}"},
      "id": "danger_areas_active_fill",
      "type": "fill",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all", ["==", "status", "active"], ["==", "type", "D"], ["any", ["==", "reason_type", "notam"], ["==", "reason_type", "tra_bulletin"]] ],
      "paint": { "fill-color": "rgba(241, 118, 23, 0.2)"}
    },
    {
      "metadata": { "filter_id": "danger_areas_active" },
      "id": "danger_areas_active_line",
      "type": "line",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all", ["==", "status", "active"], ["==", "type", "D"], ["any", ["==", "reason_type", "notam"], ["==", "reason_type", "tra_bulletin"]] ],
      "paint": {"line-color": "rgba(241, 118, 23, 1)"}
    },
    {
      "metadata": { "filter_id": "restricted_areas_inactive","tooltip": "Zone: {properties.name}" },
      "id": "restricted_areas_inactive_fill",
      "type": "fill",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["!=", "status", "active"], ["!=", "type", "D"] ],
      "paint": { "fill-color": "rgba(144, 151, 153, 0.2)"}
    },
    {
      "metadata": { "filter_id": "restricted_areas_inactive" },
      "id": "restricted_areas_inactive_line",
      "type": "line",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["!=", "status", "active"], ["!=", "type", "D"] ],
      "paint": {"line-color": "rgba(144, 151, 153, 1)"}
    },
    {
      "metadata": { "filter_id": "danger_areas_inactive","tooltip": "Zone: {properties.name}" },
      "id": "danger_areas_inactive_fill",
      "type": "fill",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["!=", "status", "active"], ["==", "type", "D"] ],
      "paint": { "fill-color": "rgba(144, 151, 153, 0.2)"}
    },
    {
      "metadata": { "filter_id": "danger_areas_inactive" },
      "id": "danger_areas_inactive_line",
      "type": "line",
      "source": "restricted_areas",
      "source-layer": "restricted_areas",
      "filter": ["all",["!=", "status", "active"], ["==", "type", "D"] ],
      "paint": {"line-color": "rgba(144, 151, 153, 1)"}
    },
    {
      "metadata": { "filter_id": "notams_active" },
      "id": "notams_active_names",
      "type": "symbol",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all",["==", "active", true], ["==", "deferred", false], ["==", "error", false] ],
      "layout": {
        "text-font": [ "TitilliumWeb-Regular" ],
        "text-field": "{notam_num}",
        "visibility": "none",
        "text-size": 10
      },
      "paint": { "text-color": "rgba(170, 0, 0, 1)" }
    },
    {
      "metadata": { "filter_id": "notams_active" },
      "id": "notams_active_line",
      "type": "line",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all",["==", "active", true], ["==", "deferred", false], ["==", "error", false] ],
      "paint": {
        "line-color": "rgba(128, 30, 30, 0.32)"
      }
    },
    {
      "metadata": { "filter_id": "notams_active" },
      "id": "notams_active_fill",
      "type": "fill",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all",["==", "active", true], ["==", "deferred", false], ["==", "error", false] ],
      "paint": {
        "fill-color": "rgba(235, 0, 0, 0.16)"
      }
    },
    {
      "metadata": { "filter_id": "notams_inactive" },
      "id": "notams_inactive_fill",
      "type": "fill",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", false], ["==", "deferred", true] ],
      "paint": {
        "fill-color": "rgba(151, 151, 151, 0.16)"
      }
    },
    {
      "metadata": { "filter_id": "notams_inactive" },
      "id": "notam_inactive_names",
      "type": "symbol",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", false], ["==", "deferred", true] ],
      "layout": {
        "text-font": [ "TitilliumWeb-Regular" ],
        "text-field": "{notam_num}",
        "visibility": "none",
        "text-size": 10
      },
      "paint": { "text-color": "rgba(81, 72, 72, 1)" }
    },
    {
      "metadata": { "filter_id": "notams_inactive" },
      "id": "notams_inactive_line",
      "type": "line",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", false], ["==", "deferred", true] ],
      "paint": {
        "line-color": "rgba(101, 94, 94, 0.32)"
      }
    },
    {
      "metadata": { "filter_id": "notams_error_active"},
      "id": "notams_error_active_fill",
      "type": "fill",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", false] ],
      "paint": {
        "fill-color": "rgba(19, 205, 223, 0.16)"
      }
    },
    {
      "metadata": { "filter_id": "notams_error_active" },
      "id": "notams_error_active_names",
      "type": "symbol",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", false] ],
      "layout": {
        "text-font": [ "TitilliumWeb-Regular" ],
        "text-field": "{notam_num}",
        "visibility": "none",
        "text-size": 10
      },
      "paint": { "text-color": "rgba(0, 146, 161, 1)" }
    },
    {
      "metadata": { "filter_id": "notams_error_active" },
      "id": "notams_error_active_line",
      "type": "line",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", false] ],
      "paint": {
        "line-color": "rgba(19, 115, 124, 0.32)"
      }
    },
    {
      "metadata": { "filter_id": "notams_error_inactive"},
      "id": "notams_error_inactive_fill",
      "type": "fill",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", true] ],
      "paint": {
        "fill-color": "rgba(151, 151, 151, 0.16)"
      }
    },
    {
      "metadata": { "filter_id": "notams_error_inactive" },
      "id": "notams_error_inactive_names",
      "type": "symbol",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", true] ],
      "layout": {
        "text-font": [ "TitilliumWeb-Regular" ],
        "text-field": "{notam_num}",
        "visibility": "none",
        "text-size": 10
      },
      "paint": { "text-color": "rgba(81, 72, 72, 1)" }
    },
    {
      "metadata": { "filter_id": "notams_error_inactive" },
      "id": "notams_error_inactive_line",
      "type": "line",
      "source": "notams",
      "source-layer": "notams",
      "filter": ["all", ["==", "error", true], ["==", "deferred", true] ],
      "paint": {
        "line-color": "rgba(101, 94, 94, 0.32)"
      }
    },
    {
      "id": "notams_fill_hover",
      "type": "fill",
      "source": "notams",
      "source-layer": "notams",
      "paint": {
        "fill-color": [
          "case",
          ["boolean", ["feature-state", "hover"], false],
          "rgba(0, 182, 255, 0.65)",
          "transparent"
        ]
      }
    }
  ]
}
