Commit facdcb01 authored by Sparkf's avatar Sparkf 🏙️
Browse files

campus-bus: add english station name according university's guideline

parent 4a8828d5
Loading
Loading
Loading
Loading
+38 −10
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ export default {
    stops1: [],
    stops2: [],
    historyBusData: [],
    themeColor: '#212529', // 默认颜色
    themeColor_rev: '#DEE2E6',
    echartsOption: {
      tooltip: {
        show: false,
@@ -112,9 +114,9 @@ export default {
        {
          type: "scatter",
          label: {
            fontSize: 10,
            fontSize: 8,
            show: true,
            color: "#999",
            color: "#212529",
            position: "right",
            formatter: "{b}",
          },
@@ -126,19 +128,19 @@ export default {
          data: [],
        },
        {
          type: "scatter",
          name: "bus",
          label: {
            fontSize: 11,
            show: true,
            color: "#000",
            textBorderColor: "#fff",
            textBorderWidth: 2,
            color: "#212529",
            textBorderColor: "#DEE2E6",
            textBorderWidth: 2.5,
            fontWeight: "bold",
            position: "right",
            distance: -5,
            formatter: "{b}",
          },
          type: "scatter",
          name: "bus",
          data: [],
        },
      ],
@@ -153,6 +155,28 @@ export default {
    setEchartsOption(appendOption) {
      this.echartsOption = appendOption;
    },
    checkTheme() {
      if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
        // console.log("dark") // 深色主题
        this.themeColor = "#DEE2E6"
        this.themeColor_rev = "#212529"
      } else {
        // console.log("bright") // 浅色主题
        this.themeColor = "#212529"
        this.themeColor_rev = "#DEE2E6"
      }
      this.updateSeriesColor();
    },
    updateSeriesColor() {
      // 更新 series 中的 color
      this.echartsOption.series = this.echartsOption.series.map(series => {
        if (series.label) {
          series.label.color = this.themeColor;
          series.label.textBorderColor = this.themeColor_rev;
        }
        return series;
      });
    },
    //加载线路与站点信息
    load_data() {
      axios
@@ -416,6 +440,10 @@ export default {
  watch: {
    lines: "updateBusPos",
  },
  created() {
    this.checkTheme();
    window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this.checkTheme);
  },
mounted() {
    this.load_data();
    this.updateBusPos();
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ export default {
        {
          "type": "Feature",
          "geometry": {"type": "Point", "coordinates": [113.997811, 22.603325]},
          "properties": {"name": "教工餐厅 Faculty Cafteria"}
          "properties": {"name": "教工餐厅 Faculty Cafeteria"}
        },
        {
          "type": "Feature",
+15 −15
Original line number Diff line number Diff line
@@ -2,20 +2,20 @@
    "type": "FeatureCollection",
    "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
    "features": [
        { "type": "Feature", "properties": { "name": "工学院", "dist": 0.0 }, "geometry": { "type": "Point", "coordinates": [113.9902, 22.60336] } },
        { "type": "Feature", "properties": { "name": "科研楼", "dist": 542.89970148591362 }, "geometry": { "type": "Point", "coordinates": [113.99153, 22.599643] } },
        { "type": "Feature", "properties": { "name": "7号门", "dist": 907.62735789785825 }, "geometry": { "type": "Point", "coordinates": [113.990399, 22.597132] } },
        { "type": "Feature", "properties": { "name": "行政楼", "dist": 1149.0456938127084 }, "geometry": { "type": "Point", "coordinates": [113.992403, 22.597011] } },
        { "type": "Feature", "properties": { "name": "1号门", "dist": 1513.4263569176362 }, "geometry": { "type": "Point", "coordinates": [113.994898, 22.59569] } },
        { "type": "Feature", "properties": { "name": "2号门", "dist": 1752 }, "geometry": { "type": "Point", "coordinates": [113.99585,22.59788] } },
        { "type": "Feature", "properties": { "name": "3号门", "dist": 2230.3249460522952 }, "geometry": { "type": "Point", "coordinates": [113.99939, 22.599893] } },
        { "type": "Feature", "properties": { "name": "专家公寓", "dist": 2546.2198658400307 }, "geometry": { "type": "Point", "coordinates": [113.998329, 22.601975] } },
        { "type": "Feature", "properties": { "name": "教工餐厅", "dist": 2727.0013627137873 }, "geometry": { "type": "Point", "coordinates": [113.997811, 22.603325] } },
        { "type": "Feature", "properties": { "name": "社康中心", "dist": 2939.8507316668038 }, "geometry": { "type": "Point", "coordinates": [113.995981, 22.60293] } },
        { "type": "Feature", "properties": { "name": "学生宿舍", "dist": 3238.416725109053 }, "geometry": { "type": "Point", "coordinates": [113.993824, 22.604854] } },
        { "type": "Feature", "properties": { "name": "荔园", "dist": 3621.0661168663187 }, "geometry": { "type": "Point", "coordinates": [113.995238, 22.606518] } },
        { "type": "Feature", "properties": { "name": "创园", "dist": 3804.8412646531024 }, "geometry": { "type": "Point", "coordinates": [113.996732, 22.606278] } },
        { "type": "Feature", "properties": { "name": "慧园", "dist": 3991.5552242009744 }, "geometry": { "type": "Point", "coordinates": [113.998372, 22.606102] } },
        { "type": "Feature", "properties": { "name": "欣园", "dist": 4592.7727333861958 }, "geometry": { "type": "Point", "coordinates": [113.997473, 22.610667] } }
        { "type": "Feature", "properties": { "name": "工学院\nCOE", "dist": 0.0 }, "geometry": { "type": "Point", "coordinates": [113.9902, 22.60336] } },
        { "type": "Feature", "properties": { "name": "科研楼\nResearch Bldg.", "dist": 542.89970148591362 }, "geometry": { "type": "Point", "coordinates": [113.99153, 22.599643] } },
        { "type": "Feature", "properties": { "name": "号门\nGate7", "dist": 907.62735789785825 }, "geometry": { "type": "Point", "coordinates": [113.990399, 22.597132] } },
        { "type": "Feature", "properties": { "name": "行政楼\nAdmin. Bldg.", "dist": 1149.0456938127084 }, "geometry": { "type": "Point", "coordinates": [113.992403, 22.597011] } },
        { "type": "Feature", "properties": { "name": "1号门\nGate 1", "dist": 1513.4263569176362 }, "geometry": { "type": "Point", "coordinates": [113.994898, 22.59569] } },
        { "type": "Feature", "properties": { "name": "2号门\nGate 2", "dist": 1752 }, "geometry": { "type": "Point", "coordinates": [113.99585,22.59788] } },
        { "type": "Feature", "properties": { "name": "3号门\nGate 3", "dist": 2230.3249460522952 }, "geometry": { "type": "Point", "coordinates": [113.99939, 22.599893] } },
        { "type": "Feature", "properties": { "name": "专家公寓\nGuest Houses", "dist": 2546.2198658400307 }, "geometry": { "type": "Point", "coordinates": [113.998329, 22.601975] } },
        { "type": "Feature", "properties": { "name": "教工餐厅\nFaculty Cafeteria", "dist": 2727.0013627137873 }, "geometry": { "type": "Point", "coordinates": [113.997811, 22.603325] } },
        { "type": "Feature", "properties": { "name": "社康中心\nHealth Center", "dist": 2939.8507316668038 }, "geometry": { "type": "Point", "coordinates": [113.995981, 22.60293] } },
        { "type": "Feature", "properties": { "name": "学生宿舍\nStu. Dormitories", "dist": 3238.416725109053 }, "geometry": { "type": "Point", "coordinates": [113.993824, 22.604854] } },
        { "type": "Feature", "properties": { "name": "荔园\nLychee Hill", "dist": 3621.0661168663187 }, "geometry": { "type": "Point", "coordinates": [113.995238, 22.606518] } },
        { "type": "Feature", "properties": { "name": "创园\nChuang Yuan", "dist": 3804.8412646531024 }, "geometry": { "type": "Point", "coordinates": [113.996732, 22.606278] } },
        { "type": "Feature", "properties": { "name": "慧园\nHui Yuan", "dist": 3991.5552242009744 }, "geometry": { "type": "Point", "coordinates": [113.998372, 22.606102] } },
        { "type": "Feature", "properties": { "name": "欣园\nJoy Highland", "dist": 4592.7727333861958 }, "geometry": { "type": "Point", "coordinates": [113.997473, 22.610667] } }
    ]
}
 No newline at end of file
+7 −7
Original line number Diff line number Diff line
@@ -2,12 +2,12 @@
    "type": "FeatureCollection",
    "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
    "features": [
        { "type": "Feature", "properties": { "name": "科研楼", "dist": 8.96320513008415 }, "geometry": { "type": "Point", "coordinates": [113.99153, 22.599643] } },
        { "type": "Feature", "properties": { "name": "工学院", "dist": 546.92460644903099 }, "geometry": { "type": "Point", "coordinates": [113.9902, 22.60336] } },
        { "type": "Feature", "properties": { "name": "学生宿舍", "dist": 3238.416725109053 }, "geometry": { "type": "Point", "coordinates": [113.993824, 22.604854] } },
        { "type": "Feature", "properties": { "name": "荔园", "dist": 1357.3744467274953 }, "geometry": { "type": "Point", "coordinates": [113.995238, 22.606518] } },
        { "type": "Feature", "properties": { "name": "创园", "dist": 1541.1495945142797 }, "geometry": { "type": "Point", "coordinates": [113.996732, 22.606278] } },
        { "type": "Feature", "properties": { "name": "慧园", "dist": 1727.8635540621517 }, "geometry": { "type": "Point", "coordinates": [113.998372, 22.606102] } },
        { "type": "Feature", "properties": { "name": "欣园", "dist": 2329.0810632473731 }, "geometry": { "type": "Point", "coordinates": [113.997473, 22.610667] } }
        { "type": "Feature", "properties": { "name": "科研楼\nResearch Bldg.", "dist": 8.96320513008415 }, "geometry": { "type": "Point", "coordinates": [113.99153, 22.599643] } },
        { "type": "Feature", "properties": { "name": "工学院\nCOE", "dist": 546.92460644903099 }, "geometry": { "type": "Point", "coordinates": [113.9902, 22.60336] } },
        { "type": "Feature", "properties": { "name": "学生宿舍\nStu. Dormitories", "dist": 3238.416725109053 }, "geometry": { "type": "Point", "coordinates": [113.993824, 22.604854] } },
        { "type": "Feature", "properties": { "name": "荔园\nLychee Hill", "dist": 1357.3744467274953 }, "geometry": { "type": "Point", "coordinates": [113.995238, 22.606518] } },
        { "type": "Feature", "properties": { "name": "创园\nChuang Yuan", "dist": 1541.1495945142797 }, "geometry": { "type": "Point", "coordinates": [113.996732, 22.606278] } },
        { "type": "Feature", "properties": { "name": "慧园\nHui Yuan", "dist": 1727.8635540621517 }, "geometry": { "type": "Point", "coordinates": [113.998372, 22.606102] } },
        { "type": "Feature", "properties": { "name": "欣园\nJoy Highland", "dist": 2329.0810632473731 }, "geometry": { "type": "Point", "coordinates": [113.997473, 22.610667] } }
    ]
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -11,3 +11,7 @@ navbar: false
<ClientOnly>
  <TabView :isMapTabEnabled="true"></TabView>
</ClientOnly>

*如需切换暗色主题,请切换后刷新页面*

*Pls REFRESH after toggle dark mode.*
 No newline at end of file
Loading