//
//  NavvoMapStyle.swift
//  Navvo Maps SDK for iOS
//

/// The built-in Navvo basemap styles, keyed to the `GET /tiles/styles` catalog.
public enum NavvoMapStyle: String, CaseIterable, Sendable {
    /// The default road map (vector). Catalog id `standard`.
    case standard

    /// A minimal light basemap (vector). Catalog id `positron`.
    case light = "positron"

    /// A night/dark basemap (vector). Catalog id `dark`.
    case dark

    /// Aerial/satellite imagery (raster). Catalog id `satellite`.
    case satellite

    /// Terrain/elevation imagery (raster). Catalog id `terrain`.
    case terrain

    /// 3D building extrusions (vector; supports `terrain: true`). Catalog id `3d`.
    case threeD = "3d"

    /// Whether this style is a raster (imagery) style — tilt is limited on these.
    public var isRaster: Bool {
        self == .satellite || self == .terrain
    }

    /// Resolve a style from a catalog id (accepts the `road` alias).
    /// Unknown ids fall back to ``standard``.
    public static func fromID(_ id: String) -> NavvoMapStyle {
        let normalized = (id == "road") ? "standard" : id
        return NavvoMapStyle(rawValue: normalized) ?? .standard
    }
}
