Rename _ol_format_XSD_ to XSD

This commit is contained in:
Tim Schaub
2017-12-17 02:25:01 -07:00
parent 06772567d5
commit 3371ae86c1
10 changed files with 284 additions and 284 deletions

View File

@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
import {createOrUpdate} from '../extent.js'; import {createOrUpdate} from '../extent.js';
import FeatureFormat from '../format/Feature.js'; import FeatureFormat from '../format/Feature.js';
import GMLBase from '../format/GMLBase.js'; import GMLBase from '../format/GMLBase.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js'; import Geometry from '../geom/Geometry.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
import {get as getProjection, transformExtent} from '../proj.js'; import {get as getProjection, transformExtent} from '../proj.js';
@@ -262,7 +262,7 @@ GML2.prototype.writeFeatureElement = function(node, feature, objectStack) {
} else { } else {
if (!(key in context.serializers[featureNS])) { if (!(key in context.serializers[featureNS])) {
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender( context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeStringTextNode); XSD.writeStringTextNode);
} }
} }
} }
@@ -365,7 +365,7 @@ GML2.prototype.writeCoordinates_ = function(node, value, objectStack) {
point = points[i]; point = points[i];
parts[i] = this.getCoords_(point, srsName, hasZ); parts[i] = this.getCoords_(point, srsName, hasZ);
} }
_ol_format_XSD_.writeStringTextNode(node, parts.join(' ')); XSD.writeStringTextNode(node, parts.join(' '));
}; };
@@ -521,7 +521,7 @@ GML2.prototype.writePoint_ = function(node, geometry, objectStack) {
node.appendChild(coordinates); node.appendChild(coordinates);
var point = geometry.getCoordinates(); var point = geometry.getCoordinates();
var coord = this.getCoords_(point, srsName, hasZ); var coord = this.getCoords_(point, srsName, hasZ);
_ol_format_XSD_.writeStringTextNode(coordinates, coord); XSD.writeStringTextNode(coordinates, coord);
}; };
@@ -773,8 +773,8 @@ GML2.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
*/ */
GML2.ENVELOPE_SERIALIZERS_ = { GML2.ENVELOPE_SERIALIZERS_ = {
'http://www.opengis.net/gml': { 'http://www.opengis.net/gml': {
'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode) 'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
} }
}; };
export default GML2; export default GML2;

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../array.js';
import {createOrUpdate} from '../extent.js'; import {createOrUpdate} from '../extent.js';
import FeatureFormat from '../format/Feature.js'; import FeatureFormat from '../format/Feature.js';
import GMLBase from '../format/GMLBase.js'; import GMLBase from '../format/GMLBase.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js'; import Geometry from '../geom/Geometry.js';
import GeometryLayout from '../geom/GeometryLayout.js'; import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js'; import LineString from '../geom/LineString.js';
@@ -363,16 +363,16 @@ GML3.prototype.readFlatPosList_ = function(node, objectStack) {
// The "dimension" attribute is from the GML 3.0.1 spec. // The "dimension" attribute is from the GML 3.0.1 spec.
var dim = 2; var dim = 2;
if (node.getAttribute('srsDimension')) { if (node.getAttribute('srsDimension')) {
dim = _ol_format_XSD_.readNonNegativeIntegerString( dim = XSD.readNonNegativeIntegerString(
node.getAttribute('srsDimension')); node.getAttribute('srsDimension'));
} else if (node.getAttribute('dimension')) { } else if (node.getAttribute('dimension')) {
dim = _ol_format_XSD_.readNonNegativeIntegerString( dim = XSD.readNonNegativeIntegerString(
node.getAttribute('dimension')); node.getAttribute('dimension'));
} else if (node.parentNode.getAttribute('srsDimension')) { } else if (node.parentNode.getAttribute('srsDimension')) {
dim = _ol_format_XSD_.readNonNegativeIntegerString( dim = XSD.readNonNegativeIntegerString(
node.parentNode.getAttribute('srsDimension')); node.parentNode.getAttribute('srsDimension'));
} else if (contextDimension) { } else if (contextDimension) {
dim = _ol_format_XSD_.readNonNegativeIntegerString(contextDimension); dim = XSD.readNonNegativeIntegerString(contextDimension);
} }
var x, y, z; var x, y, z;
var flatCoordinates = []; var flatCoordinates = [];
@@ -597,7 +597,7 @@ GML3.prototype.writePos_ = function(node, value, objectStack) {
var z = point[2] || 0; var z = point[2] || 0;
coords += ' ' + z; coords += ' ' + z;
} }
_ol_format_XSD_.writeStringTextNode(node, coords); XSD.writeStringTextNode(node, coords);
}; };
@@ -647,7 +647,7 @@ GML3.prototype.writePosList_ = function(node, value, objectStack) {
point = points[i]; point = points[i];
parts[i] = this.getCoords_(point, srsName, hasZ); parts[i] = this.getCoords_(point, srsName, hasZ);
} }
_ol_format_XSD_.writeStringTextNode(node, parts.join(' ')); XSD.writeStringTextNode(node, parts.join(' '));
}; };
@@ -675,8 +675,8 @@ GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
*/ */
GML3.ENVELOPE_SERIALIZERS_ = { GML3.ENVELOPE_SERIALIZERS_ = {
'http://www.opengis.net/gml': { 'http://www.opengis.net/gml': {
'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode) 'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
} }
}; };
@@ -1004,7 +1004,7 @@ GML3.prototype.writeFeatureElement = function(node, feature, objectStack) {
} else { } else {
if (!(key in context.serializers[featureNS])) { if (!(key in context.serializers[featureNS])) {
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender( context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeStringTextNode); XSD.writeStringTextNode);
} }
} }
} }

View File

