59 lines
1.4 KiB
Vue
59 lines
1.4 KiB
Vue
<template>
|
|
<!-- 顶部导航栏 -->
|
|
<custom-nav-bar :left="false" leftText="" @leftClick="" :title="title">
|
|
</custom-nav-bar>
|
|
<!-- 地图容器 -->
|
|
<!-- <view ref="mapContainer"></view> -->
|
|
<view id="mapContainer" style="width:100%; height:calc(100vh - 95px);"></view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
// import store from "@/store"
|
|
// import 'leaflet/dist/leaflet.css';
|
|
// import L from 'leaflet';
|
|
|
|
// export default {
|
|
// data() {
|
|
// return {
|
|
// map: null,
|
|
// user: store.state.user.user,
|
|
// title: "",
|
|
// }
|
|
// },
|
|
// onLoad() {
|
|
// console.error("onLoad")
|
|
// },
|
|
// onShow() {},
|
|
// onHide() {},
|
|
// onPageScroll(e) {},
|
|
// mounted() {
|
|
// this.initMap();
|
|
// },
|
|
// methods: {
|
|
// initMap() {
|
|
// const key = import.meta.env.VITE_APP_TIAN_DI_TU_KEY; // 替换为你的天地图 API Key
|
|
// var one = new L.tileLayer(
|
|
// `http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=${key}`, {
|
|
// zoomControl: true,
|
|
// attributionControl: false
|
|
// })
|
|
// var normal = L.layerGroup([one])
|
|
// // var normal_ying = L.layerGroup([two, four])
|
|
|
|
// var map = L.map("mapContainer", {
|
|
// center: [31.27, 113.68],
|
|
// zoom: 13,
|
|
// layers: [normal],
|
|
// attributionControl: false,
|
|
// preferCanvas: true,
|
|
// });
|
|
// this.map = map
|
|
// },
|
|
// }
|
|
// }
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style> |