Skip to content

Commit

Permalink
Initialize selectStyleFunction only once
Browse files Browse the repository at this point in the history
  • Loading branch information
werrolf committed Oct 8, 2020
1 parent 5ae0878 commit a11c290
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selectableModify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function () {

function getStyleFunction_() {
var selectStyleFunction = (function() {
var baseStyle = ol.style.Style.defaultFunction()[0].clone();
var verticesStyle = new ol.style.Style({
geometry: function(feature) {
Expand Down Expand Up @@ -48,15 +48,15 @@
}
return styles;
}
}
})();

ol.interaction.SelectableModify = function (options) {
var vertices = this.vertices_ = null;

var edges = this.edges_ = null;

this.select_ = new ol.interaction.Select({
style: getStyleFunction_()
style: selectStyleFunction
});

this.select_.on('select', function (event) {
Expand Down

0 comments on commit a11c290

Please sign in to comment.