Search code examples
androidgoogle-mapsmarker

How to display the nearby marker from the SQLite DB


I have 2000's of marker which needs to be displayed in the google maps dynamically. If I load all marker on one time it's affecting the performance of my application. So I am running my API one time and storing all coordinates in the SQLite DB and I want to display marker only which is nearby onCameraMove.

How can I achieve that? I have multiple Questions in StackOverflow but none will solve my issues.


Solution

  • You should add a criteria when retrieving the list of markers like only retrieving markers in certain radius.

    you can refer to this qustion if you decided to go with this approach : Query to get records based on Radius in SQLite?