From bb816de76834e588e626c00a736bd157803bc92a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 11 Mar 2018 22:23:18 -0600 Subject: [PATCH] Move Options to ol/format/GPX --- externs/olx.js | 19 ------------------- externs/xol.js | 11 ----------- src/ol/format/GPX.js | 14 +++++++++++++- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 76db8ffdb2..0ace491a77 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,25 +5,6 @@ let olx; -/** - * @typedef {{readExtensions: (function(ol.Feature, Node)|undefined)}} - */ -olx.format.GPXOptions; - - -/** - * Callback function to process `extensions` nodes. - * To prevent memory leaks, this callback function must - * not store any references to the node. Note that the `extensions` - * node is not allowed in GPX 1.0. Moreover, only `extensions` - * nodes from `wpt`, `rte` and `trk` can be processed, as those are - * directly mapped to a feature. - * @type {function(ol.Feature, Node)|undefined} - * @api - */ -olx.format.GPXOptions.prototype.readExtensions; - - /** * @typedef {{featureNS: (Object.|string|undefined), * featureType: (Array.|string|undefined), diff --git a/externs/xol.js b/externs/xol.js index 1f9458eb69..b93b7f3e60 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,15 +1,4 @@ -/** - * @typedef {Object} format_GPXOptions - * @property {function(ol.Feature, Node)|undefined} readExtensions Callback function to process `extensions` nodes. - * To prevent memory leaks, this callback function must - * not store any references to the node. Note that the `extensions` - * node is not allowed in GPX 1.0. Moreover, only `extensions` - * nodes from `wpt`, `rte` and `trk` can be processed, as those are - * directly mapped to a feature. - */ - - /** * @typedef {Object} format_WFSOptions * @property {Object.|string|undefined} featureNS The namespace URI used for features. diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js index 7f96a94098..27aafd3962 100644 --- a/src/ol/format/GPX.js +++ b/src/ol/format/GPX.js @@ -17,13 +17,25 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender OBJECT_PROPERTY_NODE_FACTORY, parseNode, pushParseAndPop, pushSerializeAndPop, setAttributeNS} from '../xml.js'; + +/** + * @typedef {Object} Options + * @property {function(ol.Feature, Node)|undefined} readExtensions Callback function + * to process `extensions` nodes. To prevent memory leaks, this callback function must + * not store any references to the node. Note that the `extensions` + * node is not allowed in GPX 1.0. Moreover, only `extensions` + * nodes from `wpt`, `rte` and `trk` can be processed, as those are + * directly mapped to a feature. + */ + + /** * @classdesc * Feature format for reading and writing data in the GPX format. * * @constructor * @extends {ol.format.XMLFeature} - * @param {olx.format.GPXOptions=} opt_options Options. + * @param {module:ol/format/GPX~Options=} opt_options Options. * @api */ const GPX = function(opt_options) {