Merge pull request #1433 from twpayne/vector-api-export-featuresoverlay
[vector-api] Export ol.render.FeaturesOverlay
This commit is contained in:
@@ -505,6 +505,13 @@
|
|||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} olx.render.FeaturesOverlayOptions
|
||||||
|
* @property {Array.<ol.Feature>|ol.Collection|undefined} features Features.
|
||||||
|
* @property {ol.Map|undefined} map Map.
|
||||||
|
* @property {ol.style.StyleFunction|undefined} styleFunction Style function.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} olx.source.BingMapsOptions
|
* @typedef {Object} olx.source.BingMapsOptions
|
||||||
* @property {string|undefined} culture Culture code. Default is `en-us`.
|
* @property {string|undefined} culture Culture code. Default is `en-us`.
|
||||||
|
|||||||
5
src/ol/render/featuresoverlay.exports
Normal file
5
src/ol/render/featuresoverlay.exports
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@exportSymbol ol.render.FeaturesOverlay
|
||||||
|
@exportProperty ol.render.FeaturesOverlay.prototype.getFeatures
|
||||||
|
@exportProperty ol.render.FeaturesOverlay.prototype.setFeatures
|
||||||
|
@exportProperty ol.render.FeaturesOverlay.prototype.setMap
|
||||||
|
@exportProperty ol.render.FeaturesOverlay.prototype.setStyleFunction
|
||||||
@@ -15,8 +15,11 @@ goog.require('ol.render.EventType');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @param {olx.render.FeaturesOverlayOptions=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
ol.render.FeaturesOverlay = function() {
|
ol.render.FeaturesOverlay = function(opt_options) {
|
||||||
|
|
||||||
|
var options = goog.isDef(opt_options) ? opt_options : options;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -54,6 +57,23 @@ ol.render.FeaturesOverlay = function() {
|
|||||||
*/
|
*/
|
||||||
this.styleFunction_ = undefined;
|
this.styleFunction_ = undefined;
|
||||||
|
|
||||||
|
if (goog.isDef(options.features)) {
|
||||||
|
if (goog.isArray(options.features)) {
|
||||||
|
this.setFeatures(new ol.Collection(goog.array.clone(options.features)));
|
||||||
|
} else {
|
||||||
|
goog.asserts.assertInstanceof(options.features, ol.Collection);
|
||||||
|
this.setFeatures(options.features);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goog.isDef(options.styleFunction)) {
|
||||||
|
this.setStyleFunction(options.styleFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goog.isDef(options.map)) {
|
||||||
|
this.setMap(options.map);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user