npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

maplibre-gl-overview-map

v1.0.5

Published

An overview map plugin for mapligre-gl-js.

Downloads

1

Readme

maplibre-gl-overview-map

npm GitHub GitHub Workflow Status (with event)

The maplibre-gl-overview-map plugin is designed to provide users with a high-level spatial perspective when working with Maplibre GL JS. This feature allows you to include a simplified, smaller-scale map alongside your primary map, offering valuable context and aiding in navigation.

Live example

Table of Contents

Installation

npm install maplibre-gl-overview-map

Usage

When using modules

import { Map } from 'maplibre-gl'
import 'maplibre-gl/dist/maplibre-gl.css'

import OverviewMapControl from 'maplibre-gl-overview-map'
import 'maplibre-gl-overview-map/dist/maplibre-gl-overview-map.css'

When using a CDN

<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl-overview-map.umd.js"></script>
<link
  href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css"
  rel="stylesheet"
/>
<link
  href="https://unpkg.com/[email protected]/dist/maplibre-gl-overview-map.css"
  rel="stylesheet"
/>

Example Usage

let map = new Map({
  container: 'map',
  style: 'https://yuchuntsao.github.io/simple-vector-tiles/style.json',
  center: [0, 0],
  zoom: 4
})

map.addControl(new OverviewMapControl())

Live example | code

If you want to customize the overview map control, you can see the custom example or read the document about options.

Options

All of the following options are optional.

| Attribute | Type | Default | Description | | --------------- | ------------------------------ | ---------------------------- | ------------------------------------------------------------------------------------------- | | mapContainerId | string | 'maplibre-gl-overview-map' | The map id for overview map container. | | mapStyle | StyleSpecification \| string | '' | The style for overview map. If the mapStyle is empty, it will use the style of primary map. | | zoomOffset | number | 4 | The zoom level offset between primary map and overview map. | | customClassName | string | '' | You can specific custom css style for the container of control. See custom example. | | allowRotate | Boolean | true | Allow the overview map can rotate when the primary map rotated. | | box | object | Box | The option is a object about the source, layer and style of the box on the overview map. |

Box Options

| Attribute | Type | Default | Description | | -------------- | -------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | sourceName | string | maplibre-gl-overview-map-box-source | The box source name. | | outlineLayerId | string | maplibre-gl-overview-map-box-outline-layer | The box outline layer id. | | fillLayerId | string | maplibre-gl-overview-map-box-fill-layer | The box fill layer id. | | fillStyle | object | {'fill-color': 'red','fill-opacity': 0.1} | The style of the fill layer. You can override the default style with MapLibre Style Spec. | | outlineStyle | object | {'line-color': 'red','line-width': 1.5,'line-opacity': 0.5} | The style of the outline layer. You can override the default style with MapLibre Style Spec. |

Development

pnpm install
pnpm run dev

Build

Build library

pnpm run release

Build example

pnpm run build

License

This plugin is open-source and released under the MIT License.