tiletype
v0.3.0tiletype
detect common map tile formats from a buffer
type(buffer)
Given a buffer of unknown data, return either a format as an extension string or false if the type cannot be determined.
Potential options are:
- png
- pbf
- jpg
- webp
Parameters
parameter | type | description |
---|---|---|
buffer |
Buffer | input |
Returns String,boolean
, identifier
headers(buffer)
Return headers - Content-Type and Content-Encoding - for a response containing this kind of image.
Parameters
parameter | type | description |
---|---|---|
buffer |
Buffer | input |
Returns Object
, headers
dimensions(buffer, dimensions)
Determine the width and height of an image contained in a buffer, returned as a [x, y] array.
Parameters
parameter | type | description |
---|---|---|
buffer |
Buffer | input |
dimensions |
Array,boolean |
Installation
Requires nodejs.
$ npm install tiletype
Tests
$ npm test
npm i tiletype
Metadata
- Unknown
- Whatever
- Mapbox
- released 11/17/2015
Downloads
Maintainers
aaronlidman, ajashton, ansis, bhousel, bsudekum, camilleanne, dnomadb, dthompson, dvncan, edenh, emilymcafee, gretacb, ian29, ianshward, ingalls, jfirebaugh, jrpruit1, karenzshea, kkaefer, lbud, lucaswoj, lxbarth, lyzidiamond, mapbox, mcwhittemore, miccolis, mikemorris, morganherlocker, mourner, mtirwin, nickidlugash, planemad, rclark, samanbb, sbma44, scothis, sgillies, springmeyer, themarex, tmcw, tristen, willwhite, yhahn,