Skip to content

Commit d12e3d5

Browse files
committed
[AUTO] Sync MapML Build
1 parent 1f3be3c commit d12e3d5

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

dist/mapml.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4852,6 +4852,7 @@
48524852
container.classList.add('mapml-link-preview');
48534853
container.appendChild(p);
48544854
elem.classList.add('map-a');
4855+
if (link.visited) elem.classList.add("map-a-visited");
48554856
L.DomEvent.on(elem, 'mousedown', e => dragStart = {x:e.clientX, y:e.clientY}, this);
48564857
L.DomEvent.on(elem, "mouseup", (e) => {
48574858
let onTop = true, nextLayer = this.options._leafletLayer._layerEl.nextElementSibling;
@@ -4863,13 +4864,22 @@
48634864
if(onTop && dragStart) {
48644865
L.DomEvent.stop(e);
48654866
let dist = Math.sqrt(Math.pow(dragStart.x - e.clientX, 2) + Math.pow(dragStart.y - e.clientY, 2));
4866-
if (dist <= 5) M.handleLink(link, leafletLayer);
4867+
if (dist <= 5){
4868+
link.visited = true;
4869+
elem.setAttribute("stroke", "#6c00a2");
4870+
elem.classList.add("map-a-visited");
4871+
M.handleLink(link, leafletLayer);
4872+
}
48674873
}
48684874
}, this);
48694875
L.DomEvent.on(elem, "keypress", (e) => {
48704876
L.DomEvent.stop(e);
4871-
if(e.keyCode === 13 || e.keyCode === 32)
4877+
if(e.keyCode === 13 || e.keyCode === 32) {
4878+
link.visited = true;
4879+
elem.setAttribute("stroke", "#6c00a2");
4880+
elem.classList.add("map-a-visited");
48724881
M.handleLink(link, leafletLayer);
4882+
}
48734883
}, this);
48744884
L.DomEvent.on(elem, 'mouseenter keyup', (e) => {
48754885
if(e.target !== e.currentTarget) return;
@@ -5315,13 +5325,6 @@
53155325
if (!path || !layer) { return; }
53165326
let options = layer.options, isClosed = layer.isClosed;
53175327
if ((options.stroke && (!isClosed || isOutline)) || (isMain && !layer.outlinePath)) {
5318-
if (options.link){
5319-
path.style.stroke = "#0000EE";
5320-
path.style.strokeOpacity = "1";
5321-
path.style.strokeWidth = "1px";
5322-
path.style.strokeDasharray = "none";
5323-
5324-
}
53255328
path.setAttribute('stroke', options.color);
53265329
path.setAttribute('stroke-opacity', options.opacity);
53275330
path.setAttribute('stroke-width', options.weight);
@@ -5339,6 +5342,13 @@
53395342
} else {
53405343
path.removeAttribute('stroke-dashoffset');
53415344
}
5345+
5346+
if (options.link){
5347+
path.setAttribute("stroke", options.link.visited?"#6c00a2":"#0000EE");
5348+
path.setAttribute("stroke-opacity", "1");
5349+
path.setAttribute("stroke-width", "1px");
5350+
path.setAttribute("stroke-dasharray", "none");
5351+
}
53425352
} else {
53435353
path.setAttribute('stroke', 'none');
53445354
}

0 commit comments

Comments
 (0)