@mapbox/makiwich

0.0.13 • Public • Published

Makiwich

Composites Maki icons with a map marker and returns an SVG.

Install

npm install @mapbox/makiwich --save

Usage

var makiwich = require('@mapbox/makiwich');
var mapnik = require('mapnik');

makiwich.generateMarker({
    tint: '#454545',
    symbol: 'zoo', // Valid Maki v2.1.0 icon
    size: 'l' // `s` or `l`
}, (err, svg) => {
    if (err) throw err;

    // Use mapnik to convert the SVG to a PNG and save it
    var s = new mapnik.Image.fromSVGBytesSync(new Buffer(svg), { scale: 2 });
    s.premultiplySync();
    s.saveSync(`zoo.png`);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @mapbox/makiwich

Weekly Downloads

12

Version

0.0.13

License

ISC

Unpacked Size

165 kB

Total Files

12

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user