Filter locations by zip in Smart Map 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 %}
  &lt;li class="locations__item"&gt;
    &lt;h4&gt;No results found&lt;/h4&gt;
  &lt;/li&gt;

{% 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.
This turned out to be an issue with a misconfigured Google API key.
When setting up your Google API keys, make sure that:

Your domain is whitelisted (including any staging servers).
Your keys have granted permission to the necessary functionality.

Be sure to read the full instructions for how to set up your Google API keys.