现在的问题是组件上的@tap在h5点击地图获取不到坐标,现在想获取里面的原生地图进行操作,但发现是undefined
<template>  
    <view>  
        <view class="page-body">  
            <view class="page-section page-section-gap">  
                <map ref="mapRef" id="mapTest" style="width: 100%; height: 300px;" >  
                </map>  
            </view>  
        </view>  
    </view>  
</template>  
<script setup>  
import { onReady } from '@dcloudio/uni-app';  
import {ref} from 'vue'  
const mapRef = ref(null)  
const { ctx } = getCurrentInstance();   
onReady(()=>{  
    const map =uni.createMapContext('mapTest',ctx)  
    console.log(map.$getAppMap()); //undefined  
})  
</script>这个好像是app才能用的,h5怎么获取原生地图进行操作
 
             
             
             
			 
                                        
                                     
            
0 个回复