【发布时间】:2021-03-28 20:52:53
【问题描述】:
我一直在做一些研究,但我不太清楚如何根据我给它的 id 获取 react-native-maps 标记的坐标。但是,当我运行代码时,出现“未定义不是对象”错误
这是代码
const getBounds = () => {
if (mapRef === null) {
return;
}
mapRef
.getMapBoundaries()
.then((res) => {
console.log(res);
})
.catch((err) => console.log(err));
console.log("Marker" , mapRef.markers["MyID"].showCallout());
};
【问题讨论】:
标签: reactjs react-native react-native-maps