GeoLeaf Core API - v3.19.0
    Preparing search index...

    A change to a layer's features, expressed as what MOVED rather than as the resulting collection — the input of IMapAdapter.applyDataDiff.

    Applied in the order removeAll → remove → add → update. The order is part of the contract, not an implementation detail: it is what lets a single diff express an id change (remove the old, add the new) and what makes an update on a feature added by the same diff meaningful.

    🛑 Every feature named here must carry a UNIQUE, RESOLVABLE id — an engine addresses a feature by id and by nothing else. A diff naming a feature the layer cannot identify is not an error the caller will be told about; it is a feature silently skipped. Deciding eligibility BEFORE building a diff is therefore the caller's job, and GeoJSONCore is where that decision lives.

    ⚠️ Declared here rather than imported from the engine, deliberately. A type-only import of MapLibre's own diff type is permitted by the lint rules (allowTypeImports), so this is not a rule being obeyed — it is ADR-01 one level up. IMapAdapter is the seam that makes the engine replaceable; typing one of its parameters with an engine type would make the SHAPE of the seam depend on that engine's .d.ts, and would oblige any second adapter to satisfy MapLibre's type. The translation belongs in the adapter, which is the only place that knows an engine at all.

    interface LayerDataDiff {
        removeAll?: boolean;
        remove?: readonly (string | number)[];
        add?: readonly Feature<Geometry, GeoJsonProperties>[];
        update?: readonly LayerFeatureDiff[];
    }
    Index
    removeAll?: boolean

    Removes every feature. Mutually exclusive in practice with the fields below.

    remove?: readonly (string | number)[]

    Ids of features to remove.

    add?: readonly Feature<Geometry, GeoJsonProperties>[]

    Whole features to add.

    update?: readonly LayerFeatureDiff[]

    In-place changes to features already present.