index.js
function loadMaki(options, callback) {
    var base = options.base + '-' + options.size + (options.retina ? '@2x' : ''),
        size = options.size,
        symbol = options.symbol + '-' + sizes[size] + (options.retina ? '@2x' : '');

    if (!base || !size) {
        return callback(errcode('Marker is invalid because it lacks base or size.', 'EINVALID'));
    }

    if (!makiAvailable[symbol]) {
        return callback(errcode('Marker symbol "' + options.symbol + '" is invalid.', 'EINVALID'));
    }

    fs.readFile(makiRenders + symbol + '.png', function(err, data) {
        if (err) return callback(new Error('Marker "' + JSON.stringify(options) + '" is invalid because the symbol is not found.'));

        // Base marker gets tint applied.
        var parts = [{
            buffer: markerCache.base[base],
            tint: options.parsedTint
        }];

        // If symbol is present, find correct offset (varies by marker size).
        if (symbol) {
            parts.push(xtend({
                buffer: data,
                tint: blend.parseTintString('0x0;0x0;1.4x0'),
            }, offsets[size + (options.retina ? '@2x' : '')]));
        }

        // Add mask layer.
        parts.push({
            buffer: markerCache.mask[base]
        });

        // Extract width and height from the IHDR. The IHDR chunk must appear
        // first, so the location is always fixed.
        var width = markerCache.base[base].readUInt32BE(16),
            height = markerCache.base[base].readUInt32BE(20);

        // Combine base, (optional) symbol, to supply the final marker.
        blend(parts, {
            format: 'png',
            quality: 256,
            width: width,
            height: height
        }, function(err, data) {
            if (err) return callback(err);
            return callback(null, data);
        });
    });
}
function loadMaki(options, callback) {
    var base = options.base + '-' + options.size + (options.retina ? '@2x' : ''),
        size = options.size,
        symbol = options.symbol + '-' + sizes[size] + (options.retina ? '@2x' : '');

    if (!base || !size) {
        return callback(errcode('Marker is invalid because it lacks base or size.', 'EINVALID'));
    }

    if (!makiAvailable[symbol]) {
        return callback(errcode('Marker symbol "' + options.symbol + '" is invalid.', 'EINVALID'));
    }

    fs.readFile(makiRenders + symbol + '.png', function(err, data) {
        if (err) return callback(new Error('Marker "' + JSON.stringify(options) + '" is invalid because the symbol is not found.'));

        // Base marker gets tint applied.
        var parts = [{
            buffer: markerCache.base[base],
            tint: options.parsedTint
        }];

        // If symbol is present, find correct offset (varies by marker size).
        if (symbol) {
            parts.push(xtend({
                buffer: data,
                tint: blend.parseTintString('0x0;0x0;1.4x0'),
            }, offsets[size + (options.retina ? '@2x' : '')]));
        }

        // Add mask layer.
        parts.push({
            buffer: markerCache.mask[base]
        });

        // Extract width and height from the IHDR. The IHDR chunk must appear
        // first, so the location is always fixed.
        var width = markerCache.base[base].readUInt32BE(16),
            height = markerCache.base[base].readUInt32BE(20);

        // Combine base, (optional) symbol, to supply the final marker.
        blend(parts, {
            format: 'png',
            quality: 256,
            width: width,
            height: height
        }, function(err, data) {
            if (err) return callback(err);
            return callback(null, data);
        });
    });
}
function loadMaki ( options , callback ) { var base = options . base + '-' + options . size + ( options . retina ? '@2x' : '' ) , size = options . size , symbol = options . symbol + '-' + sizes [ size ] + ( options . retina ? '@2x' : '' ) ; if ( ! base || ! size ) { return callback ( errcode ( 'Marker is invalid because it lacks base or size.' , 'EINVALID' ) ) ; } if ( ! makiAvailable [ symbol ] ) { return callback ( errcode ( 'Marker symbol "' + options . symbol + '" is invalid.' , 'EINVALID' ) ) ; } fs . readFile ( makiRenders + symbol + '.png' , function ( err , data ) { if ( err ) return callback ( new Error ( 'Marker "' + JSON . stringify ( options ) + '" is invalid because the symbol is not found.' ) ) ; // Base marker gets tint applied. var parts = [ { buffer : markerCache . base [ base ] , tint : options . parsedTint } ] ; // If symbol is present, find correct offset (varies by marker size). if ( symbol ) { parts . push ( xtend ( { buffer : data , tint : blend . parseTintString ( '0x0;0x0;1.4x0' ) , } , offsets [ size + ( options . retina ? '@2x' : '' ) ] ) ) ; } // Add mask layer. parts . push ( { buffer : markerCache . mask [ base ] } ) ; // Extract width and height from the IHDR. The IHDR chunk must appear // first, so the location is always fixed. var width = markerCache . base [ base ] . readUInt32BE ( 16 ) , height = markerCache . base [ base ] . readUInt32BE ( 20 ) ; // Combine base, (optional) symbol, to supply the final marker. blend ( parts , { format : 'png' , quality : 256 , width : width , height : height } , function ( err , data ) { if ( err ) return callback ( err ) ; return callback ( null , data ) ; } ) ; } ) ; }
Load & composite a marker from the maki icon set.

@param {object} options
@param {function} callback
Load & composite a marker from the maki icon set .