feat: add template for public space occupation authorization request form
This commit is contained in:
parent
2a78cfc27b
commit
be57578aa1
1 changed files with 13 additions and 10 deletions
|
|
@ -487,25 +487,28 @@
|
||||||
const isFirst = markers.length === 0;
|
const isFirst = markers.length === 0;
|
||||||
|
|
||||||
const el = document.createElement('div');
|
const el = document.createElement('div');
|
||||||
|
const dot = document.createElement('div');
|
||||||
|
el.appendChild(dot);
|
||||||
|
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
el.className = 'poly-marker poly-marker-first';
|
dot.className = 'poly-marker poly-marker-first';
|
||||||
el.style.cssText = 'width:14px;height:14px;border-radius:50%;background:#198754;border:2px solid #fff;box-shadow:0 0 4px rgba(0,0,0,.5);cursor:pointer;transition:transform 0.15s;';
|
dot.style.cssText = 'width:14px;height:14px;border-radius:50%;background:#198754;border:2px solid #fff;box-shadow:0 0 4px rgba(0,0,0,.5);cursor:pointer;transition:transform 0.15s;';
|
||||||
el.title = '{% translate "Cliquer pour fermer le polygone" %}';
|
dot.title = '{% translate "Cliquer pour fermer le polygone" %}';
|
||||||
el.addEventListener('mouseenter', function () {
|
dot.addEventListener('mouseenter', function () {
|
||||||
if (vertices.length >= 3) el.style.transform = 'scale(1.3)';
|
if (vertices.length >= 3) dot.style.transform = 'scale(1.3)';
|
||||||
});
|
});
|
||||||
el.addEventListener('mouseleave', function () {
|
dot.addEventListener('mouseleave', function () {
|
||||||
el.style.transform = 'scale(1)';
|
dot.style.transform = 'scale(1)';
|
||||||
});
|
});
|
||||||
el.addEventListener('click', function (ev) {
|
dot.addEventListener('click', function (ev) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
if (vertices.length >= 3) {
|
if (vertices.length >= 3) {
|
||||||
finishPolygon();
|
finishPolygon();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
el.className = 'poly-marker';
|
dot.className = 'poly-marker';
|
||||||
el.style.cssText = 'width:10px;height:10px;border-radius:50%;background:#0d6efd;border:2px solid #fff;box-shadow:0 0 3px rgba(0,0,0,.4);cursor:default;';
|
dot.style.cssText = 'width:10px;height:10px;border-radius:50%;background:#0d6efd;border:2px solid #fff;box-shadow:0 0 3px rgba(0,0,0,.4);cursor:default;';
|
||||||
}
|
}
|
||||||
|
|
||||||
const marker = new maplibregl.Marker({ element: el }).setLngLat([lng, lat]).addTo(map);
|
const marker = new maplibregl.Marker({ element: el }).setLngLat([lng, lat]).addTo(map);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue