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

    Variable GeoJSONCoreConst

    GeoJSONCore: {
        get _map(): GeoJSONNativeMap | null;
        get _layers(): Map<string, GeoJSONLayerEntry>;
        get _options(): Record<string, unknown>;
        get 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;
            };
        };
        STYLE_OPERATORS: Record<string, (a: unknown, b: unknown) => boolean>;
        evaluateStyleCondition: (
            featureOrLeft: unknown,
            conditionOrOp: string | StyleConditionInput,
            rightValue?: unknown,
        ) => boolean;
        getFeatureProperty: (feature: unknown, key: unknown) => unknown;
        getGeometryType: (feature: unknown) => string | null;
        isPointGeometry: (feature: unknown) => boolean;
        isLineGeometry: (feature: unknown) => boolean;
        isPolygonGeometry: (feature: unknown) => boolean;
        validateFeature: (
            ...args: [feature: unknown, index?: number],
        ) => { valid: boolean; errors: string[] };
        validateFeatureCollection: (
            collection: unknown,
            ...rest: unknown[],
        ) => { valid: boolean; errors: string[]; featureCount: number };
        extractCoordinates: (feature: unknown) => [number, number][] | null;
        calculateBounds: (
            features?: unknown[],
        ) => [[number, number], [number, number]] | null;
        init(options?: GeoJSONInitOptions): unknown;
        getLayerById(layerId: string): GeoJSONLayerEntry | null;
        getLayerConfig(layerId: string): GeoJSONLayerDef | null;
        getLayerData(layerId: string): unknown;
        updateLayerData(layerId: string, data: unknown): void;
        getAllLayers(): unknown[];
        showLayer(layerId: string): void;
        hideLayer(layerId: string): void;
        toggleLayer(layerId: string): void;
        removeLayer(layerId: string): void;
        setLayerStyle(layerId: string, styleConfig: unknown): boolean;
        loadFromActiveProfile(
            options?: Record<string, unknown>,
        ): Promise<unknown[]>;
        filterFeatures(
            filterFn: (feature: GeoJSONFeature, layerId: string) => boolean,
            options?: { layerIds?: string | string[]; geometryType?: string },
        ): { filtered: number; total: number; visible: number };
        clearFeatureFilter(
            options?: { layerIds?: string | string[]; geometryType?: string },
        ): { filtered: number; total: number; visible: number };
        getFeatures(
            options?: { geometryTypes?: string[]; layerIds?: string[] },
        ): TaggedFeature[];
        _updateLayerVisibilityByZoom(): void;
        _registerWithLayerManager(): void;
        _detectLayerType(layer: unknown): string;
    } = GeoJSONModule

    Type Declaration

    • get _map(): GeoJSONNativeMap | null

      Getters for direct state access (compatibility)

    • get _layers(): Map<string, GeoJSONLayerEntry>
    • get _options(): Record<string, unknown>
    • get 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;
          };
      }
    • STYLE_OPERATORS: Record<string, (a: unknown, b: unknown) => boolean>
    • evaluateStyleCondition: (
          featureOrLeft: unknown,
          conditionOrOp: string | StyleConditionInput,
          rightValue?: unknown,
      ) => boolean
    • getFeatureProperty: (feature: unknown, key: unknown) => unknown
    • getGeometryType: (feature: unknown) => string | null
    • isPointGeometry: (feature: unknown) => boolean
    • isLineGeometry: (feature: unknown) => boolean
    • isPolygonGeometry: (feature: unknown) => boolean
    • validateFeature: (
          ...args: [feature: unknown, index?: number],
      ) => { valid: boolean; errors: string[] }
    • validateFeatureCollection: (
          collection: unknown,
          ...rest: unknown[],
      ) => { valid: boolean; errors: string[]; featureCount: number }
    • extractCoordinates: (feature: unknown) => [number, number][] | null
    • calculateBounds: (features?: unknown[]) => [[number, number], [number, number]] | null
    • init: function
      • Initialise the module GeoJSON.

        Parameters

        • options: GeoJSONInitOptions = {}

          Options accepted by GeoJSONCore.init().

          • [key: string]: unknown
          • Optionalmap?: unknown

            Map instance or adapter. Falls back to GeoLeaf.Core.getMap() when absent.

          • OptionaldefaultStyle?: Record<string, unknown> | GeoJSONStyle
          • OptionaldefaultPointStyle?: Record<string, unknown>
          • OptionalonEachFeature?: (feature: GeoJSONFeature, layer: unknown) => void
          • OptionalpointToLayer?: (feature: GeoJSONFeature, latlng: unknown) => unknown
          • OptionalfitBoundsOnLoad?: boolean
          • OptionalmaxZoomOnFit?: number

        Returns unknown

        • The GeoJSON layer or null on failure.
    • getLayerById: function
    • getLayerConfig: function
      • Returns a loaded layer's authored config object (the layer definition stored on its runtime entry), or null when the layer is unknown.

        Runtime read seam for capability plugins (e.g. @geoleaf-plugins/feature-info) that need per-layer config at click/hover time. This is config passthrough (plumbing), not rendering: the kernel exposes the already-loaded config, the plugin interprets it. Reads the shared state directly (same source as the POI config resolution) so it works regardless of layer-manager wiring.

        Parameters

        • layerId: string

          GeoLeaf layer id.

        Returns GeoJSONLayerDef | null

    • getLayerData: function
    • updateLayerData: function
      • Replaces the GeoJSON data of an existing layer in real time.

        Updates both the MapLibre source (source.setData()) and the in-memory state so that subsequent getLayerData() calls return the fresh data.

        Parameters

        • layerId: string

          ID of the layer to update.

        • data: unknown

          GeoJSON FeatureCollection (or any valid GeoJSON) to set.

        Returns void

    • getAllLayers: function
    • showLayer: function
    • hideLayer: function
    • toggleLayer: function
    • removeLayer: function
    • setLayerStyle: function
      • Parameters

        • layerId: string
        • styleConfig: unknown

        Returns boolean

    • loadFromActiveProfile: function
      • Parameters

        • options: Record<string, unknown> = {}

        Returns Promise<unknown[]>

    • filterFeatures: function
      • Filters the features of every GeoJSON layer. Shows only features that pass the predicate.

        The predicate runs in JS (so arbitrary logic — substring search, distance, nested fields — is supported), but the resulting visible set is applied on the GPU via map.setFilter on feature ids (no source re-tiling) for non-clustered layers with unique properties.id; clustered / id-less layers fall back to re-feeding the filtered data (RM-P1).

        Parameters

        • filterFn: (feature: GeoJSONFeature, layerId: string) => boolean

          Fonction (feature, layerId) => boolean

        • Optionaloptions: { layerIds?: string | string[]; geometryType?: string } = {}

          Additional options

        Returns { filtered: number; total: number; visible: number }

        • { filtered: number, total: number, visible: number }
    • clearFeatureFilter: function
      • Resets the feature filter (shows all).

        Parameters

        • Optionaloptions: { layerIds?: string | string[]; geometryType?: string } = {}

          Same options as filterFeatures

        Returns { filtered: number; total: number; visible: number }

    • getFeatures: function
      • Returns all loaded features. Reads directly from state.layers (featureCache removed in Sprint 1).

        Parameters

        • Optionaloptions: { geometryTypes?: string[]; layerIds?: string[] } = {}

        Returns TaggedFeature[]

        features GeoJSON enrichies de { _layerId }

    • _updateLayerVisibilityByZoom: function
    • _registerWithLayerManager: function
    • _detectLayerType: function