/utils/olScript

Exports the olScript utility method as default.

Methods

(async, inner) olScript()

The olScript method assigns a script tag to the document head for the Openlayers cdn src. The tag is appended in a promise which assigns the resolve to the onload method of the tag element.

It is recommended to load Openlayers by defining the script in the document markup header. A warning will be logged if the script is loaded through the utility method.