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');
|
||||
for (let icon of icons) {
|
||||
const colorContainer = icon.querySelector('.couleur');
|
||||
const colorDiv = colorContainer.querySelector('div > div:nth-of-type(4)');
|
||||
const color = colorDiv.innerText.substring(colorDiv.innerText.indexOf('>') + 1, colorDiv.innerText.indexOf('<', colorDiv.innerText.indexOf('>') + 1)).trim();
|
||||
console.log(color);
|
||||
|
||||
let colorDivs = colorContainer.querySelectorAll('.separated-content');
|
||||
let 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 nidValue = nid.querySelector('div > div').innerText;
|
||||
const nidValue = nid.querySelector('.separated-content').innerText;
|
||||
|
||||
icon.addEventListener('click', function(event) {
|
||||
store.fetchEtapeData(nidValue);
|
||||
});
|
||||
|
||||
colorContainer.remove();
|
||||
nid.remove();
|
||||
//colorContainer.remove();
|
||||
//nid.remove();
|
||||
colorContainer.style.display = "none";
|
||||
nid.style.display = "none";
|
||||
const iconElements = icon.querySelectorAll('div');
|
||||
for (let iconElement of iconElements) {
|
||||
iconElement.style.backgroundColor = color;
|
||||
|
|
|
@ -301,7 +301,7 @@ body{
|
|||
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
> div:last-of-type {
|
||||
> div:nth-of-type(3) {
|
||||
height: 8px;
|
||||
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue