maplibre-gl-svg-sprite - v0.1.0
    Preparing search index...

    Class SvgUrlBuilder

    Fluent builder class for constructing SVG URLs with method chaining

    const url = new SvgUrlBuilder('marker')
    .size(44, 44)
    .pixelRatio(2)
    .colors({ fg: '#d35400', bg: '#ffffff' })
    .text('EWR', { fontSize: 18, textColor: '#d35400' })
    .build();
    Index

    Constructors

    • Parameters

      • icon: string
      • protocol: string = 'svg'

      Returns SvgUrlBuilder

    Methods

    • Set width and height

      Parameters

      • width: number
      • Optionalheight: number

      Returns this

    • Set pixel ratio for HiDPI displays

      Parameters

      • ratio: number

      Returns this

    • Set foreground and background colors

      Parameters

      • opts: { fg?: string; bg?: string; color?: string }

      Returns this

    • Apply color tint

      Parameters

      • color: string

      Returns this

    • Add text overlay

      Parameters

      Returns this

    • Add SVG overlay

      Parameters

      Returns this

    • Add icon grid

      Parameters

      Returns this

    • Set custom parameter

      Type Parameters

      • K extends
            | (keyof BaseSvgParams)
            | (keyof SvgColorParams)
            | (keyof SpriteTintParams)
            | (keyof OverlayTextParams)
            | (keyof OverlaySvgParams)
            | (keyof OverlayGridParams)

      Parameters

      Returns this

    • Build the final URL

      Returns string