Leaflet Default Extent button
JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist fix retina css Aug 30, 2014
example add 🍴 me Aug 26, 2014
src add jshint Aug 27, 2014
.gitignore ignore debug files Aug 26, 2014
.jshintrc add jshint Aug 27, 2014
LICENSE Initial commit Aug 25, 2014
README.md fix description Aug 27, 2014
gulpfile.js add jshint Aug 27, 2014
package.json bump version Sep 14, 2014

README.md

Leaflet.defaultextent

Adds a Default Extent button that returns to the original start extent of the map when clicked. Similar to the HomeButton widget.

Using the plugin

There are several ways to add the button to the map

  1. Add on initialize

      var map = L.map('map', {
        center: mapCenter,
        zoom: 14,
        defaultExtentControl: true
      });
  2. Direct

    L.control.defaultExtent()
      .addTo(map);

Options

Property Type Description
title string Tooltip title of the toggle button when mouse hover

Methods

Method Returns Description
setCenter(LatLng center) this Sets the default center to new LatLng
setZoom( <Number> zoom ) this Sets the default zoom level to a new level.