Skip to content

Commit

Permalink
[BUG] multi api including api
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Jul 17, 2024
1 parent f0db3f3 commit d5e562c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dist/extra/IFrameAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d5e562c

Please sign in to comment.