Let say you are building an app for a chain of Candy stores. You want your customer to be able to find the nearest Store from their location so they can buy your new Sparkling Mango lolipop . How do you do?
There are multiple ways to bring geospatial query in Wix but this time I decided to test geohash . For this challenge, I limit myself to only rely on Wix technology without support of an external platform to handle the geo query
The idea behind geoHash is to encode location (latitude, longitude) into a string. That string can be store in a database and filter with simple equality. I won’t go into details regarding the algorithm but you can find a good explanation here .
Using a npm package , collection hooks, wixData and google map I was able to produce the following prototype:
https://quentinces.wixsite.com/wix-geo-query
Given a point and a radius( in km ), it filters all the items for that area. As you can see, Wix can easily look into thousands (+40,000 in my test) of location in no time.
Other resources: