Skip to content
Make with

SolidJS MapLibre GL

Reactive SolidJS bindings for MapLibre GL JS

Maintained by Clifford Klein

solidjs-maplibre-gl provides a comprehensive SolidJS integration for MapLibre GL JS with reactive signals built on top of MapLibre. Features include well-documented examples, a minimally opinionated API suitable for beginners and experienced users, factory functions for custom layers and controls, and components for Sky, FeatureState, and Light.

Quick start

npm install solidjs-maplibre-gl maplibre-gl@5
import type { Component } from 'solid-js';
import { Maplibre } from 'solidjs-maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const App: Component = () => {
  return (
    <Maplibre
      style={{
        height: '400px',
        width: '100%',
      }}
      options={{
        style: 'https://tiles.openfreemap.org/styles/liberty',
        center: [0, 20],
        zoom: 2,
      }}
    />
  );
};

export default App;
Runs this code in your browser, in a new tab.
›Setup noteschecked with v0.1.1

The package depends on maplibre-gl ^5.6.1, so install MapLibre v5 and skip setWorkerUrl. Give the map an explicit height or it renders at zero size. Import maplibre-gl.css so attribution and controls display correctly.

Other platforms are on SDKs.