<p>One idea would have been to evaluate the referer header sent. However, it is always <code>Referer: http://www.openstreetmap.org/</code> (omitting the content after the hash).</p>

<p>The easiest solution would probably be to add the <code>layers</code> information from the hash to the remote control request?</p>

<div class="highlight highlight-diff"><pre><span class="pl-c1">diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js</span>
index 085b615..419ec73 100644
<span class="pl-md">--- a/app/assets/javascripts/index.js</span>
<span class="pl-mi1">+++ b/app/assets/javascripts/index.js</span>
<span class="pl-mdr">@@ -214,6 +214,7 @@</span> $(document).ready(function () {
         "https://127.0.0.1:8112/load_and_zoom?" :
         "http://127.0.0.1:8111/load_and_zoom?",
         query = {
<span class="pl-mi1">+          layers: '', // TODO obtain from location.hash</span>
           left: bbox.getWest() - 0.0001,
           top: bbox.getNorth() + 0.0001,
           right: bbox.getEast() + 0.0001,</pre></div>

<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/957#issuecomment-94093741">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLazVFOIMNrNknYXjLd9qkugewltkks5oAYplgaJpZM4EDAim.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/957#issuecomment-94093741"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>