Skip to content
A Zoom Control Panel Of Leaflet.
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
doc
src feature: init commit May 23, 2019
.gitignore
LICENSE
package.json
readme.md feature: change readme. May 23, 2019

readme.md

Leaflet.ZoomPanel

A Zoom Panel Plugin Of Leaflet.

DEMO

Installation

Install via npm

npm install leaflet.zoompanel

Install Manually

Download L.Control.ZoomPanel.css and L.Control.ZoomPanel.js and include them in your project.

Include as ES6 Module

import "leaflet.zoompanel";
import "leaflet.zoompanel/src/L.Control.ZoomPanel.css";

Development

Install the needed dependencies:

npm install

Getting Started

var layer = L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", {
  attribution:
    '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});

// You can add the control via the settings object
var map = L.map("map", {
  layers: [layer]
}).setView([57.7, 11.9], 8);

new L.zoompanel({
  labels: [
    {
      zoom: 2,
      label: "X2"
    },
    {
      zoom: 4,
      label: "X4"
    },
    {
      zoom: 6,
      label: "X6"
    },
    {
      zoom: 8,
      label: "X8"
    },
    {
      zoom: 10,
      label: "X10"
    }
  ]
}).addTo(map);
You can’t perform that action at this time.