@mapbox/tilelive-pixelmatch
Visually diff your raster tiles!
Last updated 3 years ago by lukasmartinelli .
BSD-3 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mapbox/tilelive-pixelmatch 
SYNC missed versions from official npm registry.

tilelive-pixelmatch

A readonly tilelive source for visually diffing two raster tile sources using pixelmatch. This enables visual regression testing for maps.

Use Cases

Validate Boundary Changes in OSM

Browsable map diff

Usage

var tilelive = require("tilelive");
require('tilelive-http')(tilelive).registerProtocols(tilelive);
require('@mapbox/tilelive-pixelmatch')(tilelive).registerProtocols(tilelive);

const source1 = "https://api.mapbox.com/styles/v1/morgenkaffee/cix7xgxah00aw2pnoh7nwsozf/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w";
const source2 = "https://api.mapbox.com/styles/v1/morgenkaffee/cixyw0h9300612rql81d6r83d/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w";

function copyTiles(source, target) {
  tilelive.copy(source, target, {
    type: 'scanline',
        minzoom: 0,
        maxzoom: 4
  }, function(err) {
    if (err) throw err;
  });
}

const sourceUri = "pixelmatch:?source=" + source1 + "&source=" + source2;
const targetUri = "file://./diffs";
copyTiles(sourceUri, targetUri);

Current Tags

  • 0.1.1                                ...           latest (3 years ago)

2 Versions

  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |