<p>The example of <code>myFieldHandle</code> is just a placeholder for your actual field handle.</p>
<p>So if your Address field has a handle of <code>address</code>, it would look something like this...</p>
<pre><code>{% set entries = craft.entries.section('contractors').address(params).orderBy('distance') %}
</code></pre>

CC BY-SA 4.0
2020-10-14T22:25:42.290Z
2020-10-14T22:25:42.290Z
Lindsey D
<p>I am getting a Twig runtime error on the below. The map and everything else works when I remove <code>myFieldHandle(params).orderBy('distance')</code>.</p>
<p>Error:</p>
<pre><code>Calling unknown method: craft\elements\db\EntryQuery::myFieldHandle()
</code></pre>
<p>Code:</p>
<pre><code>{% set target = '90210' %}
{% set params = {
    target: target,
    range: 100
} %}

{% set entries = craft.entries.section('contractors').myFieldHandle(params).orderBy('distance') %}

{% set options = {
    height: 700,
    draggable: false,
    markerInfo: '_includes/mapInfoBubble',
    infoWindowOptions: {
        maxWidth: 250
    }
} %}
</code></pre>

<plugin-smartmap>
myFieldHandle error in Craft using Smart Map
# myFieldHandle error in Craft using Smart Map

(Asked by: username_0 on 2020-10-14)

I am getting a Twig runtime error on the below. The map and everything else works when I remove myFieldHandle(params).orderBy('distance').
Error:
Calling unknown method: craft\elements\db\EntryQuery::myFieldHandle()

Code:
{% set target = '90210' %}
{% set params = {
    target: target,
    range: 100
} %}

{% set entries = craft.entries.section('contractors').myFieldHandle(params).orderBy('distance') %}

{% set options = {
    height: 700,
    draggable: false,
    markerInfo: '_includes/mapInfoBubble',
    infoWindowOptions: {
        maxWidth: 250
    }
} %}

**Tags:** plugin-smartmap


---

## 1 answers

### Answer by username_1 on 2020-10-14. Score: 1

The example of myFieldHandle is just a placeholder for your actual field handle.
So if your Address field has a handle of address, it would look something like this...
{% set entries = craft.entries.section('contractors').address(params).orderBy('distance') %}


---

