0

I'm building an iOS app and this is my first experience with maps. The issue is pretty simple: the user can move the map with his/her finger. Each time this happens I download some info from a server (info related to the map region just shown) to display markers. What I want is to avoid reloading and reloading again the same info if the user come back to a previously visited region.

Is there a way to check this?

Maybe an algorithm. I think this is a common issue, but I can't seem to find anything on internet.

  • 2
    Is you map loading tiles? Is there a way you can track the id number of those tiles and cache them? – Sergio C. Jul 22 '17 at 22:53
  • @SergioC. thanks for your reply. I load marker positions from a server. It's true that each marker has an id, but the point is: how can I know that, for a specific region, I already downloaded the marker positions? I already cache those positions, actually, but I'd like to avoid making another network request for a region already downloaded. I should have a sort of function to ask to: "Hey, for the region the user is displaying, have we already downloaded the marker positions?" If so, don't contact the server again. – superpuccio Jul 24 '17 at 9:11
  • 1
    You're welcome. It seems you will need to find the logic after every region Id based on the position so you don't need two server request. If, for example the tiles are 1x1 km, you would be able to identify the user coordinates and predict which tile Id it is and whether you need to pull that info from the server again or if it is already cached. I can't help you much more because I'm not in the programmer side of gis, but that's what I would do. – Sergio C. Jul 24 '17 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.