Fred

Results 2 comments of Fred

> > 相同的问题 > > 手动清除localStorage后再刷新页面,总是会抱这个错误 > > 我目前的解决方案是加个刷新按钮,点击后重新渲染地图,让用户自己去刷新 Map组件的center不能使undefined,如果center为undefined不要传center属性 就没问题了

使用map的getCenter方法可以看到会返回Q属性(如下图)猜测“Cannot read property 'Q' of null”报错原因应该是Map组件的center传入undefined后源码根据传入的center新建一个LatLng点,然后去获取该点的Q值时报错了 ![image](https://user-images.githubusercontent.com/40053981/158515888-b97fe6be-2edd-43fa-a014-15cc3f4e191e.png)