I'm building a tableview/scrollview to the lower part of a window containing a GMSMapView.map, which is intended to display the marker data of the current camera position.
The GMSMapView.map has already markers set in.
I'm missing the way to get the marker data of the current camera position, checked through Google's documentation but couldn't find it there, any help largely appreciated.
Some digging and here's the answer, simplified, using the SDK's mapView didChange position func, single already defined marker and print confirmations:
func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) {
let camView = mapView.projection.visibleRegion()
let cameraBox = GMSCoordinateBounds(region: camView)
if cameraBox.contains(marker.position) {
print("YES")
}
else {print("NO")
}