up
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var loaderScript = document.currentScript;
|
||||
|
||||
function supportsModuleScripts() {
|
||||
var script = document.createElement("script");
|
||||
return "noModule" in script;
|
||||
}
|
||||
|
||||
function supportsImportMaps() {
|
||||
return !!(window.HTMLScriptElement && HTMLScriptElement.supports && HTMLScriptElement.supports("importmap"));
|
||||
}
|
||||
|
||||
function supportsWebGL() {
|
||||
try {
|
||||
var canvas = document.createElement("canvas");
|
||||
@@ -23,7 +29,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!supportsModuleScripts() || !supportsWebGL() || typeof Promise === "undefined" || typeof fetch === "undefined") {
|
||||
if (!supportsModuleScripts() || !supportsImportMaps() || !supportsWebGL() || typeof Promise === "undefined" || typeof fetch === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +37,7 @@
|
||||
|
||||
script = document.createElement("script");
|
||||
script.type = "module";
|
||||
script.src = "assets/js/map3d.js";
|
||||
script.src = loaderScript ? new URL("map3d.js", loaderScript.src).toString() : "assets/js/map3d.js";
|
||||
script.onerror = function () {
|
||||
map.removeAttribute("data-map-module-loaded");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user