Fix destination opacity bug.

This commit is contained in:
Simon Clark 2021-06-20 19:06:24 +01:00
parent 2a3f9bf81c
commit 9d767c3dd8

View File

@ -398,7 +398,6 @@ class ControlPoint {
zIndexOffset: 1000, zIndexOffset: 1000,
draggable: this.cp.mobile, draggable: this.cp.mobile,
autoPan: true, autoPan: true,
opacity: 0.5,
}) })
.on("dragstart", () => { .on("dragstart", () => {
this.secondaryMarker.addTo(controlPointsLayer); this.secondaryMarker.addTo(controlPointsLayer);
@ -436,6 +435,7 @@ class ControlPoint {
onDestinationChanged() { onDestinationChanged() {
if (this.hasDestination()) { if (this.hasDestination()) {
this.primaryMarker.setLatLng(this.cp.destination); this.primaryMarker.setLatLng(this.cp.destination);
this.primaryMarker.setOpacity(0.5);
this.secondaryMarker.addTo(controlPointsLayer); this.secondaryMarker.addTo(controlPointsLayer);
this.path.setLatLngs([this.cp.position, this.cp.destination]); this.path.setLatLngs([this.cp.position, this.cp.destination]);
this.path.addTo(controlPointsLayer); this.path.addTo(controlPointsLayer);
@ -443,6 +443,7 @@ class ControlPoint {
} else { } else {
this.hideDestination(); this.hideDestination();
this.primaryMarker.setLatLng(this.cp.position); this.primaryMarker.setLatLng(this.cp.position);
this.primaryMarker.setOpacity(1);
} }
this.attachTooltipsAndHandlers(); this.attachTooltipsAndHandlers();
} }