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

修正接口错误

parent edce0bc5
...@@ -11,7 +11,7 @@ export default class Controls extends Component { ...@@ -11,7 +11,7 @@ export default class Controls extends Component {
showsCompass: false, showsCompass: false,
showsScale: false, showsScale: false,
showsZoomControls: true, showsZoomControls: true,
showsMyLocationButton: false, showsLocationButton: false,
} }
render() { render() {
...@@ -32,8 +32,8 @@ export default class Controls extends Component { ...@@ -32,8 +32,8 @@ export default class Controls extends Component {
<View style={styles.control}> <View style={styles.control}>
<Text>定位</Text> <Text>定位</Text>
<Switch <Switch
onValueChange={showsMyLocationButton => this.setState({showsMyLocationButton})} onValueChange={showsLocationButton => this.setState({showsLocationButton})}
value={this.state.showsMyLocationButton}/> value={this.state.showsLocationButton}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>缩放</Text> <Text>缩放</Text>
...@@ -43,10 +43,10 @@ export default class Controls extends Component { ...@@ -43,10 +43,10 @@ export default class Controls extends Component {
</View> </View>
</View> </View>
<MapView <MapView
showsUserLocation={true} locationEnabled={true}
showsCompass={this.state.showsCompass} showsCompass={this.state.showsCompass}
showsScale={this.state.showsScale} showsScale={this.state.showsScale}
showsMyLocationButton={this.state.showsMyLocationButton} showsLocationButton={this.state.showsLocationButton}
showsZoomControls={this.state.showsZoomControls} showsZoomControls={this.state.showsZoomControls}
style={styles.map}/> style={styles.map}/>
</View> </View>
......
...@@ -8,7 +8,7 @@ export default class Layers extends Component { ...@@ -8,7 +8,7 @@ export default class Layers extends Component {
} }
state = { state = {
showsMapText: true, showsLabels: true,
showsTraffic: false, showsTraffic: false,
showsBuildings: false, showsBuildings: false,
} }
...@@ -29,15 +29,15 @@ export default class Layers extends Component { ...@@ -29,15 +29,15 @@ export default class Layers extends Component {
value={this.state.showsTraffic}/> value={this.state.showsTraffic}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>文本</Text> <Text>标签</Text>
<Switch <Switch
onValueChange={showsMapText => this.setState({showsMapText})} onValueChange={showsLabels => this.setState({showsLabels})}
value={this.state.showsMapText}/> value={this.state.showsLabels}/>
</View> </View>
</View> </View>
<MapView <MapView
zoomLevel={17} zoomLevel={17}
showsMapText={this.state.showsMapText} showsLabels={this.state.showsLabels}
showsTraffic={this.state.showsTraffic} showsTraffic={this.state.showsTraffic}
showsBuildings={this.state.showsBuildings} showsBuildings={this.state.showsBuildings}
style={styles.map}/> 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