• Stars
    star
    25
  • Rank 957,573 (Top 19 %)
  • Language
    JavaScript
  • License
    ISC License
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Zoom box control for Leaflet

Leaflet.ZoomBox

A zoom box control for Leaflet.

It allows you to draw an area on the map to zoom into. See the example.

Tested with Leaflet 1.1.

Install

From NPM:

npm install leaflet-zoombox

Usage

Include the CSS:

<link rel="stylesheet" href="L.Control.ZoomBox.css" />

Include the JavaScript:

<script src="L.Control.ZoomBox.min.js"></script>

This control uses Google Material Icons by default.

Example usage:

var options = {
    modal: true,
    title: "Box area zoom"
};
var control = L.control.zoomBox(options);
map.addControl(control);

Options:

  • modal: (boolean, default = false); if false, it deactivates after each use; if true, zoomBox control stays active until you click on the control again to deactivate options (like a toggle button)
  • position: (string, default = "topleft"); position of the control
  • title: (string, default = "Zoom to specific area") title attribute for the control
  • className: (string, default = "leaflet-zoom-box-icon") className of the control link, which you can use to override the default styling; the active class will also be toggled for this element, when the control is activated; you can also override the control container style by creating a new CSS rule for .leaflet-zoom-box-control
  • content: (string, default = "") html content to set as innerHTML of the control link; used in conjunction with the className option, you can use svg or html code to customize the control (see examples/customContent.html)
  • addToZoomControl: (bool, default = false) if true, it will attempt to add the control to the map's existing zoomControl container; if false, the control link will be placed in a its own container

Changes:

  • leaflet-zoom-box-icon className is now used for the control link; use of leaflet-zoom-box-control a {...} to style the control link in the CSS has been removed.

Credits:

Developed with support from the South Atlantic Landscape Conservation Cooperative, and maintained with support from Peninsular Florida LCC and the U.S. Forest Service Northwest Regional Climate Hub.

Binding to the map's zoom box (shift-click) was inspired by ScanEx

Contributors:

See Also:

L.Control.BoxZoom: an alternative implementation

More Repositories

1

mbtileserver

Basic Go server for mbtiles
Go
561
star
2

mbgl-renderer

Static renderer for Mapbox GL
JavaScript
201
star
3

tpkutils

ArcGIS Tile Package Utilities
Python
98
star
4

Leaflet.Basemaps

A tile driven basemaps control for Leaflet.
JavaScript
69
star
5

Leaflet.HtmlLegend

A simple Leaflet plugin for creating legends with HTML elements
HTML
54
star
6

pymbtiles

Python utilities for Mapbox mbtiles files
Python
38
star
7

Leaflet.Geonames

A GeoNames powered search control for Leaflet
JavaScript
35
star
8

Leaflet.UTFGrid

UTFGrids for Leaflet 1.0
JavaScript
19
star
9

gis-metadata-parser

Parser for GIS metadata standards including ArcGIS, FGDC and ISO-19115
Python
18
star
10

trefoil

Geospatial operations for NetCDF and numpy
Python
13
star
11

psmfc-pmep

West Coast Estuaries Explorer
JavaScript
12
star
12

Leaflet.Range

A simple HTML5 range control for Leaflet maps.
JavaScript
12
star
13

ncdjango

A NetCDF mapserver app for Django.
Python
10
star
14

Leaflet.Base64Legend

A simple Leaflet plugin for showing legends with base64 elements
HTML
7
star
15

L.Control.Shapefile

A shapefile uploading control for Leaflet
JavaScript
6
star
16

seedlot-selection-tool

A web-based spatial analysis and mapping tool that allows managers to find appropriate seedlots for a given planting site, given information about species, transfer limits, and historic and future climate projections across the landscape.
TypeScript
6
star
17

mpilot

MPilot is a plugin-based, environmental modeling framework
Python
5
star
18

seedsource

A web-based spatial analysis and mapping tool that allows managers to find appropriate seedlots for a given planting site, given information about species, transfer limits, and historic and future climate projections across the landscape.
5
star
19

seedsource-core

Core seedsource functionality underlying SST, CSRT, and others.
CSS
4
star
20

go-http-fileserver

Very simple Go based HTTP file server run from the command line
Go
4
star
21

tablo

A PostGIS table to feature service app for Django.
Python
3
star
22

landscapesim

A web API for running and modifying State and Transition Simulation models.
Python
3
star
23

restle

A REST client framework
Python
3
star
24

python-databasin

A client library for Data Basin (http://databasin.org)
Python
2
star
25

eems-pro

The Environmental Evaluation Modeling System (EEMS) is an evaluative fuzzy logic modeling system developed by the Conservation Biology Institute. EEMS Pro is an ArcGIS specific implementation of EEMS that allows for the visual construction of EEMS models using ESRI's ModelBuilder environment. EEMS Pro is compatible with both ArcGIS Pro and Desktop.
Python
2
star
26

addresser

Addresser parses and normalizes street addresses and intersections. It's a port of `parse-address` and `Geo::StreetAddress::US`.
Python
2
star
27

spht

Species Potential Habitat Tool
JavaScript
1
star
28

cookbook

CBI recipes, ideas, and lessons-by-example
HTML
1
star
29

EEMS

EEMS 2.0 Repo
Python
1
star
30

docker-python3.6-gdal2

Docker image with Python 3.6 and gdal2 installed
1
star
31

parserutils

A collection of performant parsing utilities
Python
1
star
32

CDT-CEQA-California-GIS

Data processing scripts for the CDT-CEQA Project
Python
1
star
33

sarp

Southeast Aquatic Barrier Prioritization Tool
JavaScript
1
star
34

Treatment-Planner-BETA

The Treatment Planner is a conservation strategy tool designed to help users prioritize forest management actions by connecting ArcGIS, FVS, and EEMS within a 4-Box decision making framework.
Python
1
star