Google Maps for iOS - How can you tell if a marker is within the bounds of the screen?

后端 未结 5 1433
一向
一向 2020-12-31 15:11

I\'m trying to figure out a straightforward way to determine in Google Maps for iOS if a given GMSMarker is within the bounds of the visible map. There seems to be solution

5条回答
  •  余生分开走
    2020-12-31 16:10

    Retrieve the bounds of your viewport with GMSVisibleRegion and create a GMSCoordinateBounds with it. Call containsCoordinate, passing in the marker's position. It should return true if the marker is within the viewport and false if not.

提交回复
热议问题