Commit 7bc13787 authored by Qiu Xiang's avatar Qiu Xiang

修正接口错误

parent edce0bc5
......@@ -11,7 +11,7 @@ export default class Controls extends Component {
showsCompass: false,
showsScale: false,
showsZoomControls: true,
showsMyLocationButton: false,
showsLocationButton: false,
}
render() {
......@@ -32,8 +32,8 @@ export default class Controls extends Component {
<View style={styles.control}>
<Text>定位</Text>
<Switch
onValueChange={showsMyLocationButton => this.setState({showsMyLocationButton})}
value={this.state.showsMyLocationButton}/>
onValueChange={showsLocationButton => this.setState({showsLocationButton})}
value={this.state.showsLocationButton}/>
</View>
<View style={styles.control}>
<Text>缩放</Text>
......@@ -43,10 +43,10 @@ export default class Controls extends Component {
</View>
</View>
<MapView
showsUserLocation={true}
locationEnabled={true}
showsCompass={this.state.showsCompass}
showsScale={this.state.showsScale}
showsMyLocationButton={this.state.showsMyLocationButton}
showsLocationButton={this.state.showsLocationButton}
showsZoomControls={this.state.showsZoomControls}
style={styles.map}/>
</View>
......
......@@ -8,7 +8,7 @@ export default class Layers extends Component {
}
state = {
showsMapText: true,
showsLabels: true,
showsTraffic: false,
showsBuildings: false,
}
......@@ -29,15 +29,15 @@ export default class Layers extends Component {
value={this.state.showsTraffic}/>
</View>
<View style={styles.control}>
<Text>文本</Text>
<Text>标签</Text>
<Switch
onValueChange={showsMapText => this.setState({showsMapText})}
value={this.state.showsMapText}/>
onValueChange={showsLabels => this.setState({showsLabels})}
value={this.state.showsLabels}/>
</View>
</View>
<MapView
zoomLevel={17}
showsMapText={this.state.showsMapText}
showsLabels={this.state.showsLabels}
showsTraffic={this.state.showsTraffic}
showsBuildings={this.state.showsBuildings}
style={styles.map}/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment