fix: export texture

This commit is contained in:
Azgaar 2023-11-19 04:53:01 +04:00
parent 418df1cec5
commit c38aff758a
4 changed files with 16 additions and 16 deletions

View file

@ -236,27 +236,27 @@ async function getMapURL(type, options = {}) {
cloneDefs.querySelector("#defs-emblems")?.remove();
}
// replace ocean pattern href to base64
if (location.hostname) {
const el = cloneEl.getElementById("oceanicPattern");
const url = el?.getAttribute("href");
if (url) {
{
// replace ocean pattern href to base64
const image = cloneEl.getElementById("oceanicPattern");
const href = image?.getAttribute("href");
if (href) {
await new Promise(resolve => {
getBase64(url, base64 => {
el.setAttribute("href", base64);
getBase64(href, base64 => {
image.setAttribute("href", base64);
resolve();
});
});
}
}
// replace texture href to base64
if (location.hostname) {
const image = document.querySelector("#texture > image");
{
// replace texture href to base64
const image = cloneEl.querySelector("#texture > image");
if (image) {
const url = image.getAttribute("href");
const href = image.getAttribute("href");
await new Promise(resolve => {
getBase64(url, base64 => {
getBase64(href, base64 => {
image.setAttribute("href", base64);
resolve();
});