diff --git a/old/examples/style-rules.html b/old/examples/style-rules.html deleted file mode 100644 index 1837ab41ce..0000000000 --- a/old/examples/style-rules.html +++ /dev/null @@ -1,50 +0,0 @@ - - -
- - - - - - - -Draws features with rule based styles.
-See the style-rules.js source to see how this is done.
-Synthetic data example.
-See the synthetic-data.js source to see how this is done.
-Example of a countries vector layer with country labels at higher zoom levels, styling info coming from SLD.
-See the vector-layer-sld.js source to see how this is done.
-Example of parsing a WMTS Capabilities document.
-See the wmts-capabilities.js source to see how this is done.
-Example of a WMTS source built from a WMTS getCapabilities response.
-See the wmts-from-capabilities.js source to see how this is done.
-Demonstrates displaying IGN (France) WMTS layers.
-In this example two IGN WMTS layers are displayed: Ortho imagery and Cadastral parcels.. - For more information on IGN's WMTS service see the - IGN Géoportail API web page (french).
-See the wmts-ign.js source to see how this is done.
-
'
- });
-
- var sourceOptions;
- var source;
- var layer;
- var i;
-
- for (i = 0; i < layerIdentifiers.length; ++i) {
- sourceOptions = ol.source.WMTS.optionsFromCapabilities(
- capabilities, layerIdentifiers[i]);
- // we need to set the URL because it must include the key.
- sourceOptions.urls = [wmtsUrl];
- sourceOptions.attributions = [attribution];
- sourceOptions.logo = layerLogos[i];
- source = new ol.source.WMTS(sourceOptions);
- layer = new ol.layer.Tile({source: source});
- map.addLayer(layer);
- }
-
- var view = new ol.View2D();
- view.fitExtent(
- [257596.65942095537, 6250898.984085131,
- 262082.55751844167, 6251854.446938695],
- /** @type {ol.Size} */ (map.getSize()));
- map.setView(view);
- }
-};
-
-xhr.send();
diff --git a/old/parser/ogc/exceptionreportparser.js b/old/parser/ogc/exceptionreportparser.js
deleted file mode 100644
index 606e96f26a..0000000000
--- a/old/parser/ogc/exceptionreportparser.js
+++ /dev/null
@@ -1,96 +0,0 @@
-goog.provide('ol.parser.ogc.ExceptionReport');
-goog.require('goog.dom.xml');
-goog.require('ol.parser.XML');
-
-
-
-/**
- * @constructor
- * @extends {ol.parser.XML}
- */
-ol.parser.ogc.ExceptionReport = function() {
- var exceptionReader = function(node, exceptionReport) {
- var exception = {
- code: node.getAttribute('exceptionCode'),
- locator: node.getAttribute('locator'),
- texts: []
- };
- exceptionReport.exceptions.push(exception);
- this.readChildNodes(node, exception);
- };
- var exceptionTextReader = function(node, exception) {
- var text = this.getChildValue(node);
- exception.texts.push(text);
- };
- this.readers = {
- 'http://www.opengis.net/ogc': {
- 'ServiceExceptionReport': function(node, obj) {
- obj['exceptionReport'] = {};
- obj['exceptionReport']['exceptions'] = [];
- this.readChildNodes(node, obj['exceptionReport']);
- },
- 'ServiceException': function(node, exceptionReport) {
- var exception = {};
- exception['code'] = node.getAttribute('code');
- exception['locator'] = node.getAttribute('locator');
- exception['text'] = this.getChildValue(node);
- exceptionReport['exceptions'].push(exception);
- }
- },
- 'http://www.opengis.net/ows': {
- 'ExceptionReport': function(node, obj) {
- obj.success = false;
- obj.exceptionReport = {
- version: node.getAttribute('version'),
- language: node.getAttribute('language'),
- exceptions: []
- };
- this.readChildNodes(node, obj.exceptionReport);
- },
- 'Exception': function(node, exceptionReport) {
- exceptionReader.apply(this, arguments);
- },
- 'ExceptionText': function(node, exception) {
- exceptionTextReader.apply(this, arguments);
- }
- },
- 'http://www.opengis.net/ows/1.1': {
- 'ExceptionReport': function(node, obj) {
- obj.exceptionReport = {
- version: node.getAttribute('version'),
- language: node.getAttribute('xml:lang'),
- exceptions: []
- };
- this.readChildNodes(node, obj.exceptionReport);
- },
- 'Exception': function(node, exceptionReport) {
- exceptionReader.apply(this, arguments);
- },
- 'ExceptionText': function(node, exception) {
- exceptionTextReader.apply(this, arguments);
- }
- }
- };
- goog.base(this);
-};
-goog.inherits(ol.parser.ogc.ExceptionReport, ol.parser.XML);
-
-
-/**
- * Read OGC exception report data from a string, and return an object with
- * information about the exceptions.
- *
- * @param {string|Document} data to read/parse.
- * @return {Object} Information about the exceptions that occurred.
- */
-ol.parser.ogc.ExceptionReport.prototype.read = function(data) {
- if (goog.isString(data)) {
- data = goog.dom.xml.loadXml(data);
- }
- var exceptionInfo = {};
- exceptionInfo['exceptionReport'] = null;
- if (data) {
- this.readChildNodes(data, exceptionInfo);
- }
- return exceptionInfo;
-};
diff --git a/old/parser/ogc/versionedparser.js b/old/parser/ogc/versionedparser.js
deleted file mode 100644
index 2685b66e93..0000000000
--- a/old/parser/ogc/versionedparser.js
+++ /dev/null
@@ -1,121 +0,0 @@
-goog.provide('ol.parser.ogc.Versioned');
-goog.require('goog.dom.xml');
-goog.require('ol.parser.ogc.ExceptionReport');
-
-
-
-/**
- * @constructor
- * @param {Object=} opt_options Options which will be set on this object.
- */
-ol.parser.ogc.Versioned = function(opt_options) {
- var options = goog.isDef(opt_options) ? opt_options : {};
- this.options = options;
- this.defaultVersion = options.defaultVersion || null;
- this.version = options.version;
- this.profile = options.profile;
- if (goog.isDef(options.allowFallback)) {
- this.allowFallback = options.allowFallback;
- } else {
- this.allowFallback = false;
- }
- if (goog.isDef(options.stringifyOutput)) {
- this.stringifyOutput = options.stringifyOutput;
- } else {
- this.stringifyOutput = false;
- }
-};
-
-
-/**
- * @param {Element} root root element.
- * @param {Object=} opt_options optional configuration object.
- * @return {string} the version to use.
- */
-ol.parser.ogc.Versioned.prototype.getVersion = function(root, opt_options) {
- var version;
- // read
- if (root) {
- version = this.version;
- if (!version) {
- version = root.getAttribute('version');
- if (!version) {
- version = this.defaultVersion;
- }
- }
- } else {
- // write
- version = (opt_options && opt_options.version) ||
- this.version || this.defaultVersion;
- }
- return version;
-};
-
-
-/**
- * @param {string} version the version to use.
- * @return {Object} the parser to use.
- */
-ol.parser.ogc.Versioned.prototype.getParser = function(version) {
- version = version || this.defaultVersion;
- var profile = this.profile ? '_' + this.profile : '';
- if (!this.parser || this.parser.VERSION != version) {
- var format = this.parsers['v' + version.replace(/\./g, '_') + profile];
- if (!format) {
- if (profile !== '' && this.allowFallback) {
- // fallback to the non-profiled version of the parser
- profile = '';
- format = this.parsers['v' + version.replace(/\./g, '_') + profile];
- }
- if (!format) {
- throw 'Can\'t find a parser for version ' +
- version + profile;
- }
- }
- this.parser = new format(this.options);
- }
- return this.parser;
-};
-
-
-/**
- * Write a document.
- *
- * @param {Object} obj An object representing the document.
- * @param {Object=} opt_options Optional configuration object.
- * @return {Element|string} the XML created.
- */
-ol.parser.ogc.Versioned.prototype.write = function(obj, opt_options) {
- var version = this.getVersion(null, opt_options);
- this.parser = this.getParser(version);
- var root = this.parser.write(obj, opt_options);
- if (this.stringifyOutput === false) {
- return root;
- } else {
- return goog.dom.xml.serialize(root);
- }
-};
-
-
-/**
- * @param {string|Document} data Data to read.
- * @param {Object=} opt_options Options for the reader.
- * @return {Object} An object representing the document.
- */
-ol.parser.ogc.Versioned.prototype.read = function(data, opt_options) {
- if (goog.isString(data)) {
- data = goog.dom.xml.loadXml(data);
- }
- var root = data.documentElement;
- var version = this.getVersion(root);
- this.parser = this.getParser(version);
- var obj = this.parser.read(data, opt_options);
- var errorProperty = this.parser.errorProperty || null;
- if (errorProperty !== null && obj[errorProperty] === undefined) {
- // an error must have happened, so parse it and report back
- var format = new ol.parser.ogc.ExceptionReport();
- obj.error = format.read(data);
- }
- obj.version = version;
- return obj;
-};
diff --git a/old/parser/parser.js b/old/parser/parser.js
deleted file mode 100644
index bf79f729a6..0000000000
--- a/old/parser/parser.js
+++ /dev/null
@@ -1,9 +0,0 @@
-goog.provide('ol.parser.Parser');
-
-
-
-/**
- * @constructor
- * @todo stability experimental
- */
-ol.parser.Parser = function() {};
diff --git a/old/parser/xmlparser.js b/old/parser/xmlparser.js
deleted file mode 100644
index a531e276eb..0000000000
--- a/old/parser/xmlparser.js
+++ /dev/null
@@ -1,296 +0,0 @@
-goog.provide('ol.parser.XML');
-
-goog.require('goog.dom.xml');
-goog.require('ol.parser.Parser');
-
-
-
-/**
- * @constructor
- * @extends {ol.parser.Parser}
- * @todo stability experimental
- */
-ol.parser.XML = function() {
- if (goog.global.ActiveXObject) {
- this.xmldom = new ActiveXObject('Microsoft.XMLDOM');
- }
- this.regExes = {
- trimSpace: (/^\s*|\s*$/g),
- removeSpace: (/\s*/g),
- splitSpace: (/\s+/),
- trimComma: (/\s*,\s*/g)
- };
-};
-goog.inherits(ol.parser.XML, ol.parser.Parser);
-
-
-/**
- * Shorthand for applying one of the named readers given the node
- * namespace and local name. Readers take two args (node, obj) and
- * generally extend or modify the second.
- *
- * @param {Element|Document} node The node to be read (required).
- * @param {Object} obj The object to be modified (optional).
- * @return {Object} The input object, modified (or a new one if none was
- * provided).
- */
-ol.parser.XML.prototype.readNode = function(node, obj) {
- if (!obj) {
- obj = {};
- }
- var group = this.readers[node.namespaceURI] ||
- this.readers[this.defaultNamespaceURI];
- if (group) {
- var local = node.localName || node.nodeName.split(':').pop();
- var reader = group[local] || group['*'];
- if (reader) {
- reader.apply(this, [node, obj]);
- }
- }
- return obj;
-};
-
-
-/**
- * Shorthand for applying the named readers to all children of a node.
- * For each child of type 1 (element),