我正在使用react-native-maps库在react-native应用程序中显示google maps。 我正在跟踪用户移动,并希望在位置更改时旋转地图。对于地图旋转,我正在计算旋转角度并使用 animateCamera尝试如下旋转地图:
function katalog_detail(){
$id=$this->uri->segment(3);
$buku=$this->db->query('select*from buku b, kategori k where b.id_kategori=k.id_kategori')->result();
foreach ($buku as $fields)
{
$data['judul'] = $fields->judul_buku;
$data['pengarang'] = $fields->pengarang;
$data['penerbit'] = $fields->penerbit;
$data['kategori'] = $fields->nama_kategori;
$data['tahun'] = $fields->thn_terbit;
$data['isbn'] = $fields->isbn;
$data['gambar'] = $fields->gambar;
$data['id'] = $fields->id;
}
$this->load->view('desain');
$this->load->view('toplayout');
$this->load->view('detail_buku', $data);
}
我已经检查过,this.map.animateCamera({
heading: rotation,
center: {latitude: currentLocation.latitude, longitude: currentLocation.longitude},
pitch: this.state.currentAngle
}, {duration: 1000});
不是rotation, latitude, longitude, currentAngle
此后,我尝试使用animateToBearing方法,如文档所述,该方法已被弃用,但效果很好,并且旋转了地图,但显示了弃用警告。
null or empty objects
有解决方案吗?
P.S。我已经在github.com和stackoverflow.com上搜索了类似的问题,并且这个问题没有重复