correction couleur icones sur la carte
This commit is contained in:
parent
bd07a046de
commit
a87ab32bca
|
@ -152,20 +152,26 @@ import router from './router/router';
|
||||||
const icons = document.querySelectorAll('.leaflet-map-divicon');
|
const icons = document.querySelectorAll('.leaflet-map-divicon');
|
||||||
for (let icon of icons) {
|
for (let icon of icons) {
|
||||||
const colorContainer = icon.querySelector('.couleur');
|
const colorContainer = icon.querySelector('.couleur');
|
||||||
const colorDiv = colorContainer.querySelector('div > div:nth-of-type(4)');
|
let colorDivs = colorContainer.querySelectorAll('.separated-content');
|
||||||
const color = colorDiv.innerText.substring(colorDiv.innerText.indexOf('>') + 1, colorDiv.innerText.indexOf('<', colorDiv.innerText.indexOf('>') + 1)).trim();
|
let color;
|
||||||
console.log(color);
|
colorDivs.forEach((div) => {
|
||||||
|
if (div.innerText.startsWith('<div class="snippets-description">')) {
|
||||||
|
color = div.innerText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
color = color.substring(color.indexOf('>') + 1, color.indexOf('<', color.indexOf('>') + 1)).trim();
|
||||||
|
|
||||||
const nid = icon.querySelector('.nid');
|
const nid = icon.querySelector('.nid');
|
||||||
const nidValue = nid.querySelector('div > div').innerText;
|
const nidValue = nid.querySelector('.separated-content').innerText;
|
||||||
|
|
||||||
icon.addEventListener('click', function(event) {
|
icon.addEventListener('click', function(event) {
|
||||||
store.fetchEtapeData(nidValue);
|
store.fetchEtapeData(nidValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
colorContainer.remove();
|
//colorContainer.remove();
|
||||||
nid.remove();
|
//nid.remove();
|
||||||
|
colorContainer.style.display = "none";
|
||||||
|
nid.style.display = "none";
|
||||||
const iconElements = icon.querySelectorAll('div');
|
const iconElements = icon.querySelectorAll('div');
|
||||||
for (let iconElement of iconElements) {
|
for (let iconElement of iconElements) {
|
||||||
iconElement.style.backgroundColor = color;
|
iconElement.style.backgroundColor = color;
|
||||||
|
|
|
@ -301,7 +301,7 @@ body{
|
||||||
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
> div:last-of-type {
|
> div:nth-of-type(3) {
|
||||||
height: 8px;
|
height: 8px;
|
||||||
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue