All Projects → alanshaw → leaflet-zoom-min

alanshaw / leaflet-zoom-min

Licence: MIT license
The leaflet zoom control extended with a button to zoom out to min zoom

Programming Languages

javascript
184084 projects - #8 most used programming language

leaflet-zoom-min

A Leaflet control that extends L.Control.Zoom. It adds a button to the zoom control that allows you to zoom to the map minimum zoom level in a single click.

Zoom min control screenshot

Usage

Add leaflet-zoom-min JS and CSS to your page:

<link rel="stylesheet" href="L.Control.ZoomMin.css" media="screen">
<script src="L.Control.ZoomMin.js"></script>

Add the zoom min control to your map:

var map = L.map("map", {
  layers: L.tileLayer("http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png"),
  center: [51.505, -0.09],
  zoom: 3,
  minZoom: 2,
  maxZoom: 16,
  zoomControl: false
})

map.addControl(new L.Control.ZoomMin())
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].