local globe = asset.require("../../earth")



local Name = "Sea Surface Currents"
local Identifier = "noaa-sos-oceans-nasa_speed"
local Description = [[The water in the ocean is constantly moving. Ocean currents are
typically driven by surface wind and can have a huge impact on climate. Northwest Europe
is moderately temperate considering its latitude because the Gulf Stream off of the
eastern coast of the United States transports warm water north to those areas. In fact,
the Atlantic Ocean along the U.S. coast is much warmer than the Pacific Ocean along the
U.S. coast because of the warm water transported in the Gulf Stream. In this
visualization, a model created by NASA, the color variations denote speed. The lighter
green areas are moving faster than the blue areas]]
local URL = "https://sos.noaa.gov/catalog/datasets/sea-surface-currents/"


local syncedDirectory = asset.syncedResource({
  Name = Name,
  Type = "HttpSynchronization",
  Identifier = Identifier,
  Version = 1,
  UnzipFiles = true
})


local Layer = {
  Identifier = Identifier,
  Name = Name,
  Enabled = asset.enabled,
  Type = "ImageSequenceTileLayer",
  FolderPath = syncedDirectory .. "4000",
  Description = Description
}


asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.export(Layer)



asset.meta = {
  Name = Name,
  Version = "1.0",
  Description = Description .. "Data provided by the National Oceanic and Atmospheric Administration",
  Author = "National Oceanic and Atmospheric Administration",
  URL = URL,
  License = "https://sos.noaa.gov/copyright/"
}
