wc

wms-capabilities

WMS GetCapabilities to JSON

Showing:

Popularity

Downloads/wk

4.4K

GitHub Stars

31

Maintenance

Last Commit

1mo ago

Contributors

5

Package

Dependencies

1

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

WMS GetCapabilities parser

npm version

Parses WMS capabilities XML format to JSON. This is a simplified excerpt from OpenLayers code to be used separately from its large codebase.

Demo

Usage

ES

npm install wms-capabilities --save
import WMSCapabilities from 'wms-capabilities';
...
new WMSCapabilities().parse(xmlString);
//or
new WMSCapabilities(xmlString).toJSON();
// or 
new WMSCapabilities().readFromDocument(xmldoc);

Browser

<script src="path/to/wms-capabilities.min.js"></script>
...
new WMSCapabilities().parse(xmlString);

Node

Requires xmldom to traverse XML

$npm install --save xmldom

then

import xmldom from 'xmldom'; // 'xmldom' doesn't 'export' the DOMParser
import WMSCapabilities from 'wms-capabilities';
...
new WMSCapabilities(xmlString, xmldom.DOMParser).toJSON();

Command-line

$ npm install -g wms-capabilities
$ cat capabilities.xml | wmscapabilities > out.json
$ # or
$ wmscapabilities capabilities.json > out.json

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100