How to show markers according with the zoom location in google maps

I have an application that receives several locations from the api, I wanted to show for example only 5 of them with the map zoomed out and as I zoomed in the markers are refreshed and only shows the markers that belogs to the zoomed area. Can someone explain me how can I do this?

2 answers

  • answered 2018-11-08 06:43 Subrata Mondal

    This might be of help. The marker cluster will automatically align multiple markers according to the zoom level of the map.

  • answered 2018-11-08 06:49 Vadim Eksler

    Its two different issues. First you need to convert your zoom level to radius and listen to zoom changes, that you can look here zoom level listener in google maps v2 in android and Convert Google Map zoom level into km

    Second, if you use firebase, you can use geofire library to get locations in radius, if you store your locations in some other db, you need to check it self.