<template>
<div class="map-positon">
<p>{
{ currentCity }}</p>
<p>{
{ currentCity_detail }}</p>
</div>
</template>
<script>
export default {
data() {
return {
citylocation: null,
lat: 0,
lng: 0,
currentCity: "杭州市", // 没有正确得到经纬度时,默认显示杭州吧
currentCity_detail: ''
}
},
computed: {
},
methods: {
initCityService() {
var _this = this;
var city = document.getElementById("city");
//调用城市服务信息
this.citylocation = new qq.maps.CityService({
complete: function (res) {
city.style.display = 'inline';
// 在pc测试时,会有经纬度负数的情况.....我没找原因=。=&
VUE对腾讯地图API
最新推荐文章于 2024-05-14 15:38:39 发布