0

I'm working on an estate agents website and am looking to create a 'find properties near me' feature.

Any ideas on how I might do this will be gratefully received!

Thanks in advance,

Tom

2
  • Hey Tom, send me another email about this and can help you get this setup with Google Maps for EE. It should do all this stuff, and what it won't do currently I will be sure to include it in my next update (like we previously discussed). It can do the store finder already, you just need pickup the user's current location and put the coords in the lat/lng fields (if I understand you correctly). May 13, 2013 at 14:04
  • Will do, thanks for the great service Justin! May 13, 2013 at 17:05

2 Answers 2

2

Geofinder add-on will help you here: http://devot-ee.com/add-ons/geofinder

Docs: http://mightybigrobot.com/docs/geofinder/

Then each of the properties is an entry which has a longitude and latitude reference for the location.

Example search form:

{exp:geofinder:simple_form id="findhome" result_page="/home-search" class="group"}
    <fieldset>
        <legend>Search for a home</legend>
        <input type="hidden" name="radius" value="1000" />
        <label for="searchhome">Search for a home</label>
        <input type="text" name="geoquery" id="searchhome" class="required" title="Enter a search location" value="" />
        <button type="submit">Search</button>
    </fieldset>
{/exp:geofinder:simple_form}

Example results page:

{exp:geofinder:location_results channel="content" limit="6" geoquery="{segment_2}" radius="1000" latitude="latitude" longitude="longitude" disable="member_data|category_fields|trackbacks"}
    {if no_results}No results can be found for that location. Please try a different search term: either a postcode, city or town{/if}
        <div class="homeresult group">
            <div class="summary">
                <h2><a href="{page_uri}">{if alternative-title}{alternative-title}{if:else}{title}{/if} <em>{location-details}{town}, {county}{/location-details}</em></a></h2>
                <h3>{distance} miles from {exp:markup_master:replace find="+" replace=" "}{segment_2}{/exp:markup_master:replace} 
                    <a href="#?custom=true&width=600&height=400" rel="popup-map" class="button">Show on a map
                        <span class="longitude">{longitude}</span>
                        <span class="latitude">{latitude}</span>
                    </a>
                </h3>
                {if "{excerpt}"}{excerpt}{if:else}{exp:trunchtml chars="150" inline="..."}{content-text}{/exp:trunchtml}{/if}
            </div>
        </div><!--/.homeresult-->
{/exp:geofinder:location_results}

Update

The above example is where you prompt the user for a location, if you want to allow for mobile devices and automatically defaulting to the users location based on IP, you could use IPGeo http://devot-ee.com/add-ons/ipgeo. Although a great add-on, it does have a fair overhead and needs to be updated every few months to ensure all the latest IP address database.

On the initial search form you would add hidden fields like so:

{exp:ipgeo}
    <input type="hidden" name="user_lat" value="{latitude}">
    <input type="hidden" name="user_lng" value="{longitude}">

<input type="text" name="geoquery" id="searchhome" class="required" title="Enter a search location" value="{city}" />
{/exp:ipgeo}

I've only entered the automatic City entry above so that the user has something to submit to.

3
  • Thanks so much for your answer Peter. That certainly looks like it could do what I need, although the crucial part of the add-on (getting the users location) contains a broken link: The user_lat input is added to your form automatically. The purpose of the input is to allow for location aware searching. You must write your own Javascript code to populate this hidden input in order to use the functionality. Example iPhone usage (natural-logic.com/m) Any ideas where I might find some example code to get the users location and add to the fields? May 13, 2013 at 13:10
  • Added more to the solution description to accommodate mobile auto-location. May 13, 2013 at 14:02
  • Thanks again Peter for your update. Your solution sounds like a good one, although the need to manually update the IPGeo database is a slight concern. Saying that, you have answered my question perfectly so thanks again. May 13, 2013 at 15:32
1

I understand that the Google Maps for ExpressionEngine add-on is a go-to addon for "geofinding," based on this examples page in which there is a "store locator" example. As luck would have it, that particular example is borked right now (I get an "out of memory error" when I go to access the particular example).

It sounds like it would be worth it to write the developer, ask them about the add-on's compatibility with the latest EE version, and see if they can't fix the issue on the examples page so you can see how it performs.

I have this addon running on a site I'm using and I like it (it performs far better than other addons have, in my experience), but so far, I've only used it to display maps.

Rob

5
  • Thanks for the update on the memory issue, this is a new development on my server. I will look into this. And yes, Google Maps for EE is definitely what I would recommend in this case. It does so much more than Geocoder, I wouldn't recommend going down that route as someday in the future the client might as for a feature not available in Geofinder which is most likely already available in Google Maps for EE. May 13, 2013 at 14:01
  • You're assuming the original post author wanted to show results in a map (Although I do think showing properties on a map is a good thing!). Reading through the documentation of Google Maps for EE, it doesn't state that you could have an entry data pulled through to link the map to the entry or even show information about the entry (e.g. property for sale) or rollover. Also typically you would need to accommodate for postal code searching or city searching and not just rely on navigating a map. May 13, 2013 at 14:10
  • Thanks for the feedback. I will take a look at my docs and add that stuff, as you can do all that with Google Maps for EE (it's real easy). May 13, 2013 at 15:10
  • Thanks Rob for your suggestion. I am actually already using Google Maps for EE on the site to display maps for each property and it's working really well. I've also been speaking to Justin about whether this 'find properties near me' can be done using his add-on so I look forward to seeing what he comes up with. If he can find a way to do this it will certainly be the 'go-to' add-on for maps and EE. May 13, 2013 at 15:36
  • Looking forward to an update from @JustinKimbrell about making Google Maps for ExpressionEngine offer a 'find properties near me' solution. May 28, 2013 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.