2

I have this basic application where with a help of a REST API backend I fetch some custom locations(with lat long values). I call this GET api, with a given boundary of NE and SW latlong values. So after the network call executes it gives me a list of custom markers where then I draw the google map on the screen and draw(overlay) these markers on top of the map.

The full set of markers will be fetched as explained above in init() method when Home Screen loads. so when user sees the map the custom markers are already there and visible.

This approach takes time when there are few hundred of markers coming from that GET api call.

Instead I want to modify the app so. when user sees the map view, it should inly load markers in that visible screen area(of the map) only. and when user moves from that area to another then the markers which should be in that new area comes to visible. and so on and so forth.

I am not sure of how to execute such a thing with flutter.

Can I get some guidance help on this?

Pixxu Waku
  • 423
  • 8
  • 21
  • Get sorted places from API, calculate distance between two cordinates using havernsine distance https://stackoverflow.com/questions/54138750/total-distance-calculation-from-latlng-list. Then only show some within a radius(or just show nearest five), which is possible to calculate in google map api. – nibukdk93 Mar 08 '22 at 13:30

0 Answers0