Google Calendar Question

valandor062

New Member
I'm currently working on a personal project and I noticed that Fabrik has a Google calendar plugin/visualization. I am wondering if it's possible to store lat/long information in a database for any given location then on the map have a radius search for items that are within x amount of distance from that radius.

So if I have a list of restaurants in a state I would want someone to be able to type in an address, and a distance and when they submit the form it would pull up all locations in the database that are within that distance. You can get the geo-coding for that address entered from the response from Google.

So really what I would need is to call to Google via Ajax on it's response send the lat/long to an internal function that would call the database function to get what's required to show and then return it via ajax and update the map with the markers and possible removing any if the radius of the search was lowered from the last request.

If this is pre-built into fabrik I don't see it useful to reinvent the wheel. If not I may use the Google map plugin as a base for this and share the code once it's completed. Any help or suggestion would be appriciated....

Thanks,
Valandor
A.K.A. ~ Anthony
 
There are "radius search" and "radius lookup" list plugins, which are adding filters to the list and so to the googlmap vizualisation.
Until now there's no docu in the WIKI for radius lookup and I never used it, but you can try.
 
Okay, once I get it figured out I'll post it on here. I will be looking at the Harvensine Formula to complete this task so will have to build a really clean query to search for the radius or the query could take way to long... Up to 4 seconds actually.
 
So I've decided that I'm going to drop the concept of a map and list all members that are within x amount of miles from the location entered. I will still be recording a businesses lat/lon in the database and will check against the lat/long of the entered address.

I have found the Haversine formula for the SQL query which is

Code:
SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top