1
0
forked from dyf/dyf-vue-ui

地图图标路径修改

This commit is contained in:
fengerli
2025-09-02 18:34:53 +08:00
parent 78771e9551
commit 6557b79f0c
2 changed files with 4 additions and 6 deletions

View File

@ -37,8 +37,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { deviceVO } from '@/api/controlCenter/controlPanel/types'; import { deviceVO } from '@/api/controlCenter/controlPanel/types';
import { defineProps, ref, watch, onMounted, onUnmounted, nextTick } from 'vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import strongLightDefault from '@/assets/images/position_ico.png';
const props = defineProps({ const props = defineProps({
deviceList: { deviceList: {
type: Array as PropType<deviceVO[]>, type: Array as PropType<deviceVO[]>,
@ -151,7 +151,7 @@ const renderMarkers = () => {
map: mapInstance, map: mapInstance,
icon: new AMap.Icon({ icon: new AMap.Icon({
size: new AMap.Size(32, 32), // Marker显示尺寸 size: new AMap.Size(32, 32), // Marker显示尺寸
image: '/src/assets/images/position_ico.png', image: strongLightDefault,
imageSize: new AMap.Size(32, 32) imageSize: new AMap.Size(32, 32)
}) })
}); });

View File

@ -51,9 +51,7 @@
import api from "@/api/controlCenter/historyjectory/index" import api from "@/api/controlCenter/historyjectory/index"
import { formatTimestampToHM } from "@/utils/function" import { formatTimestampToHM } from "@/utils/function"
import { useRoute } from "vue-router" import { useRoute } from "vue-router"
import { ref, onMounted, onUnmounted, watch } from "vue" import strongLightDefault from '@/assets/images/position_ico.png';
import { ElMessage } from "element-plus"
// 添加AMap类型声明 // 添加AMap类型声明
declare global { declare global {
interface Window { interface Window {
@ -107,7 +105,7 @@ const initMap = () => {
position: [20, 20], position: [20, 20],
icon: new AMap.Icon({ icon: new AMap.Icon({
size: new AMap.Size(40, 40), size: new AMap.Size(40, 40),
image: '/src/assets/images/position_ico.png', image: strongLightDefault,
imageSize: new AMap.Size(40, 40), imageSize: new AMap.Size(40, 40),
}), }),
anchor: 'center', anchor: 'center',