We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21017
    • 3 Posts
    hello,

    I would create a google map where I could display retailers around a user given location. User’s address geocodeing works great and all of retailers resource have LAT LNG values. I found an SQL syntax which gives back recources by distance. What do you think it is possible to implement this syntax into getResources, or how could I crate a snippet which lists resources by distance?

    thanks.

    SELECT *,
        SQRT(POW((69.1 * (locations.latitude - 27.950898)) , 2 ) +
        POW((53 * (locations.longitude - -82.461517)), 2)) AS distance
    FROM locations
    ORDER BY distance ASC
    LIMIT 5