Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deniscarriere/wmts

WMTS scheme for Javascript applications
https://github.com/deniscarriere/wmts

gis javascript-applications ogc wmts

Last synced: 3 months ago
JSON representation

WMTS scheme for Javascript applications

Awesome Lists containing this project

README

        

# WMTS

[![Build Status](https://travis-ci.org/DenisCarriere/wmts.svg?branch=master)](https://travis-ci.org/DenisCarriere/wmts)
[![npm version](https://badge.fury.io/js/wmts.svg)](https://badge.fury.io/js/wmts)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/wmts/master/LICENSE)

[![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

> Flexible WMTS scheme for Javascript applications.

## Install

**npm**

```bash
$ yarn add wmts
```

**web browser ([ES5](https://kangax.github.io/compat-table/es5))**

```html

```

## Quickstart

```javascript
const xml = wmts.getCapabilities({
url: 'http://localhost:5000/WMTS',
title: 'Tile Service XYZ',
format: 'png',
})
//=xml
```

```xml



1.0.0
OGC WMTS
...
```

## API

### getCapabilities

Get Capabilities

**Parameters**

- `options` **Options** Options
- `options.url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** URL of WMTS service
- `options.title` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Title of service
- `options.format` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Format 'png' | 'jpeg' | 'jpg'
- `options.minzoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Minimum zoom level (optional, default `0`)
- `options.maxzoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Maximum zoom level (optional, default `22`)
- `options.accessConstraints` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Access Constraints
- `options.fees` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Fees
- `options.abstract` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Abstract
- `options.identifier` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Identifier
- `options.keywords` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** Keywords
- `options.bbox` **BBox?** BBox [west, south, east, north]
- `options.spaces` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Spaces created for XML output (optional, default `2`)

**Examples**

```javascript
const xml = wmts.getCapabilities({
url: 'http://localhost:5000/WMTS',
title: 'Tile Service XYZ',
identifier: 'service-123',
abstract: '© OSM data',
keyword: ['world', 'imagery', 'wmts'],
format: 'png',
minzoom: 10,
maxzoom: 18,
bbox: [-180, -85, 180, 85]
})
```

Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** XML string