-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and dry leaflet
- Loading branch information
Showing
1 changed file
with
4 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* !include https://cdn.jsdelivr.net/npm/@tabler/[email protected]beta20/dist/js/tabler.min.js */ | ||
/* !include https://cdn.jsdelivr.net/npm/@tabler/[email protected]beta21/dist/js/tabler.min.js */ | ||
const nonce = document.currentScript.nonce; | ||
|
||
function sqlpage_card() { | ||
|
@@ -89,19 +89,18 @@ let is_leaflet_loaded = false; | |
|
||
function sqlpage_map() { | ||
const first_map = document.querySelector("[data-pre-init=map]"); | ||
const leaflet_base_url = "https://cdn.jsdelivr.net/npm/[email protected]"; | ||
if (first_map && !is_leaflet_injected) { | ||
// Add the leaflet js and css to the page | ||
const leaflet_css = document.createElement("link"); | ||
leaflet_css.rel = "stylesheet"; | ||
leaflet_css.href = | ||
"https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"; | ||
leaflet_css.href = `${leaflet_base_url}/dist/leaflet.css`; | ||
leaflet_css.integrity = | ||
"sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="; | ||
leaflet_css.crossOrigin = "anonymous"; | ||
document.head.appendChild(leaflet_css); | ||
const leaflet_js = document.createElement("script"); | ||
leaflet_js.src = | ||
"https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"; | ||
leaflet_js.src = `${leaflet_base_url}/dist/leaflet.js`; | ||
leaflet_js.integrity = | ||
"sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="; | ||
leaflet_js.crossOrigin = "anonymous"; | ||
|