Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/deniscarriere/wmts
- Owner: DenisCarriere
- License: mit
- Created: 2016-10-28T13:55:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-01T19:50:36.000Z (over 7 years ago)
- Last Synced: 2024-04-14T06:03:42.032Z (9 months ago)
- Topics: gis, javascript-applications, ogc, wmts
- Language: JavaScript
- Homepage: https://npm.runkit.com/wmts
- Size: 326 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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