JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Latest commit bbfcfdc Dec 13, 2013



This is a simple extension of Leaflet.Control.Zoom that adds a change localization and zoom button above the zoom in and zoom out controls.

Checkout the demo.


Be sure to include the leaflet.viewcenter.js script somewhere after Leaflet is loaded.

<script src=""></script>

<link rel="stylesheet" href="leaflet.viecenter.css" />
<script src="leaflet.viewcenter.js"></script>

Do all your normal Leaflet initialization stuff, except make sure that you initialize the map without the default zoom controls:

<!-- map container -->
<div id="map"></div>

// init map
var map = new L.Map('map');

// init ViewCenter plugin
var viewCenter = new L.Control.ViewCenter();


This extension was built and tested for Leaflet version 0.6.4.

Bitdeli Badge