Skip to content

About

A MapLibre GL JS control plugin that adds a maptoolkit logo link to the map.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

maplibre-logo-control

License Version Downloads

A MapLibre GL JS control plugin that adds a maptoolkit logo link to the map.

Live demo

Install

npm install @maptoolkit/maplibre-logo-control maplibre-gl

Usage

import * as maplibregl from "maplibre-gl";
import { LogoControl } from "@maptoolkit/maplibre-logo-control";
import "@maptoolkit/maplibre-logo-control/style.css";

const map = new maplibregl.Map({ container: "map", style, center, zoom });
map.addControl(new LogoControl());

By default the control is placed in the bottom-left corner; pass a position to addControl to change that:

map.addControl(new LogoControl(), "bottom-right");

Without a bundler

The package is ESM-only (no UMD/CJS build). Loading it straight from a CDN via a <script> tag works with an import map to resolve the bare maplibre-gl specifier:

<link href="https://unpkg.com/maplibre-gl@^6.0.0/dist/maplibre-gl.css" rel="stylesheet" />
<link href="https://unpkg.com/@maptoolkit/maplibre-logo-control@^1.0.0/dist/maplibre-logo-control.css" rel="stylesheet" />

<script type="importmap">
  {
    "imports": {
      "maplibre-gl": "https://unpkg.com/maplibre-gl@^6.0.0/dist/maplibre-gl.mjs"
    }
  }
</script>
<script type="module">
  import * as maplibregl from "maplibre-gl";
  import { LogoControl } from "https://unpkg.com/@maptoolkit/maplibre-logo-control@^1.0.0/dist/maplibre-logo-control.js";

  const map = new maplibregl.Map({ container: "map", style, center, zoom });
  map.addControl(new LogoControl());
</script>

License

maplibre-logo-control is open-source under the BSD 3-Clause License.

About

A MapLibre GL JS control plugin that adds a maptoolkit logo link to the map.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages