Giter VIP home page Giter VIP logo

leaflet.sidepanel's Introduction

Leaflet.SidePanel

Slide side panel plugin for Leaflet.

How to use

Include leaflet-sidepanel.css and leaflet-sidepanel.js in your page:

<link rel="stylesheet" href="./dist/leaflet-sidepanel.css" />
<script src="./dist/leaflet-sidepanel.min.js"></script>

Options

  • panelPosition: 'left' (default) | 'right' [string]
  • hasTabs: true (default) | false [boolean]
  • tabsPosition: 'top' (default) | 'right' | 'bottom' | 'left' [string]
  • darkMode: true | false (default) [boolean]
  • pushControls: true | false (default) [boolean]
  • startTab: 1 (default) [number | string]

Example

Javascript

const panelRight = L.control.sidepanel('panelID', {
  panelPosition: 'right',
  hasTabs: false,
  tabsPosition: 'top',
  pushControls: true,
  darkMode: true,
  startTab: 'tab-5'
}).addTo(map);

Html

<div id="panelID" class="sidepanel" aria-label="side panel" aria-hidden="false">
  <div class="sidepanel-inner-wrapper">
    <nav class="sidepanel-tabs-wrapper" aria-label="sidepanel tab navigation">
      <ul class="sidepanel-tabs">
        <li class="sidepanel-tab">
          <a href="#" class="sidebar-tab-link" role="tab" data-tab-link="tab-1">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"  fill="currentColor">
              <path fill-rule="evenodd" />
            </svg>
          </a>
        </li>
        <!-- [...] -->
      </ul>
    </nav>
    <div class="sidepanel-content-wrapper">
      <div class="sidepanel-content">
        <div class="sidepanel-tab-content" data-tab-content="tab-1">
          <p>Content 1.</p>
        </div>
        <!-- [...] -->
      </div>
    </div>
  </div>
  <div class="sidepanel-toggle-container">
    <button class="sidepanel-toggle-button" type="button" aria-label="toggle side panel"></button>
  </div>
</div>

Requirements

Tested in leaflet 1.8.0

Links

Example Page

Leaflet

leaflet.sidepanel's People

Contributors

maxwell-ilai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.