Add urls option to ol.source.VectorFile
This commit is contained in:
@@ -710,6 +710,7 @@
|
|||||||
* @property {ol.proj.ProjectionLike} projection Projection.
|
* @property {ol.proj.ProjectionLike} projection Projection.
|
||||||
* @property {string|undefined} text Text.
|
* @property {string|undefined} text Text.
|
||||||
* @property {string|undefined} url URL.
|
* @property {string|undefined} url URL.
|
||||||
|
* @property {Array.<string>|undefined} urls URLs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,9 +57,19 @@ ol.source.VectorFile = function(opt_options) {
|
|||||||
this.readFeatures_(options.text);
|
this.readFeatures_(options.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goog.isDef(options.url)) {
|
if (goog.isDef(options.url) || goog.isDef(options.urls)) {
|
||||||
this.setState(ol.source.State.LOADING);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user