https://github.com/aesqe/mapboxgl-minimap
Mapbox GL minimap control
https://github.com/aesqe/mapboxgl-minimap
mapbox mapbox-gl-js minimap
Last synced: 3 months ago
JSON representation
Mapbox GL minimap control
- Host: GitHub
- URL: https://github.com/aesqe/mapboxgl-minimap
- Owner: aesqe
- License: mit
- Created: 2016-05-31T21:31:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T23:42:52.000Z (over 1 year ago)
- Last Synced: 2024-12-30T18:06:10.841Z (4 months ago)
- Topics: mapbox, mapbox-gl-js, minimap
- Language: JavaScript
- Size: 18.6 KB
- Stars: 80
- Watchers: 6
- Forks: 27
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-maplibre - mapboxgl-minimap - Adds a control to show a miniature overview of the current map. (User Interface Plugins / JavaScript)
README
# Mapbox GL Minimap Control

## Demo
[Demo on GitHub pages](http://aesqe.github.io/mapboxgl-minimap/)**--- work in progress; overall performance can probably be improved ---**
## How to use it
```javascript
var map = new mapboxgl.Map({
container: "map",
style: "mapbox://styles/mapbox/streets-v8",
center: [-73.94656812952897, 40.72912351406106],
zoom: 7
});map.on("style.load", function () {
// Possible position values are 'bottom-left', 'bottom-right', 'top-left', 'top-right'
map.addControl(new mapboxgl.Minimap(), 'top-right');
});
```## Options
```javascript
{
id: "mapboxgl-minimap",
width: "320px",
height: "180px",
style: "mapbox://styles/mapbox/streets-v8",
center: [0, 0],
zoom: 6,// should be a function; will be bound to Minimap
zoomAdjust: null,// if parent map zoom >= 18 and minimap zoom >= 14, set minimap zoom to 16
zoomLevels: [
[18, 14, 16],
[16, 12, 14],
[14, 10, 12],
[12, 8, 10],
[10, 6, 8]
],lineColor: "#08F",
lineWidth: 1,
lineOpacity: 1,fillColor: "#F80",
fillOpacity: 0.25,dragPan: false,
scrollZoom: false,
boxZoom: false,
dragRotate: false,
keyboard: false,
doubleClickZoom: false,
touchZoomRotate: false
}
```## Compatibility
The latest version should be compatible with maboxgl 0.54.0