MaplibreInspectOptions: {
    assignLayerColor?: ((layerId, alpha) => string);
    backgroundColor?: string;
    blockHoverPopupOnClick?: boolean;
    buildInspectStyle?: ((originalMapStyle, coloredLayers, opts) => StyleSpecification);
    popup?: Popup;
    queryParameters?: QueryRenderedFeaturesOptions;
    renderPopup?: ((features) => string | HTMLElement);
    selectThreshold?: number;
    showInspectButton?: boolean;
    showInspectMap?: boolean;
    showInspectMapPopup?: boolean;
    showInspectMapPopupOnHover?: boolean;
    showMapPopup?: boolean;
    showMapPopupOnHover?: boolean;
    sources?: {
        [key: string]: string[];
    };
    toggleCallback?: ((showInspectMap) => void);
    useInspectStyle?: boolean;
}

This is the main type for the available options for MapLibre Inspect

Type declaration

  • Optional assignLayerColor?: ((layerId, alpha) => string)
      • (layerId, alpha): string
      • Parameters

        • layerId: string
        • alpha: number

        Returns string

  • Optional backgroundColor?: string

    Background color for the inspect map

    Default

    '#fff'
    
  • Optional blockHoverPopupOnClick?: boolean

    Block hover popup on click

    Default

    false
    
  • Optional buildInspectStyle?: ((originalMapStyle, coloredLayers, opts) => StyleSpecification)
      • (originalMapStyle, coloredLayers, opts): StyleSpecification
      • Parameters

        • originalMapStyle: StyleSpecification
        • coloredLayers: LayerSpecification[]
        • opts: {
              backgroundColor?: string;
          }
          • Optional backgroundColor?: string

        Returns StyleSpecification

  • Optional popup?: Popup

    Maplibre GL Popup

  • Optional queryParameters?: QueryRenderedFeaturesOptions

    Query parameters for querying rendered features

  • Optional renderPopup?: ((features) => string | HTMLElement)
  • Optional selectThreshold?: number

    Select threshold

    Default

    5
    
  • Optional showInspectButton?: boolean

    Show the inspect button

    Default

    true
    
  • Optional showInspectMap?: boolean

    Show the inspect map

    Default

    false
    
  • Optional showInspectMapPopup?: boolean

    Show the inspect map popup

    Default

    true
    
  • Optional showInspectMapPopupOnHover?: boolean

    Show the inspect map popup on hover

    Default

    true
    
  • Optional showMapPopup?: boolean

    Show the map popup

    Default

    false
    
  • Optional showMapPopupOnHover?: boolean

    Show the map popup on hover

    Default

    true
    
  • Optional sources?: {
        [key: string]: string[];
    }

    Sources to be used for inspecting, setting this will disable the automatic source detection. This is a dictionary containing the source IDs and their vector layer IDs

    • [key: string]: string[]
  • Optional toggleCallback?: ((showInspectMap) => void)

    Callback for toggling the inspect map

      • (showInspectMap): void
      • Parameters

        • showInspectMap: boolean

        Returns void

  • Optional useInspectStyle?: boolean

    Use inspect style

    Default

    true