@@ -6,7 +6,7 @@ import _ol_Feature_ from '../Feature.js';
import _ol_array_ from '../array.js'; import _ol_array_ from '../array.js';
import FeatureFormat from '../format/Feature.js'; import FeatureFormat from '../format/Feature.js';
import XMLFeature from '../format/XMLFeature.js'; import XMLFeature from '../format/XMLFeature.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import GeometryLayout from '../geom/GeometryLayout.js'; import GeometryLayout from '../geom/GeometryLayout.js';
import LineString from '../geom/LineString.js'; import LineString from '../geom/LineString.js';
import MultiLineString from '../geom/MultiLineString.js'; import MultiLineString from '../geom/MultiLineString.js';
@@ -339,9 +339,9 @@ GPX.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.LINK_PARSERS_ = _ol_xml_.makeStructureNS( GPX.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'text': 'text':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkText'), _ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkText'),
'type': 'type':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkType') _ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkType')
}); });
@@ -352,15 +352,15 @@ GPX.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
GPX.RTE_PARSERS_ = _ol_xml_.makeStructureNS( GPX.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'link': GPX.parseLink_, 'link': GPX.parseLink_,
'number': 'number':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger), _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
'extensions': GPX.parseExtensions_, 'extensions': GPX.parseExtensions_,
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'rtept': GPX.parseRtePt_ 'rtept': GPX.parseRtePt_
}); });
@@ -372,8 +372,8 @@ GPX.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
GPX.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS( GPX.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime) 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
}); });
@@ -384,14 +384,14 @@ GPX.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
GPX.TRK_PARSERS_ = _ol_xml_.makeStructureNS( GPX.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'link': GPX.parseLink_, 'link': GPX.parseLink_,
'number': 'number':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger), _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'extensions': GPX.parseExtensions_, 'extensions': GPX.parseExtensions_,
'trkseg': GPX.parseTrkSeg_ 'trkseg': GPX.parseTrkSeg_
}); });
@@ -415,8 +415,8 @@ GPX.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
GPX.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS( GPX.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime) 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
}); });
@@ -427,27 +427,27 @@ GPX.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
GPX.WPT_PARSERS_ = _ol_xml_.makeStructureNS( GPX.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime), 'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime),
'magvar': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'magvar': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'geoidheight': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'geoidheight': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'link': GPX.parseLink_, 'link': GPX.parseLink_,
'sym': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'sym': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'fix': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'fix': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'sat': _ol_xml_.makeObjectPropertySetter( 'sat': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'hdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'hdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'vdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'vdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'pdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'pdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'ageofdgpsdata': 'ageofdgpsdata':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'dgpsid': 'dgpsid':
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger), _ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
'extensions': GPX.parseExtensions_ 'extensions': GPX.parseExtensions_
}); });
@@ -719,8 +719,8 @@ GPX.LINK_SEQUENCE_ = ['text', 'type'];
*/ */
GPX.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS( GPX.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'text': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'text': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode) 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
}); });
@@ -742,14 +742,14 @@ GPX.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
*/ */
GPX.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS( GPX.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'link': _ol_xml_.makeChildAppender(GPX.writeLink_), 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
'number': _ol_xml_.makeChildAppender( 'number': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeNonNegativeIntegerTextNode), XSD.writeNonNegativeIntegerTextNode),
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'rtept': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender( 'rtept': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
GPX.writeWptType_)) GPX.writeWptType_))
}); });
@@ -784,14 +784,14 @@ GPX.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
*/ */
GPX.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS( GPX.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'link': _ol_xml_.makeChildAppender(GPX.writeLink_), 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
'number': _ol_xml_.makeChildAppender( 'number': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeNonNegativeIntegerTextNode), XSD.writeNonNegativeIntegerTextNode),
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'trkseg': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender( 'trkseg': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
GPX.writeTrkSeg_)) GPX.writeTrkSeg_))
}); });
@@ -835,28 +835,28 @@ GPX.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
*/ */
GPX.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS( GPX.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
GPX.NAMESPACE_URIS_, { GPX.NAMESPACE_URIS_, {
'ele': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'ele': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'time': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDateTimeTextNode), 'time': _ol_xml_.makeChildAppender(XSD.writeDateTimeTextNode),
'magvar': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'magvar': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'geoidheight': _ol_xml_.makeChildAppender( 'geoidheight': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeDecimalTextNode), XSD.writeDecimalTextNode),
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'link': _ol_xml_.makeChildAppender(GPX.writeLink_), 'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
'sym': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'sym': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'fix': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'fix': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'sat': _ol_xml_.makeChildAppender( 'sat': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeNonNegativeIntegerTextNode), XSD.writeNonNegativeIntegerTextNode),
'hdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'hdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'vdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'vdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'pdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'pdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'ageofdgpsdata': _ol_xml_.makeChildAppender( 'ageofdgpsdata': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeDecimalTextNode), XSD.writeDecimalTextNode),
'dgpsid': _ol_xml_.makeChildAppender( 'dgpsid': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeNonNegativeIntegerTextNode) XSD.writeNonNegativeIntegerTextNode)
}); });

View File

