FIMViz.jsAPI
    Preparing search index...

    Function createLayer

    • Construct a Layer of type for fim. type is normally a registry string ('vector', 'raster', …), but a bare source works too: pass a Dataset (or anything else) in the type slot and it is treated as { source: type }fim.addLayer(ds) needs no type argument at all. Either way, when a type ends up unresolved it is inferred from opts.source/opts.sources[0]'s Dataset.kind ('raster'|'vector') — only when there is EXACTLY one source, since a multi-source type (comparison/ensemble) can't be guessed. Throws a clear error if a type can't be resolved, or if the resolved type has no registered factory.

      Parameters

      • fim: FimMap
      • Optionaltype: any

        a registry name, OR a bare source (Dataset) to infer from

      • Optionalopts: any = {}

      Returns Layer | Promise<Layer>