React 百度地图获取当前定位

const myCity = new window.BMapGL.LocalCity();
    myCity.get(r => {
      const defaultPoint = {
        locationLongitude: r.center.lng,
        locationLatitude: r.center.lat
      };
      this.setState({
        defaultPoint
      });
    });

通俗易懂,不明白请留言~

猜你喜欢

转载自blog.csdn.net/weixin_54165147/article/details/129127544