From e77312cc8f0798edadb56e8ddd20fec17d916e39 Mon Sep 17 00:00:00 2001 From: Ko Nagase Date: Sun, 18 Sep 2022 12:58:29 +0900 Subject: [PATCH] Check existence of ol.ext before initializing ol.ext.input and ol.ext.imageLoader --- src/util/imagesLoader.js | 4 +++- src/util/input/Base.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/imagesLoader.js b/src/util/imagesLoader.js index 99d86287b..3e90f03d6 100644 --- a/src/util/imagesLoader.js +++ b/src/util/imagesLoader.js @@ -2,7 +2,9 @@ import { asArray as ol_color_asArray } from 'ol/color' /** @namespace ol.ext.imageLoader */ -if (window.ol) window.ol.ext.imageLoader = {}; +if (window.ol && ol.ext && !ol.ext.imageLoader) { + ol.ext.imageLoader = {}; +} /** Helper for loading BIL-32 (Band Interleaved by Line) image * @param {string} src diff --git a/src/util/input/Base.js b/src/util/input/Base.js index ec1029e97..940b78502 100644 --- a/src/util/input/Base.js +++ b/src/util/input/Base.js @@ -6,7 +6,7 @@ import ol_Object from 'ol/Object' /** @namespace ol.ext.input */ /*global ol*/ -if (window.ol) { +if (window.ol && ol.ext && !ol.ext.input) { ol.ext.input = {}; }