1
y505174330
2024-05-18 920d34a20109cbec85e10b0345baea8723b36352
src/pages/characterMap/characterMap.vue
@@ -1,28 +1,38 @@
<template>
  <view>
    <headNav :idIndex="idIndex" text="中医人物数据库" />
    <el-button class="getBack" @click="getBack">返回</el-button>
    <view class="" style="position: relative">
    <headNav
      :idIndex="idIndex"
      text="中医人物数据库"
    />
    <el-button
      class="getBack"
      @click="getBack"
    >返回</el-button>
    <view
      class=""
      style="position: relative"
    >
      <!-- 地图 -->
      <!-- <view id="spaceTime" style="height: 90vh;width: 100%;position: relative;"></view> -->
      <div id="map"></div>
      <!-- 详情 -->
      <el-dialog class="particulars" :visible.sync="menuNav" :modal="false">
      <el-dialog
        class="particulars"
        :visible.sync="menuNav"
        :modal="false"
      >
        <view
          class="font-family"
          style="font-size: 0.26rem; padding-top: 0.16rem; font-weight: bold"
          >{{ activityInfo.participants }}</view
        >
        <ul
          style="
        >{{ activityInfo.participants }}</view>
        <ul style="
            border-bottom: 0.01rem solid #d8d8d8;
            padding: 0.16rem 0;
            font-size: 0.14rem;
            font-weight: 400;
            line-height: 0.28rem;
          "
        >
          ">
          <li>出生于{{ basicInfo.nativePlace }}</li>
          <li>
            {{
@@ -34,14 +44,12 @@
            }}
          </li>
        </ul>
        <ul
          style="
        <ul style="
            margin: 0.31rem 0 0.11rem 0;
            font-size: 0.14rem;
            font-weight: 400;
            line-height: 0.28rem;
          "
        >
          ">
          <li>活动名称:{{ activityInfo.activityName }}</li>
          <li>活动地点:{{ activityInfo.activityAddr }}</li>
          <li>活动区间:{{ activityInfo.time }}</li>
@@ -53,10 +61,14 @@
          src="https://img0.baidu.com/it/u=1845740325,2917001370&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1711731600&t=0b208ab46e1d33aa81ac31dd6bf627be"
          alt=""
        /> -->
        <div class="box" style="width: 80%">
          <span class="span" :style="{ marginLeft: spanML + 'rem' }"
            >{{ span }}年</span
          >
        <div
          class="box"
          style="width: 80%"
        >
          <span
            class="span"
            :style="{ marginLeft: spanML + 'rem' }"
          >{{ span }}年</span>
          <div class="scales">
            <view
              v-for="(item, index) in yearArr"
@@ -66,7 +78,10 @@
            ></view>
          </div>
          <div class="MX"></div>
          <div class="cursor" :style="{ marginLeft: cursorML + 'rem' }"></div>
          <div
            class="cursor"
            :style="{ marginLeft: cursorML + 'rem' }"
          ></div>
        </div>
      </el-dialog>
    </view>
@@ -77,6 +92,7 @@
import * as echarts from "echarts";
import "echarts/extension/bmap/bmap";
import { loadBMap } from "@/static/map.js";
import "leaflet.chinatmsproviders";
import L from "leaflet";
import { getPersonInfo } from "@/api/index.js";
export default {
@@ -123,7 +139,6 @@
      //   "http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}"
      // ).addTo(map);
      L.tileLayer
        .chinaProvider("TianDiTu.Normal.Map", {
          key: "76bc34ead7e30e663a4eded8aeaf5860",
@@ -137,12 +152,17 @@
        iconAnchor: [24, 41], //  图标将对应标记点的位置 这个是重点, 【值1,值2】,值1:为图标坐标第一个值(即32)的一半,值2:为图标坐标第二个值(即52)
        popupAnchor: [1, -24], // 该点是相对于iconAnchor弹出信息的位置  这个是我手动调出来的,文档默认原始值是[-1,-76],我是去一半值,取一半值调出来的
      });
      let icon = L.divIcon({
        html: "<div class='map-circle-name'></div>",
        iconSize: [80, 80],
        className: "map-circle",
      });
      this.map = map;
      if (info && info.length) {
        for (let i = 0; i < info.length; i++) {
          const item = info[i];
          const marker1 = L.marker([item.ycoord, item.xcoord], {
            icon: DefaultIcon1,
            icon: icon,
          }).addTo(map);
          marker1.on("click", (e) => {
            this.menuNav = true;
@@ -583,4 +603,10 @@
  margin: 0 auto;
  font-size: 14px !important;
}
::v-deep .map-circle-name {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #2070bc;
}
</style>