使用geolocation.getCurrentLocation()方法获取当前位置信息。try { const location = await geolocation.getCurrentLocation(); console.log('经度:', location.longitude); console.log('纬度:', location.latitude); } catch (error) { console.error('获取地理位置信息失败:', error); }
使用geolocation.getCurrentLocation()方法获取当前位置信息。