Skip to content

xiupos/maplibre-gl-sample-control

Repository files navigation

maplibre-gl-sample-control

This is a sample project that shows how to add a Control to MapLibre GL JS. demo

Screenshot

Installation

pnpm add xiupos/maplibre-gl-sample-control

Usege

// Import the plugin
import { SampleControl } from 'maplibre-gl-sample-control';
import 'maplibre-gl-sample-control/dist/style.css';

// const map = new Map({ ... });

map.on('load', () => {
  // Add sample control
  const Sample = new SampleControl({ text: 'Custom text' });
  map.addControl(Sample);
});

Credits

This project is based on the MapLibre GL JS documentation.

License

This project is licensed under the MIT License.

About

Sample project that adds a Control to MapLibre GL JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published