@maptoolkit/maplibre-logo-control
v1.0.0
Published
A MapLibre GL JS control plugin that adds a maptoolkit logo link to the map.
Readme
maplibre-logo-control
A MapLibre GL JS control plugin that adds a maptoolkit logo link to the map.
Install
npm install @maptoolkit/maplibre-logo-control maplibre-glUsage
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.
