mapbox / makiwich

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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`);
});

About


Languages

Language:JavaScript 100.0%