`你好☺️我是swift的新手。我正在谷歌地图和Goole Place工作。 我有一个搜索栏,当我点击按钮并搜索结果应显示在一个自动完成位置,但这不起作用。 这是我的代码:
func viewController(_ viewController: GMSAutocompleteViewController, didAutocompleteWith place: GMSPlace) {
let camera = GMSCameraPosition.camera(withLatitude: place.coordinate.latitude, longitude: place.coordinate.longitude, zoom: 15.0)
self.googleMapsView.camera = camera
self.dismiss(animated: true, completion: nil) //dismiss after select place
}
func viewController(_ viewController: GMSAutocompleteViewController, didFailAutocompleteWithError error: Error) {
print("Erroe Auto Complte \(error)")
}
func wasCancelled(_ viewController: GMSAutocompleteViewController) {
self.dismiss(animated: true, completion: nil)//when cancel search
}
@IBAction func openSearchAddress(_ sender: UIBarButtonItem) {
let autoCompleteController = GMSAutocompleteViewController()
autoCompleteController.delegate = self
self.locationManager.startUpdatingLocation()
self.present(autoCompleteController, animated: true, completion: nil)
}
答案 0 :(得分:0)
<Swipeout {...swipeSettings}>
<View style={styles.swipeStyle}>
<View style={styles.buttonContainer}>
<MinusButton />
</View>
<View style={styles.itemStyle}>
<Text>{this.props.name}</Text>
</View>
<View style={styles.buttonContainer}>
<PlusButton />
</View>
</View>
</Swipeout>
使用locationStart和locationEnd可以绘制折线