ol-ext: Openlayers iFrame API

The ol/ext/IFrameAPI lets you embed an ol map on your website and control the map using JavaScript. It is a bidirectional API communication between parent window and map iframe.
You don't need to include Openlayers js or css in your main page, just add the API code and embed the widget (as an IFrame)...
The API provides a controlled mechanism to securely (if used properly) access script from different orign in you page.
Draw a polygon in the IFrame:
Select an object in the IFrame:
Get/set placemark position:


Look messages in the console...
See example on CodePen
Connecting API...