# leaflet-tilejson

> TileJSON integration for Leaflet, with extension for local projections using Proj4Leaflet

Latest version **1.0.0-rc4** (published 2017-02-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install leaflet-tilejson
pnpm add leaflet-tilejson
yarn add leaflet-tilejson
bun add leaflet-tilejson
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0-rc4 |
| Published | 2017-02-09 |
| First published | 2013-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Per Liedman |
| Maintainers | liedman, pthorin |
| Keywords | TileJSON, Leaflet, Proj4 |

## Links

- npm: https://www.npmjs.com/package/leaflet-tilejson
- Repository: https://github.com/kartena/leaflet-tilejson
- Homepage: https://github.com/kartena/leaflet-tilejson#readme
- Issues: https://github.com/kartena/leaflet-tilejson/issues
- npm.io page: https://npm.io/package/leaflet-tilejson

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0-rc4 (latest) — 2017-02-09
- 1.0.0-rc3 — 2017-02-09
- 1.0.0-rc2 — 2017-02-09
- 1.0.0-rc1 — 2017-02-09
- 0.7.0 — 2015-02-18
- 0.6.0 — 2013-09-24

## README

# leaflet-tilejson [![NPM version](https://badge.fury.io/js/leaflet-tilejson.png)](http://badge.fury.io/js/leaflet-tilejson)

leaflet-tilejson adds support for the 
[TileJSON](https://github.com/mapbox/tilejson-spec) specification 
to the [Leaflet](http://leafletjs.com) map client.

For extra fun and possibility of future profit, leaflet-tilejson 
also supports an 
[extension to the TileJSON specification](https://github.com/perliedman/TileJSON/tree/master/2.0.0), 
which allows other projections than spherical-mercator. This 
extension requires [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet)
and [Proj4js](http://proj4js.org) as extra dependencies.

## Example

```javascript
var osmTileJSON = {
    "tilejson": "2.0.0",
    "name": "OpenStreetMap",
    "description": "A free editable map of the whole world.",
    "version": "1.0.0",
    "attribution": "&copy; OpenStreetMap contributors, CC-BY-SA",
    "scheme": "xyz",
    "tiles": [
        "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
    ],
    "subdomains": ["a","b","c"],
    "minzoom": 0,
    "maxzoom": 18,
    "bounds": [ -180, -85, 180, 85 ],
    "center": [ 11.9, 57.7, 8 ]
};

var map = L.TileJSON.createMap('map', osmTileJSON);
```

## Limitations

This is, as everything else, a work in progress. Current known limitations are:

 * No support for UTFGrid interaction. Mostly because Leaflet does not currently support UTFGrid.
 * Only the first tile URL specified is used. The method for specifying this in the TileJSON 
   specification and in Leaflet differs in ways that makes it hard to implement in the general case.
 * When using {s}, provide non-default subdomains (Leaflet defaults are abc) as a string or array. This is not in the TileJSON spec, and is only available here due to the previously mentioned limitation.

---
_Source: https://npm.io/package/leaflet-tilejson · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
