|
|
@@ -4,6 +4,7 @@
|
|
|
ref="mapContainer"
|
|
|
style="width: 100%; height: 520px"
|
|
|
class="tracking-map"
|
|
|
+ :class="{ 'dark-mode': themeStore.theme === 'dark' }"
|
|
|
></div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
@@ -13,6 +14,10 @@ import OriginIcon from '../images/originIcon.png'
|
|
|
import TransferIcon from '../images/transferIcon.png'
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
import * as turf from '@turf/turf'
|
|
|
+import { mapData } from './mapData'
|
|
|
+import { useThemeStore } from '@/stores/modules/theme'
|
|
|
+
|
|
|
+const themeStore = useThemeStore()
|
|
|
|
|
|
const props = defineProps<{
|
|
|
serial_no?: string
|
|
|
@@ -549,12 +554,13 @@ onUnmounted(() => {
|
|
|
margin-left: -2px;
|
|
|
font-size: 12px;
|
|
|
font-weight: 700;
|
|
|
+ color: #2b2f36;
|
|
|
}
|
|
|
}
|
|
|
.label {
|
|
|
margin-bottom: 4px;
|
|
|
font-size: 12px;
|
|
|
- color: let(--color-neutral-2);
|
|
|
+ color: #646a73;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -563,28 +569,91 @@ onUnmounted(() => {
|
|
|
.leaflet-popup-tip {
|
|
|
display: none;
|
|
|
}
|
|
|
- .transport-map {
|
|
|
- .leaflet-touch {
|
|
|
- .leaflet-bar {
|
|
|
- border: 0;
|
|
|
- border-radius: 4px;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
.leaflet-control-zoom {
|
|
|
span {
|
|
|
color: #2b2f36;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-/* 示例:将所有地图元素的颜色反转 */
|
|
|
-.leaflet-container {
|
|
|
+.leaflet-control {
|
|
|
+ a.leaflet-control-zoom-in,
|
|
|
+ a.leaflet-control-zoom-out,
|
|
|
+ a.leaflet-bar-part {
|
|
|
+ width: 26px;
|
|
|
+ height: 26px;
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.dark-mode {
|
|
|
+ div.leaflet-control-zoom.leaflet-bar.leaflet-control {
|
|
|
+ border: 0;
|
|
|
+ border-radius: 4px;
|
|
|
+ box-shadow: none;
|
|
|
+ a {
|
|
|
+ background-color: #3c414a;
|
|
|
+ border-bottom: none;
|
|
|
+ span {
|
|
|
+ color: var(--color-neutral-1);
|
|
|
+ }
|
|
|
+ &:first-child {
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ width: 24px;
|
|
|
+ border-bottom: 2px solid #575c64;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .reset-zoom-control {
|
|
|
+ border: none;
|
|
|
+ background-color: #3c414a;
|
|
|
+ }
|
|
|
+ a.leaflet-bar-part {
|
|
|
+ background-color: #3c414a;
|
|
|
+ border-radius: 4px;
|
|
|
+ box-shadow: none;
|
|
|
+ overflow: hidden;
|
|
|
+ div {
|
|
|
+ border-color: var(--color-neutral-1) !important;
|
|
|
+ div {
|
|
|
+ background-color: var(--color-neutral-1) !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/* 示例:将所有地图图片的颜色反转 */
|
|
|
+.dark-mode img:not(.leaflet-marker-icon) {
|
|
|
filter: invert(1) hue-rotate(200deg);
|
|
|
}
|
|
|
+// 防止暗黑模式下地图超出容器
|
|
|
+.tracking-map {
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+// 修改暗黑模式下的背景色
|
|
|
+.leaflet-container.dark-mode,
|
|
|
+.leaflet-map-pane.dark-mode,
|
|
|
+.leaflet-tile-container.dark-mode {
|
|
|
+ background-color: #2b2f36;
|
|
|
+}
|
|
|
+// 处理版权信息在切换模式后样式错误bug
|
|
|
+.leaflet-right .leaflet-control-attribution {
|
|
|
+ background: rgba(255, 255, 255, 0.8);
|
|
|
+ margin: 0 4px 4px 0;
|
|
|
+ color: #2b2f36;
|
|
|
+ span {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #2b2f36;
|
|
|
+ }
|
|
|
+ a {
|
|
|
+ color: #0078a8;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+}
|
|
|
/* 自定义重置缩放按钮控件样式 */
|
|
|
.reset-zoom-control {
|
|
|
- margin-top: 10px; /* 增加上边距,使按钮与默认缩放按钮之间有间距 */
|
|
|
+ margin-top: 10px;
|
|
|
border-radius: 4px;
|
|
|
background-color: white;
|
|
|
border: 1px solid #ccc;
|