├── .github
└── FUNDING.yml
├── LICENSE
├── README.md
├── index.html
├── mapboxgl-control-minimap.js
└── package.json
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: https://www.paypal.me/aesqe
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Bruno Babic
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mapbox GL Minimap Control
2 |
3 | 
4 |
5 | ## Demo
6 | [Demo on GitHub pages](http://aesqe.github.io/mapboxgl-minimap/)
7 |
8 | **--- work in progress; overall performance can probably be improved ---**
9 |
10 | ## How to use it
11 |
12 | ```javascript
13 | var map = new mapboxgl.Map({
14 | container: "map",
15 | style: "mapbox://styles/mapbox/streets-v8",
16 | center: [-73.94656812952897, 40.72912351406106],
17 | zoom: 7
18 | });
19 |
20 | map.on("style.load", function () {
21 | // Possible position values are 'bottom-left', 'bottom-right', 'top-left', 'top-right'
22 | map.addControl(new mapboxgl.Minimap(), 'top-right');
23 | });
24 | ```
25 |
26 | ## Options
27 |
28 | ```javascript
29 | {
30 | id: "mapboxgl-minimap",
31 | width: "320px",
32 | height: "180px",
33 | style: "mapbox://styles/mapbox/streets-v8",
34 | center: [0, 0],
35 | zoom: 6,
36 |
37 | // should be a function; will be bound to Minimap
38 | zoomAdjust: null,
39 |
40 | // if parent map zoom >= 18 and minimap zoom >= 14, set minimap zoom to 16
41 | zoomLevels: [
42 | [18, 14, 16],
43 | [16, 12, 14],
44 | [14, 10, 12],
45 | [12, 8, 10],
46 | [10, 6, 8]
47 | ],
48 |
49 | lineColor: "#08F",
50 | lineWidth: 1,
51 | lineOpacity: 1,
52 |
53 | fillColor: "#F80",
54 | fillOpacity: 0.25,
55 |
56 | dragPan: false,
57 | scrollZoom: false,
58 | boxZoom: false,
59 | dragRotate: false,
60 | keyboard: false,
61 | doubleClickZoom: false,
62 | touchZoomRotate: false
63 | }
64 | ```
65 |
66 | ## Compatibility
67 |
68 | The latest version should be compatible with maboxgl 0.54.0
69 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |