Svelte Maplibre

API / Controls

ControlButton

Show a button with the styling of the built-in MapLibre control buttons. Use it inside a ControlGroup.

When icon is true, the content gets the maplibregl-ctrl-icon class. When center is true, the content is centered inside the button. Use onclick to handle clicks.

import { ControlButton } from 'svelte-maplibre';

Examples

Props

  • icon boolean

    Default: true

    True if this is an icon button. This will both enable the built-in MapLibre icon button styling and center the element inside the button.

  • center boolean

    Default: true

  • title string
  • class string
  • children Snippet
  • onclick (e: MouseEvent) => void

Source: src/lib/ControlButton.svelte