createHtml method

void createHtml(
  1. String script,
  2. String scriptOsmInterop
)

Implementation

void createHtml(String script, String scriptOsmInterop) {
  final body = web.window.document.querySelector('body')!;

  debugPrint("div added iframe");
  if (web.window.document.getElementById("osm_interop") == null) {
    final interopScript =
        web.document.createElement('script') as web.HTMLScriptElement
          ..id = "osm_interop"
          ..type = 'text/javascript'
          ..text = scriptOsmInterop;
    body.appendChild(interopScript);
  }
  if (web.window.document.getElementById("mapScript") == null) {
    mapScript = web.document.createElement('script') as web.HTMLScriptElement
      ..id = "mapScript"
      ..type = 'text/javascript'
      ..text = script;
    body.appendChild(mapScript!);
  }
}