Merge pull request #7614 from KlausBenndorf/publicThisArgs

Remove opt_this from the API
This commit is contained in:
Tim Schaub
2017-12-19 09:30:54 -08:00
committed by GitHub
18 changed files with 72 additions and 135 deletions

View File

@@ -213,7 +213,7 @@ var _ol_interaction_Modify_ = function(options) {
*/
this.features_ = features;
this.features_.forEach(this.addFeature_, this);
this.features_.forEach(this.addFeature_.bind(this));
_ol_events_.listen(this.features_, CollectionEventType.ADD,
this.handleFeatureAdd_, this);
_ol_events_.listen(this.features_, CollectionEventType.REMOVE,

View File

@@ -313,12 +313,12 @@ _ol_interaction_Select_.prototype.setMap = function(map) {
var selectedFeatures =
this.featureOverlay_.getSource().getFeaturesCollection();
if (currentMap) {
selectedFeatures.forEach(currentMap.unskipFeature, currentMap);
selectedFeatures.forEach(currentMap.unskipFeature.bind(currentMap));
}
Interaction.prototype.setMap.call(this, map);
this.featureOverlay_.setMap(map);
if (map) {
selectedFeatures.forEach(map.skipFeature, map);
selectedFeatures.forEach(map.skipFeature.bind(map));
}
};

View File

@@ -302,7 +302,7 @@ _ol_interaction_Snap_.prototype.setMap = function(map) {
if (currentMap) {
keys.forEach(_ol_events_.unlistenByKey);
keys.length = 0;
features.forEach(this.forEachFeatureRemove_, this);
features.forEach(this.forEachFeatureRemove_.bind(this));
}
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
@@ -322,7 +322,7 @@ _ol_interaction_Snap_.prototype.setMap = function(map) {
this.handleFeatureRemove_, this)
);
}
features.forEach(this.forEachFeatureAdd_, this);
features.forEach(this.forEachFeatureAdd_.bind(this));
}
};
@@ -613,7 +613,7 @@ _ol_interaction_Snap_.handleEvent_ = function(evt) {
_ol_interaction_Snap_.handleUpEvent_ = function(evt) {
var featuresToUpdate = _ol_obj_.getValues(this.pendingFeatures_);
if (featuresToUpdate.length) {
featuresToUpdate.forEach(this.updateFeature_, this);
featuresToUpdate.forEach(this.updateFeature_.bind(this));
this.pendingFeatures_ = {};
}
return false;