1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| mapboxgl.accessToken = '';
var map = new mapboxgl.Map({
container: 'map', // Container ID
style: '',
//style: '', // Map style to use
center: [6.2, 45], // Starting position [lng, lat]
zoom: 13, // Starting zoom level
});
var button1 = document.getElementById('border1');
var button2 = document.getElementById('border2');
var button3 = document.getElementById('border3');
var button4 = document.getElementById('border4');
var div1 = document.getElementById('border1none');
var marker1 = document.getElementById('marker1');
var block1 = document.getElementById('block1');
function changeImage1() {
var marker1 = new mapboxgl.Marker({
color: '#ff8e0a',
className: 'marker1'
}) // Initialize a new marker
.setLngLat([6.21, 44.9]) // Marker [lng, lat] coordinates
.addTo(map);
block1.style.display = 'none';
div1.style.display = 'none';
button1.onclick = function () {
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() {
marker1.remove();
$('#border1').prop("disabled", false);
}
}
validation1.onclick = function () {
if (x.style.display = "block") {
div1.style.display = 'none';
block1.style.display = 'none';
div1.style.display = 'none';
button1.style.display = 'none';
button2.style.display = 'none';
button3.style.display = 'none';
button4.style.display = 'none';
} else {
x.style.display = "none";
}
}
annuler1.onclick = function () {
x.style.display = "none";
block1.style.display = 'none';
div1.style.display = 'none';
button1.style.display = 'block';
button2.style.display = 'block';
button3.style.display = 'block';
button4.style.display = 'block';
$('#border2,#border3,#border1,#border4').prop("disabled", false);
}
} |
Partager