Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d27dcc27c | ||
|
|
52bbebf9aa | ||
|
|
578f900435 | ||
|
|
3bc1de3f6c |
7
changelog/v4.6.2.md
Normal file
7
changelog/v4.6.2.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# 4.6.2
|
||||||
|
|
||||||
|
The v4.6.2 release fixes a regression that could cause tremendous amounts of unneeded vector data to be fetched from the source.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
* [#7546](Do not request features for wrapped extent) - Do not request features for wrapped extent ([@ahocevar](https://github.com/ahocevar))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openlayers",
|
"name": "openlayers",
|
||||||
"version": "4.6.1",
|
"version": "4.6.2",
|
||||||
"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": "4.6.1",
|
"version": "4.6.2",
|
||||||
"description": "OpenLayers as ES2015 modules",
|
"description": "OpenLayers as ES2015 modules",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"module": "index.js",
|
"module": "index.js",
|
||||||
|
|||||||
@@ -181,11 +181,11 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
|
|||||||
ol.render.canvas.rotateAtOffset(replayContext, -rotation,
|
ol.render.canvas.rotateAtOffset(replayContext, -rotation,
|
||||||
width / 2, height / 2);
|
width / 2, height / 2);
|
||||||
replayGroup.replay(replayContext, transform, rotation, skippedFeatureUids);
|
replayGroup.replay(replayContext, transform, rotation, skippedFeatureUids);
|
||||||
if (vectorSource.getWrapX() && projection.canWrapX()) {
|
if (vectorSource.getWrapX() && projection.canWrapX() &&
|
||||||
|
!ol.extent.containsExtent(projectionExtent, extent)) {
|
||||||
var startX = extent[0];
|
var startX = extent[0];
|
||||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||||
var world = 0;
|
var world = 0;
|
||||||
startX -= worldWidth;
|
|
||||||
var offsetX;
|
var offsetX;
|
||||||
while (startX < projectionExtent[0]) {
|
while (startX < projectionExtent[0]) {
|
||||||
--world;
|
--world;
|
||||||
@@ -196,7 +196,6 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
|
|||||||
}
|
}
|
||||||
world = 0;
|
world = 0;
|
||||||
startX = extent[2];
|
startX = extent[2];
|
||||||
startX += worldWidth;
|
|
||||||
while (startX > projectionExtent[2]) {
|
while (startX > projectionExtent[2]) {
|
||||||
++world;
|
++world;
|
||||||
offsetX = worldWidth * world;
|
offsetX = worldWidth * world;
|
||||||
@@ -326,7 +325,8 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, lay
|
|||||||
vectorLayerRenderBuffer * resolution);
|
vectorLayerRenderBuffer * resolution);
|
||||||
var projectionExtent = viewState.projection.getExtent();
|
var projectionExtent = viewState.projection.getExtent();
|
||||||
|
|
||||||
if (vectorSource.getWrapX() && viewState.projection.canWrapX()) {
|
if (vectorSource.getWrapX() && viewState.projection.canWrapX() &&
|
||||||
|
!ol.extent.containsExtent(projectionExtent, frameState.extent)) {
|
||||||
// For the replay group, we need an extent that intersects the real world
|
// For the replay group, we need an extent that intersects the real world
|
||||||
// (-180° to +180°). To support geometries in a coordinate range from -540°
|
// (-180° to +180°). To support geometries in a coordinate range from -540°
|
||||||
// to +540°, we add at least 1 world width on each side of the projection
|
// to +540°, we add at least 1 world width on each side of the projection
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.loadingstrategy');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
@@ -417,6 +419,44 @@ describe('ol.source.Vector', function() {
|
|||||||
|
|
||||||
describe('#loadFeatures', function() {
|
describe('#loadFeatures', function() {
|
||||||
|
|
||||||
|
describe('with the "bbox" strategy', function() {
|
||||||
|
|
||||||
|
|
||||||
|
it('requests the view extent plus render buffer', function(done) {
|
||||||
|
var center = [-97.6114, 38.8403];
|
||||||
|
var source = new ol.source.Vector({
|
||||||
|
strategy: ol.loadingstrategy.bbox,
|
||||||
|
loader: function(extent) {
|
||||||
|
setTimeout(function() {
|
||||||
|
var lonLatExtent = ol.proj.transformExtent(extent, 'EPSG:3857', 'EPSG:4326');
|
||||||
|
expect(lonLatExtent[0]).to.roughlyEqual(-99.261474609, 1e-9);
|
||||||
|
expect(lonLatExtent[2]).to.roughlyEqual(-95.965576171, 1e-9);
|
||||||
|
done();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.style.width = div.style.height = '100px';
|
||||||
|
document.body.appendChild(div);
|
||||||
|
var map = new ol.Map({
|
||||||
|
target: div,
|
||||||
|
layers: [
|
||||||
|
new ol.layer.Vector({
|
||||||
|
source: source
|
||||||
|
})
|
||||||
|
],
|
||||||
|
view: new ol.View({
|
||||||
|
center: ol.proj.fromLonLat(center),
|
||||||
|
zoom: 7
|
||||||
|
})
|
||||||
|
});
|
||||||
|
map.renderSync();
|
||||||
|
map.setTarget(null);
|
||||||
|
document.body.removeChild(div);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe('with no loader and the "all" strategy', function() {
|
describe('with no loader and the "all" strategy', function() {
|
||||||
|
|
||||||
it('stores the infinity extent in the Rtree', function() {
|
it('stores the infinity extent in the Rtree', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user