GeoCoder URL Query

6 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 5, 2012   (RSS)

Dear Support Team,

How can I do a url/search query to show listing within specific parameters?

IE show events within 50miles... 25miles... etc

Thanks

Re: [Illume Magazine] GeoCoder URL Query

By Damon - May 29, 2012

Hi,

Yes you can use the GeoCoder to create a search from that allows user to search for events within a certain distance of an address.

They can enter an address, then select from a dropdown the distance (with 5 miles, 10 miles etc). The distance dropdown can be customized with any distance options you want.

If you have any other questions about the GeoCoder, please let me know.

Thanks!
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Damon] GeoCoder URL Query

Hi Damon,

Thanks for the prompt reply. I have a sample page setup here: http://www.illumemagazine.com/indulge/xxx.php

What would I use as the url query to show a list of places nearby (no radius limit)..starting with closest to farthest?

Many thanks for your help.

Re: [Illume Magazine] GeoCoder URL Query

By Jason - June 4, 2012

Hi,

So you are trying to retrieve a list of records near the current record. Is that right? If so, you can try a modification of the searching code.

for example (NOTE: this code is untested):

// get geocoding data
list($myLat, $myLng) = geocodeAddress( $record['address'] );
$kmOrMiles = 'miles'; // can be 'miles' or 'km'
$geoOptions = geocoder_getOptions($myLat, $myLng, "100", $kmOrMiles);

// get records
list($addressRecords, $addressMetaData) = getRecords(array(
'tableName' => $GLOBALS['GEOCODER_SAMPLE_TABLENAME'],
'where' => "num != '".intval($record['num'])."'",
) + $geoOptions); // geoOptions WILL NOT override the above options


In this example, we start by geocoding the current record ($record) and setting a radius of 100 miles.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] GeoCoder URL Query

Hi Jason,

Thanks for the quick reply. What if I want to implement this code on a mobile device or website that pull user geolocation? How can I insert the user location into the code and then show a list based on a 100 mile radius?