1

I am planning to build a location-aware app with the Ionic framework. It basically comes down to showing a Google map with the location of the user and markers in his neighbourhood. I will only show markers on the visible part of the map.

This excellent tutorial of Josh Morony uses a PHP script on the database. It limits the number of markers returned to the app based on a distance calculation between the user location and all markers stored in a mysql database.

However, I would like to use a Firebase database for my app. This question already points out that server-side calculations are not possible with Firebase.

Would it harm the performance of my app if I would return all markers stored in Firebase and calculate the distance on the client side? I would then limit the markers shown based on those calculations.

Or is it better to limit the number of markers returned after server-side calculations and then load the Google Map Markers?

Community
  • 1
  • 1
Bert Carremans
  • 1,623
  • 4
  • 23
  • 47
  • 1
    Calculating the distance client-side and then filtering sounds like a bad idea. You're probably looking for [GeoFire](https://github.com/firebase/geofire-js/blob/master/examples/README.md), which allows geo-queries on the Firebase Database. – Frank van Puffelen Dec 05 '16 at 05:53

0 Answers0