diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index bc5d5bf4c4..075a24cdbb 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -710,6 +710,7 @@ * @property {ol.proj.ProjectionLike} projection Projection. * @property {string|undefined} text Text. * @property {string|undefined} url URL. + * @property {Array.|undefined} urls URLs. */ /** diff --git a/src/ol/source/vectorfilesource.js b/src/ol/source/vectorfilesource.js index b43fcc68bf..584e1b5a21 100644 --- a/src/ol/source/vectorfilesource.js +++ b/src/ol/source/vectorfilesource.js @@ -57,9 +57,19 @@ ol.source.VectorFile = function(opt_options) { this.readFeatures_(options.text); } - if (goog.isDef(options.url)) { + if (goog.isDef(options.url) || goog.isDef(options.urls)) { this.setState(ol.source.State.LOADING); - goog.net.XhrIo.send(options.url, goog.bind(this.handleXhrIo_, this)); + var handleXhrIo = goog.bind(this.handleXhrIo_, this); + if (goog.isDef(options.url)) { + goog.net.XhrIo.send(options.url, handleXhrIo); + } + if (goog.isDef(options.urls)) { + var urls = options.urls; + var i, ii; + for (i = 0, ii = urls.length; i < ii; ++i) { + goog.net.XhrIo.send(urls[i], handleXhrIo); + } + } } };