From d5e562c6614993171716f180801e11d8421453ff Mon Sep 17 00:00:00 2001 From: viglino Date: Wed, 17 Jul 2024 08:24:38 +0200 Subject: [PATCH] [BUG] multi api including api --- dist/extra/IFrameAPI.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/extra/IFrameAPI.js b/dist/extra/IFrameAPI.js index f08f1a4ab..f56d36d2f 100644 --- a/dist/extra/IFrameAPI.js +++ b/dist/extra/IFrameAPI.js @@ -25,12 +25,16 @@ ol.ext.IFrameAPI = function(targetOrigin) { } else { switch (e.data.api) { case 'ready': { - this.ready = true; - this.id = e.data.id; - window.parent.postMessage(e.data, this.targetOrigin); + // Ready + if (!this.ready && e.data.id > 0) { + this.ready = true; + this.id = e.data.id; + window.parent.postMessage(e.data, this.targetOrigin); + } break; } case 'getAPI': { + // return api e.data.data = Object.keys(this.setter); e.data.id = this.id; window.parent.postMessage(e.data, this.targetOrigin);