Use default style function in FeatureOverlay
This commit is contained in:
@@ -144,14 +144,18 @@ ol.FeatureOverlay.prototype.handleFeaturesRemove_ =
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.FeatureOverlay.prototype.handleMapPostCompose_ = function(event) {
|
ol.FeatureOverlay.prototype.handleMapPostCompose_ = function(event) {
|
||||||
if (goog.isNull(this.features_) || !goog.isDef(this.styleFunction_)) {
|
if (goog.isNull(this.features_)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var styleFunction = this.styleFunction_;
|
||||||
|
if (!goog.isDef(styleFunction)) {
|
||||||
|
styleFunction = ol.feature.defaultStyleFunction;
|
||||||
|
}
|
||||||
var resolution = event.frameState.view2DState.resolution;
|
var resolution = event.frameState.view2DState.resolution;
|
||||||
var vectorContext = event.vectorContext;
|
var vectorContext = event.vectorContext;
|
||||||
var i, ii, feature, styles;
|
var i, ii, feature, styles;
|
||||||
this.features_.forEach(function(feature) {
|
this.features_.forEach(function(feature) {
|
||||||
styles = this.styleFunction_(feature, resolution);
|
styles = styleFunction(feature, resolution);
|
||||||
if (!goog.isDefAndNotNull(styles)) {
|
if (!goog.isDefAndNotNull(styles)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user