@@ -8,7 +8,7 @@ import _ol_asserts_ from '../asserts.js';
import _ol_color_ from '../color.js'; import _ol_color_ from '../color.js';
import FeatureFormat from '../format/Feature.js'; import FeatureFormat from '../format/Feature.js';
import XMLFeature from '../format/XMLFeature.js'; import XMLFeature from '../format/XMLFeature.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import GeometryCollection from '../geom/GeometryCollection.js'; import GeometryCollection from '../geom/GeometryCollection.js';
import GeometryLayout from '../geom/GeometryLayout.js'; import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js'; import GeometryType from '../geom/GeometryType.js';
@@ -536,7 +536,7 @@ KML.readVec2_ = function(node) {
* @return {number|undefined} Scale. * @return {number|undefined} Scale.
*/ */
KML.readScale_ = function(node) { KML.readScale_ = function(node) {
return _ol_format_XSD_.readDecimal(node); return XSD.readDecimal(node);
}; };
@@ -1194,7 +1194,7 @@ KML.SchemaDataParser_ = function(node, objectStack) {
KML.SimpleDataParser_ = function(node, objectStack) { KML.SimpleDataParser_ = function(node, objectStack) {
var name = node.getAttribute('name'); var name = node.getAttribute('name');
if (name !== null) { if (name !== null) {
var data = _ol_format_XSD_.readString(node); var data = XSD.readString(node);
var featureObject = var featureObject =
/** @type {Object} */ (objectStack[objectStack.length - 1]); /** @type {Object} */ (objectStack[objectStack.length - 1]);
featureObject[name] = data; featureObject[name] = data;
@@ -1310,8 +1310,8 @@ KML.whenParser_ = function(node, objectStack) {
*/ */
KML.DATA_PARSERS_ = _ol_xml_.makeStructureNS( KML.DATA_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'displayName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'displayName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'value': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString) 'value': _ol_xml_.makeObjectPropertySetter(XSD.readString)
}); });
@@ -1346,13 +1346,13 @@ KML.REGION_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
KML.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS( KML.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'altitudeMode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'altitudeMode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'minAltitude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'minAltitude': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'maxAltitude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'maxAltitude': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'north': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'north': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'south': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'south': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'east': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'east': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'west': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal) 'west': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
}); });
@@ -1363,10 +1363,10 @@ KML.LAT_LON_ALT_BOX_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
KML.LOD_PARSERS_ = _ol_xml_.makeStructureNS( KML.LOD_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'minLodPixels': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'minLodPixels': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'maxLodPixels': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'maxLodPixels': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'minFadeExtent': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'minFadeExtent': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'maxFadeExtent': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal) 'maxFadeExtent': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
}); });
@@ -1377,9 +1377,9 @@ KML.LOD_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = _ol_xml_.makeStructureNS( KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'extrude': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean), 'extrude': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
'tessellate': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean), 'tessellate': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
'altitudeMode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString) 'altitudeMode': _ol_xml_.makeObjectPropertySetter(XSD.readString)
}); });
@@ -1441,10 +1441,10 @@ KML.ICON_PARSERS_ = _ol_xml_.makeStructureNS(
'href': _ol_xml_.makeObjectPropertySetter(KML.readURI_) 'href': _ol_xml_.makeObjectPropertySetter(KML.readURI_)
}, _ol_xml_.makeStructureNS( }, _ol_xml_.makeStructureNS(
KML.GX_NAMESPACE_URIS_, { KML.GX_NAMESPACE_URIS_, {
'x': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'x': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'y': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'y': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'w': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'w': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'h': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal) 'h': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
})); }));
@@ -1456,7 +1456,7 @@ KML.ICON_PARSERS_ = _ol_xml_.makeStructureNS(
KML.ICON_STYLE_PARSERS_ = _ol_xml_.makeStructureNS( KML.ICON_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'Icon': _ol_xml_.makeObjectPropertySetter(KML.readIcon_), 'Icon': _ol_xml_.makeObjectPropertySetter(KML.readIcon_),
'heading': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal), 'heading': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
'hotSpot': _ol_xml_.makeObjectPropertySetter(KML.readVec2_), 'hotSpot': _ol_xml_.makeObjectPropertySetter(KML.readVec2_),
'scale': _ol_xml_.makeObjectPropertySetter(KML.readScale_) 'scale': _ol_xml_.makeObjectPropertySetter(KML.readScale_)
}); });
@@ -1493,7 +1493,7 @@ KML.LABEL_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
KML.LINE_STYLE_PARSERS_ = _ol_xml_.makeStructureNS( KML.LINE_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_), 'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_),
'width': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal) 'width': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal)
}); });
@@ -1533,12 +1533,12 @@ KML.NETWORK_LINK_PARSERS_ = _ol_xml_.makeStructureNS(
'ExtendedData': KML.ExtendedDataParser_, 'ExtendedData': KML.ExtendedDataParser_,
'Region': KML.RegionParser_, 'Region': KML.RegionParser_,
'Link': KML.LinkParser_, 'Link': KML.LinkParser_,
'address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'description': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'description': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'open': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean), 'open': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
'phoneNumber': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'phoneNumber': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'visibility': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean) 'visibility': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
}); });
@@ -1572,7 +1572,7 @@ KML.OUTER_BOUNDARY_IS_PARSERS_ = _ol_xml_.makeStructureNS(
KML.PAIR_PARSERS_ = _ol_xml_.makeStructureNS( KML.PAIR_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_), 'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_),
'key': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'key': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_) 'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_)
}); });
@@ -1598,13 +1598,13 @@ KML.PLACEMARK_PARSERS_ = _ol_xml_.makeStructureNS(
KML.readPolygon_, 'geometry'), KML.readPolygon_, 'geometry'),
'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_), 'Style': _ol_xml_.makeObjectPropertySetter(KML.readStyle_),
'StyleMap': KML.PlacemarkStyleMapParser_, 'StyleMap': KML.PlacemarkStyleMapParser_,
'address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'description': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'description': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'open': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean), 'open': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
'phoneNumber': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'phoneNumber': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_), 'styleUrl': _ol_xml_.makeObjectPropertySetter(KML.readURI_),
'visibility': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean) 'visibility': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
}, _ol_xml_.makeStructureNS( }, _ol_xml_.makeStructureNS(
KML.GX_NAMESPACE_URIS_, { KML.GX_NAMESPACE_URIS_, {
'MultiTrack': _ol_xml_.makeObjectPropertySetter( 'MultiTrack': _ol_xml_.makeObjectPropertySetter(
@@ -1623,8 +1623,8 @@ KML.PLACEMARK_PARSERS_ = _ol_xml_.makeStructureNS(
KML.POLY_STYLE_PARSERS_ = _ol_xml_.makeStructureNS( KML.POLY_STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_), 'color': _ol_xml_.makeObjectPropertySetter(KML.readColor_),
'fill': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean), 'fill': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean),
'outline': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readBoolean) 'outline': _ol_xml_.makeObjectPropertySetter(XSD.readBoolean)
}); });
@@ -1924,7 +1924,7 @@ KML.prototype.readNameFromNode = function(node) {
for (n = node.firstElementChild; n; n = n.nextElementSibling) { for (n = node.firstElementChild; n; n = n.nextElementSibling) {
if (_ol_array_.includes(KML.NAMESPACE_URIS_, n.namespaceURI) && if (_ol_array_.includes(KML.NAMESPACE_URIS_, n.namespaceURI) &&
n.localName == 'name') { n.localName == 'name') {
return _ol_format_XSD_.readString(n); return XSD.readString(n);
} }
} }
for (n = node.firstElementChild; n; n = n.nextElementSibling) { for (n = node.firstElementChild; n; n = n.nextElementSibling) {
@@ -2100,7 +2100,7 @@ KML.writeColorTextNode_ = function(node, color) {
var hex = parseInt(abgr[i], 10).toString(16); var hex = parseInt(abgr[i], 10).toString(16);
abgr[i] = (hex.length == 1) ? '0' + hex : hex; abgr[i] = (hex.length == 1) ? '0' + hex : hex;
} }
_ol_format_XSD_.writeStringTextNode(node, abgr.join('')); XSD.writeStringTextNode(node, abgr.join(''));
}; };
@@ -2142,7 +2142,7 @@ KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStack) {
} }
} }
} }
_ol_format_XSD_.writeStringTextNode(node, text); XSD.writeStringTextNode(node, text);
}; };
@@ -2180,7 +2180,7 @@ KML.writeDataNode_ = function(node, pair, objectStack) {
* @private * @private
*/ */
KML.writeDataNodeName_ = function(node, name) { KML.writeDataNodeName_ = function(node, name) {
_ol_format_XSD_.writeCDATASection(node, name); XSD.writeCDATASection(node, name);
}; };
@@ -2190,7 +2190,7 @@ KML.writeDataNodeName_ = function(node, name) {
* @private * @private
*/ */
KML.writeDataNodeValue_ = function(node, value) { KML.writeDataNodeValue_ = function(node, value) {
_ol_format_XSD_.writeStringTextNode(node, value); XSD.writeStringTextNode(node, value);
}; };
@@ -2540,7 +2540,7 @@ KML.writePolyStyle_ = function(node, style, objectStack) {
*/ */
KML.writeScaleTextNode_ = function(node, scale) { KML.writeScaleTextNode_ = function(node, scale) {
// the Math is to remove any excess decimals created by float arithmetic // the Math is to remove any excess decimals created by float arithmetic
_ol_format_XSD_.writeDecimalTextNode(node, XSD.writeDecimalTextNode(node,
Math.round(scale * 1e6) / 1e6); Math.round(scale * 1e6) / 1e6);
}; };
@@ -2675,13 +2675,13 @@ KML.ICON_SEQUENCE_ = _ol_xml_.makeStructureNS(
*/ */
KML.ICON_SERIALIZERS_ = _ol_xml_.makeStructureNS( KML.ICON_SERIALIZERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'href': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode) 'href': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
}, _ol_xml_.makeStructureNS( }, _ol_xml_.makeStructureNS(
KML.GX_NAMESPACE_URIS_, { KML.GX_NAMESPACE_URIS_, {
'x': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'x': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'y': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'y': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'w': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'w': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'h': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode) 'h': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode)
})); }));
@@ -2704,7 +2704,7 @@ KML.ICON_STYLE_SEQUENCE_ = _ol_xml_.makeStructureNS(
KML.ICON_STYLE_SERIALIZERS_ = _ol_xml_.makeStructureNS( KML.ICON_STYLE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'Icon': _ol_xml_.makeChildAppender(KML.writeIcon_), 'Icon': _ol_xml_.makeChildAppender(KML.writeIcon_),
'heading': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode), 'heading': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
'hotSpot': _ol_xml_.makeChildAppender(KML.writeVec2_), 'hotSpot': _ol_xml_.makeChildAppender(KML.writeVec2_),
'scale': _ol_xml_.makeChildAppender(KML.writeScaleTextNode_) 'scale': _ol_xml_.makeChildAppender(KML.writeScaleTextNode_)
}); });
@@ -2752,7 +2752,7 @@ KML.LINE_STYLE_SEQUENCE_ = _ol_xml_.makeStructureNS(
KML.LINE_STYLE_SERIALIZERS_ = _ol_xml_.makeStructureNS( KML.LINE_STYLE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'color': _ol_xml_.makeChildAppender(KML.writeColorTextNode_), 'color': _ol_xml_.makeChildAppender(KML.writeColorTextNode_),
'width': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode) 'width': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode)
}); });
@@ -2816,16 +2816,16 @@ KML.PLACEMARK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
KML.writePrimitiveGeometry_), KML.writePrimitiveGeometry_),
'Polygon': _ol_xml_.makeChildAppender(KML.writePolygon_), 'Polygon': _ol_xml_.makeChildAppender(KML.writePolygon_),
'Style': _ol_xml_.makeChildAppender(KML.writeStyle_), 'Style': _ol_xml_.makeChildAppender(KML.writeStyle_),
'address': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'address': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'description': _ol_xml_.makeChildAppender( 'description': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeStringTextNode), XSD.writeStringTextNode),
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'open': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeBooleanTextNode), 'open': _ol_xml_.makeChildAppender(XSD.writeBooleanTextNode),
'phoneNumber': _ol_xml_.makeChildAppender( 'phoneNumber': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeStringTextNode), XSD.writeStringTextNode),
'styleUrl': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'styleUrl': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'visibility': _ol_xml_.makeChildAppender( 'visibility': _ol_xml_.makeChildAppender(
_ol_format_XSD_.writeBooleanTextNode) XSD.writeBooleanTextNode)
}); });
@@ -2847,9 +2847,9 @@ KML.PRIMITIVE_GEOMETRY_SEQUENCE_ = _ol_xml_.makeStructureNS(
*/ */
KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = _ol_xml_.makeStructureNS( KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = _ol_xml_.makeStructureNS(
KML.NAMESPACE_URIS_, { KML.NAMESPACE_URIS_, {
'extrude': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeBooleanTextNode), 'extrude': _ol_xml_.makeChildAppender(XSD.writeBooleanTextNode),
'tessellate': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeBooleanTextNode), 'tessellate': _ol_xml_.makeChildAppender(XSD.writeBooleanTextNode),
'altitudeMode': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode), 'altitudeMode': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
'coordinates': _ol_xml_.makeChildAppender( 'coordinates': _ol_xml_.makeChildAppender(
KML.writeCoordinatesTextNode_) KML.writeCoordinatesTextNode_)
}); });

