0.0.3 • Published 10 years ago

leaflet.defaultextent v0.0.3

Weekly downloads
58
License
MIT
Repository
github
Last release
10 years ago

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

PropertyTypeDescription
titlestringTooltip title of the toggle button when mouse hover

Methods

MethodReturnsDescription
setCenter(LatLng center)thisSets the default center to new LatLng
setZoom( <Number> zoom )thisSets the default zoom level to a new level.
0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago