最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
The render() format of the method is as follows:
getSnapshotBeforeUpdate(prevProps, prevState) getSnapshotBeforeUpdate() method is called before the last rendered output (submitted to the DOM node).
In getSnapshotBeforeUpdate() method, we can access the props and state .
getSnapshotBeforeUpdate() the method needs to be the same as the componentDidUpdate() method, otherwise an error will occur.
The following examples use the getSnapshotBeforeUpdate() method to viewthe update before state object, the instance will display different values before and after the update after a 1-second delay: 3.18.1. Example ¶
classHeaderextendsReact.Component{constructor(props){super(props);this.state={favoritesite:"runoob"};}componentDidMount(){setTimeout(()=>{this.setState({favoritesite:"google"})},1000)}getSnapshotBeforeUpdate(prevProps,prevState){document.getElementById("div1").innerHTML="What was your favorite website before the update:"+prevState.favoritesite;}componentDidUpdate(){document.getElementById("div2").innerHTML="What is your favorite website after the update:"+this.state.favoritesite;}render(){return(<div> <h1>My favorite website is{this.state.favoritesite}h1> <divid="div1">div> <divid="div2">div> div>);}}ReactDOM.render(<Header/>,document.getElementById('root'));