Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c93439383 | ||
|
|
873505e82a | ||
|
|
52afff2e29 | ||
|
|
82118b0e4d | ||
|
|
5a86e1aaa4 | ||
|
|
562b2f632f | ||
|
|
7b297283f2 | ||
|
|
6610391c0b | ||
|
|
6db0e1d2dc | ||
|
|
f9792f69a4 | ||
|
|
e6592c95ea | ||
|
|
eee7e2523c | ||
|
|
dcdaf6ddc5 | ||
|
|
39334fa95d | ||
|
|
ba41100799 | ||
|
|
4f0f81c802 | ||
|
|
82ff027a30 | ||
|
|
c0223590dc | ||
|
|
f43ea770e1 | ||
|
|
e128804e2a |
@@ -2,7 +2,9 @@
|
||||
|
||||
This is a bugfix release which removes a few regressions that were introduced by v6.4.0, and fixes a few issues in examples caused by the website facelift.
|
||||
|
||||
## List of all changes * [#11346](https://github.com/openlayers/openlayers/pull/11346) - Fix text instruction flat coordinates when stride is not 2 ([@ahocevar](https://github.com/ahocevar))
|
||||
## List of all changes
|
||||
|
||||
* [#11346](https://github.com/openlayers/openlayers/pull/11346) - Fix text instruction flat coordinates when stride is not 2 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#11348](https://github.com/openlayers/openlayers/pull/11348) - Add all layers to layer export ([@M393](https://github.com/M393))
|
||||
* [#11337](https://github.com/openlayers/openlayers/pull/11337) - Do not rely on old value for target ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#11345](https://github.com/openlayers/openlayers/pull/11345) - Fix the popup in the geographic example ([@MoonE](https://github.com/MoonE))
|
||||
|
||||
14
changelog/v6.4.2.md
Normal file
14
changelog/v6.4.2.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# 6.4.1
|
||||
|
||||
This is a bugfix release which removes a few regressions that were introduced by v6.4.0, and fixes a few issues in examples.
|
||||
|
||||
See the [v6.4.0 release notes](https://github.com/openlayers/openlayers/releases/tag/v6.4.0) for a complete list of changes and upgrade notes when upgrading from v6.3.x.
|
||||
|
||||
## List of all changes
|
||||
|
||||
* [#11364](https://github.com/openlayers/openlayers/pull/11364) - Load pointer events polyfill - before other polyfills ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#11365](https://github.com/openlayers/openlayers/pull/11365) - Revert to original method proposed in #11193 ([@mike-000](https://github.com/mike-000))
|
||||
* [#11359](https://github.com/openlayers/openlayers/pull/11359) - check projection can wrap before getting width ([@mike-000](https://github.com/mike-000))
|
||||
* [#11355](https://github.com/openlayers/openlayers/pull/11355) - Cloak API key with instructions where to get one ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#11354](https://github.com/openlayers/openlayers/pull/11354) - Fix line breaks in changelog ([@ahocevar](https://github.com/ahocevar))
|
||||
|
||||
@@ -35,6 +35,8 @@ tags: "fullscreen, geolocation, orientation, mobile"
|
||||
left: 10px;
|
||||
}
|
||||
</style>
|
||||
<script src="https://unpkg.com/elm-pep"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -23,6 +23,8 @@ cloak:
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<script src="https://unpkg.com/elm-pep"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -6,5 +6,9 @@ docs: >
|
||||
The map in this example is rendered in a web worker, using `OffscreenCanvas`. **Note:** This is currently only supported in Chrome and Edge.
|
||||
tags: "worker, offscreencanvas, vector-tiles"
|
||||
experimental: true
|
||||
cloak:
|
||||
- key: get_your_own_D6rA4zTHduk6KOKTXzGB
|
||||
value: Get your own API key at https://www.maptiler.com/cloud/
|
||||
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<link rel="stylesheet" href="./resources/prism/prism-1.20.0.css" type="text/css">
|
||||
<link rel="stylesheet" href="./css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
<script src="https://unpkg.com/elm-pep"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
{{{ extraHead.local }}}
|
||||
{{{ css.tag }}}
|
||||
<title>{{ title }}</title>
|
||||
@@ -190,10 +190,10 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
|
||||
<script src="https://unpkg.com/elm-pep"></script>{{#if extraHead.remote}}
|
||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
|
||||
<script src="https://unpkg.com/@openlayers/pepjs"></script>{{#if extraHead.remote}}
|
||||
{{ indent extraHead.remote spaces=4 }}{{/if}}
|
||||
<style>
|
||||
.map {
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ol",
|
||||
"version": "6.4.1",
|
||||
"version": "6.4.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ol",
|
||||
"version": "6.4.1",
|
||||
"version": "6.4.2",
|
||||
"description": "OpenLayers mapping library",
|
||||
"keywords": [
|
||||
"map",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,72 @@
|
||||
import Feature from '../../../src/ol/Feature.js';
|
||||
import Map from '../../../src/ol/Map.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
import VectorImageLayer from '../../../src/ol/layer/VectorImage.js';
|
||||
import VectorSource from '../../../src/ol/source/Vector.js';
|
||||
import View from '../../../src/ol/View.js';
|
||||
import {Fill, RegularShape, Stroke, Style} from '../../../src/ol/style.js';
|
||||
import {fromExtent} from '../../../src/ol/geom/Polygon.js';
|
||||
|
||||
const extent = [
|
||||
1900e3 - 100000,
|
||||
6300e3 - 100000,
|
||||
1900e3 + 100000,
|
||||
6300e3 + 100000,
|
||||
];
|
||||
|
||||
const pt1 = new Feature({
|
||||
name: 'point',
|
||||
geometry: new Point([1900e3, 6300e3]),
|
||||
});
|
||||
pt1.setStyle(
|
||||
new Style({
|
||||
image: new RegularShape({
|
||||
points: 4,
|
||||
radius: 20,
|
||||
fill: new Fill({
|
||||
color: 'fuchsia',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
const border = new Feature({
|
||||
name: 'extent border',
|
||||
geometry: fromExtent(extent),
|
||||
});
|
||||
|
||||
new Map({
|
||||
layers: [
|
||||
new VectorImageLayer({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'yellow',
|
||||
width: 20,
|
||||
}),
|
||||
}),
|
||||
source: new VectorSource({
|
||||
features: [border],
|
||||
}),
|
||||
}),
|
||||
new VectorImageLayer({
|
||||
style: new Style({
|
||||
stroke: new Stroke({
|
||||
color: 'green',
|
||||
width: 20,
|
||||
}),
|
||||
}),
|
||||
source: new VectorSource({
|
||||
features: [pt1, border],
|
||||
}),
|
||||
extent: extent,
|
||||
}),
|
||||
],
|
||||
target: 'map',
|
||||
view: new View({
|
||||
center: [1900e3, 6300e3],
|
||||
zoom: 7,
|
||||
rotation: Math.PI / 4,
|
||||
}),
|
||||
});
|
||||
|
||||
render();
|
||||
@@ -410,11 +410,13 @@ export function toStringXY(coordinate, opt_fractionDigits) {
|
||||
* @return {Coordinate} The coordinate within the real world extent.
|
||||
*/
|
||||
export function wrapX(coordinate, projection) {
|
||||
if (projection.canWrapX()) {
|
||||
const worldWidth = getWidth(projection.getExtent());
|
||||
const worldsAway = getWorldsAway(coordinate, projection, worldWidth);
|
||||
if (worldsAway) {
|
||||
coordinate[0] -= worldsAway * worldWidth;
|
||||
}
|
||||
}
|
||||
return coordinate;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,6 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
||||
{},
|
||||
frameState,
|
||||
{
|
||||
coordinateToPixelTransform: create(),
|
||||
declutterItems: [],
|
||||
extent: renderedExtent,
|
||||
size: [width, height],
|
||||
@@ -138,6 +137,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
||||
vectorRenderer.prepareFrame(imageFrameState) &&
|
||||
vectorRenderer.replayGroupChanged
|
||||
) {
|
||||
vectorRenderer.clipping = false;
|
||||
vectorRenderer.renderFrame(imageFrameState, null);
|
||||
renderDeclutterItems(imageFrameState, null);
|
||||
callback();
|
||||
|
||||
@@ -129,6 +129,12 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.replayGroupChanged = true;
|
||||
|
||||
/**
|
||||
* Clipping to be performed by `renderFrame()`
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.clipping = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,7 +204,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
// clipped rendering if layer extent is set
|
||||
let clipped = false;
|
||||
if (layerState.extent) {
|
||||
if (layerState.extent && this.clipping) {
|
||||
const layerExtent = fromUserExtent(layerState.extent, projection);
|
||||
clipped =
|
||||
!containsExtent(layerExtent, frameState.extent) &&
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Circle from '../../../src/ol/geom/Circle.js';
|
||||
import Projection from '../../../src/ol/proj/Projection.js';
|
||||
import {
|
||||
add as addCoordinate,
|
||||
closestOnCircle,
|
||||
@@ -271,5 +272,11 @@ describe('ol.coordinate', function () {
|
||||
it('moves far off right coordinate to real world', function () {
|
||||
expect(wrapX([1096, 48], projection)).to.eql([16, 48]);
|
||||
});
|
||||
|
||||
const swiss = new Projection({code: 'EPSG:21781', units: 'm'});
|
||||
|
||||
it('leaves non-global projection coordinates untouched', function () {
|
||||
expect(wrapX([1096, 48], swiss)).to.eql([1096, 48]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import Disposable from '../../../../src/ol/Disposable.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapRenderer from '../../../../src/ol/renderer/Map.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import {Point} from '../../../../src/ol/geom.js';
|
||||
import {Projection} from '../../../../src/ol/proj.js';
|
||||
|
||||
describe('ol.renderer.Map', function () {
|
||||
describe('constructor', function () {
|
||||
@@ -13,4 +19,46 @@ describe('ol.renderer.Map', function () {
|
||||
map.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
describe('#forEachFeatureAtCoordinate', function () {
|
||||
let map;
|
||||
beforeEach(function () {
|
||||
const target = document.createElement('div');
|
||||
target.style.width = '100px';
|
||||
target.style.height = '100px';
|
||||
document.body.appendChild(target);
|
||||
const projection = new Projection({
|
||||
code: 'EPSG:21781',
|
||||
units: 'm',
|
||||
});
|
||||
map = new Map({
|
||||
target: target,
|
||||
layers: [
|
||||
new VectorLayer({
|
||||
source: new VectorSource({
|
||||
projection: projection,
|
||||
features: [new Feature(new Point([660000, 190000]))],
|
||||
}),
|
||||
}),
|
||||
],
|
||||
view: new View({
|
||||
projection: projection,
|
||||
center: [660000, 190000],
|
||||
zoom: 9,
|
||||
}),
|
||||
});
|
||||
map.renderSync();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
const target = map.getTargetElement();
|
||||
map.setTarget(null);
|
||||
document.body.removeChild(target);
|
||||
});
|
||||
|
||||
it('works with custom projection', function () {
|
||||
const features = map.getFeaturesAtPixel([50, 50]);
|
||||
expect(features.length).to.be(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user