Optimize drag performance, refine drilling markers, and update infrastructure icon to zap
Deploy TrassenPlaner / deploy (push) Waiting to run
Details
Deploy TrassenPlaner / deploy (push) Waiting to run
Details
This commit is contained in:
parent
a0c9a45377
commit
d35b9dee0f
20
index.html
20
index.html
|
|
@ -1303,7 +1303,7 @@
|
||||||
return L.marker(latlng, {
|
return L.marker(latlng, {
|
||||||
icon: L.divIcon({
|
icon: L.divIcon({
|
||||||
className: 'infrastructure-icon',
|
className: 'infrastructure-icon',
|
||||||
html: '<i data-lucide="building-2"></i>',
|
html: '<i data-lucide="zap"></i>',
|
||||||
iconSize: [32, 32],
|
iconSize: [32, 32],
|
||||||
iconAnchor: [16, 16],
|
iconAnchor: [16, 16],
|
||||||
popupAnchor: [0, -16]
|
popupAnchor: [0, -16]
|
||||||
|
|
@ -1762,10 +1762,15 @@
|
||||||
lineOptions: { color: '#cca300', weight: 6 },
|
lineOptions: { color: '#cca300', weight: 6 },
|
||||||
vertexOptions: { color: '#cca300', radius: 6 },
|
vertexOptions: { color: '#cca300', radius: 6 },
|
||||||
middleMarkerOptions: { color: '#cca300', opacity: 0.6, radius: 4 }
|
middleMarkerOptions: { color: '#cca300', opacity: 0.6, radius: 4 }
|
||||||
}).on('editable:vertex:drag editable:vertex:dragend editable:vertex:new editable:vertex:deleted editable:vertex:inserted', (e) => {
|
}).on('editable:vertex:drag editable:drawing:move', (e) => {
|
||||||
calculateStats(v);
|
calculateStats(v, true);
|
||||||
updateVariantStatsUI(v);
|
updateVariantStatsUI(v);
|
||||||
updateRouteLabels(v);
|
updateRouteLabels(v);
|
||||||
|
}).on('editable:vertex:dragend editable:vertex:new editable:vertex:deleted editable:vertex:inserted editable:drawing:end', (e) => {
|
||||||
|
calculateStats(v, false);
|
||||||
|
updateVariantStatsUI(v);
|
||||||
|
updateRouteLabels(v);
|
||||||
|
saveVariantToDB(v);
|
||||||
});
|
});
|
||||||
|
|
||||||
drillingLayers[v.id] = L.featureGroup({ interactive: false, pane: 'drillingPane' });
|
drillingLayers[v.id] = L.featureGroup({ interactive: false, pane: 'drillingPane' });
|
||||||
|
|
@ -1943,8 +1948,7 @@
|
||||||
activeV.routes = e.layer.getLatLngs();
|
activeV.routes = e.layer.getLatLngs();
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateStats(activeV);
|
calculateStats(activeV, e.type.includes('drag') || e.type.includes('move'));
|
||||||
updateVariantStatsUI(activeV);
|
|
||||||
updateVariantStatsUI(activeV);
|
updateVariantStatsUI(activeV);
|
||||||
if (e.type.includes('end') || e.type === 'editable:created' || e.type.includes('dragend') || e.type === 'editable:vertex:inserted') {
|
if (e.type.includes('end') || e.type === 'editable:created' || e.type.includes('dragend') || e.type === 'editable:vertex:inserted') {
|
||||||
renderVariants();
|
renderVariants();
|
||||||
|
|
@ -2096,7 +2100,7 @@
|
||||||
// Cache for obstacles to avoid repeated filtering/lowercase during drag
|
// Cache for obstacles to avoid repeated filtering/lowercase during drag
|
||||||
let cachedObstacles = null;
|
let cachedObstacles = null;
|
||||||
|
|
||||||
function calculateStats(variant) {
|
function calculateStats(variant, isDragging = false) {
|
||||||
if (!variant) return;
|
if (!variant) return;
|
||||||
const vDrill = drillingLayers[variant.id];
|
const vDrill = drillingLayers[variant.id];
|
||||||
if (vDrill) vDrill.clearLayers();
|
if (vDrill) vDrill.clearLayers();
|
||||||
|
|
@ -2119,6 +2123,8 @@
|
||||||
|
|
||||||
renderSegmentLabels(variant);
|
renderSegmentLabels(variant);
|
||||||
|
|
||||||
|
if (isDragging) return;
|
||||||
|
|
||||||
// Pre-filter obstacles
|
// Pre-filter obstacles
|
||||||
if (!cachedObstacles && state.usage.features) {
|
if (!cachedObstacles && state.usage.features) {
|
||||||
const keywords = ['bahn', 'gewässer', 'wasser', 'straße', 'verkehr', 'gehölz', 'baufläche', 'wald', 'forst', 'hecke', 'weg', 'pfad', 'graben', 'bach', 'fluss'];
|
const keywords = ['bahn', 'gewässer', 'wasser', 'straße', 'verkehr', 'gehölz', 'baufläche', 'wald', 'forst', 'hecke', 'weg', 'pfad', 'graben', 'bach', 'fluss'];
|
||||||
|
|
@ -2218,7 +2224,7 @@
|
||||||
// Add Muffen markers
|
// Add Muffen markers
|
||||||
seg.muffen.forEach(mpos => {
|
seg.muffen.forEach(mpos => {
|
||||||
L.circleMarker(mpos, {
|
L.circleMarker(mpos, {
|
||||||
radius: 5,
|
radius: 3,
|
||||||
color: '#000000',
|
color: '#000000',
|
||||||
weight: 2,
|
weight: 2,
|
||||||
fillOpacity: drillingOpacity,
|
fillOpacity: drillingOpacity,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue