tilestrata-dependency

0.5.1 • Public • Published

tilestrata-dependency

NPM version Build Status Coverage Status

A TileStrata plugin for loading another layer tile as a source, which is particularly useful for cases when you want to be able to serve a rendered result in multiple formats.

$ npm install tilestrata-dependency --save

Sample Usage

var dependency = require('tilestrata-dependency');
 
server.layer('mylayer').route('tile.png')
    .use(/* provider */);
 
server.layer('mylayer').route('tile.jpg')
    .use(dependency('mylayer', 'tile.png'))
    .use(/* transform */)
 
// or if you want to dynamically serve different tiles
// based on the request, you can provide a function:
server.layer('mylayer').route('tile.jpg')
    .use(dependency(function(req) {
        if (req.z < 5) {
            return ['zoomedoutlayer', 't.png'];
        }
        return ['normal', 't.png'];
    });

Contributing

Before submitting pull requests, please update the tests and make sure they all pass.

$ npm test

License

Copyright © 2014-2017 Natural Atlas, Inc. & Contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package Sidebar

Install

npm i tilestrata-dependency

Weekly Downloads

4

Version

0.5.1

License

Apache-2.0

Last publish

Collaborators

  • brianreavis