4

Currently position of camera in map at center always. Please check screen 1 for that.

I want to fix the camera to bottom with offset, just like screen 2.

Any help will be greatly appreciated.

let carBearing = self.getBearingBetweenTwoCoordinates(coordinate1: coordinate1, coordinate2: coordinate2)

self.carMarker.position = coordinate1

let camera = GMSCameraPosition.camera(withTarget: coordinate1, zoom: Constants.GoogleMapInfo.KZOOM_LEVEL_20, bearing: carBearing, viewingAngle: 65)

DispatchQueue.main.async{
    self.mapView.animate(to: camera)
}

Thanks

Screen 1

Screen 2

Sateesh Yemireddi
  • 4,289
  • 1
  • 20
  • 37
AmitSri
  • 1,209
  • 1
  • 20
  • 48

1 Answers1

3

You can achieve this by giving padding to your mapview.

let mapInsets = UIEdgeInsets(top: 20.0, left: 0.0, bottom: 150, right: 0.0)
self?.mapView.padding = mapInsets