View File

@@ -4,7 +4,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import XLink from '../format/XLink.js'; import XLink from '../format/XLink.js';
import XML from '../format/XML.js'; import XML from '../format/XML.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import _ol_xml_ from '../xml.js'; import _ol_xml_ from '../xml.js';
/** /**
@@ -226,7 +226,7 @@ OWS.readServiceProvider_ = function(node, objectStack) {
* @return {string|undefined} The value. * @return {string|undefined} The value.
*/ */
OWS.readValue_ = function(node, objectStack) { OWS.readValue_ = function(node, objectStack) {
return _ol_format_XSD_.readString(node); return XSD.readString(node);
}; };
@@ -265,14 +265,14 @@ OWS.PARSERS_ = _ol_xml_.makeStructureNS(
OWS.ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS( OWS.ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
OWS.NAMESPACE_URIS_, { OWS.NAMESPACE_URIS_, {
'DeliveryPoint': _ol_xml_.makeObjectPropertySetter( 'DeliveryPoint': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'City': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'City': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'AdministrativeArea': _ol_xml_.makeObjectPropertySetter( 'AdministrativeArea': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'PostalCode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'PostalCode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Country': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Country': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'ElectronicMailAddress': _ol_xml_.makeObjectPropertySetter( 'ElectronicMailAddress': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
}); });
@@ -363,8 +363,8 @@ OWS.OPERATIONS_METADATA_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
OWS.PHONE_PARSERS_ = _ol_xml_.makeStructureNS( OWS.PHONE_PARSERS_ = _ol_xml_.makeStructureNS(
OWS.NAMESPACE_URIS_, { OWS.NAMESPACE_URIS_, {
'Voice': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Voice': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Facsimile': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString) 'Facsimile': _ol_xml_.makeObjectPropertySetter(XSD.readString)
}); });
@@ -389,8 +389,8 @@ OWS.SERVICE_CONTACT_PARSERS_ =
_ol_xml_.makeStructureNS( _ol_xml_.makeStructureNS(
OWS.NAMESPACE_URIS_, { OWS.NAMESPACE_URIS_, {
'IndividualName': _ol_xml_.makeObjectPropertySetter( 'IndividualName': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'PositionName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'PositionName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'ContactInfo': _ol_xml_.makeObjectPropertySetter( 'ContactInfo': _ol_xml_.makeObjectPropertySetter(
OWS.readContactInfo_) OWS.readContactInfo_)
}); });
@@ -404,13 +404,13 @@ OWS.SERVICE_CONTACT_PARSERS_ =
OWS.SERVICE_IDENTIFICATION_PARSERS_ = OWS.SERVICE_IDENTIFICATION_PARSERS_ =
_ol_xml_.makeStructureNS( _ol_xml_.makeStructureNS(
OWS.NAMESPACE_URIS_, { OWS.NAMESPACE_URIS_, {
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'AccessConstraints': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'AccessConstraints': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Fees': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Fees': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'ServiceTypeVersion': _ol_xml_.makeObjectPropertySetter( 'ServiceTypeVersion': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'ServiceType': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString) 'ServiceType': _ol_xml_.makeObjectPropertySetter(XSD.readString)
}); });
@@ -422,7 +422,7 @@ OWS.SERVICE_IDENTIFICATION_PARSERS_ =
OWS.SERVICE_PROVIDER_PARSERS_ = OWS.SERVICE_PROVIDER_PARSERS_ =
_ol_xml_.makeStructureNS( _ol_xml_.makeStructureNS(
OWS.NAMESPACE_URIS_, { OWS.NAMESPACE_URIS_, {
'ProviderName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'ProviderName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'ProviderSite': _ol_xml_.makeObjectPropertySetter(XLink.readHref), 'ProviderSite': _ol_xml_.makeObjectPropertySetter(XLink.readHref),
'ServiceContact': _ol_xml_.makeObjectPropertySetter( 'ServiceContact': _ol_xml_.makeObjectPropertySetter(
OWS.readServiceContact_) OWS.readServiceContact_)

View File

@@ -8,7 +8,7 @@ import GML3 from '../format/GML3.js';
import GMLBase from '../format/GMLBase.js'; import GMLBase from '../format/GMLBase.js';
import _ol_format_filter_ from '../format/filter.js'; import _ol_format_filter_ from '../format/filter.js';
import XMLFeature from '../format/XMLFeature.js'; import XMLFeature from '../format/XMLFeature.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import Geometry from '../geom/Geometry.js'; import Geometry from '../geom/Geometry.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
import {get as getProjection} from '../proj.js'; import {get as getProjection} from '../proj.js';
@@ -250,7 +250,7 @@ WFS.FEATURE_COLLECTION_PARSERS_ = {
*/ */
WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) { WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
var result = {}; var result = {};
var value = _ol_format_XSD_.readNonNegativeIntegerString( var value = XSD.readNonNegativeIntegerString(
node.getAttribute('numberOfFeatures')); node.getAttribute('numberOfFeatures'));
result['numberOfFeatures'] = value; result['numberOfFeatures'] = value;
return _ol_xml_.pushParseAndPop( return _ol_xml_.pushParseAndPop(
@@ -267,11 +267,11 @@ WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
WFS.TRANSACTION_SUMMARY_PARSERS_ = { WFS.TRANSACTION_SUMMARY_PARSERS_ = {
'http://www.opengis.net/wfs': { 'http://www.opengis.net/wfs': {
'totalInserted': _ol_xml_.makeObjectPropertySetter( 'totalInserted': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'totalUpdated': _ol_xml_.makeObjectPropertySetter( 'totalUpdated': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'totalDeleted': _ol_xml_.makeObjectPropertySetter( 'totalDeleted': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger) XSD.readNonNegativeInteger)
} }
}; };
@@ -382,7 +382,7 @@ WFS.prototype.readTransactionResponseFromNode = function(node) {
*/ */
WFS.QUERY_SERIALIZERS_ = { WFS.QUERY_SERIALIZERS_ = {
'http://www.opengis.net/wfs': { 'http://www.opengis.net/wfs': {
'PropertyName': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode) 'PropertyName': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
} }
}; };
@@ -518,7 +518,7 @@ WFS.writeProperty_ = function(node, pair, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
var gmlVersion = context['gmlVersion']; var gmlVersion = context['gmlVersion'];
node.appendChild(name); node.appendChild(name);
_ol_format_XSD_.writeStringTextNode(name, pair.name); XSD.writeStringTextNode(name, pair.name);
if (pair.value !== undefined && pair.value !== null) { if (pair.value !== undefined && pair.value !== null) {
var value = _ol_xml_.createElementNS(WFS.WFSNS, 'Value'); var value = _ol_xml_.createElementNS(WFS.WFSNS, 'Value');
node.appendChild(value); node.appendChild(value);
@@ -531,7 +531,7 @@ WFS.writeProperty_ = function(node, pair, objectStack) {
pair.value, objectStack); pair.value, objectStack);
} }
} else { } else {
_ol_format_XSD_.writeStringTextNode(value, pair.value); XSD.writeStringTextNode(value, pair.value);
} }
} }
}; };
@@ -552,7 +552,7 @@ WFS.writeNative_ = function(node, nativeElement, objectStack) {
node.setAttribute('safeToIgnore', nativeElement.safeToIgnore); node.setAttribute('safeToIgnore', nativeElement.safeToIgnore);
} }
if (nativeElement.value !== undefined) { if (nativeElement.value !== undefined) {
_ol_format_XSD_.writeStringTextNode(node, nativeElement.value); XSD.writeStringTextNode(node, nativeElement.value);
} }
}; };
@@ -699,7 +699,7 @@ WFS.writeWithinFilter_ = function(node, filter, objectStack) {
WFS.writeDuringFilter_ = function(node, filter, objectStack) { WFS.writeDuringFilter_ = function(node, filter, objectStack) {
var valueReference = _ol_xml_.createElementNS(WFS.FESNS, 'ValueReference'); var valueReference = _ol_xml_.createElementNS(WFS.FESNS, 'ValueReference');
_ol_format_XSD_.writeStringTextNode(valueReference, filter.propertyName); XSD.writeStringTextNode(valueReference, filter.propertyName);
node.appendChild(valueReference); node.appendChild(valueReference);
var timePeriod = _ol_xml_.createElementNS(GMLBase.GMLNS, 'TimePeriod'); var timePeriod = _ol_xml_.createElementNS(GMLBase.GMLNS, 'TimePeriod');
@@ -824,7 +824,7 @@ WFS.writeIsLikeFilter_ = function(node, filter, objectStack) {
*/ */
WFS.writeOgcExpression_ = function(tagName, node, value) { WFS.writeOgcExpression_ = function(tagName, node, value) {
var property = _ol_xml_.createElementNS(WFS.OGCNS, tagName); var property = _ol_xml_.createElementNS(WFS.OGCNS, tagName);
_ol_format_XSD_.writeStringTextNode(property, value); XSD.writeStringTextNode(property, value);
node.appendChild(property); node.appendChild(property);
}; };
@@ -860,7 +860,7 @@ WFS.writeTimeInstant_ = function(node, time) {
var timePosition = _ol_xml_.createElementNS(GMLBase.GMLNS, 'timePosition'); var timePosition = _ol_xml_.createElementNS(GMLBase.GMLNS, 'timePosition');
timeInstant.appendChild(timePosition); timeInstant.appendChild(timePosition);
_ol_format_XSD_.writeStringTextNode(timePosition, time); XSD.writeStringTextNode(timePosition, time);
}; };

View File

@@ -4,7 +4,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import XLink from '../format/XLink.js'; import XLink from '../format/XLink.js';
import XML from '../format/XML.js'; import XML from '../format/XML.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import _ol_xml_ from '../xml.js'; import _ol_xml_ from '../xml.js';
/** /**
@@ -84,15 +84,15 @@ WMSCapabilities.readAttribution_ = function(node, objectStack) {
*/ */
WMSCapabilities.readBoundingBox_ = function(node, objectStack) { WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
var extent = [ var extent = [
_ol_format_XSD_.readDecimalString(node.getAttribute('minx')), XSD.readDecimalString(node.getAttribute('minx')),
_ol_format_XSD_.readDecimalString(node.getAttribute('miny')), XSD.readDecimalString(node.getAttribute('miny')),
_ol_format_XSD_.readDecimalString(node.getAttribute('maxx')), XSD.readDecimalString(node.getAttribute('maxx')),
_ol_format_XSD_.readDecimalString(node.getAttribute('maxy')) XSD.readDecimalString(node.getAttribute('maxy'))
]; ];
var resolutions = [ var resolutions = [
_ol_format_XSD_.readDecimalString(node.getAttribute('resx')), XSD.readDecimalString(node.getAttribute('resx')),
_ol_format_XSD_.readDecimalString(node.getAttribute('resy')) XSD.readDecimalString(node.getAttribute('resy'))
]; ];
return { return {
@@ -240,41 +240,41 @@ WMSCapabilities.readLayer_ = function(node, objectStack) {
return undefined; return undefined;
} }
var queryable = var queryable =
_ol_format_XSD_.readBooleanString(node.getAttribute('queryable')); XSD.readBooleanString(node.getAttribute('queryable'));
if (queryable === undefined) { if (queryable === undefined) {
queryable = parentLayerObject['queryable']; queryable = parentLayerObject['queryable'];
} }
layerObject['queryable'] = queryable !== undefined ? queryable : false; layerObject['queryable'] = queryable !== undefined ? queryable : false;
var cascaded = _ol_format_XSD_.readNonNegativeIntegerString( var cascaded = XSD.readNonNegativeIntegerString(
node.getAttribute('cascaded')); node.getAttribute('cascaded'));
if (cascaded === undefined) { if (cascaded === undefined) {
cascaded = parentLayerObject['cascaded']; cascaded = parentLayerObject['cascaded'];
} }
layerObject['cascaded'] = cascaded; layerObject['cascaded'] = cascaded;
var opaque = _ol_format_XSD_.readBooleanString(node.getAttribute('opaque')); var opaque = XSD.readBooleanString(node.getAttribute('opaque'));
if (opaque === undefined) { if (opaque === undefined) {
opaque = parentLayerObject['opaque']; opaque = parentLayerObject['opaque'];
} }
layerObject['opaque'] = opaque !== undefined ? opaque : false; layerObject['opaque'] = opaque !== undefined ? opaque : false;
var noSubsets = var noSubsets =
_ol_format_XSD_.readBooleanString(node.getAttribute('noSubsets')); XSD.readBooleanString(node.getAttribute('noSubsets'));
if (noSubsets === undefined) { if (noSubsets === undefined) {
noSubsets = parentLayerObject['noSubsets']; noSubsets = parentLayerObject['noSubsets'];
} }
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false; layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
var fixedWidth = var fixedWidth =
_ol_format_XSD_.readDecimalString(node.getAttribute('fixedWidth')); XSD.readDecimalString(node.getAttribute('fixedWidth'));
if (!fixedWidth) { if (!fixedWidth) {
fixedWidth = parentLayerObject['fixedWidth']; fixedWidth = parentLayerObject['fixedWidth'];
} }
layerObject['fixedWidth'] = fixedWidth; layerObject['fixedWidth'] = fixedWidth;
var fixedHeight = var fixedHeight =
_ol_format_XSD_.readDecimalString(node.getAttribute('fixedHeight')); XSD.readDecimalString(node.getAttribute('fixedHeight'));
if (!fixedHeight) { if (!fixedHeight) {
fixedHeight = parentLayerObject['fixedHeight']; fixedHeight = parentLayerObject['fixedHeight'];
} }
@@ -314,12 +314,12 @@ WMSCapabilities.readDimension_ = function(node, objectStack) {
'units': node.getAttribute('units'), 'units': node.getAttribute('units'),
'unitSymbol': node.getAttribute('unitSymbol'), 'unitSymbol': node.getAttribute('unitSymbol'),
'default': node.getAttribute('default'), 'default': node.getAttribute('default'),
'multipleValues': _ol_format_XSD_.readBooleanString( 'multipleValues': XSD.readBooleanString(
node.getAttribute('multipleValues')), node.getAttribute('multipleValues')),
'nearestValue': _ol_format_XSD_.readBooleanString( 'nearestValue': XSD.readBooleanString(
node.getAttribute('nearestValue')), node.getAttribute('nearestValue')),
'current': _ol_format_XSD_.readBooleanString(node.getAttribute('current')), 'current': XSD.readBooleanString(node.getAttribute('current')),
'values': _ol_format_XSD_.readString(node) 'values': XSD.readString(node)
}; };
return dimensionObject; return dimensionObject;
}; };
@@ -397,8 +397,8 @@ WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
WMSCapabilities.readFormatOnlineresource_(node, objectStack); WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (formatOnlineresource) { if (formatOnlineresource) {
var size = [ var size = [
_ol_format_XSD_.readNonNegativeIntegerString(node.getAttribute('width')), XSD.readNonNegativeIntegerString(node.getAttribute('width')),
_ol_format_XSD_.readNonNegativeIntegerString(node.getAttribute('height')) XSD.readNonNegativeIntegerString(node.getAttribute('height'))
]; ];
formatOnlineresource['size'] = size; formatOnlineresource['size'] = size;
return formatOnlineresource; return formatOnlineresource;
@@ -513,24 +513,24 @@ WMSCapabilities.CAPABILITY_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.SERVICE_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.SERVICE_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'KeywordList': _ol_xml_.makeObjectPropertySetter( 'KeywordList': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readKeywordList_), WMSCapabilities.readKeywordList_),
'OnlineResource': _ol_xml_.makeObjectPropertySetter( 'OnlineResource': _ol_xml_.makeObjectPropertySetter(
XLink.readHref), XLink.readHref),
'ContactInformation': _ol_xml_.makeObjectPropertySetter( 'ContactInformation': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readContactInformation_), WMSCapabilities.readContactInformation_),
'Fees': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Fees': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'AccessConstraints': _ol_xml_.makeObjectPropertySetter( 'AccessConstraints': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'LayerLimit': _ol_xml_.makeObjectPropertySetter( 'LayerLimit': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MaxWidth': _ol_xml_.makeObjectPropertySetter( 'MaxWidth': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MaxHeight': _ol_xml_.makeObjectPropertySetter( 'MaxHeight': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger) XSD.readNonNegativeInteger)
}); });
@@ -544,15 +544,15 @@ WMSCapabilities.CONTACT_INFORMATION_PARSERS_ = _ol_xml_.makeStructureNS(
'ContactPersonPrimary': _ol_xml_.makeObjectPropertySetter( 'ContactPersonPrimary': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readContactPersonPrimary_), WMSCapabilities.readContactPersonPrimary_),
'ContactPosition': _ol_xml_.makeObjectPropertySetter( 'ContactPosition': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'ContactAddress': _ol_xml_.makeObjectPropertySetter( 'ContactAddress': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readContactAddress_), WMSCapabilities.readContactAddress_),
'ContactVoiceTelephone': _ol_xml_.makeObjectPropertySetter( 'ContactVoiceTelephone': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'ContactFacsimileTelephone': _ol_xml_.makeObjectPropertySetter( 'ContactFacsimileTelephone': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'ContactElectronicMailAddress': _ol_xml_.makeObjectPropertySetter( 'ContactElectronicMailAddress': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
}); });
@@ -564,9 +564,9 @@ WMSCapabilities.CONTACT_INFORMATION_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'ContactPerson': _ol_xml_.makeObjectPropertySetter( 'ContactPerson': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'ContactOrganization': _ol_xml_.makeObjectPropertySetter( 'ContactOrganization': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
}); });
@@ -577,13 +577,13 @@ WMSCapabilities.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'AddressType': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'AddressType': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'City': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'City': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'StateOrProvince': _ol_xml_.makeObjectPropertySetter( 'StateOrProvince': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'PostCode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'PostCode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Country': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString) 'Country': _ol_xml_.makeObjectPropertySetter(XSD.readString)
}); });
@@ -594,7 +594,7 @@ WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Format': _ol_xml_.makeArrayPusher(_ol_format_XSD_.readString) 'Format': _ol_xml_.makeArrayPusher(XSD.readString)
}); });
@@ -605,12 +605,12 @@ WMSCapabilities.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'KeywordList': _ol_xml_.makeObjectPropertySetter( 'KeywordList': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readKeywordList_), WMSCapabilities.readKeywordList_),
'CRS': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString), 'CRS': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
'EX_GeographicBoundingBox': _ol_xml_.makeObjectPropertySetter( 'EX_GeographicBoundingBox': _ol_xml_.makeObjectPropertySetter(
WMSCapabilities.readEXGeographicBoundingBox_), WMSCapabilities.readEXGeographicBoundingBox_),
'BoundingBox': _ol_xml_.makeObjectPropertyPusher( 'BoundingBox': _ol_xml_.makeObjectPropertyPusher(
@@ -621,7 +621,7 @@ WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.readAttribution_), WMSCapabilities.readAttribution_),
'AuthorityURL': _ol_xml_.makeObjectPropertyPusher( 'AuthorityURL': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readAuthorityURL_), WMSCapabilities.readAuthorityURL_),
'Identifier': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString), 'Identifier': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
'MetadataURL': _ol_xml_.makeObjectPropertyPusher( 'MetadataURL': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readMetadataURL_), WMSCapabilities.readMetadataURL_),
'DataURL': _ol_xml_.makeObjectPropertyPusher( 'DataURL': _ol_xml_.makeObjectPropertyPusher(
@@ -631,9 +631,9 @@ WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
'Style': _ol_xml_.makeObjectPropertyPusher( 'Style': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readStyle_), WMSCapabilities.readStyle_),
'MinScaleDenominator': _ol_xml_.makeObjectPropertySetter( 'MinScaleDenominator': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'MaxScaleDenominator': _ol_xml_.makeObjectPropertySetter( 'MaxScaleDenominator': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'Layer': _ol_xml_.makeObjectPropertyPusher( 'Layer': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readLayer_) WMSCapabilities.readLayer_)
}); });
@@ -646,7 +646,7 @@ WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'OnlineResource': _ol_xml_.makeObjectPropertySetter( 'OnlineResource': _ol_xml_.makeObjectPropertySetter(
XLink.readHref), XLink.readHref),
'LogoURL': _ol_xml_.makeObjectPropertySetter( 'LogoURL': _ol_xml_.makeObjectPropertySetter(
@@ -662,13 +662,13 @@ WMSCapabilities.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ = WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
_ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, { _ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, {
'westBoundLongitude': _ol_xml_.makeObjectPropertySetter( 'westBoundLongitude': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'eastBoundLongitude': _ol_xml_.makeObjectPropertySetter( 'eastBoundLongitude': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'southBoundLatitude': _ol_xml_.makeObjectPropertySetter( 'southBoundLatitude': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'northBoundLatitude': _ol_xml_.makeObjectPropertySetter( 'northBoundLatitude': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal) XSD.readDecimal)
}); });
@@ -695,7 +695,7 @@ WMSCapabilities.REQUEST_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.OPERATIONTYPE_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.OPERATIONTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Format': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString), 'Format': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
'DCPType': _ol_xml_.makeObjectPropertyPusher( 'DCPType': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readDCPType_) WMSCapabilities.readDCPType_)
}); });
@@ -734,9 +734,9 @@ WMSCapabilities.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.STYLE_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'LegendURL': _ol_xml_.makeObjectPropertyPusher( 'LegendURL': _ol_xml_.makeObjectPropertyPusher(
WMSCapabilities.readSizedFormatOnlineresource_), WMSCapabilities.readSizedFormatOnlineresource_),
'StyleSheetURL': _ol_xml_.makeObjectPropertySetter( 'StyleSheetURL': _ol_xml_.makeObjectPropertySetter(
@@ -753,7 +753,7 @@ WMSCapabilities.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
*/ */
WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ = WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ =
_ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, { _ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, {
'Format': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString), 'Format': _ol_xml_.makeObjectPropertySetter(XSD.readString),
'OnlineResource': _ol_xml_.makeObjectPropertySetter( 'OnlineResource': _ol_xml_.makeObjectPropertySetter(
XLink.readHref) XLink.readHref)
}); });
@@ -766,6 +766,6 @@ WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ =
*/ */
WMSCapabilities.KEYWORDLIST_PARSERS_ = _ol_xml_.makeStructureNS( WMSCapabilities.KEYWORDLIST_PARSERS_ = _ol_xml_.makeStructureNS(
WMSCapabilities.NAMESPACE_URIS_, { WMSCapabilities.NAMESPACE_URIS_, {
'Keyword': _ol_xml_.makeArrayPusher(_ol_format_XSD_.readString) 'Keyword': _ol_xml_.makeArrayPusher(XSD.readString)
}); });
export default WMSCapabilities; export default WMSCapabilities;

