| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, getCurrentInstance } from 'vue'; |
| | | import { onMounted, ref, getCurrentInstance, nextTick } from 'vue'; |
| | | import AMapLoader from '@amap/amap-jsapi-loader'; |
| | | |
| | | import DialogType1 from './dialog/dialog-type1.vue'; |
| | |
| | | // 过滤图列 |
| | | const filterLegend = (item) => { |
| | | const { icon, positions, type } = item; |
| | | const dialog = dialogList.value[type].$refs.dialog; |
| | | const dialog = dialogList.value[type]._.refs.dialog; |
| | | const tempList = []; |
| | | positions.map(position => { |
| | | const markerIcon = createIcon(icon); |
| | |
| | | |
| | | // 弹窗与组件映射 |
| | | const mapComponentInstance = () => { |
| | | legendList.value.map((item) => { |
| | | dialogList.value[item.id] = ctx.$refs[`dtype${item.id}`]; |
| | | console.log(ctx); |
| | | legendList.value.forEach((item) => { |
| | | dialogList.value[item.id] = ctx._.refs[`dtype${item.id}`]; |
| | | }) |
| | | } |
| | | |
| | |
| | | // 创建infowindow |
| | | createInfoWindow(); |
| | | // 映射组件 |
| | | mapComponentInstance(); |
| | | nextTick(() => { |
| | | mapComponentInstance(); |
| | | }) |
| | | }) |
| | | .catch((e) => { |
| | | console.log(e); |