react-native-baidu-map icon indicating copy to clipboard operation
react-native-baidu-map copied to clipboard

在真机上设置center无效

Open qzc123321 opened this issue 4 years ago • 0 comments

真机上获取定位成功后设置center无效,还是显示在北京,marker已经生效了

Geolocation.getCurrentPosition()
      .then(data => {
        this.setState({
          zoom: 15,
          marker: {
            latitude: data.latitude,
            longitude: data.longitude,
            title: data.address
          },
          center: {
            latitude: data.latitude,
            longitude: data.longitude,
            rand: Math.random()
          },
          address: data.address
        });
      })
      .catch(e => {
        Toast.fail("定位失败:" + e.message);
      })

qzc123321 avatar Apr 02 '20 08:04 qzc123321