react地图页面根据材料来显示不同的地图,点击材料后,不能正常显示地图,是因为导航方式不同,这样解决:

+    const newUrl = `/show_result_as_map/${calculationResultDetailId}?calculation_result_id=${calculationResultId}&material_id=${materialIdUpdate}&token=${getToken()}`
+    location.href = newUrl
+    //this.props.history.push(newUrl);

理解

使用location.href类似于直接在浏览器地址栏中输入URL并按下回车键进行导航,使用histrory.push是React router提供的方式,是在React项目中使用 。location.href可以直接操作浏览器刷新。