swift - Google Maps API IOS cannot load new coordinates with custom UIView -


i have problem loading coordinates custom uiview has been linked through iboutlet , subclassed gmsmapview. mapview loads shows wrong location every time (always london presume default). if change self.mapview self.view, coordinates load correctly within map. have no clue why loading coordinates custom uiview doesn't work while using superview works. thank in advanced!

@iboutlet var mapview: gmsmapview!   override func loadview() {     super.loadview()     let kcameralatitude = 37.314617900000002     let kcameralongitude = -121.7901318     let camera = gmscameraposition.camerawithlatitude(kcameralatitude,                                                       longitude: kcameralongitude, zoom: 1)     let newmapview = gmsmapview.mapwithframe(self.mapview.frame, camera: camera)     self.mapview = newmapview } 

i had same problem.

i fixed changing view camera such:

@iboutlet var mapview: gmsmapview!   override func loadview() {     super.loadview()     let kcameralatitude = 37.314617900000002     let kcameralongitude = -121.7901318     let camera = gmscameraposition.camerawithlatitude(kcameralatitude,                                                       longitude: kcameralongitude, zoom: 1)     self.mapview.camera = camera } 

Comments