View File

@@ -6,7 +6,7 @@ import {boundingExtent} from '../extent.js';
import OWS from '../format/OWS.js'; import OWS from '../format/OWS.js';
import XLink from '../format/XLink.js'; import XLink from '../format/XLink.js';
import XML from '../format/XML.js'; import XML from '../format/XML.js';
import _ol_format_XSD_ from '../format/XSD.js'; import XSD from '../format/XSD.js';
import _ol_xml_ from '../xml.js'; import _ol_xml_ from '../xml.js';
/** /**
@@ -211,7 +211,7 @@ _ol_format_WMTSCapabilities_.readLegendUrl_ = function(node, objectStack) {
* @return {Object|undefined} Coordinates object. * @return {Object|undefined} Coordinates object.
*/ */
_ol_format_WMTSCapabilities_.readCoordinates_ = function(node, objectStack) { _ol_format_WMTSCapabilities_.readCoordinates_ = function(node, objectStack) {
var coordinates = _ol_format_XSD_.readString(node).split(' '); var coordinates = XSD.readString(node).split(' ');
if (!coordinates || coordinates.length != 2) { if (!coordinates || coordinates.length != 2) {
return undefined; return undefined;
} }
@@ -320,7 +320,7 @@ _ol_format_WMTSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
'Style': _ol_xml_.makeObjectPropertyPusher( 'Style': _ol_xml_.makeObjectPropertyPusher(
_ol_format_WMTSCapabilities_.readStyle_), _ol_format_WMTSCapabilities_.readStyle_),
'Format': _ol_xml_.makeObjectPropertyPusher( 'Format': _ol_xml_.makeObjectPropertyPusher(
_ol_format_XSD_.readString), XSD.readString),
'TileMatrixSetLink': _ol_xml_.makeObjectPropertyPusher( 'TileMatrixSetLink': _ol_xml_.makeObjectPropertyPusher(
_ol_format_WMTSCapabilities_.readTileMatrixSetLink_), _ol_format_WMTSCapabilities_.readTileMatrixSetLink_),
'Dimension': _ol_xml_.makeObjectPropertyPusher( 'Dimension': _ol_xml_.makeObjectPropertyPusher(
@@ -329,13 +329,13 @@ _ol_format_WMTSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.readResourceUrl_) _ol_format_WMTSCapabilities_.readResourceUrl_)
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, { }, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
'Title': _ol_xml_.makeObjectPropertySetter( 'Title': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'Abstract': _ol_xml_.makeObjectPropertySetter( 'Abstract': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'WGS84BoundingBox': _ol_xml_.makeObjectPropertySetter( 'WGS84BoundingBox': _ol_xml_.makeObjectPropertySetter(
_ol_format_WMTSCapabilities_.readWgs84BoundingBox_), _ol_format_WMTSCapabilities_.readWgs84BoundingBox_),
'Identifier': _ol_xml_.makeObjectPropertySetter( 'Identifier': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
})); }));
@@ -350,9 +350,9 @@ _ol_format_WMTSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.readLegendUrl_) _ol_format_WMTSCapabilities_.readLegendUrl_)
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, { }, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
'Title': _ol_xml_.makeObjectPropertySetter( 'Title': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'Identifier': _ol_xml_.makeObjectPropertySetter( 'Identifier': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
})); }));
@@ -364,7 +364,7 @@ _ol_format_WMTSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.TMS_LINKS_PARSERS_ = _ol_xml_.makeStructureNS( _ol_format_WMTSCapabilities_.TMS_LINKS_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, { _ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
'TileMatrixSet': _ol_xml_.makeObjectPropertySetter( 'TileMatrixSet': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'TileMatrixSetLimits': _ol_xml_.makeObjectPropertySetter( 'TileMatrixSetLimits': _ol_xml_.makeObjectPropertySetter(
_ol_format_WMTSCapabilities_.readTileMatrixLimitsList_) _ol_format_WMTSCapabilities_.readTileMatrixLimitsList_)
}); });
@@ -389,15 +389,15 @@ _ol_format_WMTSCapabilities_.TMS_LIMITS_LIST_PARSERS_ = _ol_xml_.makeStructureNS
_ol_format_WMTSCapabilities_.TMS_LIMITS_PARSERS_ = _ol_xml_.makeStructureNS( _ol_format_WMTSCapabilities_.TMS_LIMITS_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, { _ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
'TileMatrix': _ol_xml_.makeObjectPropertySetter( 'TileMatrix': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'MinTileRow': _ol_xml_.makeObjectPropertySetter( 'MinTileRow': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MaxTileRow': _ol_xml_.makeObjectPropertySetter( 'MaxTileRow': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MinTileCol': _ol_xml_.makeObjectPropertySetter( 'MinTileCol': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MaxTileCol': _ol_xml_.makeObjectPropertySetter( 'MaxTileCol': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger) XSD.readNonNegativeInteger)
}); });
@@ -409,12 +409,12 @@ _ol_format_WMTSCapabilities_.TMS_LIMITS_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.DIMENSION_PARSERS_ = _ol_xml_.makeStructureNS( _ol_format_WMTSCapabilities_.DIMENSION_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, { _ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
'Default': _ol_xml_.makeObjectPropertySetter( 'Default': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'Value': _ol_xml_.makeObjectPropertyPusher( 'Value': _ol_xml_.makeObjectPropertyPusher(
_ol_format_XSD_.readString) XSD.readString)
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, { }, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
'Identifier': _ol_xml_.makeObjectPropertySetter( 'Identifier': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
})); }));
@@ -440,14 +440,14 @@ _ol_format_WMTSCapabilities_.WGS84_BBOX_READERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.TMS_PARSERS_ = _ol_xml_.makeStructureNS( _ol_format_WMTSCapabilities_.TMS_PARSERS_ = _ol_xml_.makeStructureNS(
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, { _ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
'WellKnownScaleSet': _ol_xml_.makeObjectPropertySetter( 'WellKnownScaleSet': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'TileMatrix': _ol_xml_.makeObjectPropertyPusher( 'TileMatrix': _ol_xml_.makeObjectPropertyPusher(
_ol_format_WMTSCapabilities_.readTileMatrix_) _ol_format_WMTSCapabilities_.readTileMatrix_)
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, { }, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
'SupportedCRS': _ol_xml_.makeObjectPropertySetter( 'SupportedCRS': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString), XSD.readString),
'Identifier': _ol_xml_.makeObjectPropertySetter( 'Identifier': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
})); }));
@@ -461,17 +461,17 @@ _ol_format_WMTSCapabilities_.TM_PARSERS_ = _ol_xml_.makeStructureNS(
'TopLeftCorner': _ol_xml_.makeObjectPropertySetter( 'TopLeftCorner': _ol_xml_.makeObjectPropertySetter(
_ol_format_WMTSCapabilities_.readCoordinates_), _ol_format_WMTSCapabilities_.readCoordinates_),
'ScaleDenominator': _ol_xml_.makeObjectPropertySetter( 'ScaleDenominator': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readDecimal), XSD.readDecimal),
'TileWidth': _ol_xml_.makeObjectPropertySetter( 'TileWidth': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'TileHeight': _ol_xml_.makeObjectPropertySetter( 'TileHeight': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MatrixWidth': _ol_xml_.makeObjectPropertySetter( 'MatrixWidth': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger), XSD.readNonNegativeInteger),
'MatrixHeight': _ol_xml_.makeObjectPropertySetter( 'MatrixHeight': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readNonNegativeInteger) XSD.readNonNegativeInteger)
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, { }, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
'Identifier': _ol_xml_.makeObjectPropertySetter( 'Identifier': _ol_xml_.makeObjectPropertySetter(
_ol_format_XSD_.readString) XSD.readString)
})); }));
export default _ol_format_WMTSCapabilities_; export default _ol_format_WMTSCapabilities_;

