<p>For full details, please refer to this post first: <a href="https://help.openstreetmap.org/questions/48088/what-makes-a-closed-way-show-up-as-an-enclosing-feature-with-query-features">https://help.openstreetmap.org/questions/48088/what-makes-a-closed-way-show-up-as-an-enclosing-feature-with-query-features</a></p>
<p><strong>How to reproduce:</strong> <a href="http://www.openstreetmap.org/query?lat=39.6181&lon=-74.5019#map=15/39.6176/-74.4857">http://www.openstreetmap.org/query?lat=39.6181&lon=-74.5019#map=15/39.6176/-74.4857</a></p>
<p>-> Although there are several enclosing features, none of them are shown. Javascript console shows the following error message: TypeError: t.bounds is undefined</p>
<div class="highlight highlight-source-c"><pre>[timeout:<span class="pl-c1">5</span>][out:json];is_in(<span class="pl-c1">39.6163</span>,-<span class="pl-c1">74.5054</span>)->.a;way(pivot.a);
out tags <span class="pl-en">geom</span>(<span class="pl-c1">39.59927344095099</span>,-<span class="pl-c1">74.5391035079956</span>,<span class="pl-c1">39.633324269501465</span>,-<span class="pl-c1">74.4717264175415</span>);relation(pivot.a);out tags bb;</pre></div>
<p>Overpass result:</p>
<pre><code> "type": "way",
"id": 33832747,
"geometry": [
...
null,
null,
null,
null
],
"tags": {
"area": "yes",
"boundary": "national_park",
"name": "Pinelands National Reserve"
}
},
</code></pre>
<p>Issue: Overpass API result doesn't include a <code>bounds</code> tags for way 33832747 - because all of it's nodes are outside the specified bounding box, so there's no meaningful bounding box which could be provided.</p>
<p>This triggers a javascript error in the following function, because t doesn't have a bounds element.</p>
<pre><code> function i(t, e) {
var n = t.bounds.maxlon - t.bounds.minlon
, o = t.bounds.maxlat - t.bounds.minlat
, a = n * o
, r = e.bounds.maxlat - e.bounds.minlat
, i = e.bounds.maxlat - e.bounds.minlat
, s = r * i;
return a - s
}
</code></pre>
<p>I'd suggest to filter out results without bounds to avoid the </p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1156">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLa0rdUVWZg51WR_muLFR_0ztQWk_ks5pk0NPgaJpZM4HbSi1.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/1156"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>