0.4.2 • Published 4 years ago

@tilecloud/mbgl-export-control v0.4.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@tilecloud/mbgl-export-control

Build Status npm version

This is a Mapbox GL JS plugin that allows you to download the map as .png file.

npm.io

Demo

https://geolonia.github.io/mbgl-export-control/

How to install

$ npm install @tilecloud/mbgl-export-control

Then:

import 'babel-polyfill' // For ie11
import ExportControl from '@tilecloud/mbgl-export-control'

const map = new mapboxgl.Map({...});

// Add the control to download png.
map.addControl(new ExportControl());

Options

The constructor of this plugin has some options.

new ExportControl({
  dpi: 300,
  attribution: "© OpenStreetMap Contributors",
})
  • dpi - Optional. Resolution for the png image. The default value is 300.
  • attribution - Optional. The attribution text for map exported with png format.
  • textFont - Optional. An array of text fonts. ["Noto Sans Italic", "..."]. If it is empty, this plugin try to detect font from JSON for the style of the map.

LICENCE

MIT

0.4.2

4 years ago

0.4.1

5 years ago

0.3.10

5 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago