获取地理位置

getCity () {
            const map = new BMap.Map('map');
            const nowCity = new BMap.LocalCity();
            nowCity.get(bdGetPosition);
            const _this = this;
            function bdGetPosition (result) {
                var cityName = result.name;
                _this.pickerData && _this.pickerData[0].forEach(item => {
                    item.children.forEach(value => {
                        if (value.text === cityName) {
                            _this.pickerDefaultValue = [item.value, value.value]
                        }
                    })
                })
            }
        },

原文地址:https://www.cnblogs.com/wsj1/p/14535862.html