Eventy

There is a possibility to send information without reloading the iframe. In the same way you can receive information from the iframe.

Sending event:

<body>
 <iframe id="iframe" src="https://iframe.hogs.live/"></iframe>
</body>
<script>
 const iframe = document.getElementById('iframe');
 function sendEventToIframe(data) {
  iframe.contentWindow.postMessage(data, '*');
 }
 sendEventToIframe('sth');
</script>

Receiving event

window.addEventListener('message', (event) => {
  console.log('Dane z iframe: ', event.data);
});

Event model

interface Event {
  type: string;
  data: any;
}

Eventy przyjowane przez iframe’a

NameDataComments
calculateRoute option parameter value for mode= calculateRouteRoute plotting request
setLang ENG | DEU | CZE | ESP | FRA | POL | RUS | UKR Dynamic languege change. Requesting new map render

Eventy emitowane

NameDataComments
calculationSucces format described hereEmit with information about plotted route
errorError message
warningWarning message