<p>Here's a context menu implemented for the main map view. Fixes <a href="https://github.com/openstreetmap/openstreetmap-website/issues/251" class="issue-link" title="Add right click menu.">#251</a>. I think a context-menu click is a nice way to interact with the (relatively new) directions and query-here tools.</p>

<p>The exact choice of items is a matter that can be debated, but that aside, I'd like to ask if this approach seems broadly acceptable.</p>

<p>Notes:</p>

<ul>
<li>The browser's built-in context menu remains accessible, by holding shift while right-clicking.</li>
<li>The "Add note here" option adds it in not-quite the right place, unless you also merge <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1028" class="issue-link" title="Location of New Note marker: OK to centre it?">#1028</a> in which case it works correctly.</li>
<li>I haven't yet done the i18n - wanted to get dev feedback before I do that.</li>
</ul>

<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/1030'>https://github.com/openstreetmap/openstreetmap-website/pull/1030</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Import leaflet.contextmenu source files</li>
  <li>Implement context menu with: directions, add note, describe, centre.</li>
  <li>Add "Query features" to context menu</li>
  <li>Allow users to get default contextmenu on shift-click</li>
  <li>Enable/disable some context-menu options conditional on zoom</li>
  <li>tidier code</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1030/files#diff-0">app/assets/javascripts/index.js</a>
    (83)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1030/files#diff-1">app/assets/javascripts/leaflet.contextmenu.js</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1030/files#diff-2">app/assets/stylesheets/leaflet-all.scss</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1030/files#diff-3">app/assets/stylesheets/leaflet.contextmenu.css</a>
    (54)
  </li>
</ul>

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

<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/pull/1030">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLUnwb-NEKpDvbCIiGNDWp1VAhevcks5ol5YkgaJpZM4FoQbk.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/pull/1030"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>