Home

Awesome

Minimap Plugin for Maplibre-gl Map Engine

This package provides a configurable MiniMap component to use with the MapLibre GL project. It allows you to display a small overview map alongside the main map, with customizable options for size, zoom level, interactions, and styling, making it a flexible tool for enhancing your MapLibre GL applications.

!!!Note: This library is currently in development and not yet ready for production use. Use it at your own risk, and expect potential changes in future releases.!!!

Instructions

$ npm i maplibregl-minimap
import MinimapControl from "maplibregl-minimap";

const miniMapConfig = {
  id: "myCustomMiniMap",
  width: "200px",
  height: "200px",
  zoomLevelOffset: 6,
  interactions: { drag: true, zoom: false },
  initialMinimized: false,
  minimizableMinimap: true,
  collapsedWidth: "30px",
  collapsedHeight: "30px",
  borderRadius: "5px",
};

// after the initilize your map
map.on("load", () => {
  map.control(new MinimapControl(miniMapConfig));
});

MiniMap Configuration

The configuration object for the MiniMap allows you to control its size, visibility, interaction, and style. Below are the available options. It's possible to

Configuration Properties

export type MiniMapConfiguration = Partial<{
  showText: string;
  hideText: string;
}> & {
  id: string;
  width: string;
  height: string;
  zoomLevelOffset: 5 | 6 | 7 | 8;
  interactions: MinimapInteractions;
  initialMinimized: boolean;
  minimizableMinimap: boolean;
  collapsedWidth: string;
  collapsedHeight: string;
  borderRadius: string;
  style: StyleSpecification;
};

Property Descriptions

To-Do/Fix