<p dir="auto">Part of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2459415506" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5064" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5064/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5064">#5064</a>. I'm pulling it out because it's also required for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2354285020" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4900" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4900/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4900">#4900</a>.</p>
<p dir="auto">The noticeable difference after this PR should be geocoding request cancelling when leaving the directions page. Previously you could pick "Directions from/to here" then quickly close the directions form or go to any other map layout page. The geocoding request could terminate after that, placing an endpoint marker on the map despite not being on the directions page.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5095'>https://github.com/openstreetmap/openstreetmap-website/pull/5095</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/commits/06a315b7f7ae08c93833024ebb731c81752bb1d3" class="commit-link">06a315b</a>  Install endpoint listeners using enable/disable methods</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/commits/924f09f9b8168895c35acbe1d45361f84df4ccf0" class="commit-link">924f09f</a>  Remove endpoint markers in disable method</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/commits/ccbec6c3e6b6afe7bba8ab2f92ee9289ad367b01" class="commit-link">ccbec6c</a>  Replace geocode request boolean property with request object</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/files#diff-720e11d91a0c3a64a70dd6bfad46c242e9f4755b2470797031de5b55ff9a8c5d">app/assets/javascripts/index/directions-endpoint.js</a>
    (35)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095/files#diff-fdb9558c2ba79ddf9fbcb92594a8a8fa54abb1b3e25ce264de37951b428a958b">app/assets/javascripts/index/directions.js</a>
    (10)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5095.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5095.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5095.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5095.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5095">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOIJFRVKLIE5UHT7PDZSINMXAVCNFSM6AAAAABMYF2BESVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TGNZWGE3TMNA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLP45QL5JVVZV2MT6SDZSINMXA5CNFSM6AAAAABMYF2BESWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJG4U34Q.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5095</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5095",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5095",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>