Compare commits

...

64 Commits

Author SHA1 Message Date
Andreas Hocevar
7c93439383 Update package version to 6.4.2 2020-07-30 23:09:27 +02:00
Andreas Hocevar
873505e82a Changelog for v6.4.2 2020-07-30 23:08:46 +02:00
Andreas Hocevar
52afff2e29 Merge pull request #11364 from ahocevar/pep-examples
Load pointer events polyfill - before other polyfills
2020-07-30 22:55:37 +02:00
Andreas Hocevar
82118b0e4d Merge pull request #11365 from mike-000/patch-6
Revert to original method proposed in #11193
2020-07-30 22:54:28 +02:00
Andreas Hocevar
5a86e1aaa4 Add rendering test for rotated image vector clipping with intersection 2020-07-30 22:49:18 +02:00
mike-000
562b2f632f Revert #11193, set vectorRenderer.clipping = false 2020-07-30 20:11:11 +01:00
Andreas Hocevar
7b297283f2 Load pointer events polyfill - before other polyfills 2020-07-30 21:01:10 +02:00
mike-000
6610391c0b Add clipping property 2020-07-30 19:58:23 +01:00
Andreas Hocevar
6db0e1d2dc Merge pull request #11359 from mike-000/patch-3
check projection can wrap before getting width
2020-07-30 18:24:01 +02:00
Andreas Hocevar
f9792f69a4 Add more tests 2020-07-30 18:04:44 +02:00
mike-000
e6592c95ea remove whitespace 2020-07-30 14:23:51 +01:00
mike-000
eee7e2523c fix prettier 2020-07-30 14:18:58 +01:00
mike-000
dcdaf6ddc5 add non-global projection wrapX text 2020-07-30 14:15:17 +01:00
mike-000
39334fa95d check projection can wrap before getting width 2020-07-30 12:24:03 +01:00
Andreas Hocevar
ba41100799 Merge pull request #11355 from ahocevar/api-key
Cloak API key with instructions where to get one
2020-07-30 12:02:55 +02:00
Andreas Hocevar
4f0f81c802 Cloak API key with instructions where to get one 2020-07-30 09:39:34 +02:00
Andreas Hocevar
82ff027a30 Merge pull request #11354 from ahocevar/line-breaks
Fix line breaks in changelog
2020-07-30 09:18:10 +02:00
Andreas Hocevar
c0223590dc Fix line breaks in changelog 2020-07-30 09:16:14 +02:00
Andreas Hocevar
f43ea770e1 Merge pull request #11351 from openlayers/release-v6.4.1
Release v6.4.1
2020-07-29 20:33:06 +02:00
Andreas Hocevar
e128804e2a Develop on 4.6.1-dev 2020-07-29 20:31:06 +02:00
Andreas Hocevar
577c95e259 Update package version to 6.4.1 2020-07-29 20:25:17 +02:00
Andreas Hocevar
e4da490c2a Changelog for v6.4.1 2020-07-29 20:24:05 +02:00
Andreas Hocevar
a8231ad6cb Merge pull request #11346 from ahocevar/text-stride
Fix text instruction flat coordinates when stride is not 2
2020-07-29 20:12:56 +02:00
Andreas Hocevar
274a8b8fc3 Fix text instruction flat coordinates when stride is not 2 2020-07-29 19:56:37 +02:00
Tim Schaub
0fb76262df Merge pull request #11348 from M393/mapboxvector-to-layer-exports
Add all layers to layer export
2020-07-29 07:34:16 -06:00
Maximilian Krög
fc8bf7b7b8 Add all layers to layer export 2020-07-29 13:54:16 +02:00
Andreas Hocevar
cbe7561a80 Merge pull request #11337 from ahocevar/from-invalid-target
Do not rely on old value for target
2020-07-29 09:45:44 +02:00
Andreas Hocevar
47d291b504 Merge pull request #11345 from MoonE/examples-fix-geographic
Fix the popup in the geographic example
2020-07-28 21:01:48 +02:00
Andreas Hocevar
71a4995017 Merge pull request #11336 from ahocevar/retina-hitdetect
Hit detect with pixelRatio of 1
2020-07-28 20:55:01 +02:00
Maximilian Krög
85e4a62553 Fix the popup in the geographic example
Set the container to prevent the popup from moving the element to the body.
Don't sanitze the html, as table is not in the list of allowed elements.
2020-07-28 20:21:12 +02:00
Andreas Hocevar
517d38461c Merge pull request #11330 from openlayers/dependabot/npm_and_yarn/rollup-2.23.0
Bump rollup from 2.22.1 to 2.23.0
2020-07-28 12:58:50 +02:00
dependabot-preview[bot]
96f4c08572 Bump rollup from 2.22.1 to 2.23.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.22.1 to 2.23.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.22.1...v2.23.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-28 10:46:20 +00:00
Andreas Hocevar
e17aa61dfd Merge pull request #11332 from openlayers/dependabot/npm_and_yarn/jsdoc-3.6.5
Bump jsdoc from 3.6.4 to 3.6.5
2020-07-28 12:45:01 +02:00
Andreas Hocevar
cdb8dc27c2 Merge pull request #11329 from openlayers/dependabot/npm_and_yarn/puppeteer-5.2.1
Bump puppeteer from 5.2.0 to 5.2.1
2020-07-28 12:43:59 +02:00
Andreas Hocevar
013d7b3fe9 Merge pull request #11328 from openlayers/dependabot/npm_and_yarn/webpack-4.44.0
Bump webpack from 4.43.0 to 4.44.0
2020-07-28 12:43:23 +02:00
Andreas Hocevar
753ccdd673 Merge pull request #11341 from jipexu/patch-1
update link to BS  doc
2020-07-28 01:02:45 +02:00
jipexu
322410e114 update link ti BS doc 2020-07-28 00:54:59 +02:00
Andreas Hocevar
fc58425df8 Merge pull request #11340 from MoonE/examples-fix-build
Examples fix / improvement
2020-07-27 23:32:15 +02:00
Maximilian Krög
edf5125149 Fix kml-earthquakes tooltip 2020-07-27 23:22:53 +02:00
Maximilian Krög
3be9435a70 Remove unused codepen resources, duplicate bootstrap / jquery js
Use push instead of setting by index, gets rid of some empty lines generated by sparse
resource array
2020-07-27 23:22:50 +02:00
Maximilian Krög
a0e487fcbd Update jquery version to 3.5.1 for all examples 2020-07-27 21:13:00 +02:00
Andreas Hocevar
cda979b848 Merge pull request #11339 from MoonE/examples-use-new-bootstrap
Use bootstrap 4.5.0 in all examples
2020-07-27 20:29:02 +02:00
Maximilian Krög
594ba4a0ab Use bootstrap 4.5.0 in all examples 2020-07-27 20:15:55 +02:00
Andreas Hocevar
ac5f52a21f Hit detect everything with a pixel ratio of 1 2020-07-27 19:56:35 +02:00
Andreas Hocevar
93d3528047 Do not rely on old value for target 2020-07-27 17:23:42 +02:00
Andreas Hocevar
cad5057a96 Merge pull request #11327 from ahocevar/fix-ie11
Fix Internet Explorer issues
2020-07-27 13:23:41 +02:00
Andreas Hocevar
fe16ce6b4d IE does not support document.contains 2020-07-27 11:31:29 +02:00
dependabot-preview[bot]
7ce0e0e745 Bump jsdoc from 3.6.4 to 3.6.5
Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 3.6.4 to 3.6.5.
- [Release notes](https://github.com/jsdoc/jsdoc/releases)
- [Changelog](https://github.com/jsdoc/jsdoc/blob/3.6.5/CHANGES.md)
- [Commits](https://github.com/jsdoc/jsdoc/compare/3.6.4...3.6.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 09:26:18 +00:00
dependabot-preview[bot]
7495f04e4e Bump puppeteer from 5.2.0 to 5.2.1
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Commits](https://github.com/puppeteer/puppeteer/compare/v5.2.0...v5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 09:24:31 +00:00
dependabot-preview[bot]
b9166215e7 Bump webpack from 4.43.0 to 4.44.0
Bumps [webpack](https://github.com/webpack/webpack) from 4.43.0 to 4.44.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.43.0...v4.44.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 09:23:09 +00:00
Andreas Hocevar
3e4c82c557 Use transpiled modules for legacy build 2020-07-27 10:32:49 +02:00
Andreas Hocevar
b759c7e08d Merge pull request #11323 from openlayers/release-v6.4.0
Release v6.4.0
2020-07-26 20:51:43 +02:00
Andreas Hocevar
4ae924ea78 Develop on 6.4.1-dev 2020-07-26 20:44:50 +02:00
Andreas Hocevar
93c6f84896 Merge pull request #11315 from MoonE/examples-fix-html
Examples fix html
2020-07-26 19:45:38 +02:00
Maximilian Krög
4deb3a2dfc Do not load resources multiple time for codepen 2020-07-26 19:31:59 +02:00
Maximilian Krög
e51643dfca Show correct link for codepen button 2020-07-26 19:31:59 +02:00
Maximilian Krög
e39e3ea152 Update prism js version
Use latest version of prism, add json formatter, copy to clipboard plugin,
and line-numbers.
Now the clipboard js is automatically loaded by prism it  it not included
and the buttons are automatically initialized. Though I added some css to
match the previous style.
2020-07-26 19:31:59 +02:00
Maximilian Krög
e723061f9b Add empty alt tag to logo 2020-07-26 19:31:57 +02:00
Maximilian Krög
f8edc928ed The charset meta tag should be withing the first 1024 bytes 2020-07-26 19:27:11 +02:00
Maximilian Krög
8b733c2eba Cleanup experimental notice
With bootstrap js always included there is no need to add own js to dismiss it.
Only generate the notice for experimental pages, no need to have js for that.
2020-07-26 19:27:11 +02:00
Maximilian Krög
4f76334c92 Script tag not allowed out side body / head 2020-07-26 19:27:11 +02:00
Maximilian Krög
281f7d7a8f Remove unused ol.css from the example index.html 2020-07-26 19:27:09 +02:00
Maximilian Krög
e5983d262a Add missing comma between tags / use same case as in other examples 2020-07-26 19:25:59 +02:00
Maximilian Krög
9844483364 Remove tags / duplicate url from exported info script
The tags are not used currently.
Adding the query string to the urls doesn't make sense as far as I understand
it.
2020-07-26 19:25:56 +02:00
52 changed files with 1253 additions and 549 deletions

28
changelog/v6.4.1 Normal file
View File

@@ -0,0 +1,28 @@
# 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 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))
* [#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))
* [#11336](https://github.com/openlayers/openlayers/pull/11336) - Hit detect with pixelRatio of 1 ([@ahocevar](https://github.com/ahocevar))
* [#11341](https://github.com/openlayers/openlayers/pull/11341) - update link to BS doc ([@jipexu](https://github.com/jipexu))
* [#11340](https://github.com/openlayers/openlayers/pull/11340) - Examples fix / improvement ([@MoonE](https://github.com/MoonE))
* [#11339](https://github.com/openlayers/openlayers/pull/11339) - Use bootstrap 4.5.0 in all examples ([@MoonE](https://github.com/MoonE))
* [#11327](https://github.com/openlayers/openlayers/pull/11327) - Fix Internet Explorer issues ([@ahocevar](https://github.com/ahocevar))
* [#11315](https://github.com/openlayers/openlayers/pull/11315) - Examples fix html ([@MoonE](https://github.com/MoonE))
<details>
<summary>Dependency Updates</summary>
* [#11330](https://github.com/openlayers/openlayers/pull/11330) - Bump rollup from 2.22.1 to 2.23.0 ([@openlayers](https://github.com/openlayers))
* [#11332](https://github.com/openlayers/openlayers/pull/11332) - Bump jsdoc from 3.6.4 to 3.6.5 ([@openlayers](https://github.com/openlayers))
* [#11329](https://github.com/openlayers/openlayers/pull/11329) - Bump puppeteer from 5.2.0 to 5.2.1 ([@openlayers](https://github.com/openlayers))
* [#11328](https://github.com/openlayers/openlayers/pull/11328) - Bump webpack from 4.43.0 to 4.44.0 ([@openlayers](https://github.com/openlayers))
</details>

14
changelog/v6.4.2.md Normal file
View 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))

View File

@@ -80,10 +80,13 @@ var version = obj.packageInfo.version;
<body>
<div class="container-fluid">
<header class="navbar navbar-expand-sm navbar-dark mb-3 py-0 fixed-top" role="navigation">
<a class="navbar-brand" href="https://openlayers.org/"><img src="logo-70x70.png"> OpenLayers</a>
<a class="navbar-brand" href="https://openlayers.org/"><img src="logo-70x70.png" alt="">&nbsp;OpenLayers</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#olmenu" aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- menu items that get hidden below 768px width -->
<nav class="collapse navbar-collapse" id="olmenu">
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">

View File

@@ -5,7 +5,7 @@ module.exports = {
mode: 'production',
resolve: {
alias: {
ol: path.resolve('./src/ol'),
ol: path.resolve('./build/ol'),
},
},
output: {

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Custom Tooltips
shortdesc: This example shows how to customize the buttons tooltips with Bootstrap.
docs: >
This example shows how to customize the buttons tooltips with <a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap</a>.
This example shows how to customize the buttons tooltips with <a href="https://getbootstrap.com/docs/4.5/components/tooltips/">Bootstrap</a>.
tags: "custom, tooltip"
resources:
- https://code.jquery.com/jquery-3.5.1.min.js

View File

@@ -9,10 +9,12 @@ docs: >
tags: "geographic"
experimental: true
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js
---
<div id="map" class="map"><div id="popup"></div></div>
<div id="map" class="map">
<div id="popup"></div>
</div>
<div id="info"></div>

View File

@@ -68,13 +68,15 @@ map.on('click', function (event) {
const coordinate = feature.getGeometry().getCoordinates();
popup.setPosition(coordinate);
$(element).popover({
placement: 'top',
container: element.parentElement,
html: true,
sanitize: false,
content: formatCoordinate(coordinate),
placement: 'top',
});
$(element).popover('show');
} else {
$(element).popover('destroy');
$(element).popover('dispose');
}
});

View File

@@ -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>

View File

@@ -3,14 +3,14 @@ layout: example.html
title: Icon Scale
shortdesc: Example of scaling icons and labels.
docs: >
Icons and labels can be scaled in both dimensions if required. A negative value will flip the image
Icons and labels can be scaled in both dimensions if required. A negative value will flip the image
or text around its anchor point (reversed text is <b>not</b> suitable for line placement). A newline
character inserted in label text is interpreted in a <b>vector layer</b>, but will not be shown in
a <b>vector context</b>.
tags: "vector, style, icon, label, scale"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js
---
<div id="map" class="map"><div id="popup"></div></div>

View File

@@ -107,7 +107,7 @@ map.on('click', function (evt) {
const feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
return feature;
});
$(element).popover('destroy');
$(element).popover('dispose');
if (feature) {
const coordinates = feature.getGeometry().getCoordinates();
popup.setPosition(coordinates);
@@ -124,7 +124,7 @@ map.on('click', function (evt) {
// change mouse cursor when over marker
map.on('pointermove', function (e) {
if (e.dragging) {
$(element).popover('destroy');
$(element).popover('dispose');
return;
}
const pixel = map.getEventPixel(e.originalEvent);

View File

@@ -6,8 +6,8 @@ docs: >
Example using an icon to symbolize a point.
tags: "vector, style, icon, marker, popup"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js
---
<div id="map" class="map"><div id="popup"></div></div>

View File

@@ -75,14 +75,14 @@ map.on('click', function (evt) {
});
$(element).popover('show');
} else {
$(element).popover('destroy');
$(element).popover('dispose');
}
});
// change mouse cursor when over marker
map.on('pointermove', function (e) {
if (e.dragging) {
$(element).popover('destroy');
$(element).popover('dispose');
return;
}
const pixel = map.getEventPixel(e.originalEvent);

View File

@@ -6,7 +6,6 @@
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
<style>
body {
@@ -62,7 +61,7 @@
<body>
<header class="navbar navbar-expand-md navbar-dark mb-3 py-0 fixed-top" role="navigation">
<a class="navbar-brand" href="https://openlayers.org/"><img class="header-logo" src="./resources/logo-70x70.png">&nbsp;OpenLayers</a>
<a class="navbar-brand" href="https://openlayers.org/"><img class="header-logo" src="./resources/logo-70x70.png" alt="">&nbsp;OpenLayers</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#olmenu" aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@@ -113,7 +112,7 @@
<a jugl:attributes="href example.link" class="example bg-light border rounded">
<span class="mainlink">
<strong><span jugl:replace="example.title">title</span></strong><br>
<small jugl:content="'(' + example.example + ')'"></small>
<small jugl:content="'(' + example.link + ')'"></small>
</span>
<p class="description" jugl:content="example.shortdesc"></p>
</a>

View File

@@ -98,9 +98,6 @@
}
window.addEventListener('load', function () {
for (let i = 0; i < info.examples.length; ++i) {
info.examples[i].link += window.location.search;
}
template = new jugl.Template('template');
target = document.getElementById('examples');
const params = parseParams();

View File

@@ -6,8 +6,8 @@ docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a size relative to their magnitude.
tags: "KML, vector, style, tooltip"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js
---
<div id="map" class="map"><div id="info"></div></div>

View File

@@ -73,11 +73,7 @@ const displayFeatureInfo = function (pixel) {
return feature;
});
if (feature) {
info
.tooltip('hide')
.attr('data-original-title', feature.get('name'))
.tooltip('fixTitle')
.tooltip('show');
info.attr('data-original-title', feature.get('name')).tooltip('show');
} else {
info.tooltip('hide');
}

View File

@@ -7,8 +7,8 @@ docs: >
yellow with an opacity calculated based on the current offset to local noon.
tags: "KML, vector, style"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js
---
<div id="map" class="map"><div id="info"></div></div>

View File

@@ -6,7 +6,7 @@ docs: >
Example of a map with layer group.
tags: "tilejson, input, bind, group, layergroup"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
value: Your Mapbox access token from https://mapbox.com/ here

View File

@@ -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>

View File

@@ -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>

View File

@@ -7,19 +7,6 @@
.replace(/=+$/, ``);
}
var htmlClipboard = new Clipboard('#copy-html-button');
htmlClipboard.on('success', function(e) {
e.clearSelection();
});
var jsClipboard = new Clipboard('#copy-js-button');
jsClipboard.on('success', function(e) {
e.clearSelection();
});
var pkgClipboard = new Clipboard('#copy-pkg-button');
pkgClipboard.on('success', function(e) {
e.clearSelection();
});
function fetchResource(resource) {
return new Promise((resolve, reject) => {
const isImage = /\.(png|jpe?g|gif|tiff)$/.test(resource);
@@ -51,20 +38,23 @@
})
}
var codepenButton = document.getElementsByClassName('codepen-button')[0];
const codepenButton = document.getElementById('codepen-button');
if (codepenButton) {
codepenButton.onclick = function(event) {
const form = document.getElementById('codepen-form');
codepenButton.href = form.action;
codepenButton.addEventListener('click', function(event) {
event.preventDefault();
const html = document.getElementById('example-html-source').innerText;
const js = document.getElementById('example-js-source').innerText;
const workerContainer = document.getElementById('example-worker-source');
const worker = workerContainer ? workerContainer.innerText : undefined;
const pkgJson = document.getElementById('example-pkg-source').innerText;
const form = document.getElementById('codepen-form');
const unique = new Set();
const localResources = (js.match(/'data\/[^']*/g) || [])
.concat(js.match(/'resources\/[^']*/g) || [])
.map(f => f.slice(1));
.map(f => f.slice(1))
.filter(f => unique.has(f) ? false : unique.add(f));
const promises = localResources.map(resource => fetchResource(resource));
@@ -100,6 +90,6 @@
form.parameters.value = compress(data);
form.submit();
});
};
});
}
})();

View File

@@ -133,34 +133,16 @@ ol.inline>li {
width: 100%;
}
pre[class*="language-"] {
margin-top: 20px;
background: #FFFFFF;
}
pre>legend {
font-size: 100%;
.source-heading {
margin-top: 1em;
margin-bottom: 0;
padding-left: .6em;
font-weight: bold;
}
.source-controls {
position: absolute;
margin-top: 10px;
right: 40px;
}
.source-controls a {
margin-left: 15px;
}
.copy-button {
text-decoration: none;
cursor: pointer;
}
.codepen-button {
text-decoration: none;
cursor: pointer;
pre[class*="language-"] {
background: #FFFFFF;
font-size: 87.5%;
}
pre {
@@ -178,3 +160,36 @@ pre {
margin-top: -10px;
margin-bottom: 10px;
}
/* restyle prism copy button */
div.code-toolbar > .toolbar {
opacity: 1;
top: -2.4em;
}
div.code-toolbar > .toolbar button {
font-size: 16px;
color: #03899c;
background-color: transparent;
box-shadow: none;
padding: .615rem .75rem;
}
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus {
color: #ff7a00;
}
div.code-toolbar > .toolbar button:focus {
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
div.code-toolbar > .toolbar button:before {
margin-right: .184em;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
content: "\f0ea";
font-size: 1.33333333em;
line-height: .75em;
vertical-align: middle;
}

View File

@@ -0,0 +1,249 @@
/* PrismJS 1.20.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+json&plugins=line-numbers+toolbar+copy-to-clipboard */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.token.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
/* This background color was intended by the author of this theme. */
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
div.code-toolbar {
position: relative;
}
div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}
div.code-toolbar:hover > .toolbar {
opacity: 1;
}
/* Separate line b/c rules are thrown out if selector is invalid.
IE11 and old Edge versions don't support :focus-within. */
div.code-toolbar:focus-within > .toolbar {
opacity: 1;
}
div.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}
div.code-toolbar > .toolbar a {
cursor: pointer;
}
div.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}
div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: .5em;
}
div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,140 +0,0 @@
/* PrismJS 1.10.0
http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<script>
var gaProperty = 'UA-2577926-1';
// Disable tracking if the opt-out cookie exists.
@@ -59,31 +62,29 @@
})
});
</script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
<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 }}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
<title>{{ title }}</title>
</head>
<body>
<header class="navbar navbar-expand-sm navbar-dark mb-3 py-0" role="navigation">
<a class="navbar-brand" href="https://openlayers.org/"><img src="./resources/logo-70x70.png">&nbsp;OpenLayers</a>
<a class="navbar-brand" href="https://openlayers.org/"><img src="./resources/logo-70x70.png" alt="">&nbsp;OpenLayers</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#olmenu" aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- menu items that get hidden below 768px width -->
<nav class="collapse navbar-collapse" id="olmenu">
<ul class="nav navbar-nav ml-auto" >
<ul class="nav navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="docdropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Docs</a>
<div class="dropdown-menu dropdown-menu-right mb-3" aria-labelledby="docdropdown">
@@ -110,25 +111,27 @@
</nav>
</header>
<div class="container-fluid">
<div class="container-fluid line-numbers">
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
<button id="latest-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
This example uses OpenLayers v<span>{{ olVersion }}</span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
</div>
<div id="experimental-notice" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
{{#if ./experimental}}
<div id="experimental-notice" class="alert alert-warning alert-dismissible" role="alert">
<button id="experimental-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
This example uses features that are not part of the stable API and subject to change between releases. Consult the <a href="https://openlayers.org/en/latest/apidoc/">API documentation</a>
to see what is supported in the latest release.
</div>
{{/if}}
<div class="row-fluid">
<a href="" class="codepen-button float-right"><i class="fa fa-codepen fa-lg"></i> Edit</a>
<a href="#" id="codepen-button" class="btn btn-link float-right">
<i class="fa fa-codepen fa-lg"></i> Edit
</a>
<div class="span12">
<h4 id="title">
{{ title }}
</h4>
<h4 id="title">{{ title }}</h4>
<p class="tags">
{{#each tags}}
<span class="badge-group">
@@ -176,25 +179,21 @@
</div>
<div class="row-fluid">
<div class="source-controls">
<button class="copy-button btn btn-link" id="copy-js-button" data-clipboard-target="#example-js-source"><i class="fa fa-clipboard fa-lg"></i> Copy</button>
</div>
<pre><legend>main.js</legend><hr /><code id="example-js-source" class="language-js">import 'ol/ol.css';
<h5 class="source-heading">main.js</h5>
<pre><code id="example-js-source" class="language-js">import 'ol/ol.css';
{{ js.source }}</code></pre>
</div>
<div class="row-fluid">
<div class="source-controls">
<button class="copy-button btn btn-link" id="copy-html-button" data-clipboard-target="#example-html-source"><i class="fa fa-clipboard fa-lg"></i> Copy</button>
</div>
<pre><legend>index.html</legend><hr /><code id="example-html-source" class="language-markup">&lt;!DOCTYPE html&gt;
<h5 class="source-heading">index.html</h5>
<pre><code id="example-html-source" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;{{ title }}&lt;/title&gt;
&lt;!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer --&gt;
&lt;script src="https://unpkg.com/elm-pep"&gt;&lt;/script&gt;{{#if extraHead.remote}}
&lt;!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --&gt;
&lt;script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"&gt;&lt;/script&gt;
&lt;!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer --&gt;
&lt;script src="https://unpkg.com/@openlayers/pepjs"&gt;&lt;/script&gt;{{#if extraHead.remote}}
{{ indent extraHead.remote spaces=4 }}{{/if}}
&lt;style&gt;
.map {
@@ -211,25 +210,21 @@
{{#if worker.source}}
<div class="row-fluid">
<div class="source-controls">
<button class="copy-button btn btn-link" id="copy-worker-button" data-clipboard-target="#example-worker-source"><i class="fa fa-clipboard fa-lg"></i> Copy</button>
</div>
<pre><legend>worker.js</legend><hr /><code id="example-worker-source" class="language-js">{{ worker.source }}</code></pre>
<h5 class="source-heading">worker.js</h5>
<pre><code id="example-worker-source" class="language-js">{{ worker.source }}</code></pre>
</div>
{{/if}}
<div class="row-fluid">
<div class="source-controls">
<button class="copy-button btn btn-link" id="copy-pkg-button" data-clipboard-target="#example-pkg-source"><i class="fa fa-clipboard fa-lg"></i> Copy</button>
</div>
<pre><legend>package.json</legend><hr /><code id="example-pkg-source" class="language-js">{{ pkgJson }}</code></pre>
<h5 class="source-heading">package.json</h5>
<pre><code id="example-pkg-source" class="language-json">{{ pkgJson }}</code></pre>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js"></script>
<script src="./resources/prism/prism-1.20.0.min.js"></script>
<script src="./resources/common.js"></script>
<script src="./resources/prism/prism.min.js"></script>
{{{ js.tag }}}
<script>
$('#tag-example-list').on('show.bs.modal', function (event) {
@@ -240,41 +235,31 @@
modal.find('.modal-title').text(title);
modal.find('.modal-body').html(content);
});
var packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
fetch(packageUrl).then(function(response) {
return response.json();
}).then(function(json) {
var latestVersion = json.version;
document.getElementById('latest-version').innerHTML = latestVersion;
var url = window.location.href;
var branchSearch = url.match(/\/([^\/]*)\/examples\//);
var cookieText = 'dismissed=-' + latestVersion + '-';
var dismissed = document.cookie.indexOf(cookieText) != -1;
if (branchSearch && !dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && '{{ olVersion }}' != latestVersion) {
var link = url.replace(branchSearch[0], '/latest/examples/');
fetch(link, {method: 'head'}).then(function(response) {
var a = document.getElementById('latest-link');
a.href = response.status == 200 ? link : '../../latest/examples/';
});
var latestCheck = document.getElementById('latest-check');
latestCheck.style.display = '';
document.getElementById('latest-dismiss').onclick = function() {
latestCheck.style.display = 'none';
document.cookie = cookieText;
}
}
});
</script>
</body>
<script>
var packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
fetch(packageUrl).then(function(response) {
return response.json();
}).then(function(json) {
var latestVersion = json.version;
document.getElementById('latest-version').innerHTML = latestVersion;
var url = window.location.href;
var branchSearch = url.match(/\/([^\/]*)\/examples\//);
var cookieText = 'dismissed=-' + latestVersion + '-';
var dismissed = document.cookie.indexOf(cookieText) != -1;
if (branchSearch && !dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && '{{ olVersion }}' != latestVersion) {
var link = url.replace(branchSearch[0], '/latest/examples/');
fetch(link, {method: 'head'}).then(function(response) {
var a = document.getElementById('latest-link');
a.href = response.status == 200 ? link : '../../latest/examples/';
});
var latestCheck = document.getElementById('latest-check');
latestCheck.style.display = '';
document.getElementById('latest-dismiss').onclick = function() {
latestCheck.style.display = 'none';
document.cookie = cookieText;
}
}
var experimentalNotice = document.getElementById('experimental-notice');
if (window.experimental) {
experimentalNotice.style.display = 'block';
document.getElementById('experimental-dismiss').onclick = function() {
experimentalNotice.style.display = 'none';
}
}
});
</script>
</html>

View File

@@ -8,7 +8,7 @@ docs: >
tags: "draw, edit, vector, topology, topolis"
resources:
- https://unpkg.com/topolis@0.2.5/dist/topolis.js
- https://code.jquery.com/jquery-3.1.1.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
- https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.js
- https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css
---

View File

@@ -6,7 +6,7 @@ docs: >
This example loads features from ArcGIS REST Feature Service and allows to add new features or update existing features.
tags: "vector, esri, ArcGIS, REST, Feature, Service, loading, server, edit, updateFeature, addFeature"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
---
<div id="map" class="map"></div>
<form class="form-inline">

View File

@@ -6,7 +6,7 @@ docs: >
This example loads new features from ArcGIS REST Feature Service when the view extent changes.
tags: "vector, esri, ArcGIS, REST, Feature, Service, loading, server"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://code.jquery.com/jquery-3.5.1.min.js
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -9,9 +9,11 @@ const promisify = require('util').promisify;
const RawSource = require('webpack-sources').RawSource;
const readFile = promisify(fs.readFile);
const isCssRegEx = /\.css$/;
const isCssRegEx = /\.css(\?.*)?$/;
const isJsRegEx = /\.js(\?.*)?$/;
const importRegEx = /^import .* from '(.*)';$/;
const isTemplateJs = /\/(jquery(-\d+\.\d+\.\d+)?|(bootstrap(\.bundle)?))(\.min)?\.js(\?.*)?$/;
const isTemplateCss = /\/bootstrap(\.min)?\.css(\?.*)?$/;
handlebars.registerHelper(
'md',
@@ -193,7 +195,6 @@ class ExampleBuilder {
const examples = exampleData.map((data) => {
return {
link: data.filename,
example: data.filename,
title: data.title,
shortdesc: data.shortdesc,
tags: data.tags,
@@ -292,15 +293,11 @@ class ExampleBuilder {
jsSource = jsSource.replace('new Worker()', "new Worker('./worker.js')");
data.js = {
tag: `<script src="${this.common}.js"></script><script src="${jsName}"></script>`,
tag: `<script src="${this.common}.js"></script>
<script src="${jsName}"></script>`,
source: jsSource,
};
if (data.experimental) {
const prelude = '<script>window.experimental = true;</script>';
data.js.tag = prelude + data.js.tag;
}
// check for worker js
const workerName = `${name}.worker.js`;
const workerPath = path.join(data.dir, workerName);
@@ -366,41 +363,34 @@ class ExampleBuilder {
// add additional resources
if (data.resources) {
const resources = [];
const localResources = [];
const remoteResources = [];
const codePenResources = [];
for (let i = 0, ii = data.resources.length; i < ii; ++i) {
const resource = data.resources[i];
const remoteResource =
resource.indexOf('//') === -1
? `https://openlayers.org/en/v${pkg.version}/examples/${resource}`
: resource;
codePenResources[i] = remoteResource;
data.resources.forEach((resource) => {
const remoteResource = /^https?:\/\//.test(resource)
? resource
: `https://openlayers.org/en/v${pkg.version}/examples/${resource}`;
if (isJsRegEx.test(resource)) {
resources[i] = `<script src="${resource}"></script>`;
remoteResources[i] = `<script src="${remoteResource}"></script>`;
} else if (isCssRegEx.test(resource)) {
if (resource.indexOf('bootstrap.min.css') === -1) {
resources[i] = '<link rel="stylesheet" href="' + resource + '">';
if (!isTemplateJs.test(resource)) {
localResources.push(`<script src="${resource}"></script>`);
}
remoteResources[i] =
'<link rel="stylesheet" href="' + remoteResource + '">';
remoteResources.push(`<script src="${remoteResource}"></script>`);
} else if (isCssRegEx.test(resource)) {
if (!isTemplateCss.test(resource)) {
localResources.push(`<link rel="stylesheet" href="${resource}">`);
}
remoteResources.push(
`<link rel="stylesheet" href="${remoteResource}">`
);
} else {
throw new Error(
'Invalid value for resource: ' +
resource +
' is not .js or .css: ' +
data.filename
`Invalid resource: '${resource}' is not .js or .css: ${data.filename}`
);
}
}
});
data.extraHead = {
local: resources.join('\n'),
local: localResources.join('\n'),
remote: remoteResources.join('\n'),
};
data.extraResources = data.resources.length
? ',' + codePenResources.join(',')
: '';
}
const templatePath = path.join(this.templates, data.layout);

View File

@@ -4,6 +4,6 @@ title: XYZ Esri
shortdesc: Example of a XYZ source using Esri tiles.
docs: >
ArcGIS REST tile services are supported by `ol/source/XYZ`.
tags: "xyz, esri, arcgis rest"
tags: "xyz, esri, ArcGIS, REST"
---
<div id="map" class="map"></div>

493
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "6.4.0",
"version": "6.4.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -3945,6 +3945,14 @@
"bn.js": "^4.0.0",
"inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"assert": {
@@ -4494,10 +4502,16 @@
"integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==",
"dev": true
},
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
"bn.js": {
"version": "4.11.8",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==",
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz",
"integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==",
"dev": true
},
"body-parser": {
@@ -4651,21 +4665,56 @@
"requires": {
"bn.js": "^4.1.0",
"randombytes": "^2.0.1"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"browserify-sign": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz",
"integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz",
"integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==",
"dev": true,
"requires": {
"bn.js": "^4.1.1",
"browserify-rsa": "^4.0.0",
"create-hash": "^1.1.0",
"create-hmac": "^1.1.2",
"elliptic": "^6.0.0",
"inherits": "^2.0.1",
"parse-asn1": "^5.0.0"
"bn.js": "^5.1.1",
"browserify-rsa": "^4.0.1",
"create-hash": "^1.2.0",
"create-hmac": "^1.1.7",
"elliptic": "^6.5.2",
"inherits": "^2.0.4",
"parse-asn1": "^5.1.5",
"readable-stream": "^3.6.0",
"safe-buffer": "^5.2.0"
},
"dependencies": {
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
}
}
},
"browserify-zlib": {
@@ -4784,9 +4833,9 @@
"dev": true
},
"cacache": {
"version": "12.0.3",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz",
"integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==",
"version": "12.0.4",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz",
"integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==",
"dev": true,
"requires": {
"bluebird": "^3.5.5",
@@ -4804,14 +4853,6 @@
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
},
"dependencies": {
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
}
}
},
"cache-base": {
@@ -5680,6 +5721,14 @@
"requires": {
"bn.js": "^4.1.0",
"elliptic": "^6.0.0"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"create-hash": {
@@ -5753,9 +5802,9 @@
"dev": true
},
"cyclist": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz",
"integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz",
"integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=",
"dev": true
},
"dashdash": {
@@ -5962,9 +6011,9 @@
"dev": true
},
"devtools-protocol": {
"version": "0.0.767361",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.767361.tgz",
"integrity": "sha512-ziRTdhEVQ9jEwedaUaXZ7kl9w9TF/7A3SXQ0XuqrJB+hMS62POHZUWTbumDN2ehRTfvWqTPc2Jw4gUl/jggmHA==",
"version": "0.0.781568",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.781568.tgz",
"integrity": "sha512-9Uqnzy6m6zEStluH9iyJ3iHyaQziFnMnLeC8vK0eN6smiJmIx7+yB64d67C2lH/LZra+5cGscJAJsNXO+MdPMg==",
"dev": true
},
"di": {
@@ -5988,6 +6037,14 @@
"bn.js": "^4.1.0",
"miller-rabin": "^4.0.0",
"randombytes": "^2.0.0"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"dir-glob": {
@@ -6086,9 +6143,9 @@
"dev": true
},
"elliptic": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
"integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
"dev": true,
"requires": {
"bn.js": "^4.4.0",
@@ -6098,6 +6155,14 @@
"inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0",
"minimalistic-crypto-utils": "^1.0.0"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"emoji-regex": {
@@ -6185,14 +6250,26 @@
}
},
"enhanced-resolve": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz",
"integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz",
"integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"memory-fs": "^0.4.0",
"memory-fs": "^0.5.0",
"tapable": "^1.0.0"
},
"dependencies": {
"memory-fs": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
"integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
"dev": true,
"requires": {
"errno": "^0.1.3",
"readable-stream": "^2.0.1"
}
}
}
},
"enquirer": {
@@ -6219,9 +6296,9 @@
"dev": true
},
"entities": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz",
"integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
"integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==",
"dev": true
},
"errno": {
@@ -7139,9 +7216,9 @@
"dev": true
},
"events": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz",
"integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz",
"integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==",
"dev": true
},
"eventsource": {
@@ -7580,9 +7657,9 @@
}
},
"figgy-pudding": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz",
"integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==",
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz",
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
"dev": true
},
"figures": {
@@ -8749,13 +8826,39 @@
}
},
"hash-base": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
"integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
"integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
"dev": true,
"requires": {
"inherits": "^2.0.1",
"safe-buffer": "^5.0.1"
"inherits": "^2.0.4",
"readable-stream": "^3.6.0",
"safe-buffer": "^5.2.0"
},
"dependencies": {
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
}
}
},
"hash.js": {
@@ -9730,9 +9833,9 @@
"dev": true
},
"jsdoc": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz",
"integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==",
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.5.tgz",
"integrity": "sha512-SbY+i9ONuxSK35cgVHaI8O9senTE4CDYAmGSDJ5l3+sfe62Ff4gy96osy6OW84t4K4A8iGnMrlRrsSItSNp3RQ==",
"dev": true,
"requires": {
"@babel/parser": "^7.9.4",
@@ -9751,18 +9854,6 @@
"underscore": "~1.10.2"
},
"dependencies": {
"@babel/parser": {
"version": "7.9.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz",
"integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==",
"dev": true
},
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
"escape-string-regexp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
@@ -9782,9 +9873,9 @@
"dev": true
},
"strip-json-comments": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
"integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
}
}
@@ -10412,9 +10503,9 @@
}
},
"markdown-it-anchor": {
"version": "5.2.7",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.7.tgz",
"integrity": "sha512-REFmIaSS6szaD1bye80DMbp7ePwsPNvLTR5HunsUcZ0SG0rWJQ+Pz24R4UlTKtjKBPhxo0v0tOBDYjZQQknW8Q==",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz",
"integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==",
"dev": true
},
"marked": {
@@ -10515,6 +10606,14 @@
"requires": {
"bn.js": "^4.0.0",
"brorand": "^1.0.1"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"mime": {
@@ -11451,12 +11550,12 @@
"dev": true
},
"parallel-transform": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz",
"integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz",
"integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==",
"dev": true,
"requires": {
"cyclist": "~0.2.2",
"cyclist": "^1.0.1",
"inherits": "^2.0.3",
"readable-stream": "^2.1.5"
}
@@ -11604,9 +11703,9 @@
}
},
"pbkdf2": {
"version": "3.0.17",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz",
"integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz",
"integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==",
"dev": true,
"requires": {
"create-hash": "^1.1.2",
@@ -11837,6 +11936,14 @@
"parse-asn1": "^5.0.0",
"randombytes": "^2.0.1",
"safe-buffer": "^5.1.2"
},
"dependencies": {
"bn.js": {
"version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true
}
}
},
"pump": {
@@ -11879,13 +11986,13 @@
"dev": true
},
"puppeteer": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.2.0.tgz",
"integrity": "sha512-Hru70mFT+dts5W3l1MVg46EfJiWE63qjmXlDvC2kkCeEzLgt6KrwEkDJcJKKzERTvy9xXhOvjyGNx36fd78mVQ==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.2.1.tgz",
"integrity": "sha512-PZoZG7u+T6N1GFWBQmGVG162Ak5MAy8nYSVpeeQrwJK2oYUlDWpHEJPcd/zopyuEMTv7DiztS1blgny1txR2qw==",
"dev": true,
"requires": {
"debug": "^4.1.0",
"devtools-protocol": "0.0.767361",
"devtools-protocol": "0.0.781568",
"extract-zip": "^2.0.0",
"https-proxy-agent": "^4.0.0",
"mime": "^2.0.3",
@@ -12439,9 +12546,9 @@
}
},
"rollup": {
"version": "2.22.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.22.1.tgz",
"integrity": "sha512-K9AUQUCJkVqC+A7uUDacfhmpEeAjc2uOmSpvGI5xaYsm8pXgy4ZWEM8wHPfKj11xvCwFZppkRDo8a0RESJXCnw==",
"version": "2.23.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.23.0.tgz",
"integrity": "sha512-vLNmZFUGVwrnqNAJ/BvuLk1MtWzu4IuoqsH9UWK5AIdO3rt8/CSiJNvPvCIvfzrbNsqKbNzPAG1V2O4eTe2XZg==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
@@ -12697,10 +12804,13 @@
}
},
"serialize-javascript": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",
"integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==",
"dev": true
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz",
"integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==",
"dev": true,
"requires": {
"randombytes": "^2.1.0"
}
},
"serve-index": {
"version": "1.9.1",
@@ -13504,9 +13614,9 @@
}
},
"stream-shift": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz",
"integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz",
"integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
"dev": true
},
"streamroller": {
@@ -13816,9 +13926,9 @@
}
},
"terser": {
"version": "4.6.6",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.6.tgz",
"integrity": "sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==",
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
"dev": true,
"requires": {
"commander": "^2.20.0",
@@ -14610,14 +14720,145 @@
}
},
"watchpack": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz",
"integrity": "sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA==",
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz",
"integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==",
"dev": true,
"requires": {
"chokidar": "^2.1.8",
"chokidar": "^3.4.1",
"graceful-fs": "^4.1.2",
"neo-async": "^2.5.0"
"neo-async": "^2.5.0",
"watchpack-chokidar2": "^2.0.0"
},
"dependencies": {
"anymatch": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
"integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
"dev": true,
"optional": true,
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
}
},
"binary-extensions": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
"integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
"dev": true,
"optional": true
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"optional": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"chokidar": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz",
"integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==",
"dev": true,
"optional": true,
"requires": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.1.2",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.4.0"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"optional": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
},
"glob-parent": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
"dev": true,
"optional": true,
"requires": {
"is-glob": "^4.0.1"
}
},
"is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"optional": true,
"requires": {
"binary-extensions": "^2.0.0"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"optional": true
},
"readdirp": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz",
"integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==",
"dev": true,
"optional": true,
"requires": {
"picomatch": "^2.2.1"
},
"dependencies": {
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true,
"optional": true
}
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"optional": true,
"requires": {
"is-number": "^7.0.0"
}
}
}
},
"watchpack-chokidar2": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz",
"integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==",
"dev": true,
"optional": true,
"requires": {
"chokidar": "^2.1.8"
}
},
"wbuf": {
@@ -14635,9 +14876,9 @@
"integrity": "sha1-mM6VCXsp4x++czBT4Q5XFkLRxsc="
},
"webpack": {
"version": "4.43.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz",
"integrity": "sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g==",
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.0.tgz",
"integrity": "sha512-wAuJxK123sqAw31SpkPiPW3iKHgFUiKvO7E7UZjtdExcsRe3fgav4mvoMM7vvpjLHVoJ6a0Mtp2fzkoA13e0Zw==",
"dev": true,
"requires": {
"@webassemblyjs/ast": "1.9.0",
@@ -14648,7 +14889,7 @@
"ajv": "^6.10.2",
"ajv-keywords": "^3.4.1",
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^4.1.0",
"enhanced-resolve": "^4.3.0",
"eslint-scope": "^4.0.3",
"json-parse-better-errors": "^1.0.2",
"loader-runner": "^2.4.0",
@@ -14661,14 +14902,14 @@
"schema-utils": "^1.0.0",
"tapable": "^1.1.3",
"terser-webpack-plugin": "^1.4.3",
"watchpack": "^1.6.1",
"watchpack": "^1.7.4",
"webpack-sources": "^1.4.1"
},
"dependencies": {
"ajv": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"version": "6.12.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
"integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@@ -14678,34 +14919,34 @@
}
},
"ajv-keywords": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
"integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==",
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.1.tgz",
"integrity": "sha512-KWcq3xN8fDjSB+IMoh2VaXVhRI0BBGxoYp3rx7Pkb6z0cFjYR9Q9l4yZqqals0/zsioCmocC5H6UvsGD4MoIBA==",
"dev": true
},
"fast-deep-equal": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"neo-async": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
"terser-webpack-plugin": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz",
"integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==",
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz",
"integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==",
"dev": true,
"requires": {
"cacache": "^12.0.2",
"find-cache-dir": "^2.1.0",
"is-wsl": "^1.1.0",
"schema-utils": "^1.0.0",
"serialize-javascript": "^2.1.2",
"serialize-javascript": "^3.1.0",
"source-map": "^0.6.1",
"terser": "^4.1.2",
"webpack-sources": "^1.4.0",
@@ -15190,9 +15431,9 @@
"dev": true
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true
},
"y18n": {

View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "6.4.0",
"version": "6.4.2",
"description": "OpenLayers mapping library",
"keywords": [
"map",
@@ -73,7 +73,7 @@
"istanbul": "0.4.5",
"istanbul-instrumenter-loader": "^3.0.1",
"jquery": "3.5.1",
"jsdoc": "3.6.4",
"jsdoc": "3.6.5",
"jsdoc-plugin-typescript": "^2.0.5",
"json-stringify-safe": "^5.0.1",
"karma": "^5.0.1",
@@ -89,7 +89,7 @@
"pixelmatch": "^5.1.0",
"pngjs": "^5.0.0",
"proj4": "2.6.2",
"puppeteer": "5.2.0",
"puppeteer": "5.2.1",
"rollup": "^2.1.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.0.0",
@@ -102,7 +102,7 @@
"typescript": "^3.8.3",
"url-polyfill": "^1.1.5",
"walk": "^2.3.9",
"webpack": "4.43.0",
"webpack": "4.44.0",
"webpack-cli": "^3.3.2",
"webpack-dev-middleware": "^3.6.2",
"webpack-dev-server": "^3.3.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -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();

View File

@@ -1007,14 +1007,16 @@ class PluggableMap extends BaseObject {
originalEvent.clientY
);
if (
// Abort if the target is a child of the container for elements whose events are not meant
// to be handled by map interactions.
this.overlayContainerStopEvent_.contains(target) ||
// Abort if the event target is a child of the container that is no longer in the page.
// It's possible for the target to no longer be in the page if it has been removed in an
// event listener, this might happen in a Control that recreates it's content based on
// user interaction either manually or via a render in something like https://reactjs.org/
!rootNode.contains(target) ||
// Abort if the target is a child of the container for elements whose events are not meant
// to be handled by map interactions.
this.overlayContainerStopEvent_.contains(target)
!(rootNode === document ? document.documentElement : rootNode).contains(
target
)
) {
return;
}
@@ -1101,10 +1103,9 @@ class PluggableMap extends BaseObject {
}
/**
* @param {import("./Object").ObjectEvent} event Event.
* @private
*/
handleTargetChanged_(event) {
handleTargetChanged_() {
// target may be undefined, null, a string or an Element.
// If it's a string we convert it to an Element before proceeding.
// If it's not now an Element we remove the viewport from the DOM.
@@ -1115,7 +1116,7 @@ class PluggableMap extends BaseObject {
targetElement = this.getTargetElement();
}
if (event.oldValue) {
if (this.mapBrowserEventHandler_) {
for (let i = 0, ii = this.keyHandlerKeys_.length; i < ii; ++i) {
unlistenByKey(this.keyHandlerKeys_[i]);
}
@@ -1133,6 +1134,7 @@ class PluggableMap extends BaseObject {
this.handleResize_ = undefined;
}
this.mapBrowserEventHandler_.dispose();
this.mapBrowserEventHandler_ = null;
removeNode(this.viewport_);
}

View File

@@ -410,10 +410,12 @@ export function toStringXY(coordinate, opt_fractionDigits) {
* @return {Coordinate} The coordinate within the real world extent.
*/
export function wrapX(coordinate, projection) {
const worldWidth = getWidth(projection.getExtent());
const worldsAway = getWorldsAway(coordinate, projection, worldWidth);
if (worldsAway) {
coordinate[0] -= worldsAway * worldWidth;
if (projection.canWrapX()) {
const worldWidth = getWidth(projection.getExtent());
const worldsAway = getWorldsAway(coordinate, projection, worldWidth);
if (worldsAway) {
coordinate[0] -= worldsAway * worldWidth;
}
}
return coordinate;
}

View File

@@ -2,11 +2,14 @@
* @module ol/layer
*/
export {default as Graticule} from './layer/Graticule.js';
export {default as Group} from './layer/Group.js';
export {default as Heatmap} from './layer/Heatmap.js';
export {default as Image} from './layer/Image.js';
export {default as Layer} from './layer/Layer.js';
export {default as MapboxVector} from './layer/MapboxVector.js';
export {default as Tile} from './layer/Tile.js';
export {default as Vector} from './layer/Vector.js';
export {default as VectorImage} from './layer/VectorImage.js';
export {default as VectorTile} from './layer/VectorTile.js';
export {default as WebGLPoints} from './layer/WebGLPoints.js';

View File

@@ -163,20 +163,17 @@ class CanvasImageBuilder extends CanvasBuilder {
myEnd,
this.hitDetectionImage_,
// Remaining arguments to DRAW_IMAGE are in alphabetical order
this.anchorX_ * this.imagePixelRatio_,
this.anchorY_ * this.imagePixelRatio_,
this.anchorX_,
this.anchorY_,
this.declutterGroups_,
Math.ceil(this.height_ * this.imagePixelRatio_),
this.height_,
this.opacity_,
this.originX_,
this.originY_,
this.rotateWithView_,
this.rotation_,
[
(this.scale_[0] * this.pixelRatio) / this.imagePixelRatio_,
(this.scale_[1] * this.pixelRatio) / this.imagePixelRatio_,
],
Math.ceil(this.width_ * this.imagePixelRatio_),
this.scale_,
this.width_,
]);
this.endGeometry(feature);
}
@@ -226,20 +223,17 @@ class CanvasImageBuilder extends CanvasBuilder {
myEnd,
this.hitDetectionImage_,
// Remaining arguments to DRAW_IMAGE are in alphabetical order
this.anchorX_ * this.imagePixelRatio_,
this.anchorY_ * this.imagePixelRatio_,
this.anchorX_,
this.anchorY_,
this.declutterGroups_,
Math.ceil(this.height_ * this.imagePixelRatio_),
this.height_,
this.opacity_,
this.originX_,
this.originY_,
this.rotateWithView_,
this.rotation_,
[
(this.scale_[0] * this.pixelRatio) / this.imagePixelRatio_,
(this.scale_[1] * this.pixelRatio) / this.imagePixelRatio_,
],
Math.ceil(this.width_ * this.imagePixelRatio_),
this.scale_,
this.width_,
]);
this.endGeometry(feature);
}
@@ -273,7 +267,7 @@ class CanvasImageBuilder extends CanvasBuilder {
setImageStyle(imageStyle, declutterGroups) {
const anchor = imageStyle.getAnchor();
const size = imageStyle.getSize();
const hitDetectionImage = imageStyle.getHitDetectionImage(this.pixelRatio);
const hitDetectionImage = imageStyle.getHitDetectionImage();
const image = imageStyle.getImage(this.pixelRatio);
const origin = imageStyle.getOrigin();
this.imagePixelRatio_ = imageStyle.getPixelRatio(this.pixelRatio);

View File

@@ -174,7 +174,7 @@ class CanvasTextBuilder extends CanvasBuilder {
const geometryType = geometry.getType();
let flatCoordinates = null;
let end = 2;
let stride = 2;
let stride = geometry.getStride();
let i, ii;
if (textState.placement === TextPlacement.LINE) {
@@ -183,7 +183,6 @@ class CanvasTextBuilder extends CanvasBuilder {
}
let ends;
flatCoordinates = geometry.getFlatCoordinates();
stride = geometry.getStride();
if (geometryType == GeometryType.LINE_STRING) {
ends = [flatCoordinates.length];
} else if (geometryType == GeometryType.MULTI_LINE_STRING) {
@@ -250,6 +249,7 @@ class CanvasTextBuilder extends CanvasBuilder {
break;
case GeometryType.MULTI_LINE_STRING:
flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getFlatMidpoints();
stride = 2;
end = flatCoordinates.length;
break;
case GeometryType.POLYGON:
@@ -268,6 +268,7 @@ class CanvasTextBuilder extends CanvasBuilder {
}
flatCoordinates.push(interiorPoints[i], interiorPoints[i + 1]);
}
stride = 2;
end = flatCoordinates.length;
if (end == 0) {
return;

View File

@@ -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();

View File

@@ -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) &&

View File

@@ -352,11 +352,10 @@ class Icon extends ImageStyle {
}
/**
* @param {number} pixelRatio Pixel ratio.
* @return {HTMLImageElement|HTMLCanvasElement} Image element.
*/
getHitDetectionImage(pixelRatio) {
return this.iconImage_.getHitDetectionImage(pixelRatio);
getHitDetectionImage() {
return this.iconImage_.getHitDetectionImage();
}
/**

View File

@@ -28,9 +28,9 @@ class IconImage extends EventTarget {
/**
* @private
* @type {Object<number, HTMLImageElement|HTMLCanvasElement>}
* @type {HTMLImageElement|HTMLCanvasElement}
*/
this.hitDetectionImage_ = {};
this.hitDetectionImage_ = null;
/**
* @private
@@ -162,27 +162,21 @@ class IconImage extends EventTarget {
}
/**
* @param {number} pixelRatio Pixel ratio.
* @return {HTMLImageElement|HTMLCanvasElement} Image element.
*/
getHitDetectionImage(pixelRatio) {
if (!this.hitDetectionImage_[pixelRatio]) {
getHitDetectionImage() {
if (!this.hitDetectionImage_) {
if (this.isTainted_()) {
const usedPixelRatio = this.color_ ? pixelRatio : 1;
const width = this.size_[0];
const height = this.size_[1];
const context = createCanvasContext2D(
Math.ceil(width * usedPixelRatio),
Math.ceil(height * usedPixelRatio)
);
context.scale(usedPixelRatio, usedPixelRatio);
const context = createCanvasContext2D(width, height);
context.fillRect(0, 0, width, height);
this.hitDetectionImage_[pixelRatio] = context.canvas;
this.hitDetectionImage_ = context.canvas;
} else {
this.hitDetectionImage_[pixelRatio] = this.image_;
this.hitDetectionImage_ = this.image_;
}
}
return this.hitDetectionImage_[pixelRatio];
return this.hitDetectionImage_;
}
/**

View File

@@ -154,10 +154,9 @@ class ImageStyle {
/**
* @abstract
* @param {number} pixelRatio Pixel ratio.
* @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element.
*/
getHitDetectionImage(pixelRatio) {
getHitDetectionImage() {
return abstract();
}

View File

@@ -79,9 +79,9 @@ class RegularShape extends ImageStyle {
/**
* @private
* @type {Object<number, HTMLCanvasElement>}
* @type {HTMLCanvasElement}
*/
this.hitDetectionCanvas_ = {};
this.hitDetectionCanvas_ = null;
/**
* @private
@@ -204,16 +204,15 @@ class RegularShape extends ImageStyle {
}
/**
* @param {number} pixelRatio Pixel ratio.
* @return {HTMLCanvasElement} Image element.
*/
getHitDetectionImage(pixelRatio) {
if (!this.hitDetectionCanvas_[pixelRatio || 1]) {
getHitDetectionImage() {
if (!this.hitDetectionCanvas_) {
const renderOptions = this.createRenderOptions();
this.createHitDetectionCanvas_(renderOptions, pixelRatio || 1);
this.createHitDetectionCanvas_(renderOptions);
}
return this.hitDetectionCanvas_[pixelRatio || 1];
return this.hitDetectionCanvas_;
}
/**
@@ -410,7 +409,7 @@ class RegularShape extends ImageStyle {
const displacement = this.getDisplacement();
this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size];
this.createHitDetectionCanvas_(renderOptions, 1);
this.createHitDetectionCanvas_(renderOptions);
this.anchor_ = [size / 2 - displacement[0], size / 2 + displacement[1]];
this.size_ = [size, size];
@@ -488,10 +487,9 @@ class RegularShape extends ImageStyle {
/**
* @private
* @param {RenderOptions} renderOptions Render options.
* @param {number} pixelRatio The pixel ratio.
*/
createHitDetectionCanvas_(renderOptions, pixelRatio) {
this.hitDetectionCanvas_[pixelRatio] = this.getImage(pixelRatio);
createHitDetectionCanvas_(renderOptions) {
this.hitDetectionCanvas_ = this.getImage(1);
if (this.fill_) {
let color = this.fill_.getColor();
@@ -509,12 +507,12 @@ class RegularShape extends ImageStyle {
// if a transparent fill style is set, create an extra hit-detection image
// with a default fill style
const context = createCanvasContext2D(
renderOptions.size * pixelRatio,
renderOptions.size * pixelRatio
renderOptions.size,
renderOptions.size
);
this.hitDetectionCanvas_[pixelRatio] = context.canvas;
this.hitDetectionCanvas_ = context.canvas;
this.drawHitDetectionCanvas_(renderOptions, context, 0, 0, pixelRatio);
this.drawHitDetectionCanvas_(renderOptions, context, 0, 0);
}
}
}
@@ -525,13 +523,9 @@ class RegularShape extends ImageStyle {
* @param {CanvasRenderingContext2D} context The context.
* @param {number} x The origin for the symbol (x).
* @param {number} y The origin for the symbol (y).
* @param {number} pixelRatio The pixel ratio.
*/
drawHitDetectionCanvas_(renderOptions, context, x, y, pixelRatio) {
// reset transform
context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
// then move to (x, y)
drawHitDetectionCanvas_(renderOptions, context, x, y) {
// move to (x, y)
context.translate(x, y);
context.beginPath();

View File

@@ -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]);
});
});
});

View File

@@ -1,6 +1,11 @@
import Circle from '../../../../../src/ol/geom/Circle.js';
import Executor from '../../../../../src/ol/render/canvas/Executor.js';
import Feature from '../../../../../src/ol/Feature.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../../src/ol/geom/Point.js';
import Polygon from '../../../../../src/ol/geom/Polygon.js';
import Text from '../../../../../src/ol/style/Text.js';
import TextBuilder from '../../../../../src/ol/render/canvas/TextBuilder.js';
@@ -43,6 +48,202 @@ function executeInstructions(
}
describe('ol.render.canvas.TextBuilder', function () {
it('builds correct coordinates array with a stride of 2 for geometries with 2 dimensions', function () {
const builder = createBuilder();
const features = [
new Feature(new Point([0, 0])),
new Feature(new Point([1, 1])),
new Feature(
new MultiLineString([
new LineString([
[1, 1],
[3, 3],
]),
new LineString([
[2, 2],
[4, 4],
]),
])
),
new Feature(
new LineString([
[3, 3],
[5, 5],
])
),
new Feature(new Circle([5, 5, 7], 4)),
new Feature(
new MultiPoint([
[6, 6],
[7, 7],
])
),
new Feature(
new Polygon([
[
[7, 7],
[7, 9],
[9, 9],
[9, 7],
[7, 7],
],
])
),
new Feature(
new MultiPolygon([
new Polygon([
[
[8, 8],
[8, 10],
[10, 10],
[10, 8],
[8, 8],
],
]),
new Polygon([
[
[9, 9],
[9, 11],
[11, 11],
[11, 9],
[9, 9],
],
]),
])
),
];
builder.setTextStyle(
new Text({
text: 'Text',
})
);
features.forEach(function (feature) {
builder.drawText(feature.getGeometry(), feature);
});
expect(builder.coordinates).to.eql([
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
]);
});
it('builds correct coordinates array with a stride of 2 for geometries with 3 dimensions', function () {
const builder = createBuilder();
const features = [
new Feature(new Point([0, 0, 1])),
new Feature(new Point([1, 1, 2])),
new Feature(
new MultiLineString([
new LineString([
[1, 1, 1],
[3, 3, 2],
]),
new LineString([
[2, 2, 3],
[4, 4, 4],
]),
])
),
new Feature(
new LineString([
[3, 3, 5],
[5, 5, 6],
])
),
new Feature(new Circle([5, 5, 7], 4)),
new Feature(
new MultiPoint([
[6, 6, 8],
[7, 7, 9],
])
),
new Feature(
new Polygon([
[
[7, 7, 1],
[7, 9, 2],
[9, 9, 3],
[9, 7, 4],
[7, 7, 5],
],
])
),
new Feature(
new MultiPolygon([
new Polygon([
[
[8, 8, 1],
[8, 10, 2],
[10, 10, 3],
[10, 8, 4],
[8, 8, 1],
],
]),
new Polygon([
[
[9, 9, 5],
[9, 11, 6],
[11, 11, 7],
[11, 9, 8],
[9, 9, 5],
],
]),
])
),
];
builder.setTextStyle(
new Text({
text: 'Text',
})
);
features.forEach(function (feature) {
builder.drawText(feature.getGeometry(), feature);
});
expect(builder.coordinates).to.eql([
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
]);
});
it('renders polygon labels only when they fit', function () {
let builder = createBuilder();
const geometry = new Polygon([

View File

@@ -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);
});
});
});

View File

@@ -12,8 +12,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because no fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
@@ -30,8 +30,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// hit-detection image is created, because transparent fill style is set
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
@@ -48,8 +48,8 @@ describe('ol.style.Circle', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because non-transparent fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
});

View File

@@ -38,8 +38,8 @@ describe('ol.style.RegularShape', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because no fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});
@@ -59,11 +59,10 @@ describe('ol.style.RegularShape', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// hit-detection image is created, because transparent fill style is set
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.not.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
expect(style.getHitDetectionImage(1).width).to.be(21);
expect(style.getHitDetectionImage(2).width).to.be(42);
expect(style.getHitDetectionImage().width).to.be(21);
});
it('creates a canvas (non-transparent fill-style)', function () {
@@ -79,8 +78,8 @@ describe('ol.style.RegularShape', function () {
expect(style.getOrigin()).to.eql([0, 0]);
expect(style.getAnchor()).to.eql([10.5, 10.5]);
// no hit-detection image is created, because non-transparent fill style is set
expect(style.getImage(1)).to.be(style.getHitDetectionImage(1));
expect(style.getHitDetectionImage(1)).to.be.an(HTMLCanvasElement);
expect(style.getImage(1)).to.be(style.getHitDetectionImage());
expect(style.getHitDetectionImage()).to.be.an(HTMLCanvasElement);
expect(style.getHitDetectionImageSize()).to.eql([21, 21]);
});