stamen / mapstitch

Stitches map tiles together
MIT License
14 stars 1 forks source link

mapstitch

Stitches map tiles together.

Installation

npm install mapstitch

Running

npm start

Then visit http://localhost:8080/mapimg?w=1500&h=1500&extent=37.955:-122.737:37.449:-122.011&p=toner to see a stitched map.

Custom Validation

When initializing mapstitch, provide a custom validate function. The stitch object that's returned will be bound as this, so you can extend as well as skip the built-in validation:

var stitch = require("mapstitch")({
  validate: function(err, res, callback) {
    return this.validate(err, res, function(err) {
      if (err) {
        return callback(err);
      }

      // arbitrarily fail 10% of the time
      if (Math.random() * 10 <= 1) {
        return callback(new Error("Randomized error value"));
      }

      return callback();
    });
  }
});

License

Copyright (c) 2013 Stamen

Published under the MIT License.