Skip to content

sraimund/wms-capabilities

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Usage

Browserify

npm install wms-capabilities --save
var WMSCapabilities = require('wms-capabilities');
...
new WMSCapabilities().parse(xmlString);
//or
new WMSCapabilities(xmlString).toJSON();

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

var DOMParser = global.DOMParser = require('xmldom').DOMParser;
var WMSCapabilities = require('wms-capabilities');
...
new WMSCapabilities(xmlString).toJSON();

Command-line

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

Packages

No packages published

Languages

  • JavaScript 58.8%
  • CSS 40.3%
  • Other 0.9%