diff --git a/README.md b/README.md index 8cc93aaf52..c2d5861182 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,14 @@ TypeScript users may want to use a [third-party types package](https://github.co ## Supported Browsers -OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`. +OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. + +For older browsers and platforms (Internet Explorer, Android 4.x, iOS v12 and older, Safari v12 and older), polyfills may be needed for the following browser features: + +* [`requestAnimationFrame`](https://caniuse.com/#feat=requestanimationframe): Available from [polyfill.io](https://polyfill.io/). +* [`element.prototype.classList` (`add`/`remove`)](https://caniuse.com/#feat=classlist): Available from [polyfill.io](https://polyfill.io/). +* [`URL` API](https://caniuse.com/#feat=url): Available from [polyfill.io](https://polyfill.io/). +* [Pointer events](https://caniuse.com/#feat=pointer): Use [elm-pep](https://npmjs.com/package/elm-pep) (lightweight) or [@openlayers/pepjs](https://npmjs.com/package/pepjs) (for really, really old browsers). ## Documentation diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index e269e77ae8..4b93745b56 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -1,5 +1,11 @@ ## Upgrade notes +### v6.4.0 + +#### Pointer events polyfill removed + +Now that all major browsers support Pointer events natively, we removed the [elm-pep](https://npmjs.com/package/elm-pep) dependency. If you are targeting older browsers that do not have Pointer events, you now need to include the polyfill in your application. + ### v6.3.2 #### Backwards incompatible changes diff --git a/examples/templates/example.html b/examples/templates/example.html index 5826db242f..e8cb2ba0be 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -68,6 +68,7 @@ + {{{ extraHead.local }}} {{{ css.tag }}} @@ -147,7 +148,9 @@ <head> <title>{{ title }}</title> <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --> - <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>{{#if extraHead.remote}} + <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script> + <!-- Pointer events polyfill for old browsers, seehttps://caniuse.com/#feat=pointer --> + <script src="https://unpkg.com/elm-pep"></script>{{#if extraHead.remote}} {{ indent extraHead.remote spaces=4 }}{{/if}} <style> .map { diff --git a/package-lock.json b/package-lock.json index bd2376e886..3ac2497963 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5081,11 +5081,6 @@ "minimalistic-crypto-utils": "^1.0.0" } }, - "elm-pep": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/elm-pep/-/elm-pep-1.0.6.tgz", - "integrity": "sha512-1DJ6ReFk8+GtgoqRiEhBo28K69Rxe9Bfc7h16+1VMQT2KlCuPBYj5W33OYa2AZpqkuqCBLhcNzO10zxJVakapA==" - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", diff --git a/package.json b/package.json index 7acd09a1bb..983d098439 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "url": "https://opencollective.com/openlayers" }, "dependencies": { - "elm-pep": "^1.0.4", "ol-mapbox-style": "^6.1.1", "pbf": "3.2.1", "rbush": "^3.0.1" diff --git a/src/ol/MapBrowserEventHandler.js b/src/ol/MapBrowserEventHandler.js index 705d80225d..dd950f0488 100644 --- a/src/ol/MapBrowserEventHandler.js +++ b/src/ol/MapBrowserEventHandler.js @@ -2,7 +2,6 @@ * @module ol/MapBrowserEventHandler */ -import 'elm-pep'; import EventTarget from './events/Target.js'; import EventType from './events/EventType.js'; import MapBrowserEvent from './MapBrowserEvent.js'; diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index b08ac7d3bd..10dae0d11d 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -2,7 +2,6 @@ * @module ol/control/MousePosition */ -import 'elm-pep'; import Control from './Control.js'; import EventType from '../pointer/EventType.js'; import {getChangeEventType} from '../Object.js'; diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index 0c38723e19..0387f0bfc3 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -2,7 +2,6 @@ * @module ol/control/ZoomSlider */ -import 'elm-pep'; import Control from './Control.js'; import EventType from '../events/EventType.js'; import PointerEventType from '../pointer/EventType.js';