HTML5 Geo Location Support Product Page

Answered

radius search

Asked 20 Oct 2014 19:18:21
1
has this question
20 Oct 2014 19:18:21 Denis Hoffmann posted:
Hello,
can I do a radius search with this extension and with the google maps extensions? I want to show my users BARS that are arund their location.
I have addresses and geodata in my database from the locations. But now I need to have a solution I can bring both together...the user location and the sourrounded BARS. And if possible, change the search radius...
Any suggestions?
Denis

Replies

Replied 24 Oct 2014 12:49:24
24 Oct 2014 12:49:24 Teodor Kuduschiev replied:
Hello Denis,
Actually this is possible using the HTML5 Data Bindings Formattter.
When filtering the database values on your page, using HTML5 Data Bindigs / DMXzone Database connector, you can define 4 different hidden fields, as filter variables:

1. Max_latitude - {{your current latittude + XX}}
2. Max_longitude - {{your current longitude + XX}}
3. Min_latitude - {{your current latittude - XX }}
4. Min_longitude - {{your current longitude - XX}}
(current location comes from the geo location addon and XX is a value provided by you, depending on the radius size you need)

So in the filters tab of the query builder you just add those 4 hidden fields as filter with "AND" :
Latitude < $FORM.Max_latitude
AND
Longitude < $FORM.Max_longitude
AND
Latitude > $FORM.Min_latitude
AND
Longitude > $FORM.Min_longitude

That's all


Reply to this topic