I am making a simple call to entries near a zip code using this url format:
example.com/locations-zip-ajax?near=93003
My template includes this code:
{% set target = craft.request.getParam('near') %}
{% set params = {
target: target|length ? target : 37212,
range: target|length ? 30 : 7000,
} %}
{% set locations = craft.entries.section('locationsFeed').address(params).order('distance').find() %}
{% for location in locations %}
//do some stuff
{% else %}
<li class="locations__item">
<h4>No results found</h4>
</li>
{% endfor %}
But no matter what zip code is entered, the results are always in the same order and the nearest entry is always 5,828.2 miles away even if the result entry's zip code is identical to the 'near' param.
I have ensured that my target param is being populated correctly and that my range param is working as well.