diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index fe1441c1e7..cf1995025b 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -910,7 +910,7 @@ * @property {ol.Extent|undefined} extent Extent. * @property {ol.format.Feature} format Format. * @property {function(this: ol.source.ServerVector, ol.Extent, number, ol.proj.Projection)} loadingFunction Loading function. - * @property {function(ol.Extent, number): Array.} loadingStrategy Loading strategy. + * @property {function(ol.Extent, number): Array.|undefined} loadingStrategy Loading strategy. Default is `ol.loadingstrategy.bbox`. * @property {string|undefined} logo Logo. * @property {ol.proj.ProjectionLike} projection Projection. */ diff --git a/src/ol/source/servervectorsource.js b/src/ol/source/servervectorsource.js index 6a968372d2..e804659b06 100644 --- a/src/ol/source/servervectorsource.js +++ b/src/ol/source/servervectorsource.js @@ -3,6 +3,7 @@ goog.provide('ol.source.ServerVector'); goog.require('ol.extent'); +goog.require('ol.loadingstrategy'); goog.require('ol.source.FormatVector'); goog.require('ol.structs.RBush'); @@ -40,7 +41,8 @@ ol.source.ServerVector = function(options) { * @private * @type {function(ol.Extent, number): Array.} */ - this.loadingStrategy_ = options.loadingStrategy; + this.loadingStrategy_ = goog.isDef(options.loadingStrategy) ? + options.loadingStrategy : ol.loadingstrategy.bbox; /** * @private