@tilecloud/mbgl-export-control
[![Build Status](https://travis-ci.org/tilecloud/mbgl-export-control.svg?branch=master)](https://travis-ci.org/tilecloud/mbgl-export-control) [![npm version](https://badge.fury.io/js/%40tilecloud%2Fmbgl-export-control.svg)](https://badge.fury.io/js/%40til
Last updated 6 months ago by miya0001 .
MIT · Original npm · Tarball · package.json
$ cnpm install @tilecloud/mbgl-export-control 
SYNC missed versions from official npm registry.

@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.

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

Current Tags

  • 0.4.2                                ...           latest (6 months ago)

11 Versions

  • 0.4.2                                ...           6 months ago
  • 0.4.1                                ...           2 years ago
  • 0.3.10                                ...           2 years ago
  • 0.3.8                                ...           2 years ago
  • 0.3.7                                ...           2 years ago
  • 0.3.5                                ...           2 years ago
  • 0.3.4                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 5
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |