0

i'm using firebase to save stores and you will be able to select a range and then it should find all locations in this range. My current code is:

function search(){
//converts address to coordinates
    var address = addres;
    var lng = 0;
    var lat = 0;
//calculates ranges
    var range = document.getElementById("range").value;
    var maxlon = lng + range;
    var minlon = lng - range;
    var maxlat = lat + range;
    var minlat = lat - range;
    //biermerken
    var score = document.getElementById("alfa").checked;
    var beer = document.getElementById("amstel").checked;
    var school = document.getElementById("bavaria").checked;
    var leffe = document.getElementById("leffe").checked;

It should first search between max lon and min lon for example and then max lat and min lat. And then it should check if for example everything except score is checked off it should only display items where score is turned on. I can't seem to find anything in the firebase docs or anything...

To be able to search for more than one item in the firebase

evolutionxbox
  • 3,932
  • 6
  • 34
  • 51
  • This should do the trick: https://www.google.com/search?q=firebase+realtime+database+-firestore+nearby. Some good results from there: https://stackoverflow.com/questions/47365000/sort-array-by-distance-near-user-location-from-firebase and https://stackoverflow.com/questions/43357990/query-for-nearby-locations/43358909#43358909 – Frank van Puffelen Feb 03 '23 at 16:39

0 Answers0