wms-capabilities
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -217,2 +217,18 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.WMSCapabilities = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
* @param {Node} node Node. | ||
* @return {ol.Extent} Bounding box object. | ||
*/ | ||
WMS._readBoundingBoxExtent = function(node) { | ||
var readDecimalString = XSD.readDecimalString; | ||
return [ | ||
readDecimalString(node.getAttribute('minx')), | ||
readDecimalString(node.getAttribute('miny')), | ||
readDecimalString(node.getAttribute('maxx')), | ||
readDecimalString(node.getAttribute('maxy')) | ||
]; | ||
} | ||
/** | ||
* @private | ||
* @param {Node} node Node. | ||
* @param {Array.<*>} objectStack Object stack. | ||
@@ -222,9 +238,4 @@ * @return {Object} Bounding box object. | ||
WMS._readBoundingBox = function(node, objectStack) { | ||
var extent = WMS._readBoundingBoxExtent(node); | ||
var readDecimalString = XSD.readDecimalString; | ||
var extent = [ | ||
readDecimalString(node.getAttribute('minx')), | ||
readDecimalString(node.getAttribute('miny')), | ||
readDecimalString(node.getAttribute('maxx')), | ||
readDecimalString(node.getAttribute('maxy')) | ||
]; | ||
@@ -243,3 +254,20 @@ var resolutions = [ | ||
/** | ||
* @private | ||
* @param {Node} node Node. | ||
* @param {Array.<*>} objectStack Object stack. | ||
* @return {ol.Extent|undefined} Bounding box object. | ||
*/ | ||
WMS._readLatLonBoundingBox = function(node, objectStack) { | ||
var extent = WMS._readBoundingBoxExtent(node); | ||
if (!isDef(extent[0]) || !isDef(extent[1]) || | ||
!isDef(extent[2]) || !isDef(extent[3])) { | ||
return undefined; | ||
} | ||
return extent; | ||
}; | ||
/** | ||
@@ -713,3 +741,5 @@ * @private | ||
'CRS': XMLParser.makeObjectPropertyPusher(XSD.readString), | ||
'SRS': XMLParser.makeObjectPropertyPusher(XSD.readString), | ||
'EX_GeographicBoundingBox': makePropertySetter(WMS._readEXGeographicBoundingBox), | ||
'LatLonBoundingBox': makePropertySetter(WMS._readLatLonBoundingBox), | ||
'BoundingBox': XMLParser.makeObjectPropertyPusher(WMS._readBoundingBox), | ||
@@ -716,0 +746,0 @@ 'Dimension': XMLParser.makeObjectPropertyPusher(WMS._readDimension), |
@@ -1,19 +0,19 @@ | ||
(function(r){"object"===typeof exports&&"undefined"!==typeof module?module.exports=r():"function"===typeof define&&define.Ka?define([],r):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).WMSCapabilities=r()})(function(){return function f(h,a,e){function g(c,l){if(!a[c]){if(!h[c]){var b="function"==typeof require&&require;if(!l&&b)return b(c,!0);if(m)return m(c,!0);b=Error("Cannot find module '"+c+"'");throw b.code="MODULE_NOT_FOUND",b;}b= | ||
a[c]={exports:{}};h[c][0].call(b.exports,function(a){var b=h[c][1][a];return g(b?b:a)},b,b.exports,f,h,a,e)}return a[c].exports}for(var m="function"==typeof require&&require,c=0;c<e.length;c++)g(e[c]);return g}({1:[function(f,h){h.exports=f("./src/wms")},{"./src/wms":6}],2:[function(f,h){h.exports={u:1,Ba:2,ba:3,M:4,Ga:5,Fa:6,Ja:7,Ca:8,o:9,Ea:10,Da:11,Ia:12}},{}],3:[function(f,h){h.exports=function(a){return void 0!==a}},{}],4:[function(f,h){h.exports=function(a,e,g){return e in a?a[e]:a[e]=g}},{}], | ||
5:[function(f,h){var a=f("./isdef"),e=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;h.exports={trim:function(a){return a.replace(e,"")},m:function(e,f,c){e=a(c)?e.toFixed(c):String(e);c=e.indexOf(".");-1==c&&(c=e.length);f=Math.max(0,f-c);return Array(f+1).join("0")+e}}},{"./isdef":3}],6:[function(f,h){function a(a){this.version=void 0;this.v=new e;this.F=a}var e=f("./xml_parser"),g=f("./utils/isdef"),m=f("./node_types"),c=f("./utils/setifundefined"),d=f("./xsd"),l=f("./xlink"),b=e.va;a.prototype.data=function(a){this.F= | ||
a;return this};a.prototype.toJSON=function(a){a=a||this.F;return this.parse(a)};a.prototype.parse=function(a){return this.oa(this.v.za(a))};a.prototype.oa=function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType==m.u)return this.ya(a);return null};a.prototype.ya=function(c){this.version=c.getAttribute("version");return e.b({version:this.version},a.Y,c,[])||null};a.ca=function(c,b){return e.b({},a.K,c,b)};a.ea=function(a){var c=d.s,b=[c(a.getAttribute("minx")),c(a.getAttribute("miny")),c(a.getAttribute("maxx")), | ||
c(a.getAttribute("maxy"))],c=[c(a.getAttribute("resx")),c(a.getAttribute("resy"))];return{crs:a.getAttribute("CRS")||a.getAttribute("SRS"),extent:b,res:c}};a.ma=function(c,b){var d=e.b({},a.T,c,b);if(g(d)){var l=d.westBoundLongitude,k=d.southBoundLatitude,f=d.eastBoundLongitude,d=d.northBoundLatitude;return g(l)&&g(k)&&g(f)&&g(d)?[l,k,f,d]:void 0}};a.fa=function(c,b){return e.b({},a.L,c,b)};a.ta=function(c,b){return e.b({},a.$,c,b)};a.ia=function(c,b){return e.b({},a.O,c,b)};a.ja=function(c,b){return e.b({}, | ||
a.P,c,b)};a.ha=function(c,b){return e.b({},a.N,c,b)};a.na=function(c,b){return e.b([],a.S,c,b)};a.ga=function(c,b){return e.b({},a.D,c,b)};a.qa=function(b,l){var f=l[l.length-1],h=e.b({},a.D,b,l);if(g(h)){var k=d.i(b.getAttribute("queryable"));g(k)||(k=f.queryable);h.queryable=g(k)?k:!1;k=d.C(b.getAttribute("cascaded"));g(k)||(k=f.cascaded);h.cascaded=k;k=d.i(b.getAttribute("opaque"));g(k)||(k=f.opaque);h.opaque=g(k)?k:!1;k=d.i(b.getAttribute("noSubsets"));g(k)||(k=f.noSubsets);h.noSubsets=g(k)?k: | ||
!1;k=d.s(b.getAttribute("fixedWidth"));g(k)||(k=f.fixedWidth);h.fixedWidth=k;k=d.s(b.getAttribute("fixedHeight"));g(k)||(k=f.fixedHeight);h.fixedHeight=k;for(var m=["Style","CRS","AuthorityURL"],k=0,t=m.length;k<t;k++){var n=m[k],q=f[n];if(g(q)){var p=c(h,n,[]),p=p.concat(q);h[n]=p}}m="EX_GeographicBoundingBox BoundingBox Dimension Attribution MinScaleDenominator MaxScaleDenominator".split(" ");k=0;for(t=m.length;k<t;k++)n=m[k],p=h[n],g(p)||(q=f[n],h[n]=q);return h}};a.la=function(a){return{name:a.getAttribute("name"), | ||
units:a.getAttribute("units"),unitSymbol:a.getAttribute("unitSymbol"),"default":a.getAttribute("default"),multipleValues:d.i(a.getAttribute("multipleValues")),nearestValue:d.i(a.getAttribute("nearestValue")),current:d.i(a.getAttribute("current")),values:d.a(a)}};a.h=function(c,b){return e.b({},a.U,c,b)};a.sa=function(c,b){return e.b({},a.Z,c,b)};a.ka=function(c,b){return e.b({},a.R,c,b)};a.pa=function(c,b){return e.b({},a.V,c,b)};a.w=function(c,b){return e.b({},a.X,c,b)};a.H=function(c,b){var e=a.h(c, | ||
b);if(g(e)){var l=d.C,l=[l(c.getAttribute("width")),l(c.getAttribute("height"))];e.size=l;return e}};a.da=function(c,b){var d=a.h(c,b);if(g(d))return d.name=c.getAttribute("name"),d};a.ra=function(c,b){var d=a.h(c,b);if(g(d))return d.type=c.getAttribute("type"),d};a.ua=function(c,b){return e.b({},a.aa,c,b)};a.G=function(c,b){return e.b([],a.W,c,b)};a.c=[null,"http://www.opengis.net/wms"];a.Y=e.f(a.c,{Service:b(a.ta),Capability:b(a.fa)});a.L=e.f(a.c,{Request:b(a.sa),Exception:b(a.na),Layer:b(a.ga)}); | ||
a.$=e.f(a.c,{Name:b(d.a),Title:b(d.a),Abstract:b(d.a),KeywordList:b(a.G),OnlineResource:b(l.A),ContactInformation:b(a.ia),Fees:b(d.a),AccessConstraints:b(d.a),LayerLimit:b(d.B),MaxWidth:b(d.B),MaxHeight:b(d.B)});a.O=e.f(a.c,{ContactPersonPrimary:b(a.ja),ContactPosition:b(d.a),ContactAddress:b(a.ha),ContactVoiceTelephone:b(d.a),ContactFacsimileTelephone:b(d.a),ContactElectronicMailAddress:b(d.a)});a.P=e.f(a.c,{ContactPerson:b(d.a),ContactOrganization:b(d.a)});a.N=e.f(a.c,{AddressType:b(d.a),Address:b(d.a), | ||
City:b(d.a),StateOrProvince:b(d.a),PostCode:b(d.a),Country:b(d.a)});a.S=e.f(a.c,{Format:e.J(d.a)});a.D=e.f(a.c,{Name:b(d.a),Title:b(d.a),Abstract:b(d.a),KeywordList:b(a.G),CRS:e.g(d.a),EX_GeographicBoundingBox:b(a.ma),BoundingBox:e.g(a.ea),Dimension:e.g(a.la),Attribution:b(a.ca),AuthorityURL:e.g(a.da),Identifier:e.g(d.a),MetadataURL:e.g(a.ra),DataURL:e.g(a.h),FeatureListURL:e.g(a.h),Style:e.g(a.ua),MinScaleDenominator:b(d.j),MaxScaleDenominator:b(d.j),Layer:e.g(a.qa)});a.K=e.f(a.c,{Title:b(d.a),OnlineResource:b(l.A), | ||
LogoURL:b(a.H)});a.T=e.f(a.c,{westBoundLongitude:b(d.j),eastBoundLongitude:b(d.j),southBoundLatitude:b(d.j),northBoundLatitude:b(d.j)});a.Z=e.f(a.c,{GetCapabilities:b(a.w),GetMap:b(a.w),GetFeatureInfo:b(a.w)});a.X=e.f(a.c,{Format:e.g(d.a),DCPType:e.g(a.ka)});a.R=e.f(a.c,{HTTP:b(a.pa)});a.V=e.f(a.c,{Get:b(a.h),Post:b(a.h)});a.aa=e.f(a.c,{Name:b(d.a),Title:b(d.a),Abstract:b(d.a),LegendURL:e.g(a.H),StyleSheetURL:b(a.h),StyleURL:b(a.h)});a.U=e.f(a.c,{Format:b(d.a),OnlineResource:b(l.A)});a.W=e.f(a.c, | ||
{Keyword:e.J(d.a)});h.exports=a},{"./node_types":2,"./utils/isdef":3,"./utils/setifundefined":4,"./xlink":7,"./xml_parser":8,"./xsd":9}],7:[function(f,h){h.exports={A:function(a){return a.getAttributeNS("http://www.w3.org/1999/xlink","href")}}},{}],8:[function(f,h){function a(){this.v=new DOMParser}var e=f("./utils/isdef"),g=f("./utils/setifundefined"),m=f("./node_types");a.prototype.za=function(a){return this.v.parseFromString(a,"application/xml")};a.l=function(c){return a.I(c,!1,[]).join("")};a.I= | ||
function(c,d,e){if(c.nodeType===m.M||c.nodeType===m.ba)d?e.push(String(c.nodeValue).replace(/(\r\n|\r|\n)/g,"")):e.push(c.nodeValue);else for(c=c.firstChild;c;c=c.nextSibling)a.I(c,d,e);return e};a.xa=function(c,d,l){for(d=a.firstElementChild(d);d;d=a.nextElementSibling(d)){var b=c[d.namespaceURI||null];e(b)&&(b=b[d.localName],e(b)&&b.call(void 0,d,l))}};a.firstElementChild=function(a){for(a=a.firstElementChild||a.firstChild;a&&a.nodeType!==m.u;)a=a.nextSibling;return a};a.nextElementSibling=function(a){for(a= | ||
a.nextElementSibling||a.nextSibling;a&&a.nodeType!==m.u;)a=a.nextSibling;return a};a.f=function(c,d){return a.wa(c,d)};a.wa=function(a,d){var l=e(void 0)?void 0:{},b,f;b=0;for(f=a.length;b<f;++b)l[a[b]]=d;return l};a.va=function(a,d,l){return function(b,f){var g=a.call(e(l)?l:this,b,f);if(e(g)){var h=f[f.length-1],m=e(d)?d:b.localName;h[m]=g}}};a.g=function(a){return function(d,f){var b=a.call(e(void 0)?void 0:this,d,f);if(e(b)){var h=f[f.length-1],m=e(void 0)?void 0:d.localName;g(h,m,[]).push(b)}}}; | ||
a.J=function(a){return function(d,f){var b=a.call(e(void 0)?void 0:this,d,f);e(b)&&f[f.length-1].push(b)}};a.b=function(c,d,e,b){b.push(c);a.xa(d,e,b);return b.pop()};h.exports=a},{"./node_types":2,"./utils/isdef":3,"./utils/setifundefined":4}],9:[function(f,h){var a=f("./utils/isdef"),e=f("./utils/string"),g=f("./xml_parser"),m={Ha:"http://www.w3.org/2001/XMLSchema",La:function(a){a=g.l(a);return m.i(a)},i:function(c){if(c=/^\s*(true|1)|(false|0)\s*$/.exec(c))return a(c[1])||!1},Ma:function(c){c= | ||
g.l(c);if(c=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|(?:([+\-])(\d{2})(?::(\d{2}))?))\s*$/.exec(c)){var d=Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),parseInt(c[6],10))/1E3;if("Z"!=c[7]){var e="-"==c[8]?-1:1,d=d+60*e*parseInt(c[9],10);a(c[10])&&(d+=3600*e*parseInt(c[10],10))}return d}},j:function(a){a=g.l(a);return m.s(a)},s:function(a){if(a=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(a))return parseFloat(a[1])},B:function(a){a= | ||
g.l(a);return m.C(a)},C:function(a){if(a=/^\s*(\d+)\s*$/.exec(a))return parseInt(a[1],10)},a:function(a){a=g.l(a);return e.trim(a)},Na:function(a,d){m.Aa(a,d?"1":"0")},Oa:function(a,d){var e=new Date(1E3*d),b=e.getUTCFullYear()+"-"+b.m(e.getUTCMonth()+1,2)+"-"+b.m(e.getUTCDate(),2)+"T"+b.m(e.getUTCHours(),2)+":"+b.m(e.getUTCMinutes(),2)+":"+b.m(e.getUTCSeconds(),2)+"Z";a.appendChild(g.o.createTextNode(b))},Pa:function(a,d){a.appendChild(g.o.createTextNode(d.toPrecision()))},Qa:function(a,d){a.appendChild(g.o.createTextNode(d.toString()))}, | ||
Aa:function(a,d){a.appendChild(g.o.createTextNode(d))}};h.exports=m},{"./utils/isdef":3,"./utils/string":5,"./xml_parser":8}]},{},[1])(1)}); | ||
(function(r){"object"===typeof exports&&"undefined"!==typeof module?module.exports=r():"function"===typeof define&&define.Ma?define([],r):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).WMSCapabilities=r()})(function(){return function g(h,a,e){function f(c,m){if(!a[c]){if(!h[c]){var b="function"==typeof require&&require;if(!m&&b)return b(c,!0);if(l)return l(c,!0);b=Error("Cannot find module '"+c+"'");throw b.code="MODULE_NOT_FOUND",b;}b= | ||
a[c]={exports:{}};h[c][0].call(b.exports,function(a){var b=h[c][1][a];return f(b?b:a)},b,b.exports,g,h,a,e)}return a[c].exports}for(var l="function"==typeof require&&require,c=0;c<e.length;c++)f(e[c]);return f}({1:[function(g,h){h.exports=g("./src/wms")},{"./src/wms":6}],2:[function(g,h){h.exports={u:1,Da:2,ca:3,N:4,Ia:5,Ha:6,La:7,Ea:8,s:9,Ga:10,Fa:11,Ka:12}},{}],3:[function(g,h){h.exports=function(a){return void 0!==a}},{}],4:[function(g,h){h.exports=function(a,e,f){return e in a?a[e]:a[e]=f}},{}], | ||
5:[function(g,h){var a=g("./isdef"),e=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;h.exports={trim:function(a){return a.replace(e,"")},m:function(e,g,c){e=a(c)?e.toFixed(c):String(e);c=e.indexOf(".");-1==c&&(c=e.length);return Array(Math.max(0,g-c)+1).join("0")+e}}},{"./isdef":3}],6:[function(g,h){function a(a){this.version=void 0;this.v=new e;this.F=a}var e=g("./xml_parser"),f=g("./utils/isdef"),l=g("./node_types"),c=g("./utils/setifundefined"),d=g("./xsd"),m=g("./xlink"),b=e.xa;a.prototype.data=function(a){this.F= | ||
a;return this};a.prototype.toJSON=function(a){a=a||this.F;return this.parse(a)};a.prototype.parse=function(a){return this.pa(this.v.Ba(a))};a.prototype.pa=function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType==l.u)return this.Aa(a);return null};a.prototype.Aa=function(c){this.version=c.getAttribute("version");return e.b({version:this.version},a.Z,c,[])||null};a.da=function(c,b){return e.b({},a.L,c,b)};a.G=function(a){var c=d.o;return[c(a.getAttribute("minx")),c(a.getAttribute("miny")),c(a.getAttribute("maxx")), | ||
c(a.getAttribute("maxy"))]};a.fa=function(c){var b=a.G(c),e=d.o,e=[e(c.getAttribute("resx")),e(c.getAttribute("resy"))];return{crs:c.getAttribute("CRS")||c.getAttribute("SRS"),extent:b,res:e}};a.ra=function(c){c=a.G(c);return f(c[0])&&f(c[1])&&f(c[2])&&f(c[3])?c:void 0};a.na=function(c,b){var d=e.b({},a.U,c,b);if(f(d)){var m=d.westBoundLongitude,k=d.southBoundLatitude,g=d.eastBoundLongitude,d=d.northBoundLatitude;return f(m)&&f(k)&&f(g)&&f(d)?[m,k,g,d]:void 0}};a.ga=function(c,b){return e.b({},a.M, | ||
c,b)};a.va=function(c,b){return e.b({},a.aa,c,b)};a.ja=function(c,b){return e.b({},a.P,c,b)};a.ka=function(c,b){return e.b({},a.R,c,b)};a.ia=function(c,b){return e.b({},a.O,c,b)};a.oa=function(c,b){return e.b([],a.T,c,b)};a.ha=function(c,b){return e.b({},a.D,c,b)};a.sa=function(b,m){var g=m[m.length-1],h=e.b({},a.D,b,m);if(f(h)){var k=d.i(b.getAttribute("queryable"));f(k)||(k=g.queryable);h.queryable=f(k)?k:!1;k=d.C(b.getAttribute("cascaded"));f(k)||(k=g.cascaded);h.cascaded=k;k=d.i(b.getAttribute("opaque")); | ||
f(k)||(k=g.opaque);h.opaque=f(k)?k:!1;k=d.i(b.getAttribute("noSubsets"));f(k)||(k=g.noSubsets);h.noSubsets=f(k)?k:!1;k=d.o(b.getAttribute("fixedWidth"));f(k)||(k=g.fixedWidth);h.fixedWidth=k;k=d.o(b.getAttribute("fixedHeight"));f(k)||(k=g.fixedHeight);h.fixedHeight=k;for(var l=["Style","CRS","AuthorityURL"],k=0,t=l.length;k<t;k++){var n=l[k],q=g[n];if(f(q)){var p=c(h,n,[]),p=p.concat(q);h[n]=p}}l="EX_GeographicBoundingBox BoundingBox Dimension Attribution MinScaleDenominator MaxScaleDenominator".split(" "); | ||
k=0;for(t=l.length;k<t;k++)n=l[k],p=h[n],f(p)||(q=g[n],h[n]=q);return h}};a.ma=function(a){return{name:a.getAttribute("name"),units:a.getAttribute("units"),unitSymbol:a.getAttribute("unitSymbol"),"default":a.getAttribute("default"),multipleValues:d.i(a.getAttribute("multipleValues")),nearestValue:d.i(a.getAttribute("nearestValue")),current:d.i(a.getAttribute("current")),values:d.a(a)}};a.h=function(c,b){return e.b({},a.V,c,b)};a.ua=function(c,b){return e.b({},a.$,c,b)};a.la=function(c,b){return e.b({}, | ||
a.S,c,b)};a.qa=function(c,b){return e.b({},a.W,c,b)};a.w=function(c,b){return e.b({},a.Y,c,b)};a.I=function(c,b){var e=a.h(c,b);if(f(e)){var m=d.C,m=[m(c.getAttribute("width")),m(c.getAttribute("height"))];e.size=m;return e}};a.ea=function(c,b){var d=a.h(c,b);if(f(d))return d.name=c.getAttribute("name"),d};a.ta=function(c,b){var d=a.h(c,b);if(f(d))return d.type=c.getAttribute("type"),d};a.wa=function(c,b){return e.b({},a.ba,c,b)};a.H=function(c,b){return e.b([],a.X,c,b)};a.c=[null,"http://www.opengis.net/wms"]; | ||
a.Z=e.f(a.c,{Service:b(a.va),Capability:b(a.ga)});a.M=e.f(a.c,{Request:b(a.ua),Exception:b(a.oa),Layer:b(a.ha)});a.aa=e.f(a.c,{Name:b(d.a),Title:b(d.a),Abstract:b(d.a),KeywordList:b(a.H),OnlineResource:b(m.A),ContactInformation:b(a.ja),Fees:b(d.a),AccessConstraints:b(d.a),LayerLimit:b(d.B),MaxWidth:b(d.B),MaxHeight:b(d.B)});a.P=e.f(a.c,{ContactPersonPrimary:b(a.ka),ContactPosition:b(d.a),ContactAddress:b(a.ia),ContactVoiceTelephone:b(d.a),ContactFacsimileTelephone:b(d.a),ContactElectronicMailAddress:b(d.a)}); | ||
a.R=e.f(a.c,{ContactPerson:b(d.a),ContactOrganization:b(d.a)});a.O=e.f(a.c,{AddressType:b(d.a),Address:b(d.a),City:b(d.a),StateOrProvince:b(d.a),PostCode:b(d.a),Country:b(d.a)});a.T=e.f(a.c,{Format:e.K(d.a)});a.D=e.f(a.c,{Name:b(d.a),Title:b(d.a),Abstract:b(d.a),KeywordList:b(a.H),CRS:e.g(d.a),SRS:e.g(d.a),EX_GeographicBoundingBox:b(a.na),LatLonBoundingBox:b(a.ra),BoundingBox:e.g(a.fa),Dimension:e.g(a.ma),Attribution:b(a.da),AuthorityURL:e.g(a.ea),Identifier:e.g(d.a),MetadataURL:e.g(a.ta),DataURL:e.g(a.h), | ||
FeatureListURL:e.g(a.h),Style:e.g(a.wa),MinScaleDenominator:b(d.j),MaxScaleDenominator:b(d.j),Layer:e.g(a.sa)});a.L=e.f(a.c,{Title:b(d.a),OnlineResource:b(m.A),LogoURL:b(a.I)});a.U=e.f(a.c,{westBoundLongitude:b(d.j),eastBoundLongitude:b(d.j),southBoundLatitude:b(d.j),northBoundLatitude:b(d.j)});a.$=e.f(a.c,{GetCapabilities:b(a.w),GetMap:b(a.w),GetFeatureInfo:b(a.w)});a.Y=e.f(a.c,{Format:e.g(d.a),DCPType:e.g(a.la)});a.S=e.f(a.c,{HTTP:b(a.qa)});a.W=e.f(a.c,{Get:b(a.h),Post:b(a.h)});a.ba=e.f(a.c,{Name:b(d.a), | ||
Title:b(d.a),Abstract:b(d.a),LegendURL:e.g(a.I),StyleSheetURL:b(a.h),StyleURL:b(a.h)});a.V=e.f(a.c,{Format:b(d.a),OnlineResource:b(m.A)});a.X=e.f(a.c,{Keyword:e.K(d.a)});h.exports=a},{"./node_types":2,"./utils/isdef":3,"./utils/setifundefined":4,"./xlink":7,"./xml_parser":8,"./xsd":9}],7:[function(g,h){h.exports={A:function(a){return a.getAttributeNS("http://www.w3.org/1999/xlink","href")}}},{}],8:[function(g,h){function a(){this.v=new DOMParser}var e=g("./utils/isdef"),f=g("./utils/setifundefined"), | ||
l=g("./node_types");a.prototype.Ba=function(a){return this.v.parseFromString(a,"application/xml")};a.l=function(c){return a.J(c,!1,[]).join("")};a.J=function(c,d,e){if(c.nodeType===l.N||c.nodeType===l.ca)d?e.push(String(c.nodeValue).replace(/(\r\n|\r|\n)/g,"")):e.push(c.nodeValue);else for(c=c.firstChild;c;c=c.nextSibling)a.J(c,d,e);return e};a.za=function(c,d,m){for(d=a.firstElementChild(d);d;d=a.nextElementSibling(d)){var b=c[d.namespaceURI||null];e(b)&&(b=b[d.localName],e(b)&&b.call(void 0,d,m))}}; | ||
a.firstElementChild=function(a){for(a=a.firstElementChild||a.firstChild;a&&a.nodeType!==l.u;)a=a.nextSibling;return a};a.nextElementSibling=function(a){for(a=a.nextElementSibling||a.nextSibling;a&&a.nodeType!==l.u;)a=a.nextSibling;return a};a.f=function(c,d){return a.ya(c,d)};a.ya=function(a,d){var m=e(void 0)?void 0:{},b,f;b=0;for(f=a.length;b<f;++b)m[a[b]]=d;return m};a.xa=function(a,d,f){return function(b,g){var h=a.call(e(f)?f:this,b,g);if(e(h)){var l=g[g.length-1],u=e(d)?d:b.localName;l[u]=h}}}; | ||
a.g=function(a){return function(d,g){var b=a.call(e(void 0)?void 0:this,d,g);if(e(b)){var h=g[g.length-1],l=e(void 0)?void 0:d.localName;f(h,l,[]).push(b)}}};a.K=function(a){return function(d,f){var b=a.call(e(void 0)?void 0:this,d,f);e(b)&&f[f.length-1].push(b)}};a.b=function(c,d,e,b){b.push(c);a.za(d,e,b);return b.pop()};h.exports=a},{"./node_types":2,"./utils/isdef":3,"./utils/setifundefined":4}],9:[function(g,h){var a=g("./utils/isdef"),e=g("./utils/string"),f=g("./xml_parser"),l={Ja:"http://www.w3.org/2001/XMLSchema", | ||
Na:function(a){a=f.l(a);return l.i(a)},i:function(c){if(c=/^\s*(true|1)|(false|0)\s*$/.exec(c))return a(c[1])||!1},Oa:function(c){c=f.l(c);if(c=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|(?:([+\-])(\d{2})(?::(\d{2}))?))\s*$/.exec(c)){var d=Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),parseInt(c[6],10))/1E3;if("Z"!=c[7]){var e="-"==c[8]?-1:1,d=d+60*e*parseInt(c[9],10);a(c[10])&&(d+=3600*e*parseInt(c[10],10))}return d}},j:function(a){a= | ||
f.l(a);return l.o(a)},o:function(a){if(a=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(a))return parseFloat(a[1])},B:function(a){a=f.l(a);return l.C(a)},C:function(a){if(a=/^\s*(\d+)\s*$/.exec(a))return parseInt(a[1],10)},a:function(a){a=f.l(a);return e.trim(a)},Pa:function(a,d){l.Ca(a,d?"1":"0")},Qa:function(a,d){var e=new Date(1E3*d),b=e.getUTCFullYear()+"-"+b.m(e.getUTCMonth()+1,2)+"-"+b.m(e.getUTCDate(),2)+"T"+b.m(e.getUTCHours(),2)+":"+b.m(e.getUTCMinutes(),2)+":"+b.m(e.getUTCSeconds(),2)+ | ||
"Z";a.appendChild(f.s.createTextNode(b))},Ra:function(a,d){a.appendChild(f.s.createTextNode(d.toPrecision()))},Sa:function(a,d){a.appendChild(f.s.createTextNode(d.toString()))},Ca:function(a,d){a.appendChild(f.s.createTextNode(d))}};h.exports=l},{"./utils/isdef":3,"./utils/string":5,"./xml_parser":8}]},{},[1])(1)}); |
{ | ||
"name": "wms-capabilities", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "WMS service Capabilities > JSON, based on openlayers ", | ||
@@ -15,3 +15,3 @@ "main": "index.js", | ||
"build-less": "lessc example/less/style.less > example/css/style.css", | ||
"build-css": "npm run build-less && npm run compress-less", | ||
"build-css": "npm run build-less", | ||
"build-js": "browserify -s WMSCapabilities index.js -o dist/wms-capabilities.js", | ||
@@ -18,0 +18,0 @@ "compress": "npm run compress-js", |
@@ -41,1 +41,10 @@ # WMS `GetCapabilities` parser | ||
``` | ||
### Command-line | ||
```sh | ||
$ npm install -g wms-capabilities | ||
$ cat capabilities.xml | wmscapabilities > out.json | ||
$ # or | ||
$ wmscapabilities capabilities.json > out.json | ||
``` |
@@ -105,2 +105,18 @@ "use strict"; | ||
* @param {Node} node Node. | ||
* @return {ol.Extent} Bounding box object. | ||
*/ | ||
WMS._readBoundingBoxExtent = function(node) { | ||
var readDecimalString = XSD.readDecimalString; | ||
return [ | ||
readDecimalString(node.getAttribute('minx')), | ||
readDecimalString(node.getAttribute('miny')), | ||
readDecimalString(node.getAttribute('maxx')), | ||
readDecimalString(node.getAttribute('maxy')) | ||
]; | ||
} | ||
/** | ||
* @private | ||
* @param {Node} node Node. | ||
* @param {Array.<*>} objectStack Object stack. | ||
@@ -110,9 +126,4 @@ * @return {Object} Bounding box object. | ||
WMS._readBoundingBox = function(node, objectStack) { | ||
var extent = WMS._readBoundingBoxExtent(node); | ||
var readDecimalString = XSD.readDecimalString; | ||
var extent = [ | ||
readDecimalString(node.getAttribute('minx')), | ||
readDecimalString(node.getAttribute('miny')), | ||
readDecimalString(node.getAttribute('maxx')), | ||
readDecimalString(node.getAttribute('maxy')) | ||
]; | ||
@@ -131,3 +142,20 @@ var resolutions = [ | ||
/** | ||
* @private | ||
* @param {Node} node Node. | ||
* @param {Array.<*>} objectStack Object stack. | ||
* @return {ol.Extent|undefined} Bounding box object. | ||
*/ | ||
WMS._readLatLonBoundingBox = function(node, objectStack) { | ||
var extent = WMS._readBoundingBoxExtent(node); | ||
if (!isDef(extent[0]) || !isDef(extent[1]) || | ||
!isDef(extent[2]) || !isDef(extent[3])) { | ||
return undefined; | ||
} | ||
return extent; | ||
}; | ||
/** | ||
@@ -601,3 +629,5 @@ * @private | ||
'CRS': XMLParser.makeObjectPropertyPusher(XSD.readString), | ||
'SRS': XMLParser.makeObjectPropertyPusher(XSD.readString), | ||
'EX_GeographicBoundingBox': makePropertySetter(WMS._readEXGeographicBoundingBox), | ||
'LatLonBoundingBox': makePropertySetter(WMS._readLatLonBoundingBox), | ||
'BoundingBox': XMLParser.makeObjectPropertyPusher(WMS._readBoundingBox), | ||
@@ -604,0 +634,0 @@ 'Dimension': XMLParser.makeObjectPropertyPusher(WMS._readDimension), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50
2396780
11800