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



local texturesPath = asset.syncedResource({
  Type = "HttpSynchronization",
  Name = "Titan textures",
  Identifier = "titan_textures",
  Version = 2
})


local Layer = {
  Identifier = "Cassini_ISS_Global_Mosaic_4km_Local",
  Name = "Cassini ISS Global Mosaic 4km",
  Enabled = asset.enabled,
  FilePath = texturesPath .. "Titan_ISS_P19658_Mosaic_Global_4km_os.tif",
  Description = [[This global digital map of Saturn's moon Titan was created using
    images taken by the Cassini spacecraft's Imaging Science Subsystem (ISS). The map
    was produced in June 2015 using data collected through Cassini's flyby on April 7,
    2014, known as "T100". The mean radius of Titan used for projection of this map is
    1,600 miles (2,575 kilometers). Pixel resolution is 4005 meters per pixel (m).
    Titan is assumed to be spherical until a control network -- a model of the moon's
    shape based on multiple images tied together at defined points on the surface --
    is created at some point in the future. (Description from URL)]]
}


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

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

asset.export("layer", Layer)



asset.meta = {
  Name = "Cassini ISS Global Mosaic",
  Version = "1.1",
  Description = "Cassini global image layer for Titan",
  Author = "USGS",
  URL = "https://astrogeology.usgs.gov/search/map/Titan/Cassini/Global-Mosaic/" ..
    "Titan_ISS_P19658_Mosaic_Global_4km",
  License = "NASA/PDS"
}