View File

@@ -3,23 +3,23 @@
*/ */
import _ol_xml_ from '../xml.js'; import _ol_xml_ from '../xml.js';
import _ol_string_ from '../string.js'; import _ol_string_ from '../string.js';
var _ol_format_XSD_ = {}; var XSD = {};
/** /**
* @const * @const
* @type {string} * @type {string}
*/ */
_ol_format_XSD_.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema'; XSD.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema';
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @return {boolean|undefined} Boolean. * @return {boolean|undefined} Boolean.
*/ */
_ol_format_XSD_.readBoolean = function(node) { XSD.readBoolean = function(node) {
var s = _ol_xml_.getAllTextContent(node, false); var s = _ol_xml_.getAllTextContent(node, false);
return _ol_format_XSD_.readBooleanString(s); return XSD.readBooleanString(s);
}; };
@@ -27,7 +27,7 @@ _ol_format_XSD_.readBoolean = function(node) {
* @param {string} string String. * @param {string} string String.
* @return {boolean|undefined} Boolean. * @return {boolean|undefined} Boolean.
*/ */
_ol_format_XSD_.readBooleanString = function(string) { XSD.readBooleanString = function(string) {
var m = /^\s*(true|1)|(false|0)\s*$/.exec(string); var m = /^\s*(true|1)|(false|0)\s*$/.exec(string);
if (m) { if (m) {
return m[1] !== undefined || false; return m[1] !== undefined || false;
@@ -41,7 +41,7 @@ _ol_format_XSD_.readBooleanString = function(string) {
* @param {Node} node Node. * @param {Node} node Node.
* @return {number|undefined} DateTime in seconds. * @return {number|undefined} DateTime in seconds.
*/ */
_ol_format_XSD_.readDateTime = function(node) { XSD.readDateTime = function(node) {
var s = _ol_xml_.getAllTextContent(node, false); var s = _ol_xml_.getAllTextContent(node, false);
var dateTime = Date.parse(s); var dateTime = Date.parse(s);
return isNaN(dateTime) ? undefined : dateTime / 1000; return isNaN(dateTime) ? undefined : dateTime / 1000;
@@ -52,9 +52,9 @@ _ol_format_XSD_.readDateTime = function(node) {
* @param {Node} node Node. * @param {Node} node Node.
* @return {number|undefined} Decimal. * @return {number|undefined} Decimal.
*/ */
_ol_format_XSD_.readDecimal = function(node) { XSD.readDecimal = function(node) {
var s = _ol_xml_.getAllTextContent(node, false); var s = _ol_xml_.getAllTextContent(node, false);
return _ol_format_XSD_.readDecimalString(s); return XSD.readDecimalString(s);
}; };
@@ -62,7 +62,7 @@ _ol_format_XSD_.readDecimal = function(node) {
* @param {string} string String. * @param {string} string String.
* @return {number|undefined} Decimal. * @return {number|undefined} Decimal.
*/ */
_ol_format_XSD_.readDecimalString = function(string) { XSD.readDecimalString = function(string) {
// FIXME check spec // FIXME check spec
var m = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(string); var m = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(string);
if (m) { if (m) {
@@ -77,9 +77,9 @@ _ol_format_XSD_.readDecimalString = function(string) {
* @param {Node} node Node. * @param {Node} node Node.
* @return {number|undefined} Non negative integer. * @return {number|undefined} Non negative integer.
*/ */
_ol_format_XSD_.readNonNegativeInteger = function(node) { XSD.readNonNegativeInteger = function(node) {
var s = _ol_xml_.getAllTextContent(node, false); var s = _ol_xml_.getAllTextContent(node, false);
return _ol_format_XSD_.readNonNegativeIntegerString(s); return XSD.readNonNegativeIntegerString(s);
}; };
@@ -87,7 +87,7 @@ _ol_format_XSD_.readNonNegativeInteger = function(node) {
* @param {string} string String. * @param {string} string String.
* @return {number|undefined} Non negative integer. * @return {number|undefined} Non negative integer.
*/ */
_ol_format_XSD_.readNonNegativeIntegerString = function(string) { XSD.readNonNegativeIntegerString = function(string) {
var m = /^\s*(\d+)\s*$/.exec(string); var m = /^\s*(\d+)\s*$/.exec(string);
if (m) { if (m) {
return parseInt(m[1], 10); return parseInt(m[1], 10);
@@ -101,7 +101,7 @@ _ol_format_XSD_.readNonNegativeIntegerString = function(string) {
* @param {Node} node Node. * @param {Node} node Node.
* @return {string|undefined} String. * @return {string|undefined} String.
*/ */
_ol_format_XSD_.readString = function(node) { XSD.readString = function(node) {
return _ol_xml_.getAllTextContent(node, false).trim(); return _ol_xml_.getAllTextContent(node, false).trim();
}; };
@@ -110,8 +110,8 @@ _ol_format_XSD_.readString = function(node) {
* @param {Node} node Node to append a TextNode with the boolean to. * @param {Node} node Node to append a TextNode with the boolean to.
* @param {boolean} bool Boolean. * @param {boolean} bool Boolean.
*/ */
_ol_format_XSD_.writeBooleanTextNode = function(node, bool) { XSD.writeBooleanTextNode = function(node, bool) {
_ol_format_XSD_.writeStringTextNode(node, (bool) ? '1' : '0'); XSD.writeStringTextNode(node, (bool) ? '1' : '0');
}; };
@@ -119,7 +119,7 @@ _ol_format_XSD_.writeBooleanTextNode = function(node, bool) {
* @param {Node} node Node to append a CDATA Section with the string to. * @param {Node} node Node to append a CDATA Section with the string to.
* @param {string} string String. * @param {string} string String.
*/ */
_ol_format_XSD_.writeCDATASection = function(node, string) { XSD.writeCDATASection = function(node, string) {
node.appendChild(_ol_xml_.DOCUMENT.createCDATASection(string)); node.appendChild(_ol_xml_.DOCUMENT.createCDATASection(string));
}; };
@@ -128,7 +128,7 @@ _ol_format_XSD_.writeCDATASection = function(node, string) {
* @param {Node} node Node to append a TextNode with the dateTime to. * @param {Node} node Node to append a TextNode with the dateTime to.
* @param {number} dateTime DateTime in seconds. * @param {number} dateTime DateTime in seconds.
*/ */
_ol_format_XSD_.writeDateTimeTextNode = function(node, dateTime) { XSD.writeDateTimeTextNode = function(node, dateTime) {
var date = new Date(dateTime * 1000); var date = new Date(dateTime * 1000);
var string = date.getUTCFullYear() + '-' + var string = date.getUTCFullYear() + '-' +
_ol_string_.padNumber(date.getUTCMonth() + 1, 2) + '-' + _ol_string_.padNumber(date.getUTCMonth() + 1, 2) + '-' +
@@ -144,7 +144,7 @@ _ol_format_XSD_.writeDateTimeTextNode = function(node, dateTime) {
* @param {Node} node Node to append a TextNode with the decimal to. * @param {Node} node Node to append a TextNode with the decimal to.
* @param {number} decimal Decimal. * @param {number} decimal Decimal.
*/ */
_ol_format_XSD_.writeDecimalTextNode = function(node, decimal) { XSD.writeDecimalTextNode = function(node, decimal) {
var string = decimal.toPrecision(); var string = decimal.toPrecision();
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string)); node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
}; };
@@ -154,7 +154,7 @@ _ol_format_XSD_.writeDecimalTextNode = function(node, decimal) {
* @param {Node} node Node to append a TextNode with the decimal to. * @param {Node} node Node to append a TextNode with the decimal to.
* @param {number} nonNegativeInteger Non negative integer. * @param {number} nonNegativeInteger Non negative integer.
*/ */
_ol_format_XSD_.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) { XSD.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) {
var string = nonNegativeInteger.toString(); var string = nonNegativeInteger.toString();
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string)); node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
}; };
@@ -164,7 +164,7 @@ _ol_format_XSD_.writeNonNegativeIntegerTextNode = function(node, nonNegativeInte
* @param {Node} node Node to append a TextNode with the string to. * @param {Node} node Node to append a TextNode with the string to.
* @param {string} string String. * @param {string} string String.
*/ */
_ol_format_XSD_.writeStringTextNode = function(node, string) { XSD.writeStringTextNode = function(node, string) {
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string)); node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
}; };
export default _ol_format_XSD_; export default XSD;

View File

@@ -1,4 +1,4 @@
import _ol_format_XSD_ from '../../../../src/ol/format/XSD.js'; import XSD from '../../../../src/ol/format/XSD.js';
describe('ol.format.XSD', function() { describe('ol.format.XSD', function() {
@@ -7,7 +7,7 @@ describe('ol.format.XSD', function() {
it('can handle non-Zulu time zones', function() { it('can handle non-Zulu time zones', function() {
var node = document.createElement('time'); var node = document.createElement('time');
node.textContent = '2016-07-12T15:00:00+03:00'; node.textContent = '2016-07-12T15:00:00+03:00';
expect(new Date(_ol_format_XSD_.readDateTime(node) * 1000).toISOString()).to.eql('2016-07-12T12:00:00.000Z'); expect(new Date(XSD.readDateTime(node) * 1000).toISOString()).to.eql('2016-07-12T12:00:00.000Z');
}); });
}); });