var counter = 0;
function changeImage1(){
counter++;
var marker1 = document.getElementById('marker1');
var marker1 = new mapboxgl.Marker({
color: '#ff8e0a',
className: 'marker1'
}) // Initialize a new marker
.setLngLat([]) // Marker [lng, lat] coordinates
.setPopup(new mapboxgl.Popup({
offset: 25,
className: 'popup1'
}) // add popups,
button1.onclick = function (){
counter++;
if(counter===2){
if (button1.style.display !== 'none') {
div1.style.display = 'block';
block1.style.display = 'block';
button1.style.display = 'none';
$('#border2,#border3,#border4').prop("disabled", true);
} else {
div1.style.display = 'none';
block1.style.display = 'none';
button1.style.display = 'block';
}
}
div1.onclick = function (){
if (div1.style.display !== 'none') {
div1.style.display = 'none';
block1.style.display = 'none';
button1.style.display = 'block';
$('#border2,#border3,#border4').prop("disabled", false);
} else {
div1.style.display = 'block';
block1.style.display = 'block';
button1.style.display = 'none';
}
}
button1.onclick = function(){
counter++;
if(counter===3){
marker1.remove();
}
}
}
}
3 janv. 2021 à 12:48