move the typedefs out of objectliterals

This commit is contained in:
Bart van den Eijnden
2013-11-25 14:29:00 +01:00
parent 279c358af2
commit d564b5170c
3 changed files with 28 additions and 28 deletions

View File

@@ -595,20 +595,6 @@
* calculations.
*/
/**
* @typedef {Object} ol.parser.WFSOptions
* @property {string} featureNS The feature namespace to use.
* @property {string} featurePrefix The prefix for the namespace.
* @property {Array.<string>} featureTypes The feature types to use.
*/
/**
* @typedef {Object} ol.parser.WFSNative
* @property {string} vendorId The vendor id to use.
* @property {boolean} safeToIgnore Is it safe to ignore?
* @property {string} value The value of the Native element.
*/
/**
* @typedef {Object} ol.source.BingMapsOptions
* @property {string|undefined} culture Culture code. Default is `en-us`.

View File

@@ -3,6 +3,22 @@ goog.require('goog.dom.xml');
goog.require('ol.parser.XML');
/**
* @typedef {{featureNS: string,
featurePrefix: string,
featureTypes: Array.<string>,
handle: string,
outputFormat: string,
nativeElements: Array.<{
vendorId: string,
safeToIgnore: boolean,
value: string
}>,
maxFeatures: number}}
*/
ol.parser.WFSWriteOptions;
/**
* @constructor
@@ -21,7 +37,7 @@ ol.parser.ogc.WFS_v1 = function() {
this.writers = {};
this.writers[this.defaultNamespaceURI] = {
'GetFeature': function(options) {
options = /** @type {ol.parser.WFSOptions} */(options);
options = /** @type {ol.parser.WFSWriteOptions} */(options);
var node = this.createElementNS('wfs:GetFeature');
node.setAttribute('service', 'WFS');
node.setAttribute('version', this.version);
@@ -47,7 +63,7 @@ ol.parser.ogc.WFS_v1 = function() {
},
'Transaction': function(obj) {
obj = obj || {};
var options = obj.options || {};
var options = /** {ol.parser.WFSWriteOptions} */(obj.options || {});
var node = this.createElementNS('wfs:Transaction');
node.setAttribute('service', 'WFS');
node.setAttribute('version', this.version);
@@ -152,7 +168,7 @@ ol.parser.ogc.WFS_v1.prototype.read = function(data) {
/**
* @param {Array.<ol.Feature>} features The features to write out.
* @param {Object} options Write options.
* @param {ol.parser.WFSWriteOptions} options Write options.
* @return {string} A serialized WFS transaction.
*/
ol.parser.ogc.WFS_v1.prototype.write = function(features, options) {

View File

@@ -52,17 +52,15 @@ describe('ol.parser.ogc.WFS', function() {
var url = 'spec/ol/parser/ogc/xml/wfs_v1/Native.xml';
afterLoadXml(url, function(xml) {
var p = new ol.parser.ogc.WFS_v1_1_0();
var output = p.write(null, {
nativeElements: [{
vendorId: 'ORACLE',
safeToIgnore: true,
value: 'ALTER SESSION ENABLE PARALLEL DML'
}, {
vendorId: 'ORACLE',
safeToIgnore: false,
value: 'Another native line goes here'
}]
});
var output = p.write(null, {nativeElements: [{
vendorId: 'ORACLE',
safeToIgnore: true,
value: 'ALTER SESSION ENABLE PARALLEL DML'
}, {
vendorId: 'ORACLE',
safeToIgnore: false,
value: 'Another native line goes here'
}]});
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
done();
});