react-native-baidumap
react-native-baidumap copied to clipboard
this.refs["mapView"].zoomToLocs([[x, y]])报错
undefined is not a function (evaluating '_react2.default.findNodeHandle(this.refs["baiduMap"])')
是原因导致的?不执行这句的话,可以显示默认的北京地区地图。
Get answer:
With new react-native, should:
import {
...,
findNodeHandle,
...,
} from 'react-native';
...
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs["baiduMap"]),
UIManager.RCTBaiduMap.Commands.zoomToLocs,
[locs]
);
...