auto-sync: 2026-05-04 00:40:01
This commit is contained in:
14
tasks/enduro-trails/prototype/static/app.js
vendored
14
tasks/enduro-trails/prototype/static/app.js
vendored
@@ -455,18 +455,18 @@ function addRulerPoint(lngLat, isLast) {
|
||||
const label = rulerPoints.length === 1 ? '0 м' :
|
||||
rulerTotal >= 1 ? rulerTotal.toFixed(1) + ' км' : Math.round(rulerTotal * 1000) + ' м';
|
||||
|
||||
// Кастомный маркер с подписью и крестиком
|
||||
// Кружок точно на координатах
|
||||
const el = document.createElement('div');
|
||||
el.style.cssText = 'position:relative;display:flex;flex-direction:column;align-items:center;cursor:default';
|
||||
el.style.cssText = 'position:relative;width:10px;height:10px;';
|
||||
el.innerHTML = `
|
||||
<div style="display:flex;align-items:center;gap:3px;background:rgba(0,0,0,0.7);color:#fff;font-size:11px;font-weight:600;padding:2px 5px;border-radius:3px;margin-bottom:3px;white-space:nowrap">
|
||||
<span class="ruler-label">${label}</span>
|
||||
<span style="cursor:pointer;opacity:0.7;font-size:10px;line-height:1" onclick="removeRulerPoint(${idx})" title="Удалить точку">✕</span>
|
||||
<div style="width:10px;height:10px;background:#0088ff;border:2px solid #fff;border-radius:50%;box-shadow:0 0 4px rgba(0,0,0,0.3)"></div>
|
||||
<div style="position:absolute;bottom:14px;left:50%;transform:translateX(-50%);display:inline-flex;align-items:center;gap:3px;background:rgba(0,0,0,0.7);color:#fff;font-size:11px;font-weight:600;padding:2px 5px;border-radius:3px;white-space:nowrap;pointer-events:auto">
|
||||
<span>${label}</span>
|
||||
<span style="cursor:pointer;opacity:0.8;font-size:10px" onclick="removeRulerPoint(${idx})">✕</span>
|
||||
</div>
|
||||
<div style="background:#0088ff;border:2px solid #fff;border-radius:50%;width:10px;height:10px;box-shadow:0 0 4px rgba(0,0,0,0.3);flex-shrink:0"></div>
|
||||
`;
|
||||
|
||||
const marker = new maplibregl.Marker({ element: el, anchor: 'bottom' })
|
||||
const marker = new maplibregl.Marker({ element: el, anchor: 'center' })
|
||||
.setLngLat([lngLat.lng, lngLat.lat])
|
||||
.addTo(map);
|
||||
rulerMarkers.push(marker);
|
||||
|
||||
Reference in New Issue
Block a user