Coder Social home page Coder Social logo

node-tilejson's Introduction

Build Status Build status Coverage Status

node-tilejson

A javascript implementation of https://github.com/mapbox/tilejson-spec

install

npm install --save @mapbox/tilejson

API

This module mainly provides an API for use by tilelive: it implements methods that allow fetching of tiles and metadata given a TileJSON object.

Provides a metadata for online tile sources in json format.

node-tilejson's People

Contributors

flippmoke avatar hanchao avatar ianshward avatar jfirebaugh avatar kkaefer avatar miccolis avatar mikemorris avatar mojodna avatar rclark avatar taketime avatar tmcw avatar tomhughes avatar willwhite avatar wrynearson avatar yhahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-tilejson's Issues

Failing to get a lock doesn't retry

Encountered an issue while running http://github.com/mapbox/unpacker tests where tilelive.load(tilejson_url) wouldn't return, causing the tests to hang at https://github.com/mapbox/tilelive.js/blob/master/lib/tilelive.js#L97 and eventually time out.

Traced this back to the Locking function, where it appears that failed attempts at getting a lock aren't handled properly. It seems that the lock doesn't actually prevent subsequent listeners still being bound to the done event, only ensures that the first listener to respond takes the lock, blocking others. Triggered listeners that encounter !locks[id].io fail silently rather than retrying.

Added logging around this issue at https://github.com/mapbox/node-tilejson/blob/broken-locking/lib/tilejson.js#L226-252, this is what I'm seeing.

3 Dec 17:54:25 - 33403d98-bc58-4f2c-92e3-bfc5c96c79c0 test.test-5331-valid-tilejson - Downloaded file from http://tilestream-tilesets-testing.s3.amazonaws.com/_pending/test/test-5331-valid-tilejson
TILELIVE handler { filename: '/tmp/unpacker/33403d98-bc58-4f2c-92e3-bfc5c96c79c0' }
PRE-EMIT listeners.length 1
LOCKED
TILELIVE handler {}
EMIT listeners.length 2
LOCK RELEASED

Is this a dupe of #4? Is a lock necessary here?

/cc @yhahn @willwhite

Update agentkeepalive

To prevent agentkeepalive error

TypeError: this._evictSession is not a function

Dependency version should be updated

Add configurable retry

Allow node-retry configuration to be passed in, similar to to carmen. Default to 0 retries.

support for HiDPI

The module doesn't seem to works with HiDPI screens like Retina.

Example:
save following under config.json, then run /usr/bin/nodejs /usr/bin/tessera -c . -p 28089

{
 "/toner": {
   "source": "tilejson+http://staging.tile.stamen.com/toner-background/index.json"
  },
 "/toner-http": {
   "source": "http://toner-elb-3vaew2i23b6d-1666871272.us-east-1.elb.amazonaws.com/toner-background/{z}/{x}/{y}.png"
  }
}

http://127.0.0.1:28089/toner-http/6/11/[email protected] returns a 512x512 image. Fine.

http://toner-elb-3vaew2i23b6d-1666871272.us-east-1.elb.amazonaws.com/toner-background/6/11/[email protected] returns a 512x512 image (it's the link described in the tilejson file). Fine.

http://127.0.0.1:28089/toner/6/11/[email protected] returns a 256x256 image. Wrong :-(.

The solution is probably as simple as integrating the modifications proposed in https://github.com/mapbox/node-tilejson/pull/26/files.

Add caching

  • Save to disk or to file system
  • Respect HTTP headers
  • Cache both grids and tiles

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.