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.
Construct a Layer of
typeforfim.typeis normally a registry string ('vector', 'raster', …), but a bare source works too: pass a Dataset (or anything else) in thetypeslot 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 fromopts.source/opts.sources[0]'sDataset.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.