React Baidu map to get the current location

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

Easy to understand, please leave a message if you don’t understand~

Guess you like

Origin blog.csdn.net/weixin_54165147/article/details/129127544