Skip to content
This repository was archived by the owner on Jun 30, 2026. It is now read-only.
mapboxPublic archive

About

detect common map tile formats from a buffer

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

114 watching

Forks

Latest commit

 

History

44 Commits

Folders and files

tiletype

build status Coverage Status

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 @mapbox/tiletype

Tests

$ npm test

About

detect common map tile formats from a buffer

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

114 watching

Forks

Releases

Packages

Used by

Contributors

Languages