Compare commits

..

5 Commits

Author SHA1 Message Date
Andreas Hocevar
992bfdc126 Update package version to 4.6.1 2017-12-06 21:43:24 +01:00
Andreas Hocevar
a96b8c5ca6 Changelog for v4.6.1 2017-12-06 21:42:35 +01:00
Andreas Hocevar
2bce90470e Merge pull request #7543 from ahocevar/interiorpoint-donut
Donut polygon labels do not get a chance to get rendered
2017-12-06 21:39:34 +01:00
Andreas Hocevar
50053c1b3f Merge pull request #7542 from ahocevar/overflow
Still respect deprecated exceedLength option
2017-12-06 21:39:14 +01:00
Andreas Hocevar
0c5134b789 Merge pull request #7541 from ahocevar/vectorrendertype-case
Fix case of vectorrendertype.js
2017-12-06 21:38:52 +01:00
7 changed files with 39 additions and 14 deletions

9
changelog/v4.6.1.md Normal file
View File

@@ -0,0 +1,9 @@
# 4.6.1
The v4.6.1 release fixes a number of issues in the 4.6 releases.
## Fixes
* [#7543](https://github.com/openlayers/openlayers/pull/7543) - Donut polygon labels do not get a chance to get rendered ([@ahocevar](https://github.com/ahocevar))
* [#7542](https://github.com/openlayers/openlayers/pull/7542) - Still respect deprecated exceedLength option ([@ahocevar](https://github.com/ahocevar))
* [#7541](https://github.com/openlayers/openlayers/pull/7541) - Fix case of vectorrendertype.js ([@ahocevar](https://github.com/ahocevar))

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "4.6.0",
"version": "4.6.1",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",

View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "4.6.0",
"version": "4.6.1",
"description": "OpenLayers as ES2015 modules",
"main": "index.js",
"module": "index.js",

View File

@@ -24,18 +24,20 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
/** @type {Array.<number>} */
var intersections = [];
// Calculate intersections with the horizontal line
var end = ends[0];
x1 = flatCoordinates[end - stride];
y1 = flatCoordinates[end - stride + 1];
for (i = offset; i < end; i += stride) {
x2 = flatCoordinates[i];
y2 = flatCoordinates[i + 1];
if ((y <= y1 && y2 <= y) || (y1 <= y && y <= y2)) {
x = (y - y1) / (y2 - y1) * (x2 - x1) + x1;
intersections.push(x);
for (var r = 0, rr = ends.length; r < rr; ++r) {
var end = ends[r];
x1 = flatCoordinates[end - stride];
y1 = flatCoordinates[end - stride + 1];
for (i = offset; i < end; i += stride) {
x2 = flatCoordinates[i];
y2 = flatCoordinates[i + 1];
if ((y <= y1 && y2 <= y) || (y1 <= y && y <= y2)) {
x = (y - y1) / (y2 - y1) * (x2 - x1) + x1;
intersections.push(x);
}
x1 = x2;
y1 = y2;
}
x1 = x2;
y1 = y2;
}
// Find the longest segment of the horizontal line that has its center point
// inside the linear ring.

View File

@@ -78,11 +78,14 @@ ol.style.Text = function(opt_options) {
*/
this.placement_ = options.placement !== undefined ? options.placement : ol.style.TextPlacement.POINT;
//TODO Use options.overflow directly after removing @deprecated exceedLength
var overflow = options.overflow === undefined ? options.exceedLength : options.overflow;
/**
* @private
* @type {boolean}
*/
this.overflow_ = options.overflow !== undefined ? options.overflow : false;
this.overflow_ = overflow !== undefined ? overflow : false;
/**
* @private

View File

@@ -550,6 +550,17 @@ describe('ol.geom.Polygon', function() {
expect(interiorPoint.layout).to.be('XYM');
expect(interiorPoint.getCoordinates()).to.eql([0.5, 0.5, 1]);
});
it('returns XYM point for donut polygons', function() {
var geom = new ol.geom.Polygon([
[[0.5, 0.5], [0.5, 2.5], [2.5, 2.5], [2.5, 0.5], [0.5, 0.5]],
[[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]
]);
var interiorPoint = geom.getInteriorPoint();
expect(interiorPoint.getType()).to.be('Point');
expect(interiorPoint.layout).to.be('XYM');
expect(interiorPoint.getCoordinates()).to.eql([0.75, 1.5, 0.5]);
});
});
describe('ol.geom.Polygon.fromExtent', function() {