Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
394c338ff8 | ||
|
|
a112dd83e2 | ||
|
|
c6aef2a7da | ||
|
|
0b3eed5500 | ||
|
|
b98a28857d | ||
|
|
a14a348246 | ||
|
|
ffefda132a |
10
changelog/v3.18.1.md
Normal file
10
changelog/v3.18.1.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# v3.18.1
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The v3.18.1 release is a patch release that addresses two regressions in the v3.18.0 release. See the [v3.18.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.18.0) for details on upgrading from v3.17.x.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
* [#5798](https://github.com/openlayers/ol3/pull/5798) - Move to 90° along the circle, not 0° ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5790](https://github.com/openlayers/ol3/pull/5790) - Fix vector tile rotation on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
||||||
9
changelog/v3.18.2.md
Normal file
9
changelog/v3.18.2.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# v3.18.2
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The v3.18.2 release is a patch release that addresses a regression in the v3.18.1 release. See the [v3.18.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.18.0) for details on upgrading from v3.17.x.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
* [#5828](https://github.com/openlayers/ol3/pull/5828) - Always close polygon rings ([@ahocevar](https://github.com/ahocevar))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openlayers",
|
"name": "openlayers",
|
||||||
"version": "3.18.0",
|
"version": "3.18.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",
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
var dx = x2 - x1;
|
var dx = x2 - x1;
|
||||||
var dy = y2 - y1;
|
var dy = y2 - y1;
|
||||||
var r = Math.sqrt(dx * dx + dy * dy);
|
var r = Math.sqrt(dx * dx + dy * dy);
|
||||||
context.moveTo(x2, y2);
|
context.moveTo(x1 + r, y1);
|
||||||
context.arc(x1, y1, r, 0, 2 * Math.PI, true);
|
context.arc(x1, y1, r, 0, 2 * Math.PI, true);
|
||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
@@ -1268,10 +1268,8 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo
|
|||||||
for (var i = 0; i < numEnds; ++i) {
|
for (var i = 0; i < numEnds; ++i) {
|
||||||
var end = ends[i];
|
var end = ends[i];
|
||||||
var myBegin = this.coordinates.length;
|
var myBegin = this.coordinates.length;
|
||||||
var myEnd = this.appendFlatCoordinates(flatCoordinates, offset, end, stride,
|
var myEnd = this.appendFlatCoordinates(
|
||||||
// Performance optimization: only close the ring when we do not have a
|
flatCoordinates, offset, end, stride, true);
|
||||||
// stroke. Otherwise closePath() will take care of that.
|
|
||||||
!stroke);
|
|
||||||
var moveToLineToInstruction =
|
var moveToLineToInstruction =
|
||||||
[ol.render.canvas.Instruction.MOVE_TO_LINE_TO, myBegin, myEnd];
|
[ol.render.canvas.Instruction.MOVE_TO_LINE_TO, myBegin, myEnd];
|
||||||
this.instructions.push(moveToLineToInstruction);
|
this.instructions.push(moveToLineToInstruction);
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.renderTileReplays_ = function(
|
|||||||
var size = frameState.size;
|
var size = frameState.size;
|
||||||
var pixelScale = pixelRatio / resolution;
|
var pixelScale = pixelRatio / resolution;
|
||||||
var source = /** @type {ol.source.VectorTile} */ (layer.getSource());
|
var source = /** @type {ol.source.VectorTile} */ (layer.getSource());
|
||||||
var tilePixelRatio = source.getTilePixelRatio(pixelRatio);
|
var tilePixelRatio = source.getTilePixelRatio();
|
||||||
|
|
||||||
var transform = this.getTransform(frameState, 0);
|
var transform = this.getTransform(frameState, 0);
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
|
|||||||
var resolution = tileGrid.getResolution(tileCoord[0]);
|
var resolution = tileGrid.getResolution(tileCoord[0]);
|
||||||
var extent, reproject, tileResolution;
|
var extent, reproject, tileResolution;
|
||||||
if (pixelSpace) {
|
if (pixelSpace) {
|
||||||
var tilePixelRatio = tileResolution = source.getTilePixelRatio(pixelRatio);
|
var tilePixelRatio = tileResolution = source.getTilePixelRatio();
|
||||||
var tileSize = ol.size.toSize(tileGrid.getTileSize(tileCoord[0]));
|
var tileSize = ol.size.toSize(tileGrid.getTileSize(tileCoord[0]));
|
||||||
extent = [0, 0, tileSize[0] * tilePixelRatio, tileSize[1] * tilePixelRatio];
|
extent = [0, 0, tileSize[0] * tilePixelRatio, tileSize[1] * tilePixelRatio];
|
||||||
} else {
|
} else {
|
||||||
@@ -276,7 +276,6 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||||
var pixelRatio = frameState.pixelRatio;
|
|
||||||
var resolution = frameState.viewState.resolution;
|
var resolution = frameState.viewState.resolution;
|
||||||
var rotation = frameState.viewState.rotation;
|
var rotation = frameState.viewState.rotation;
|
||||||
var layer = this.getLayer();
|
var layer = this.getLayer();
|
||||||
@@ -299,7 +298,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = functi
|
|||||||
}
|
}
|
||||||
if (tile.getProjection().getUnits() === ol.proj.Units.TILE_PIXELS) {
|
if (tile.getProjection().getUnits() === ol.proj.Units.TILE_PIXELS) {
|
||||||
origin = ol.extent.getTopLeft(tileExtent);
|
origin = ol.extent.getTopLeft(tileExtent);
|
||||||
tilePixelRatio = source.getTilePixelRatio(pixelRatio);
|
tilePixelRatio = source.getTilePixelRatio();
|
||||||
tileResolution = tileGrid.getResolution(tileCoord[0]) / tilePixelRatio;
|
tileResolution = tileGrid.getResolution(tileCoord[0]) / tilePixelRatio;
|
||||||
tileSpaceCoordinate = [
|
tileSpaceCoordinate = [
|
||||||
(coordinate[0] - origin[0]) / tileResolution,
|
(coordinate[0] - origin[0]) / tileResolution,
|
||||||
@@ -421,7 +420,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.renderTileImage_ = function(
|
|||||||
tileContext.translate(width / 2, height / 2);
|
tileContext.translate(width / 2, height / 2);
|
||||||
var pixelSpace = tile.getProjection().getUnits() == ol.proj.Units.TILE_PIXELS;
|
var pixelSpace = tile.getProjection().getUnits() == ol.proj.Units.TILE_PIXELS;
|
||||||
var pixelScale = pixelRatio / resolution;
|
var pixelScale = pixelRatio / resolution;
|
||||||
var tilePixelRatio = source.getTilePixelRatio(pixelRatio);
|
var tilePixelRatio = source.getTilePixelRatio();
|
||||||
var tilePixelResolution = tileResolution / tilePixelRatio;
|
var tilePixelResolution = tileResolution / tilePixelRatio;
|
||||||
var tileExtent = tileGrid.getTileCoordExtent(
|
var tileExtent = tileGrid.getTileCoordExtent(
|
||||||
tile.getTileCoord(), this.tmpExtent);
|
tile.getTileCoord(), this.tmpExtent);
|
||||||
|
|||||||
@@ -242,10 +242,14 @@ ol.source.Tile.prototype.getTileCacheForProjection = function(projection) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* Get the tile pixel ratio for this source. Subclasses may override this
|
||||||
|
* method, which is meant to return a supported pixel ratio that matches the
|
||||||
|
* provided `opt_pixelRatio` as close as possible. When no `opt_pixelRatio` is
|
||||||
|
* provided, it is meant to return `this.tilePixelRatio_`.
|
||||||
|
* @param {number=} opt_pixelRatio Pixel ratio.
|
||||||
* @return {number} Tile pixel ratio.
|
* @return {number} Tile pixel ratio.
|
||||||
*/
|
*/
|
||||||
ol.source.Tile.prototype.getTilePixelRatio = function(pixelRatio) {
|
ol.source.Tile.prototype.getTilePixelRatio = function(opt_pixelRatio) {
|
||||||
return this.tilePixelRatio_;
|
return this.tilePixelRatio_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileArcGISRest.prototype.getTilePixelRatio = function(pixelRatio) {
|
ol.source.TileArcGISRest.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||||
return pixelRatio;
|
return /** @type {number} */ (pixelRatio);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,8 @@ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileE
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileWMS.prototype.getTilePixelRatio = function(pixelRatio) {
|
ol.source.TileWMS.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||||
return (!this.hidpi_ || this.serverType_ === undefined) ? 1 : pixelRatio;
|
return (!this.hidpi_ || this.serverType_ === undefined) ? 1 :
|
||||||
|
/** @type {number} */ (pixelRatio);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,12 +104,22 @@ ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projectio
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
ol.source.VectorTile.prototype.getTilePixelRatio = function(opt_pixelRatio) {
|
||||||
|
return opt_pixelRatio == undefined ?
|
||||||
|
ol.source.UrlTile.prototype.getTilePixelRatio.call(this, opt_pixelRatio) :
|
||||||
|
opt_pixelRatio;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.VectorTile.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
|
ol.source.VectorTile.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
|
||||||
var tileSize = ol.size.toSize(this.tileGrid.getTileSize(z));
|
var tileSize = ol.size.toSize(this.tileGrid.getTileSize(z));
|
||||||
return [tileSize[0] * pixelRatio, tileSize[1] * pixelRatio];
|
return [Math.round(tileSize[0] * pixelRatio), Math.round(tileSize[1] * pixelRatio)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
test_rendering/spec/ol/layer/expected/vector-canvas-rotated.png
Normal file
BIN
test_rendering/spec/ol/layer/expected/vector-canvas-rotated.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -96,6 +96,26 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders rotation correctly with the canvas renderer', function(done) {
|
||||||
|
map = createMap('canvas');
|
||||||
|
map.getView().setRotation(Math.PI + Math.PI / 4);
|
||||||
|
addPolygon(300);
|
||||||
|
addCircle(500);
|
||||||
|
map.addLayer(new ol.layer.Vector({
|
||||||
|
source: source,
|
||||||
|
style: new ol.style.Style({
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
width: 2,
|
||||||
|
color: 'black'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
map.once('postrender', function() {
|
||||||
|
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-rotated.png',
|
||||||
|
1.7, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('renders fill/stroke batches correctly with the canvas renderer', function(done) {
|
it('renders fill/stroke batches correctly with the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
source = new ol.source.Vector({
|
source = new ol.source.Vector({
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
|
|
||||||
var target, map;
|
var target, map;
|
||||||
|
|
||||||
function createMap(renderer) {
|
function createMap(renderer, opt_pixelRatio) {
|
||||||
target = createMapDiv(50, 50);
|
target = createMapDiv(50, 50);
|
||||||
|
|
||||||
map = new ol.Map({
|
map = new ol.Map({
|
||||||
|
pixelRatio: opt_pixelRatio,
|
||||||
target: target,
|
target: target,
|
||||||
renderer: renderer,
|
renderer: renderer,
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
@@ -79,6 +80,32 @@ describe('ol.rendering.layer.VectorTile', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders rotated view correctly with the canvas renderer', function(done) {
|
||||||
|
map = createMap('canvas');
|
||||||
|
map.getView().setRotation(Math.PI / 4);
|
||||||
|
waitForTiles(source, {}, function() {
|
||||||
|
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated.png',
|
||||||
|
13.4, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders correctly with the canvas renderer (HiDPI)', function(done) {
|
||||||
|
map = createMap('canvas', 2);
|
||||||
|
waitForTiles(source, {}, function() {
|
||||||
|
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-hidpi.png',
|
||||||
|
11.3, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders rotated view correctly with the canvas renderer (HiDPI)', function(done) {
|
||||||
|
map = createMap('canvas', 2);
|
||||||
|
map.getView().setRotation(Math.PI / 4);
|
||||||
|
waitForTiles(source, {}, function() {
|
||||||
|
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated-hidpi.png',
|
||||||
|
14.8, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user