Prevent unnecessary function calls
handlePointerMove_ doesn't need to be called when dragging. handleDragEvent_ takes care of the event in that case. in handleDragEvent_, createOrUpdateVertexFeature_ doesn't need to be called for each dragged segment. it can be called only once with current vertex. fixes made to pass the build
This commit is contained in:
@@ -129,7 +129,7 @@ var source = new ol.source.GeoJSON(
|
|||||||
[[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
|
[[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
|
||||||
[-3e6, 6e6], [-5e6, 6e6]]],
|
[-3e6, 6e6], [-5e6, 6e6]]],
|
||||||
[[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6],
|
[[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6],
|
||||||
[0, 6e6], [-3e6, 6e6] ]],
|
[0, 6e6], [-3e6, 6e6]]],
|
||||||
[[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
|
[[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
|
||||||
[3e6, 6e6], [1e6, 6e6]]]
|
[3e6, 6e6], [1e6, 6e6]]]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -507,8 +507,8 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
geometry.setCoordinates(coordinates);
|
geometry.setCoordinates(coordinates);
|
||||||
this.createOrUpdateVertexFeature_(vertex);
|
|
||||||
}
|
}
|
||||||
|
this.createOrUpdateVertexFeature_(vertex);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -538,7 +538,8 @@ ol.interaction.Modify.handleUpEvent_ = function(evt) {
|
|||||||
ol.interaction.Modify.handleEvent = function(mapBrowserEvent) {
|
ol.interaction.Modify.handleEvent = function(mapBrowserEvent) {
|
||||||
var handled;
|
var handled;
|
||||||
if (!mapBrowserEvent.map.getView().getHints()[ol.ViewHint.INTERACTING] &&
|
if (!mapBrowserEvent.map.getView().getHints()[ol.ViewHint.INTERACTING] &&
|
||||||
mapBrowserEvent.type == ol.MapBrowserEvent.EventType.POINTERMOVE) {
|
mapBrowserEvent.type == ol.MapBrowserEvent.EventType.POINTERMOVE &&
|
||||||
|
!this.handlingDownUpSequence) {
|
||||||
this.handlePointerMove_(mapBrowserEvent);
|
this.handlePointerMove_(mapBrowserEvent);
|
||||||
}
|
}
|
||||||
if (!goog.isNull(this.vertexFeature_) &&
|
if (!goog.isNull(this.vertexFeature_) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user