Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f515c86f54 | ||
|
|
87eaa1fba4 | ||
|
|
032ce16519 | ||
|
|
ea190e2009 | ||
|
|
fbd954ac7c | ||
|
|
676dda7ca6 | ||
|
|
186935c147 | ||
|
|
8e35b7a1ad | ||
|
|
0c159cf0f7 |
11
changelog/v4.0.1.md
Normal file
11
changelog/v4.0.1.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 4.0.1
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The v4.0.1 release is a patch release that addresses a regression in the v4.0.0 release. The fix makes pinch zooming work again properly when the two fingers are not placed on the screen at the same time.
|
||||||
|
|
||||||
|
See the [v4.0.0 release notes](https://github.com/openlayers/openlayers/releases/tag/v4.0.0) for details on upgrading from v3.20.x.
|
||||||
|
|
||||||
|
## Fix
|
||||||
|
|
||||||
|
* [#6486](https://github.com/openlayers/openlayers/pull/6486) - Do not set center when touches count has changed ([@ahocevar](https://github.com/ahocevar))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openlayers",
|
"name": "openlayers",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"map",
|
"map",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ol",
|
"name": "ol",
|
||||||
"version": "3.21.0-beta.17",
|
"version": "4.0.1-beta.1",
|
||||||
"description": "OpenLayers as ES2015 modules",
|
"description": "OpenLayers as ES2015 modules",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"module": "index.js",
|
"module": "index.js",
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ ol.interaction.DragPan = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.lastCentroid = null;
|
this.lastCentroid = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.lastPointersCount_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.EventsConditionType}
|
* @type {ol.EventsConditionType}
|
||||||
@@ -62,8 +67,10 @@ ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
||||||
|
var targetPointers = this.targetPointers;
|
||||||
var centroid =
|
var centroid =
|
||||||
ol.interaction.Pointer.centroid(this.targetPointers);
|
ol.interaction.Pointer.centroid(targetPointers);
|
||||||
|
if (targetPointers.length == this.lastPointersCount_) {
|
||||||
if (this.kinetic_) {
|
if (this.kinetic_) {
|
||||||
this.kinetic_.update(centroid[0], centroid[1]);
|
this.kinetic_.update(centroid[0], centroid[1]);
|
||||||
}
|
}
|
||||||
@@ -80,7 +87,13 @@ ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
center = view.constrainCenter(center);
|
center = view.constrainCenter(center);
|
||||||
view.setCenter(center);
|
view.setCenter(center);
|
||||||
}
|
}
|
||||||
|
} else if (this.kinetic_) {
|
||||||
|
// reset so we don't overestimate the kinetic energy after
|
||||||
|
// after one finger down, tiny drag, second finger down
|
||||||
|
this.kinetic_.begin();
|
||||||
|
}
|
||||||
this.lastCentroid = centroid;
|
this.lastCentroid = centroid;
|
||||||
|
this.lastPointersCount_ = targetPointers.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user