Skip to content

qazsato/maplibre-gl-logo

Repository files navigation

maplibre-gl-logo

A customizable logo control for MapLibre GL JS.

This plugin provides a customizable logo control inspired by the built-in LogoControl of MapLibre GL JS.
It allows you to display your own logo (e.g., a company or product logo) on the map.

Installation

npm install maplibre-gl-logo

Usage

import { Map } from "maplibre-gl";
import "maplibre-gl/dist/maplibre-gl.css";
import { CustomLogoControl } from "maplibre-gl-logo";

const map = new Map({
  /* YOUR_MAP_OPTIONS */
});

map.addControl(
  new CustomLogoControl({
    logo: "YOUR_IMAGE_URL",
    href: "YOUR_SITE_URL",
  }),
);

Options

Name Required Default Description
logo Yes - The src attribute for the <img>.
href Yes - The href attribute for the <a>.
width No - The width attribute for the <img>.
height No - The height attribute for the <img>.
alt No - The alt attribute for the <img>.
target No "_blank" The target attribute for the <a>.
rel No "noopener nofollow" The rel attribute for the <a>.

License

This project is licensed under the terms of the MIT license.

About

A customizable logo control for MapLibre GL JS.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors