ruoyi-plus-soybean/src/views/plugin/map/components/TencentMap.vue

30 lines
670 B
Vue
Raw Normal View History

2022-01-24 00:36:38 +08:00
<template>
<div ref="domRef"></div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useScriptTag } from '@vueuse/core';
import { TENCENT_MAP_SDK_URL } from '@/config';
const { load } = useScriptTag(TENCENT_MAP_SDK_URL);
const domRef = ref<HTMLDivElement | null>(null);
async function renderBaiduMap() {
if (!domRef.value) return;
2022-01-24 00:36:38 +08:00
await load(true);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const map = new TMap.Map(domRef.value, {
2022-01-24 00:36:38 +08:00
center: new TMap.LatLng(39.98412, 116.307484),
zoom: 11,
viewMode: '3D',
2022-01-24 00:36:38 +08:00
});
}
onMounted(() => {
renderBaiduMap();
});
</script>
<style scoped></style>