JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 149
  • Score
    100M100P100Q96080F
  • License MIT

Flexible WMTS scheme for Javascript applications

Package Exports

  • wmts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wmts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

WMTS

Build Status Coverage Status npm version MIT licensed

Standard - JavaScript Style Guide

Flexible WMTS scheme for Javascript applications.

Install

$ npm install --save wtms

Usage

getCapabilities

Get Capabilities

Parameters

  • options [Options](default {}) Options
    • options.spaces [number] Spaces created for XML output (optional, default 2)
    • options.title string Title of service
    • options.format string Format 'png' | 'jpeg' | 'jpg'
    • options.url string URL of WMTS service
    • options.fees [string] Fees
    • options.abstract [string] Abstract
    • options.identifier [string] Identifier
    • options.keywords [Array<string>] Keywords
    • options.bbox [BBox] BBox [west, south, east, north] (optional, default [-180,-85,180,85])
    • options.accessConstraints [string] Access Constraints
  • minzoom [number] Minimum zoom level (optional, default 0)
  • maxzoom [number] Maximum zoom level (optional, default 22)

Examples

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 XML string

Capabilities

Capabilities JSON scheme

Parameters

  • options [Options](default {}) Options
    • options.url string URL of WMTS service

Examples

Capabilities({
  url: 'http://localhost:5000'
})

Returns ElementCompact JSON scheme

GoogleMapsCompatible

GoogleMapsCompatible JSON scheme

Parameters

  • minzoom [number] Minimum zoom level (optional, default 0)
  • maxzoom [number] Maximum zoom level (optional, default 22)

Examples

wmts.GoogleMapsCompatible(10, 17)

Returns ElementCompact JSON scheme

TileMatrix

TileMatrix JSON scheme

Parameters

  • minzoom [number] Minimum zoom level (optional, default 0)
  • maxzoom [number] Maximum zoom level (optional, default 22)

Examples

wmts.TileMatrix(0, 18)

Returns ElementCompact JSON scheme

ServiceIdentification

ServiceIdentification JSON scheme

Parameters

  • options [Options](default {}) Options
    • options.title string Title of service
    • options.abstract [string] Abstract
    • options.keywords [Array<string>] Keywords
    • options.accessConstraints [string] Access Constraints
    • options.fees [string] Fees

Examples

ServiceIdentification({
  title: 'Service name',
  abstract: 'A long description of this service',
  keywords: ['world', 'wmts', 'imagery']
})

Returns ElementCompact JSON scheme

Keywords

Keywords JSON scheme

Parameters

Examples

Keywords(['world', 'imagery', 'wmts'])

Returns ElementCompact JSON scheme

OperationsMetadata

OperationsMetadata JSON scheme

Parameters

  • url string URL of Service Provider

Examples

OperationsMetadata('http://localhost:5000/wmts')

Returns ElementCompact JSON scheme

Operation

Operation JSON scheme

Parameters

  • operation string Name of operation
  • restful string URL for RESTful
  • kvp string URL for KVP

Returns ElementCompact JSON scheme

Get

Get JSON scheme

Parameters

  • url string URL of Service Provider
  • value string Type of Get 'RESTful' | 'KVP'

Examples

Get()
//= Get > Constraint > AllowedValues> Value

Returns ElementCompact JSON scheme

Contents

Capabilities.Contents JSON scheme

Parameters

  • options [Options](default {}) Options

Examples

Contents()
//= Contents > [Layer, TileMatrixSet, TileMatrixSet]

Returns Element

Layer

Capabilities.Contents.Layer JSON scheme

Parameters

  • options [Options](default {}) Options
    • options.title string Title
    • options.url string URL
    • options.format string Format 'png' | 'jpeg' | 'jpg'
    • options.abstract [string] Abstract
    • options.identifier [string] Identifier
    • options.bbox [BBox] BBox [west, south, east, north] (optional, default [-180,-85,180,85])

Examples

Layer({
  title: 'Tile Service'
  url: 'http://localhost:5000/wmts'
  format: 'jpg'
})

Returns ElementCompact JSON scheme

clean

Clean remove undefined attributes from object

Parameters

normalize

Normalize URL

Parameters

Returns string Normalized URL

error

Pretty Error message

Parameters

  • message ...Any

License

MIT © Denis Carriere