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

    Variable GeoJSONSharedConst

    GeoJSONShared: {
        state: {
            map: GeoJSONNativeMap | null;
            layerGroup: unknown;
            geoJsonLayer: unknown;
            layers: Map<string, GeoJSONLayerEntry>;
            layerIdCounter: number;
            options: {
                defaultStyle: {
                    color: string;
                    weight: number;
                    opacity: number;
                    fillColor: string;
                    fillOpacity: number;
                };
                defaultPointStyle: {
                    radius: number;
                    color: string;
                    weight: number;
                    fillColor: string;
                    fillOpacity: number;
                };
                onEachFeature: ((feature: unknown, layer: unknown) => void)
                | null;
                pointToLayer: ((feature: unknown, latlng: unknown) => unknown) | null;
                fitBoundsOnLoad: boolean;
                maxZoomOnFit: number;
            };
            adapter: GeoJSONAdapter
            | null;
        };
        STYLE_OPERATORS: Record<string, (a: unknown, b: unknown) => boolean>;
        DEFAULT_STYLES: {
            polygon: {
                color: string;
                weight: number;
                opacity: number;
                fillColor: string;
                fillOpacity: number;
            };
            line: {
                color: string;
                weight: number;
                opacity: number;
                fillColor: string;
                fillOpacity: number;
            };
            point: {
                radius: number;
                color: string;
                weight: number;
                fillColor: string;
                fillOpacity: number;
            };
        };
        reset(): void;
        getLog(): Console | { warn?: (a: string, b?: unknown) => void };
        getLayers(): Map<string, GeoJSONLayerEntry>;
        getLayerById(layerId: string): GeoJSONLayerEntry | undefined;
        setLayerCollection(layerId: string, data: unknown): void;
    } = ...

    Type Declaration

    • state: {
          map: GeoJSONNativeMap | null;
          layerGroup: unknown;
          geoJsonLayer: unknown;
          layers: Map<string, GeoJSONLayerEntry>;
          layerIdCounter: number;
          options: {
              defaultStyle: {
                  color: string;
                  weight: number;
                  opacity: number;
                  fillColor: string;
                  fillOpacity: number;
              };
              defaultPointStyle: {
                  radius: number;
                  color: string;
                  weight: number;
                  fillColor: string;
                  fillOpacity: number;
              };
              onEachFeature: ((feature: unknown, layer: unknown) => void)
              | null;
              pointToLayer: ((feature: unknown, latlng: unknown) => unknown) | null;
              fitBoundsOnLoad: boolean;
              maxZoomOnFit: number;
          };
          adapter: GeoJSONAdapter
          | null;
      }
      • map: GeoJSONNativeMap | null
      • layerGroup: unknown
      • geoJsonLayer: unknown
      • layers: Map<string, GeoJSONLayerEntry>
      • layerIdCounter: number
      • options: {
            defaultStyle: {
                color: string;
                weight: number;
                opacity: number;
                fillColor: string;
                fillOpacity: number;
            };
            defaultPointStyle: {
                radius: number;
                color: string;
                weight: number;
                fillColor: string;
                fillOpacity: number;
            };
            onEachFeature: ((feature: unknown, layer: unknown) => void)
            | null;
            pointToLayer: ((feature: unknown, latlng: unknown) => unknown) | null;
            fitBoundsOnLoad: boolean;
            maxZoomOnFit: number;
        }
      • adapter: GeoJSONAdapter | null

        IMapAdapter instance (set during init).

    • STYLE_OPERATORS: Record<string, (a: unknown, b: unknown) => boolean>

      Comparison operators for conditional style rules — see style-operators.ts.

    • DEFAULT_STYLES: {
          polygon: {
              color: string;
              weight: number;
              opacity: number;
              fillColor: string;
              fillOpacity: number;
          };
          line: {
              color: string;
              weight: number;
              opacity: number;
              fillColor: string;
              fillOpacity: number;
          };
          point: {
              radius: number;
              color: string;
              weight: number;
              fillColor: string;
              fillOpacity: number;
          };
      }

      Default styles for each geometry type (polygon, line, point).

    • reset: function
    • getLog: function
    • getLayers: function
    • getLayerById: function
    • setLayerCollection: function
      • Records, on the layer entry, the collection the map source now holds.

        🛑 THE STORE IS THE TRUTH OF WHAT THE SOURCE CONTAINS, and this function is the one place that says so. Every writer of a whole collection goes through it, so a reader of entry.features never has to ask which of the two is ahead.

        ⚠️ The invariant was not free before, it was merely SELF-HEALING. A writer that fed the source without recording it here left the store stale — and the next setData re-pushed the whole store collection, so the two agreed again (the store winning, the other write lost). That repair disappears the moment a mutation is expressed as a DIFF: the source keeps what it was fed, the store keeps what it had, and the two never re-converge. Measured case: applyOgcRefreshedData fed the source an autoRefresh result straight off the network, which the store never saw.

        🛑 AND IT ANNOUNCES — geoleaf:layer:updated, once per write. What derives from the store (an open table, an active filter) follows the event, and the event used to leave from the calls of GeoLeaf.Layers alone: a real-time tick, an OGC auto-refresh and a host's own GeoLeaf.GeoJSON.updateLayerData rewrote the store unannounced, and both stayed stale until the user's next gesture. Announcing HERE covers every writer of a whole collection by construction — including the ones not written yet.

        ⚠️ What derives a verdict from the collection is invalidated BEFORE the announcement: a listener that mutates the layer synchronously must not read one computed for the collection just replaced.

        Not exported as a free function on purpose — it belongs to the state it writes, beside getLayerById, which is what readers of that state already reach for.

        Parameters

        • layerId: string
        • data: unknown

        Returns void