mirror of
https://github.com/CIMEngine/map.git
synced 2024-11-22 10:56:21 +03:00
Deploying to gh-pages from @ CIMEngine/map@6439516bff 🚀
This commit is contained in:
parent
e130d9e522
commit
edcf5daa94
2 changed files with 52 additions and 59 deletions
109
index.bundle.js
109
index.bundle.js
|
@ -513,7 +513,7 @@
|
||||||
console.log(
|
console.log(
|
||||||
`%c ${info} `,
|
`%c ${info} `,
|
||||||
"color:white; background-color: #78d6fa; border-radius:10px;",
|
"color:white; background-color: #78d6fa; border-radius:10px;",
|
||||||
...str
|
...str,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
window.onload = async () => {
|
window.onload = async () => {
|
||||||
|
@ -527,7 +527,7 @@
|
||||||
let mapDataFromId = (
|
let mapDataFromId = (
|
||||||
await (
|
await (
|
||||||
await fetch(
|
await fetch(
|
||||||
`https://raw.githubusercontent.com/CIMEngine/MapList/main/index.json`
|
`https://raw.githubusercontent.com/CIMEngine/MapList/main/index.json`,
|
||||||
)
|
)
|
||||||
).json()
|
).json()
|
||||||
)[mapId];
|
)[mapId];
|
||||||
|
@ -563,7 +563,7 @@
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
"top-left"
|
"top-left",
|
||||||
);
|
);
|
||||||
|
|
||||||
map.addControl(new ZoomControl(), "top-right");
|
map.addControl(new ZoomControl(), "top-right");
|
||||||
|
@ -577,7 +577,7 @@
|
||||||
Crosshair: true,
|
Crosshair: true,
|
||||||
PrintableArea: true,
|
PrintableArea: true,
|
||||||
}),
|
}),
|
||||||
"top-right"
|
"top-right",
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
@ -592,7 +592,7 @@
|
||||||
(error, image) => {
|
(error, image) => {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
map.addImage("city", image);
|
map.addImage("city", image);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
map.loadImage(
|
map.loadImage(
|
||||||
|
@ -601,7 +601,7 @@
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
map.addImage("capital-city", image);
|
map.addImage("capital-city", image);
|
||||||
map.addImage("capital", image);
|
map.addImage("capital", image);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
map.loadImage(
|
map.loadImage(
|
||||||
|
@ -609,7 +609,7 @@
|
||||||
(error, image) => {
|
(error, image) => {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
map.addImage("landmark-0", image);
|
map.addImage("landmark-0", image);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let lasticocords;
|
let lasticocords;
|
||||||
|
@ -626,16 +626,6 @@
|
||||||
data: geoURL,
|
data: geoURL,
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayer({
|
|
||||||
id: "map-data-fill",
|
|
||||||
type: "fill",
|
|
||||||
source: "map-data",
|
|
||||||
paint: {
|
|
||||||
"fill-color": ["get", "fill"],
|
|
||||||
"fill-opacity": ["coalesce", ["get", "fill-opacity"], 0.3],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
map.addLayer({
|
map.addLayer({
|
||||||
id: "map-data-fill-outline",
|
id: "map-data-fill-outline",
|
||||||
type: "line",
|
type: "line",
|
||||||
|
@ -647,6 +637,16 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
map.addLayer({
|
||||||
|
id: "map-data-fill",
|
||||||
|
type: "fill",
|
||||||
|
source: "map-data",
|
||||||
|
paint: {
|
||||||
|
"fill-color": ["get", "fill"],
|
||||||
|
"fill-opacity": ["coalesce", ["get", "fill-opacity"], 0.3],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
map.addLayer({
|
map.addLayer({
|
||||||
id: "map-data-symbol",
|
id: "map-data-symbol",
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
|
@ -683,35 +683,31 @@
|
||||||
.setLngLat(coordinates)
|
.setLngLat(coordinates)
|
||||||
.setHTML(
|
.setHTML(
|
||||||
`
|
`
|
||||||
${
|
${feature?.properties?.amount
|
||||||
feature?.properties?.amount
|
? `<div class="row glass" style="color: "white";"><div class="col">Population - ${feature.properties.amount} people.</div></div>`
|
||||||
? `<div class="row glass" style="color: "white";"><div class="col">Population - ${feature.properties.amount} people.</div></div>`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
<div class="row" style="padding: 5px;">
|
<div class="row" style="padding: 5px;">
|
||||||
${
|
${feature?.properties?.img
|
||||||
feature?.properties?.img
|
? `<div class="col-md-12 col-sm-12" style="padding: 0px;"><img class="w-100 about-img" src="${feature.properties.img}" alt="${feature.properties.name} img"></div>`
|
||||||
? `<div class="col-md-12 col-sm-12" style="padding: 0px;"><img class="w-100 about-img" src="${feature.properties.img}" alt="${feature.properties.name} img"></div>`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
<div class="col-md-12 col-sm-12 text-center glass mb-2">
|
<div class="col-md-12 col-sm-12 text-center glass mb-2">
|
||||||
<h5 className="card-title">${feature.properties.name}
|
<h5 className="card-title">${feature.properties.name}
|
||||||
${
|
${feature.properties.name_ru
|
||||||
feature.properties.name_ru
|
? ` - ${feature.properties.name_ru}`
|
||||||
? ` - ${feature.properties.name_ru}`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
${
|
${feature.properties.description
|
||||||
feature.properties.description
|
? `<div class="col-md-12 col-sm-12 text-center glass"><div>${converter.makeHtml(
|
||||||
? `<div class="col-md-12 col-sm-12 text-center glass"><div>${converter.makeHtml(
|
feature.properties.description,
|
||||||
feature.properties.description
|
)}</div></div>`
|
||||||
)}</div></div>`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`,
|
||||||
)
|
)
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
} else if (
|
} else if (
|
||||||
|
@ -730,9 +726,8 @@
|
||||||
`
|
`
|
||||||
<div class="row" style="padding: 5px;">
|
<div class="row" style="padding: 5px;">
|
||||||
<div class="col-12 col-sm-12" style="padding: 0px;">
|
<div class="col-12 col-sm-12" style="padding: 0px;">
|
||||||
<img class="w-100 about-img" src="${
|
<img class="w-100 about-img" src="${country.img
|
||||||
country.img
|
}">
|
||||||
}">
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center glass">
|
<div class="col-12 text-center glass">
|
||||||
<h5>
|
<h5>
|
||||||
|
@ -741,32 +736,30 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center glass">
|
<div class="col-12 text-center glass">
|
||||||
${JSON.parse(
|
${JSON.parse(
|
||||||
feature.properties.tags || "[]"
|
feature.properties.tags || "[]",
|
||||||
).join(", ")}
|
).join(", ")}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center glass">
|
<div class="col-12 text-center glass">
|
||||||
Founding date: ${country.date}
|
Founding date: ${country.date}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 col-sm-12 text-center glass">
|
<div class="col-md-12 col-sm-12 text-center glass">
|
||||||
${
|
${country.description
|
||||||
country.description
|
? `<div>${converter.makeHtml(
|
||||||
? `<div>${converter.makeHtml(
|
country.description,
|
||||||
country.description
|
)}</div>`
|
||||||
)}</div>`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center glass">
|
<div class="col-12 text-center glass">
|
||||||
Area: ${feature.properties.area} km²
|
Area: ${feature.properties.area} km²
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center mt-2">
|
<div class="col-12 text-center mt-2">
|
||||||
${
|
${country.about
|
||||||
country.about
|
? `<a href="${country.about}" class="about">About</a>`
|
||||||
? `<a href="${country.about}" class="about">About</a>`
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`,
|
||||||
)
|
)
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue