Use setStyle in the constructor
This commit is contained in:
@@ -65,14 +65,17 @@ ol.FeatureOverlay = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction}
|
* @type {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction}
|
||||||
*/
|
*/
|
||||||
this.style_ = goog.isDef(options.style) ? options.style : null;
|
this.style_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.feature.StyleFunction|undefined}
|
* @type {ol.feature.StyleFunction|undefined}
|
||||||
*/
|
*/
|
||||||
this.styleFunction_ = goog.isDef(options.style) ?
|
this.styleFunction_ = undefined;
|
||||||
ol.feature.createStyleFunction(options.style) : undefined;
|
|
||||||
|
if (goog.isDef(options.style)) {
|
||||||
|
this.setStyle(options.style);
|
||||||
|
}
|
||||||
|
|
||||||
if (goog.isDef(options.features)) {
|
if (goog.isDef(options.features)) {
|
||||||
if (goog.isArray(options.features)) {
|
if (goog.isArray(options.features)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user