Android Question Google Maps bounds

huho

New Member
Licensed User
Longtime User
Hi guys,

I've got a MapFragment and use GoogleMapsExtras to add PolyLines.
Unfortunately the list of lines can easily get very large, so I need to cut down the number.

My first idea was to only display a certain number of lines and whenever the user zooms in the visible number of lines gets recalculated based on the map bounds. This approach here would work, but I cannot find the same methods in B4A (or maybe I'm just blind).

Do you have any suggestions on how to get the map bounds or maybe another approach to decrease the number of lines without sacrificing detail?
 

scrat

Active Member
Licensed User
Longtime User
Hi

B4X:
GME.GetProjection(Gmap).GetVisibleRegion.LatLngBounds

GME a googlemapextras
Gmap a googlemap

Result is a LatLngBounds

Good luck
 
Upvote 0

huho

New Member
Licensed User
Longtime User
Thanks scrat, that works. :)

[Additionally I detect when points of a line switch from visible to invisible (and vice versa) to avoid missing line segments at the borders.]
 
Upvote 0
Top