diff --git a/inst/doc/images/neotomaUML_as.svg b/inst/doc/images/neotomaUML_as.svg deleted file mode 100644 index 4fc1cc1..0000000 --- a/inst/doc/images/neotomaUML_as.svg +++ /dev/null @@ -1,2654 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/inst/doc/images/site_collunit_dataset.svg b/inst/doc/images/site_collunit_dataset.svg deleted file mode 100644 index 52bc876..0000000 --- a/inst/doc/images/site_collunit_dataset.svg +++ /dev/null @@ -1,616 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Site: Nath Sagar - Collection Unit 1 - Collection Unit 2 - - - - - Chronology - Chronology - - - - - - - AnalysisUnit - Sample - - - CharcoalDataset - - - - PollenDataset - - - - DiatomDataset - - diff --git a/inst/doc/images/siteboundarydiagram.svg b/inst/doc/images/siteboundarydiagram.svg deleted file mode 100644 index 7cfd59b..0000000 --- a/inst/doc/images/siteboundarydiagram.svg +++ /dev/null @@ -1,536 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - c. - - - - - - - - - - - - - - - - - b. - site - - - - - - - - - - a. - bounding box - site - - collection unit - - - diff --git a/inst/doc/images/siteshot.png b/inst/doc/images/siteshot.png deleted file mode 100644 index 7268347..0000000 Binary files a/inst/doc/images/siteshot.png and /dev/null differ diff --git a/inst/doc/images/understandingAgeRanges.svg b/inst/doc/images/understandingAgeRanges.svg deleted file mode 100644 index b2c889c..0000000 --- a/inst/doc/images/understandingAgeRanges.svg +++ /dev/null @@ -1,955 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Neotoma Dataset Age Range Searches - - - Time (calibrated ybp) - - - - - - - - - - 0 - 10000 - 5000 - 7500 - 2500 - - - - - - - - - We are looking for datasets/sites that span some specific point in time.• ageof: The dataset spans a range that includes ageof. - - ageof = NULLageof = 5000 (in all examples, empty circles are not selected)ageof = 1250 - - - - - - - - - - - - - - - - - - - - - Each rectange represents a dataset that spans an age range (x-axis). The filled circles at the end are used to represent the datasets in examples below.Dashed red lines represent ages used in the examples below. - - We are looking for datasets that completely span an age range.• ageyounger: Defines the minimum age that must be covered by the dataset.• ageolder: Defines the maximum age that must be covered by the dataset. - - ageyounger/ageolder = NULLageyounger = 5000, ageolder=7500ageyounger = 1250, ageolder = 2500 - - - - - - - - - - - - - - - - - - - - - We are looking for datasets with any samples that fall within an age bound.• minage: Defines the minimum age bound for searched datasets.• maxage: Defines the maximum age bound for searched datasets. - - minage/maxage = NULLminage = 5000, maxage=7500minage = 1250, maxage = 2500 - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/inst/doc/images/understanding_S4_structure.svg b/inst/doc/images/understanding_S4_structure.svg deleted file mode 100644 index f9062b2..0000000 --- a/inst/doc/images/understanding_S4_structure.svg +++ /dev/null @@ -1,604 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - diff --git a/inst/doc/images/understanding_S4_structure_get_datasets.svg b/inst/doc/images/understanding_S4_structure_get_datasets.svg deleted file mode 100644 index 1f98ac1..0000000 --- a/inst/doc/images/understanding_S4_structure_get_datasets.svg +++ /dev/null @@ -1,565 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - diff --git a/inst/doc/images/understanding_S4_structure_get_sites.svg b/inst/doc/images/understanding_S4_structure_get_sites.svg deleted file mode 100644 index c05cac6..0000000 --- a/inst/doc/images/understanding_S4_structure_get_sites.svg +++ /dev/null @@ -1,423 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - diff --git a/inst/doc/index.html b/inst/doc/index.html deleted file mode 100644 index b46bb28..0000000 --- a/inst/doc/index.html +++ /dev/null @@ -1,86 +0,0 @@ - -Articles • neotoma2 - - -
-
- - - -
-
- - -
-

All vignettes

-

- -
The neotoma2 R Package
-
-
-
-
- - -
- - - - - - - - diff --git a/inst/doc/neotoma2-package.html b/inst/doc/neotoma2-package.html deleted file mode 100644 index 670d26d..0000000 --- a/inst/doc/neotoma2-package.html +++ /dev/null @@ -1,8448 +0,0 @@ - - - - - - - - - - - - - - -The neotoma2 R Package - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The neotoma2 R Package

- - - -
-closeup of several Neotoma sites in the Caribbean. -
closeup of several Neotoma sites in the -Caribbean.
-
-
-

Neotoma Resources

-

The Neotoma Paleoecology -Database is a domain-specific data resource containing millions of -fossil records from around the globe, covering the last 5.4 million -years. The neotoma2 R package simplifies some of the data -structures and concepts to facilitate statistical analysis and -visualization. Users may wish to gain a deeper understanding of the -resource itself, or build more complex data objects and relationships. -For those users a partial list is provided here, including a table of -code examples focusing on different geographic regions, languages and -dataset types.

-
-

Resources

- -
-
-
-

Neotoma Data Structure

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - c. - - - - - - - - - - - - - - - - - b. - site - - - - - - - - - - a. - bounding box - site - - collection unit - - - -
Three panels showing context for Neotoma’s -geographic representation of sites. In panel a a site is defined by the -boundaries of a lake. The site also has a bounding box, and the core -location is defined by a collection unit within the site that is defined -with precise coordinates. In panel b a site is defined as a single -point, for example, from a textual reference indicating the site is at -the intersection of two roads. Here the site and collection unit share -the unique point location. In panel c we show how that site location may -be obfuscated using a bounding box as the site delimiter. In this case -the collection unit would not be defined (but is represented as the -triangle for illustration). Figure obtained from the Neotoma Database -Manual.
-
-

Data in Neotoma is associated with sites, specific locations with -lat/long coordinates. Within a site, there may be one or more collection -units – locations at which samples are physically collected -within the site. For example, an archaeological site -may have one or more collection units, pits within a -broader dig site; a pollen sampling site on a lake may -have multiple collection units – core sites within the -lake basin. Collection units may have higher resolution GPS locations, -but are considered to be part of the broader site. Within a -collection unit data is collected at various -[analysis units] from which samples -are obtained.

-

Because Neotoma is made up of a number of constituent databases -(e.g., the Indo-Pacific Pollen Database, NANODe, FAUNMAP), a set of -samples associated with a collection -unit are assigned to a single dataset -associated with a particular dataset type (e.g., -pollen, diatom, vertebrate fauna) and constituent -database.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Site: Nath Sagar - Collection Unit 1 - Collection Unit 2 - - - - - Chronology - Chronology - - - - - - - AnalysisUnit - Sample - - - CharcoalDataset - - - - PollenDataset - - - - DiatomDataset - - -
Figure. The structure of -sites, collection units and datasets within Neotoma. A site contains one -or more collection units. Chronologies are associated with collection -units. Data of a common type (pollen, diatoms, vertebrate fauna) are -assigned to a dataset.
-
-

Researchers often begin by searching for sites within a particular -study area, whether that is defined by geographic or political -boundaries. From there they interrogate the available datasets for their -particular dataset type of interest. When they find records of interest, -they will then often call for the data and associated chronologies.

-

The neotoma2 R package is intended to act as the -intermediary to support these research activities using the Neotoma -Paleoecology Database. Because R is not a relational database, we needed -to modify the data structures of the objects. To do this the package -uses a set of S4 objects to represent different elements within the -database.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A diagram showing the different major classes -within the neotoma2 R package, and the way the elements are -related to one another. Individual boxes represent the major classes -(sites, site, collectionunits, etc.). Each box then has a list of the -specific metadata contained within the class, and the variable type -(e.g., siteid: integer). Below these are the functions that can -be applied to the object (e.g., [[<-).
-
-

It is important to note, here and elsewhere: Almost -everything you will interact with is a sites -object. A sites object is the general currency of -this package. sites may have more or less metadata -associated with them, but they are the primary object, and, as you can -see in the diagram above, they have the most functions associated with -them.

-
-

Package Requirements

-

The earlier neotoma package tried to use base R as much -as possible. The neotoma2 package now draws primarily on -dplyr and purrr packages from the -tidyverse, and on the sf spatial data package. -The choice to integrate tidyverse packages was made largely -because of the current ubiquity of the tidyverse in R -education.

-
-
-
-

Site Searches

-

The highest level object in Neotoma is the site. -Sites have spatial coordinates and, in many cases, additional metadata -related to lake parameters, or other site-specific properties.

-

Sites can be searched using the get_sites() function, -or, can be created using the set_site() function. A single -site object is a special object in R, that can be combined -with other sites into a sites object. A sites -object is effectively a list() of site objects -with special methods for printing, plotting and exporting -information.

-
-

Finding Sites

-

All sites in Neotoma have a unique numeric identifier. With the -neotoma2 package you can search for a site using the -get_sites() function by its unique site id -(siteid), by name (sitename), by altitude -(altmin, altmax), by geopolitical name -(gpid), location (loc) or age bounds.

-

If we’re looking for a site and we know its specific identifier, we -can use the simplest implementation of get_sites(). Here we -are searching for a site (Alexander Lake), where we know that the siteid -for the record in Neotoma is 24. We can get these siteids -using the Neotoma -Explorer web application, or if we have some familiarity with the -site records already.

-
# Search for site by a single numeric ID:
-alex <- get_sites(24)
-alex
-#>  siteid       sitename      lat      long altitude
-#>      24 Alexander Lake 53.33333 -60.58333      143
-
-# Search for sites with multiple IDs using c():
-multiple_sites <- get_sites(c(24, 47))
-multiple_sites
-#>  siteid       sitename      lat      long altitude
-#>      24 Alexander Lake 53.33333 -60.58333      143
-#>      47        Liberty 43.52000 -90.78000      305
-

Once you search for a site, the neotoma2 R package makes -a call to the Neotoma Database, and returns a structured -sites object that contains metadata about the sites, and -some additional metadata about collection units and datasets at those -sites. This limited metadata helps speed up further searches, but is not -complete, for the purposes of analysis.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - -
The result of a hypothetical -get_sites() call, is a sites object containing -two individual site objects. Each site object -contains a collunits object with some limited metadata. The -top site appears to have two collection units, while the -lower site has only a single collection unit. Each of the top two -collection units appear to contain two datasets, while the bottom site -has only the one collection unit with only one dataset.
-
-
-

Searching for Sites by Name

-

Often we do not know the particular siteid. If we’re -looking for a site and we know its name or a part of its name, we can -search using the function with the sitename argument, -get_site(sitename = 'XXX'), where 'XXX' is the -site name. This does not support multiple text strings (i.e., you can’t -use c()).

-
alex <- get_sites(sitename = "Alexander Lake")
-alex
-#>  siteid       sitename      lat      long altitude
-#>      24 Alexander Lake 53.33333 -60.58333      143
-

Neotoma uses a Postgres Database to manage data. Postgres uses the -% sign as a general wildcard, so we can use the -% in the sitename argument operator to help us -find sites when we’re not sure the exact match. Note that the search is -case insensitive so a search for alex% or -Alex% will return the same results.

-
alex <- get_sites(sitename = 'Alex%')
-alex
-#>  siteid           sitename      lat      long altitude
-#>      24     Alexander Lake 53.33333 -60.58333      143
-#>      25        Alexis Lake 52.51667 -57.03333      200
-#>    4478 Alexander [3CN117] 35.25000 -92.61667       88
-#>   26226     Alexandra Lake 43.29030 -74.16966      354
- -
-
-

Searching for Sites by Age

-

There are several ways of searching for sites using age parameters. -These are represented below:

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - Neotoma Dataset Age Range Searches - - - Time (calibrated ybp) - - - - - - - - - - 0 - 10000 - 5000 - 7500 - 2500 - - - - - - - - - We are looking for datasets/sites that span some specific point in time.• ageof: The dataset spans a range that includes ageof. - - ageof = NULLageof = 5000 (in all examples, empty circles are not selected)ageof = 1250 - - - - - - - - - - - - - - - - - - - - - Each rectange represents a dataset that spans an age range (x-axis). The filled circles at the end are used to represent the datasets in examples below.Dashed red lines represent ages used in the examples below. - - We are looking for datasets that completely span an age range.• ageyounger: Defines the minimum age that must be covered by the dataset.• ageolder: Defines the maximum age that must be covered by the dataset. - - ageyounger/ageolder = NULLageyounger = 5000, ageolder=7500ageyounger = 1250, ageolder = 2500 - - - - - - - - - - - - - - - - - - - - - We are looking for datasets with any samples that fall within an age bound.• minage: Defines the minimum age bound for searched datasets.• maxage: Defines the maximum age bound for searched datasets. - - minage/maxage = NULLminage = 5000, maxage=7500minage = 1250, maxage = 2500 - - - - - - - - - - - - - - - - - - - - - - - - - -
Site searches using age parameters including -ageof, ageyoung, ageold, -maxage and minage.
-
-

We offer several methods of searching because different users have -different requirements. A user might be only interested in one specific -point in time in the past, for example the 8.2ka event. In this instance -they would search get_sites(ageof = 8200). They may want -sites with records that completely span a time period, for example the -Atlantic chronozone of the Holocene: -get_sites(ageyounger = 5000, ageolder = 8000). These sites -would have samples both within and outside the defined age range, so -that the user could track change into and out of the time period. A user -may also be interested in any record within a time bin, regardless of -whether the site spans that time zone or not. They would query -get_sites(minage = 5000, maxage = 8000).

-

We can see how these age bounds differ:

-
# Note, we are using the `all_data = TRUE` flag here to avoid the default limit of 25 records, discussed below.
-# Because these queries are searching through every record they are slow and and are not
-# run in knitting this vignette.
-get_sites(ageof = 8200, all_data = TRUE) %>% length()
-get_sites(ageyounger = 5000, ageolder = 8000, all_data = TRUE) %>% length()
-get_sites(minage = 5000, maxage = 8000, all_data = TRUE) %>% length()
-

It is possible to pass all parameters (ageof, -minage, maxage, ageyounger, . . . -), but it is likely that these will conflict and result in an empty set -of records. To avoid this, be aware of the relationships among these -search parameters, and how they might affect your search window.

-
-
-
-

Accessing sites metadata

-

Although the sites are structured using S4 objects (see -Hadley Wickham’s S4 -documentation), we’ve added helper functions to make accessing -elements easier for users.

-

The alex object is composed of several smaller objects -of class site. We can call any individual site using -[[ ]], placing the index of the desired object between the -brackets. Then we can also call the particular variable we want using -the $ symbol.

-
alex <- get_sites(sitename = "Alexander Lake")
-alex[[1]]$siteid
-#> [1] 24
-

The elements within a site are the same as the defined -columns within the Neotoma ndb.sites -table, with the exception of the collunits slot, which -contains the collection units and associated datasets that are found -within a site. You can see all the site slots using the -names() function. You can select individual elements of a -site, and you can assign values to these parameters:

-
names(alex[[1]])
-#> [1] "siteid"       "sitename"     "geography"    "altitude"     "geopolitical"
-#> [6] "area"         "notes"        "description"  "collunits"
-
-# Modify a value using $<- assignment:
-alex[[1]]$area
-#> [1] NA
-alex[[1]]$area <- 100
-alex[[1]]$area
-#> [1] 100
-
-# Modify a value using [<- assignment:
-alex[[1]]["area"] <- 30
-# alex[[1]][7] <- 30  This fails because the `Notes` field expects a character string.
-

Using assignment, we can add information programmatically, for -example, by working interactively with a digital elevation model or -hydrographic data to obtain lake area measurements. Although not -currently implemented, the goal is to support direct upload of updated -information by users.

-
-
-

Creating a Site

-

As explained above, a site is the fundamental unit of -the Neotoma Database. If you are working with your own data, you might -want to create a site object to allow it to interact with -other data within Neotoma. You can create a site with the -set_site() function. It will ask you to provide important -information such as sitename, lat, and -long attributes.

-
my_site <- set_site(sitename = "My Lake", 
-                    geography = st_sf(a = 3, st_sfc(st_point(1:2))), 
-                    description = "my lake", 
-                    altitude = 30)
-my_site
-#>                                siteid sitename lat long altitude
-#>  24fcaf8f-239a-4c40-a221-c6e33f270404  My Lake   2    1       30
-

If we have a set of sites that we are analyzing, we can add the new -site to the set of sites, either by appending it to the end, using -c(), or by replacing a particular element using -[[<-.

-

This method allows us to begin modifying site information for -existing sites if we have updated knowledge about site properties.

-
# Add a new site that's been edited using set_site()
-longer_alex <- c(alex, my_site)
-# Or replace an element within the existing list of sites
-# with the newly created site.
-longer_alex[[2]] <- my_site
-
-# Or append to the `sites` list with assignment:
-longer_alex[[3]] <- my_site
-

We can also use set_sites() as a tool to update the -metadata associated with an existing site object:

-
# Update a value within an existing `sites` object:
-longer_alex[[3]] <- set_site(longer_alex[[3]],
-  altitude = 3000)
-longer_alex
-
-
-
-

Datasets

-

If you need to get to a deeper level of the sites object, you may -want to look at the get_datasets() function. You can use -get_datasets() using search parameters, or you can use it -on an existing sites object, such as our prior -alex dataset.

-

get_datasets() adds additional metadata to the -site objects, letting us know which -datasettypes are associated with a site, and the dataset -sample locations at the site.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - -
Using get_datasets() provides more -complete metadata about a record, including the addition of -chronological information, and more complete metadata about the -datasets, compared to the get_sites() call, shown above. -The objects here are the same as above, but now have chronology -metadata, and contact metadata for the records. Note that there is still -no sample or taxonomic information about these records. This comes from -the get_downloads() function.
-
-

Getting the datasets by id is the easiest call, you can also pass a -vector of IDs or, if you already have a sites object, you -can pass a sites object.

-
# Getting datasets by ID
-my_datasets <- get_datasets(c(5, 10, 15, 20))
-my_datasets
-#>  siteid                   sitename       lat      long altitude
-#>       5                       17/2  55.25000 -74.93333      335
-#>      10 Site 1 (Cohen unpublished)  30.83000 -82.33000       37
-#>      15                    Aguilar -23.83333 -65.75000     4000
-#>      20                   Akuvaara  69.12326  27.67406      170
-

You can also retrieve datasets by type directly from the API.

-
# Getting datasets by type
-my_pollen_datasets <- get_datasets(datasettype = "pollen", limit = 25)
-my_pollen_datasets
-#>  siteid                            sitename       lat       long altitude
-#>       7                     Three Pines Bog  47.00000  -80.11667      294
-#>       8                 Abalone Rocks Marsh  33.95639 -119.97667        0
-#>       9                              Adange  43.30556   41.33333     1750
-#>      11        Konus Exposure, Adycha River  67.75000  135.58333      130
-#>      12                       Ageröds Mosse  55.93329   13.42559       58
-#>      13                     Aguas Calientes -23.08333  -67.40000     4210
-#>      14                   Aguas Calientes 2 -23.50000  -67.58333     4210
-#>      15                             Aguilar -23.83333  -65.75000     4000
-#>      16                           Ahlenmoor  53.69908    8.74688        2
-#>      17                               Ajata -18.25000  -69.20000     4700
-#>      18                    South Soefje Bog  29.60000  -97.51694       97
-#>      19             Akulinin Exposure P1282  47.11667  138.55000       20
-#>      20                            Akuvaara  69.12326   27.67406      170
-#>      21 Alazeya River Exposure, 8 m Terrace  68.50000  154.50000       40
-#>      22 Alazeya River Exposure, 9 m Terrace  64.33333  154.50000       40
-#>      24                      Alexander Lake  53.33333  -60.58333      143
-#>      25                         Alexis Lake  52.51667  -57.03333      200
-#>      27                          Aliuk Pond  54.58333  -57.36667       25
-#>      29                          Lake Allie  44.80156  -94.55982      328
-#>      30                         Almora Lake  46.20611  -95.29361      437
-#>      31                           Alut Lake  60.13667  152.31278      480
-#>      32                             Amarete -15.23333  -68.98333     4000
-#>      33             Amba River Exposure 596  43.31667  131.81667        5
-#>      68     Amguema River Valley Exposure 1  67.75000  178.70000      175
-#>      69     Amguema River Valley Exposure 2  67.66667  178.60000       87
-

It can be computationally intensive to obtain the full set of records -for sites or datasets. By default the -limit for all queries is 25. The default -offset is 0. To capture all results we can use -the all_data = TRUE flag in our calls. -However, this is hard on the Neotoma servers. We tend -to prefer that users use all_data = TRUE once their -analytic workflow is mostly complete.

-

We can use that all_data = TRUE in R in the following -way:

-
allSites_dt <- get_sites(datasettype = "diatom")
-allSites_dt_all <- get_sites(datasettype = "diatom", all_data = TRUE)
-
-# Because we used the `all_data = TRUE` flag, there will be more sites
-# in allSites_dt_all, because it represents all sites containing diatom datasets.
-length(allSites_dt_all) > length(allSites_dt)
-
-

Spatial Searches

-

You can get the coordinates to create a GeoJson bounding box from here, or you can use -pre-existing objects within R, for example, country-level data within -the spData package:

-

Accessing datasets by bounding box:

-
brazil <- '{"type": "Polygon", 
-            "coordinates": [[
-                [-73.125, -9.102],
-                [-56.953, -33.138],
-                [-36.563, -7.711],
-                [-68.203, 13.923],
-                [-73.125, -9.102]
-              ]]}'
-
-# We can make the geojson a spatial object if we want to use the
-# functionality of the `sf` package.
-brazil_sf <- geojsonsf::geojson_sf(brazil)
-
-brazil_datasets <- get_datasets(loc = brazil_sf)
-brazil_datasets
-#>  siteid                   sitename       lat      long altitude
-#>      32                    Amarete -15.23333 -68.98333     4000
-#>     211             Lago do Aquiri  -3.16667 -44.98333       10
-#>     323                 Cala Conto -17.56667 -65.93333     2700
-#>     347               Chacaltaya 1 -16.36667 -68.15000     4750
-#>     348               Chacaltaya 2 -16.36667 -68.15000     4350
-#>     523             Cumbre Unduavi -16.35000 -68.04167     4620
-#>     532            Lagoa das Patas   0.26667 -66.68333      300
-#>     843        Serra Campos Gerais -24.66667 -50.21667     1200
-#>    1406                  Katantica -14.80000 -69.18333     4820
-#>    1994                 Río Kaluyo -16.43333 -68.13333     4070
-#>    2827                  Wasa Mayu -17.53333 -65.81667     2720
-#>    9685              Laguna Granja -13.26341 -63.71025      138
-#>    9686             Laguna Orícore -13.34833 -63.52796      139
-#>   11923              Lake Valencia  10.16576 -67.76755      410
-#>   13964              Lake Chalalán -14.42868 -67.92125      330
-#>     526            Lagoa da Curuça  -0.76667 -47.85000       35
-#>    1717               Monte Blanco -17.02500 -67.35000     4780
-#>    2248 Lagoa Campestre de Salitre -19.00000 -46.76667      980
-#>   11877              Lake Consuelo -13.95125 -68.99162     1333
-

Now we have an object called brazil_datasets that -contains 19.

-

You can plot these findings!

-
plotLeaflet(brazil_datasets)
-
- -
-
-
-

Filtering Records

-

Sometimes we take a large number of records, do some analysis, and -then choose to select a subset. For example, we may want to select all -sites in a region, and then subset those by dataset type. If we want to -look at only the geochronological datasets from Brazil, we can start -with the set of records returned from our get_datasets() -query, and then use the filter function in -neotoma2 to select only those datasets that are -geochronologic:

-
brazil_dates <- neotoma2::filter(brazil_datasets,
-  datasettype == "geochronologic")
-
-# or:
-
-brazil_dates <- brazil_datasets %>%
-  neotoma2::filter(datasettype == "geochronologic")
-
-# With boolean operators:
-
-brazil_space <- brazil_datasets %>% neotoma2::filter(lat > -18 & lat < -16)
-

The filter() function takes as the first argument, a -datasets object, followed by the criteria we want to use to filter. -Current supported criteria includes:

- -

You also need to make sure that you accompany any of these terms with -the following boolean operators: <, > or -==, !=. datasettype has to be of -type string, while the other terms must be numeric. If you need to -filter by the same argument, let’s say, you need to filter -“geochronologic” and “pollen data types, then you will also make use of -& and | operators.

-
-
-

Sample and Taxonomic data

-

Once we have the set of records we wish to examine, we then want to -recover the actual sample data. This will provide us with information -about the kinds of elements found at the site, within the dataset, their -sample ages, and their counts or measurements. To do this we use the -get_downloads() call. Note, as before, we are returning a -sites objects, but this time with the most complete -metadata.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sites - - - - site - - - - collunits - - - - collunit - - - - chronologies - - - - chronology - - - - contacts - - - - contact - - - - datasets - - - - samples - - - - dataset - - - - -
Using get_downloads() returns a -sites object, but one that contains dataset objects with -filled samples slots. The samples slot is -often very large relative to the other metadata associated with -sites, and so it is commonly held back until a direct -request is provided. Helper functions at the sites level -can pull out sample data once get_downloads() -has been called.
-
-

Assuming we continue with our example from Brazil, we want to extract -records from the country, filter to only pollen records with samples -covering the last 10,000 years, and then look at the relative frequency -of taxa across sites. We might do something like this:

-
brazil <- '{"type": "Polygon", 
-            "coordinates": [[
-                [-73.125, -9.102],
-                [-56.953, -33.138],
-                [-36.563, -7.711],
-                [-68.203, 13.923],
-                [-73.125, -9.102]
-              ]]}'
-
-# We can make the geojson a spatial object if we want to use the
-# functionality of the `sf` package.
-brazil_sf <- geojsonsf::geojson_sf(brazil)
-
-brazil_records <- get_datasets(loc = brazil_sf) %>%
-  neotoma2::filter(datasettype == "pollen" & age_range_young <= 1000 & age_range_old >= 10000) %>%
-  get_downloads(verbose = FALSE)
-
-count_by_site <- samples(brazil_records) %>%
-  dplyr::filter(elementtype == "pollen" & units == "NISP") %>%
-  group_by(siteid, variablename) %>%
-  summarise(n = n()) %>%
-  group_by(variablename) %>%
-  summarise(n = n()) %>%
-  arrange(desc(n))
-#> `summarise()` has grouped output by 'siteid'. You can override using the
-#> `.groups` argument.
-

In this code chunk we define the bounding polygon for our sites, -filter by time and dataset type, and then return the full records for -those sites. We get a sites object with dataset and sample -information (because we used get_downloads()). We execute -the samples() function to extract all the samples from the -sites objects, and then filter the resulting -data.frame to pull only pollen (a pollen dataset may -contain spores and other elements that are not, strictly speaking, -pollen) that are counted using the number of identified specimens (or -NISP). We then group_by() the unique site identifiers -(siteid) and the taxa (variablename) to get a -count of the number of times each taxon appears in each site. We then -want to summarize() to a higher level, just trying to -understand how many sites each taxon appears in. After that we -arrange() so that the records show the most common taxa -first in the resulting variable count_by_site.

-
-
-

Publications

-

Many Neotoma records have publications associated with them. The -publication object (and the publications -collection) provide the opportunity to do this. The publication -table in Neotoma contains an extensive number of fields. The methods for -publications in the neotoma2 package provide -us with tools to retrieve publication data from Neotoma, to set and -manipulate publication data locally, and to retrieve publication data -from external sources (e.g., using a DOI).

-
-

get_publications() from Neotoma

-

The most simple case is a search for a publication based on one or -more publication IDs. Most people do not know the unique publication ID -of individual articles, but this provides a simple method to highlight -the way Neotoma retrieves and presents publication information.

-
-

Get Publication By ID

-

We can use a single publication ID or multiple IDs. In either case -the API returns the publication(s) and creates a new -publications object (which consists of multiple individual -publications).

-
one <- get_publications(12)
-two <- get_publications(c(12, 14))
-

From there we can then then subset and extract elements from the list -using the standard [[ format. For example:

-
two[[2]]
-#>   publicationid
-#> 1            14
-#>                                                                                                                                                                                                      citation
-#> 1 Baker, R.G., R.S. Rhodes II, D.P. Schwert, A.C. Ashworth, T.J. Frest, G.R. Hallberg, and J.A. Janssens. 1986. A full- glacial biota from southeastern Iowa, USA. Journal of Quaternary Science 1(2):91-107.
-#>                      doi
-#> 1 10.1002/jqs.3390010202
-

Will return the second publication in the list, corresponding to the -publication with publicationid 14 in this case.

-
- -
-

Create (or Import) New Publications

-

Just as we can use the set_sites() function to set new -site information, we can also create new publication information using -set_publications(). With set_publications() -you can enter as much or as little of the article metadata as you’d -like, but it’s designed (in part) to use the CrossRef API to return -information from a DOI.

-
new_pub <- set_publications(
-  articletitle = "Myrtle Lake: a late- and post-glacial pollen diagram from northern Minnesota",
-  journal = "Canadian Journal of Botany",
-  volume = 46)
-

A publication has a large number of slots that can be -defined. These may be left blank, they may be set directly after the -publication is defined:

-
new_pub@pages <- "1397-1410"
-
-
-
-
-

Workshops and Code Examples

- -
- - - - - - - - - - - diff --git a/inst/doc/neotoma2-package_files/Proj4Leaflet-1.0.1/proj4leaflet.js b/inst/doc/neotoma2-package_files/Proj4Leaflet-1.0.1/proj4leaflet.js deleted file mode 100644 index eaa650c..0000000 --- a/inst/doc/neotoma2-package_files/Proj4Leaflet-1.0.1/proj4leaflet.js +++ /dev/null @@ -1,272 +0,0 @@ -(function (factory) { - var L, proj4; - if (typeof define === 'function' && define.amd) { - // AMD - define(['leaflet', 'proj4'], factory); - } else if (typeof module === 'object' && typeof module.exports === "object") { - // Node/CommonJS - L = require('leaflet'); - proj4 = require('proj4'); - module.exports = factory(L, proj4); - } else { - // Browser globals - if (typeof window.L === 'undefined' || typeof window.proj4 === 'undefined') - throw 'Leaflet and proj4 must be loaded first'; - factory(window.L, window.proj4); - } -}(function (L, proj4) { - if (proj4.__esModule && proj4.default) { - // If proj4 was bundled as an ES6 module, unwrap it to get - // to the actual main proj4 object. - // See discussion in https://github.com/kartena/Proj4Leaflet/pull/147 - proj4 = proj4.default; - } - - L.Proj = {}; - - L.Proj._isProj4Obj = function(a) { - return (typeof a.inverse !== 'undefined' && - typeof a.forward !== 'undefined'); - }; - - L.Proj.Projection = L.Class.extend({ - initialize: function(code, def, bounds) { - var isP4 = L.Proj._isProj4Obj(code); - this._proj = isP4 ? code : this._projFromCodeDef(code, def); - this.bounds = isP4 ? def : bounds; - }, - - project: function (latlng) { - var point = this._proj.forward([latlng.lng, latlng.lat]); - return new L.Point(point[0], point[1]); - }, - - unproject: function (point, unbounded) { - var point2 = this._proj.inverse([point.x, point.y]); - return new L.LatLng(point2[1], point2[0], unbounded); - }, - - _projFromCodeDef: function(code, def) { - if (def) { - proj4.defs(code, def); - } else if (proj4.defs[code] === undefined) { - var urn = code.split(':'); - if (urn.length > 3) { - code = urn[urn.length - 3] + ':' + urn[urn.length - 1]; - } - if (proj4.defs[code] === undefined) { - throw 'No projection definition for code ' + code; - } - } - - return proj4(code); - } - }); - - L.Proj.CRS = L.Class.extend({ - includes: L.CRS, - - options: { - transformation: new L.Transformation(1, 0, -1, 0) - }, - - initialize: function(a, b, c) { - var code, - proj, - def, - options; - - if (L.Proj._isProj4Obj(a)) { - proj = a; - code = proj.srsCode; - options = b || {}; - - this.projection = new L.Proj.Projection(proj, options.bounds); - } else { - code = a; - def = b; - options = c || {}; - this.projection = new L.Proj.Projection(code, def, options.bounds); - } - - L.Util.setOptions(this, options); - this.code = code; - this.transformation = this.options.transformation; - - if (this.options.origin) { - this.transformation = - new L.Transformation(1, -this.options.origin[0], - -1, this.options.origin[1]); - } - - if (this.options.scales) { - this._scales = this.options.scales; - } else if (this.options.resolutions) { - this._scales = []; - for (var i = this.options.resolutions.length - 1; i >= 0; i--) { - if (this.options.resolutions[i]) { - this._scales[i] = 1 / this.options.resolutions[i]; - } - } - } - - this.infinite = !this.options.bounds; - - }, - - scale: function(zoom) { - var iZoom = Math.floor(zoom), - baseScale, - nextScale, - scaleDiff, - zDiff; - if (zoom === iZoom) { - return this._scales[zoom]; - } else { - // Non-integer zoom, interpolate - baseScale = this._scales[iZoom]; - nextScale = this._scales[iZoom + 1]; - scaleDiff = nextScale - baseScale; - zDiff = (zoom - iZoom); - return baseScale + scaleDiff * zDiff; - } - }, - - zoom: function(scale) { - // Find closest number in this._scales, down - var downScale = this._closestElement(this._scales, scale), - downZoom = this._scales.indexOf(downScale), - nextScale, - nextZoom, - scaleDiff; - // Check if scale is downScale => return array index - if (scale === downScale) { - return downZoom; - } - if (downScale === undefined) { - return -Infinity; - } - // Interpolate - nextZoom = downZoom + 1; - nextScale = this._scales[nextZoom]; - if (nextScale === undefined) { - return Infinity; - } - scaleDiff = nextScale - downScale; - return (scale - downScale) / scaleDiff + downZoom; - }, - - distance: L.CRS.Earth.distance, - - R: L.CRS.Earth.R, - - /* Get the closest lowest element in an array */ - _closestElement: function(array, element) { - var low; - for (var i = array.length; i--;) { - if (array[i] <= element && (low === undefined || low < array[i])) { - low = array[i]; - } - } - return low; - } - }); - - L.Proj.GeoJSON = L.GeoJSON.extend({ - initialize: function(geojson, options) { - this._callLevel = 0; - L.GeoJSON.prototype.initialize.call(this, geojson, options); - }, - - addData: function(geojson) { - var crs; - - if (geojson) { - if (geojson.crs && geojson.crs.type === 'name') { - crs = new L.Proj.CRS(geojson.crs.properties.name); - } else if (geojson.crs && geojson.crs.type) { - crs = new L.Proj.CRS(geojson.crs.type + ':' + geojson.crs.properties.code); - } - - if (crs !== undefined) { - this.options.coordsToLatLng = function(coords) { - var point = L.point(coords[0], coords[1]); - return crs.projection.unproject(point); - }; - } - } - - // Base class' addData might call us recursively, but - // CRS shouldn't be cleared in that case, since CRS applies - // to the whole GeoJSON, inluding sub-features. - this._callLevel++; - try { - L.GeoJSON.prototype.addData.call(this, geojson); - } finally { - this._callLevel--; - if (this._callLevel === 0) { - delete this.options.coordsToLatLng; - } - } - } - }); - - L.Proj.geoJson = function(geojson, options) { - return new L.Proj.GeoJSON(geojson, options); - }; - - L.Proj.ImageOverlay = L.ImageOverlay.extend({ - initialize: function (url, bounds, options) { - L.ImageOverlay.prototype.initialize.call(this, url, null, options); - this._projectedBounds = bounds; - }, - - // Danger ahead: Overriding internal methods in Leaflet. - // Decided to do this rather than making a copy of L.ImageOverlay - // and doing very tiny modifications to it. - // Future will tell if this was wise or not. - _animateZoom: function (event) { - var scale = this._map.getZoomScale(event.zoom); - var northWest = L.point(this._projectedBounds.min.x, this._projectedBounds.max.y); - var offset = this._projectedToNewLayerPoint(northWest, event.zoom, event.center); - - L.DomUtil.setTransform(this._image, offset, scale); - }, - - _reset: function () { - var zoom = this._map.getZoom(); - var pixelOrigin = this._map.getPixelOrigin(); - var bounds = L.bounds( - this._transform(this._projectedBounds.min, zoom)._subtract(pixelOrigin), - this._transform(this._projectedBounds.max, zoom)._subtract(pixelOrigin) - ); - var size = bounds.getSize(); - - L.DomUtil.setPosition(this._image, bounds.min); - this._image.style.width = size.x + 'px'; - this._image.style.height = size.y + 'px'; - }, - - _projectedToNewLayerPoint: function (point, zoom, center) { - var viewHalf = this._map.getSize()._divideBy(2); - var newTopLeft = this._map.project(center, zoom)._subtract(viewHalf)._round(); - var topLeft = newTopLeft.add(this._map._getMapPanePos()); - - return this._transform(point, zoom)._subtract(topLeft); - }, - - _transform: function (point, zoom) { - var crs = this._map.options.crs; - var transformation = crs.transformation; - var scale = crs.scale(zoom); - - return transformation.transform(point, scale); - } - }); - - L.Proj.imageOverlay = function (url, bounds, options) { - return new L.Proj.ImageOverlay(url, bounds, options); - }; - - return L.Proj; -})); diff --git a/inst/doc/neotoma2-package_files/htmlwidgets-1.5.4/htmlwidgets.js b/inst/doc/neotoma2-package_files/htmlwidgets-1.5.4/htmlwidgets.js deleted file mode 100644 index da8b236..0000000 --- a/inst/doc/neotoma2-package_files/htmlwidgets-1.5.4/htmlwidgets.js +++ /dev/null @@ -1,903 +0,0 @@ -(function() { - // If window.HTMLWidgets is already defined, then use it; otherwise create a - // new object. This allows preceding code to set options that affect the - // initialization process (though none currently exist). - window.HTMLWidgets = window.HTMLWidgets || {}; - - // See if we're running in a viewer pane. If not, we're in a web browser. - var viewerMode = window.HTMLWidgets.viewerMode = - /\bviewer_pane=1\b/.test(window.location); - - // See if we're running in Shiny mode. If not, it's a static document. - // Note that static widgets can appear in both Shiny and static modes, but - // obviously, Shiny widgets can only appear in Shiny apps/documents. - var shinyMode = window.HTMLWidgets.shinyMode = - typeof(window.Shiny) !== "undefined" && !!window.Shiny.outputBindings; - - // We can't count on jQuery being available, so we implement our own - // version if necessary. - function querySelectorAll(scope, selector) { - if (typeof(jQuery) !== "undefined" && scope instanceof jQuery) { - return scope.find(selector); - } - if (scope.querySelectorAll) { - return scope.querySelectorAll(selector); - } - } - - function asArray(value) { - if (value === null) - return []; - if ($.isArray(value)) - return value; - return [value]; - } - - // Implement jQuery's extend - function extend(target /*, ... */) { - if (arguments.length == 1) { - return target; - } - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var prop in source) { - if (source.hasOwnProperty(prop)) { - target[prop] = source[prop]; - } - } - } - return target; - } - - // IE8 doesn't support Array.forEach. - function forEach(values, callback, thisArg) { - if (values.forEach) { - values.forEach(callback, thisArg); - } else { - for (var i = 0; i < values.length; i++) { - callback.call(thisArg, values[i], i, values); - } - } - } - - // Replaces the specified method with the return value of funcSource. - // - // Note that funcSource should not BE the new method, it should be a function - // that RETURNS the new method. funcSource receives a single argument that is - // the overridden method, it can be called from the new method. The overridden - // method can be called like a regular function, it has the target permanently - // bound to it so "this" will work correctly. - function overrideMethod(target, methodName, funcSource) { - var superFunc = target[methodName] || function() {}; - var superFuncBound = function() { - return superFunc.apply(target, arguments); - }; - target[methodName] = funcSource(superFuncBound); - } - - // Add a method to delegator that, when invoked, calls - // delegatee.methodName. If there is no such method on - // the delegatee, but there was one on delegator before - // delegateMethod was called, then the original version - // is invoked instead. - // For example: - // - // var a = { - // method1: function() { console.log('a1'); } - // method2: function() { console.log('a2'); } - // }; - // var b = { - // method1: function() { console.log('b1'); } - // }; - // delegateMethod(a, b, "method1"); - // delegateMethod(a, b, "method2"); - // a.method1(); - // a.method2(); - // - // The output would be "b1", "a2". - function delegateMethod(delegator, delegatee, methodName) { - var inherited = delegator[methodName]; - delegator[methodName] = function() { - var target = delegatee; - var method = delegatee[methodName]; - - // The method doesn't exist on the delegatee. Instead, - // call the method on the delegator, if it exists. - if (!method) { - target = delegator; - method = inherited; - } - - if (method) { - return method.apply(target, arguments); - } - }; - } - - // Implement a vague facsimilie of jQuery's data method - function elementData(el, name, value) { - if (arguments.length == 2) { - return el["htmlwidget_data_" + name]; - } else if (arguments.length == 3) { - el["htmlwidget_data_" + name] = value; - return el; - } else { - throw new Error("Wrong number of arguments for elementData: " + - arguments.length); - } - } - - // http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex - function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } - - function hasClass(el, className) { - var re = new RegExp("\\b" + escapeRegExp(className) + "\\b"); - return re.test(el.className); - } - - // elements - array (or array-like object) of HTML elements - // className - class name to test for - // include - if true, only return elements with given className; - // if false, only return elements *without* given className - function filterByClass(elements, className, include) { - var results = []; - for (var i = 0; i < elements.length; i++) { - if (hasClass(elements[i], className) == include) - results.push(elements[i]); - } - return results; - } - - function on(obj, eventName, func) { - if (obj.addEventListener) { - obj.addEventListener(eventName, func, false); - } else if (obj.attachEvent) { - obj.attachEvent(eventName, func); - } - } - - function off(obj, eventName, func) { - if (obj.removeEventListener) - obj.removeEventListener(eventName, func, false); - else if (obj.detachEvent) { - obj.detachEvent(eventName, func); - } - } - - // Translate array of values to top/right/bottom/left, as usual with - // the "padding" CSS property - // https://developer.mozilla.org/en-US/docs/Web/CSS/padding - function unpackPadding(value) { - if (typeof(value) === "number") - value = [value]; - if (value.length === 1) { - return {top: value[0], right: value[0], bottom: value[0], left: value[0]}; - } - if (value.length === 2) { - return {top: value[0], right: value[1], bottom: value[0], left: value[1]}; - } - if (value.length === 3) { - return {top: value[0], right: value[1], bottom: value[2], left: value[1]}; - } - if (value.length === 4) { - return {top: value[0], right: value[1], bottom: value[2], left: value[3]}; - } - } - - // Convert an unpacked padding object to a CSS value - function paddingToCss(paddingObj) { - return paddingObj.top + "px " + paddingObj.right + "px " + paddingObj.bottom + "px " + paddingObj.left + "px"; - } - - // Makes a number suitable for CSS - function px(x) { - if (typeof(x) === "number") - return x + "px"; - else - return x; - } - - // Retrieves runtime widget sizing information for an element. - // The return value is either null, or an object with fill, padding, - // defaultWidth, defaultHeight fields. - function sizingPolicy(el) { - var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']"); - if (!sizingEl) - return null; - var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}"); - if (viewerMode) { - return sp.viewer; - } else { - return sp.browser; - } - } - - // @param tasks Array of strings (or falsy value, in which case no-op). - // Each element must be a valid JavaScript expression that yields a - // function. Or, can be an array of objects with "code" and "data" - // properties; in this case, the "code" property should be a string - // of JS that's an expr that yields a function, and "data" should be - // an object that will be added as an additional argument when that - // function is called. - // @param target The object that will be "this" for each function - // execution. - // @param args Array of arguments to be passed to the functions. (The - // same arguments will be passed to all functions.) - function evalAndRun(tasks, target, args) { - if (tasks) { - forEach(tasks, function(task) { - var theseArgs = args; - if (typeof(task) === "object") { - theseArgs = theseArgs.concat([task.data]); - task = task.code; - } - var taskFunc = tryEval(task); - if (typeof(taskFunc) !== "function") { - throw new Error("Task must be a function! Source:\n" + task); - } - taskFunc.apply(target, theseArgs); - }); - } - } - - // Attempt eval() both with and without enclosing in parentheses. - // Note that enclosing coerces a function declaration into - // an expression that eval() can parse - // (otherwise, a SyntaxError is thrown) - function tryEval(code) { - var result = null; - try { - result = eval("(" + code + ")"); - } catch(error) { - if (!(error instanceof SyntaxError)) { - throw error; - } - try { - result = eval(code); - } catch(e) { - if (e instanceof SyntaxError) { - throw error; - } else { - throw e; - } - } - } - return result; - } - - function initSizing(el) { - var sizing = sizingPolicy(el); - if (!sizing) - return; - - var cel = document.getElementById("htmlwidget_container"); - if (!cel) - return; - - if (typeof(sizing.padding) !== "undefined") { - document.body.style.margin = "0"; - document.body.style.padding = paddingToCss(unpackPadding(sizing.padding)); - } - - if (sizing.fill) { - document.body.style.overflow = "hidden"; - document.body.style.width = "100%"; - document.body.style.height = "100%"; - document.documentElement.style.width = "100%"; - document.documentElement.style.height = "100%"; - if (cel) { - cel.style.position = "absolute"; - var pad = unpackPadding(sizing.padding); - cel.style.top = pad.top + "px"; - cel.style.right = pad.right + "px"; - cel.style.bottom = pad.bottom + "px"; - cel.style.left = pad.left + "px"; - el.style.width = "100%"; - el.style.height = "100%"; - } - - return { - getWidth: function() { return cel.offsetWidth; }, - getHeight: function() { return cel.offsetHeight; } - }; - - } else { - el.style.width = px(sizing.width); - el.style.height = px(sizing.height); - - return { - getWidth: function() { return el.offsetWidth; }, - getHeight: function() { return el.offsetHeight; } - }; - } - } - - // Default implementations for methods - var defaults = { - find: function(scope) { - return querySelectorAll(scope, "." + this.name); - }, - renderError: function(el, err) { - var $el = $(el); - - this.clearError(el); - - // Add all these error classes, as Shiny does - var errClass = "shiny-output-error"; - if (err.type !== null) { - // use the classes of the error condition as CSS class names - errClass = errClass + " " + $.map(asArray(err.type), function(type) { - return errClass + "-" + type; - }).join(" "); - } - errClass = errClass + " htmlwidgets-error"; - - // Is el inline or block? If inline or inline-block, just display:none it - // and add an inline error. - var display = $el.css("display"); - $el.data("restore-display-mode", display); - - if (display === "inline" || display === "inline-block") { - $el.hide(); - if (err.message !== "") { - var errorSpan = $("").addClass(errClass); - errorSpan.text(err.message); - $el.after(errorSpan); - } - } else if (display === "block") { - // If block, add an error just after the el, set visibility:none on the - // el, and position the error to be on top of the el. - // Mark it with a unique ID and CSS class so we can remove it later. - $el.css("visibility", "hidden"); - if (err.message !== "") { - var errorDiv = $("
").addClass(errClass).css("position", "absolute") - .css("top", el.offsetTop) - .css("left", el.offsetLeft) - // setting width can push out the page size, forcing otherwise - // unnecessary scrollbars to appear and making it impossible for - // the element to shrink; so use max-width instead - .css("maxWidth", el.offsetWidth) - .css("height", el.offsetHeight); - errorDiv.text(err.message); - $el.after(errorDiv); - - // Really dumb way to keep the size/position of the error in sync with - // the parent element as the window is resized or whatever. - var intId = setInterval(function() { - if (!errorDiv[0].parentElement) { - clearInterval(intId); - return; - } - errorDiv - .css("top", el.offsetTop) - .css("left", el.offsetLeft) - .css("maxWidth", el.offsetWidth) - .css("height", el.offsetHeight); - }, 500); - } - } - }, - clearError: function(el) { - var $el = $(el); - var display = $el.data("restore-display-mode"); - $el.data("restore-display-mode", null); - - if (display === "inline" || display === "inline-block") { - if (display) - $el.css("display", display); - $(el.nextSibling).filter(".htmlwidgets-error").remove(); - } else if (display === "block"){ - $el.css("visibility", "inherit"); - $(el.nextSibling).filter(".htmlwidgets-error").remove(); - } - }, - sizing: {} - }; - - // Called by widget bindings to register a new type of widget. The definition - // object can contain the following properties: - // - name (required) - A string indicating the binding name, which will be - // used by default as the CSS classname to look for. - // - initialize (optional) - A function(el) that will be called once per - // widget element; if a value is returned, it will be passed as the third - // value to renderValue. - // - renderValue (required) - A function(el, data, initValue) that will be - // called with data. Static contexts will cause this to be called once per - // element; Shiny apps will cause this to be called multiple times per - // element, as the data changes. - window.HTMLWidgets.widget = function(definition) { - if (!definition.name) { - throw new Error("Widget must have a name"); - } - if (!definition.type) { - throw new Error("Widget must have a type"); - } - // Currently we only support output widgets - if (definition.type !== "output") { - throw new Error("Unrecognized widget type '" + definition.type + "'"); - } - // TODO: Verify that .name is a valid CSS classname - - // Support new-style instance-bound definitions. Old-style class-bound - // definitions have one widget "object" per widget per type/class of - // widget; the renderValue and resize methods on such widget objects - // take el and instance arguments, because the widget object can't - // store them. New-style instance-bound definitions have one widget - // object per widget instance; the definition that's passed in doesn't - // provide renderValue or resize methods at all, just the single method - // factory(el, width, height) - // which returns an object that has renderValue(x) and resize(w, h). - // This enables a far more natural programming style for the widget - // author, who can store per-instance state using either OO-style - // instance fields or functional-style closure variables (I guess this - // is in contrast to what can only be called C-style pseudo-OO which is - // what we required before). - if (definition.factory) { - definition = createLegacyDefinitionAdapter(definition); - } - - if (!definition.renderValue) { - throw new Error("Widget must have a renderValue function"); - } - - // For static rendering (non-Shiny), use a simple widget registration - // scheme. We also use this scheme for Shiny apps/documents that also - // contain static widgets. - window.HTMLWidgets.widgets = window.HTMLWidgets.widgets || []; - // Merge defaults into the definition; don't mutate the original definition. - var staticBinding = extend({}, defaults, definition); - overrideMethod(staticBinding, "find", function(superfunc) { - return function(scope) { - var results = superfunc(scope); - // Filter out Shiny outputs, we only want the static kind - return filterByClass(results, "html-widget-output", false); - }; - }); - window.HTMLWidgets.widgets.push(staticBinding); - - if (shinyMode) { - // Shiny is running. Register the definition with an output binding. - // The definition itself will not be the output binding, instead - // we will make an output binding object that delegates to the - // definition. This is because we foolishly used the same method - // name (renderValue) for htmlwidgets definition and Shiny bindings - // but they actually have quite different semantics (the Shiny - // bindings receive data that includes lots of metadata that it - // strips off before calling htmlwidgets renderValue). We can't - // just ignore the difference because in some widgets it's helpful - // to call this.renderValue() from inside of resize(), and if - // we're not delegating, then that call will go to the Shiny - // version instead of the htmlwidgets version. - - // Merge defaults with definition, without mutating either. - var bindingDef = extend({}, defaults, definition); - - // This object will be our actual Shiny binding. - var shinyBinding = new Shiny.OutputBinding(); - - // With a few exceptions, we'll want to simply use the bindingDef's - // version of methods if they are available, otherwise fall back to - // Shiny's defaults. NOTE: If Shiny's output bindings gain additional - // methods in the future, and we want them to be overrideable by - // HTMLWidget binding definitions, then we'll need to add them to this - // list. - delegateMethod(shinyBinding, bindingDef, "getId"); - delegateMethod(shinyBinding, bindingDef, "onValueChange"); - delegateMethod(shinyBinding, bindingDef, "onValueError"); - delegateMethod(shinyBinding, bindingDef, "renderError"); - delegateMethod(shinyBinding, bindingDef, "clearError"); - delegateMethod(shinyBinding, bindingDef, "showProgress"); - - // The find, renderValue, and resize are handled differently, because we - // want to actually decorate the behavior of the bindingDef methods. - - shinyBinding.find = function(scope) { - var results = bindingDef.find(scope); - - // Only return elements that are Shiny outputs, not static ones - var dynamicResults = results.filter(".html-widget-output"); - - // It's possible that whatever caused Shiny to think there might be - // new dynamic outputs, also caused there to be new static outputs. - // Since there might be lots of different htmlwidgets bindings, we - // schedule execution for later--no need to staticRender multiple - // times. - if (results.length !== dynamicResults.length) - scheduleStaticRender(); - - return dynamicResults; - }; - - // Wrap renderValue to handle initialization, which unfortunately isn't - // supported natively by Shiny at the time of this writing. - - shinyBinding.renderValue = function(el, data) { - Shiny.renderDependencies(data.deps); - // Resolve strings marked as javascript literals to objects - if (!(data.evals instanceof Array)) data.evals = [data.evals]; - for (var i = 0; data.evals && i < data.evals.length; i++) { - window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]); - } - if (!bindingDef.renderOnNullValue) { - if (data.x === null) { - el.style.visibility = "hidden"; - return; - } else { - el.style.visibility = "inherit"; - } - } - if (!elementData(el, "initialized")) { - initSizing(el); - - elementData(el, "initialized", true); - if (bindingDef.initialize) { - var result = bindingDef.initialize(el, el.offsetWidth, - el.offsetHeight); - elementData(el, "init_result", result); - } - } - bindingDef.renderValue(el, data.x, elementData(el, "init_result")); - evalAndRun(data.jsHooks.render, elementData(el, "init_result"), [el, data.x]); - }; - - // Only override resize if bindingDef implements it - if (bindingDef.resize) { - shinyBinding.resize = function(el, width, height) { - // Shiny can call resize before initialize/renderValue have been - // called, which doesn't make sense for widgets. - if (elementData(el, "initialized")) { - bindingDef.resize(el, width, height, elementData(el, "init_result")); - } - }; - } - - Shiny.outputBindings.register(shinyBinding, bindingDef.name); - } - }; - - var scheduleStaticRenderTimerId = null; - function scheduleStaticRender() { - if (!scheduleStaticRenderTimerId) { - scheduleStaticRenderTimerId = setTimeout(function() { - scheduleStaticRenderTimerId = null; - window.HTMLWidgets.staticRender(); - }, 1); - } - } - - // Render static widgets after the document finishes loading - // Statically render all elements that are of this widget's class - window.HTMLWidgets.staticRender = function() { - var bindings = window.HTMLWidgets.widgets || []; - forEach(bindings, function(binding) { - var matches = binding.find(document.documentElement); - forEach(matches, function(el) { - var sizeObj = initSizing(el, binding); - - if (hasClass(el, "html-widget-static-bound")) - return; - el.className = el.className + " html-widget-static-bound"; - - var initResult; - if (binding.initialize) { - initResult = binding.initialize(el, - sizeObj ? sizeObj.getWidth() : el.offsetWidth, - sizeObj ? sizeObj.getHeight() : el.offsetHeight - ); - elementData(el, "init_result", initResult); - } - - if (binding.resize) { - var lastSize = { - w: sizeObj ? sizeObj.getWidth() : el.offsetWidth, - h: sizeObj ? sizeObj.getHeight() : el.offsetHeight - }; - var resizeHandler = function(e) { - var size = { - w: sizeObj ? sizeObj.getWidth() : el.offsetWidth, - h: sizeObj ? sizeObj.getHeight() : el.offsetHeight - }; - if (size.w === 0 && size.h === 0) - return; - if (size.w === lastSize.w && size.h === lastSize.h) - return; - lastSize = size; - binding.resize(el, size.w, size.h, initResult); - }; - - on(window, "resize", resizeHandler); - - // This is needed for cases where we're running in a Shiny - // app, but the widget itself is not a Shiny output, but - // rather a simple static widget. One example of this is - // an rmarkdown document that has runtime:shiny and widget - // that isn't in a render function. Shiny only knows to - // call resize handlers for Shiny outputs, not for static - // widgets, so we do it ourselves. - if (window.jQuery) { - window.jQuery(document).on( - "shown.htmlwidgets shown.bs.tab.htmlwidgets shown.bs.collapse.htmlwidgets", - resizeHandler - ); - window.jQuery(document).on( - "hidden.htmlwidgets hidden.bs.tab.htmlwidgets hidden.bs.collapse.htmlwidgets", - resizeHandler - ); - } - - // This is needed for the specific case of ioslides, which - // flips slides between display:none and display:block. - // Ideally we would not have to have ioslide-specific code - // here, but rather have ioslides raise a generic event, - // but the rmarkdown package just went to CRAN so the - // window to getting that fixed may be long. - if (window.addEventListener) { - // It's OK to limit this to window.addEventListener - // browsers because ioslides itself only supports - // such browsers. - on(document, "slideenter", resizeHandler); - on(document, "slideleave", resizeHandler); - } - } - - var scriptData = document.querySelector("script[data-for='" + el.id + "'][type='application/json']"); - if (scriptData) { - var data = JSON.parse(scriptData.textContent || scriptData.text); - // Resolve strings marked as javascript literals to objects - if (!(data.evals instanceof Array)) data.evals = [data.evals]; - for (var k = 0; data.evals && k < data.evals.length; k++) { - window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]); - } - binding.renderValue(el, data.x, initResult); - evalAndRun(data.jsHooks.render, initResult, [el, data.x]); - } - }); - }); - - invokePostRenderHandlers(); - } - - - function has_jQuery3() { - if (!window.jQuery) { - return false; - } - var $version = window.jQuery.fn.jquery; - var $major_version = parseInt($version.split(".")[0]); - return $major_version >= 3; - } - - /* - / Shiny 1.4 bumped jQuery from 1.x to 3.x which means jQuery's - / on-ready handler (i.e., $(fn)) is now asyncronous (i.e., it now - / really means $(setTimeout(fn)). - / https://jquery.com/upgrade-guide/3.0/#breaking-change-document-ready-handlers-are-now-asynchronous - / - / Since Shiny uses $() to schedule initShiny, shiny>=1.4 calls initShiny - / one tick later than it did before, which means staticRender() is - / called renderValue() earlier than (advanced) widget authors might be expecting. - / https://github.com/rstudio/shiny/issues/2630 - / - / For a concrete example, leaflet has some methods (e.g., updateBounds) - / which reference Shiny methods registered in initShiny (e.g., setInputValue). - / Since leaflet is privy to this life-cycle, it knows to use setTimeout() to - / delay execution of those methods (until Shiny methods are ready) - / https://github.com/rstudio/leaflet/blob/18ec981/javascript/src/index.js#L266-L268 - / - / Ideally widget authors wouldn't need to use this setTimeout() hack that - / leaflet uses to call Shiny methods on a staticRender(). In the long run, - / the logic initShiny should be broken up so that method registration happens - / right away, but binding happens later. - */ - function maybeStaticRenderLater() { - if (shinyMode && has_jQuery3()) { - window.jQuery(window.HTMLWidgets.staticRender); - } else { - window.HTMLWidgets.staticRender(); - } - } - - if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", function() { - document.removeEventListener("DOMContentLoaded", arguments.callee, false); - maybeStaticRenderLater(); - }, false); - } else if (document.attachEvent) { - document.attachEvent("onreadystatechange", function() { - if (document.readyState === "complete") { - document.detachEvent("onreadystatechange", arguments.callee); - maybeStaticRenderLater(); - } - }); - } - - - window.HTMLWidgets.getAttachmentUrl = function(depname, key) { - // If no key, default to the first item - if (typeof(key) === "undefined") - key = 1; - - var link = document.getElementById(depname + "-" + key + "-attachment"); - if (!link) { - throw new Error("Attachment " + depname + "/" + key + " not found in document"); - } - return link.getAttribute("href"); - }; - - window.HTMLWidgets.dataframeToD3 = function(df) { - var names = []; - var length; - for (var name in df) { - if (df.hasOwnProperty(name)) - names.push(name); - if (typeof(df[name]) !== "object" || typeof(df[name].length) === "undefined") { - throw new Error("All fields must be arrays"); - } else if (typeof(length) !== "undefined" && length !== df[name].length) { - throw new Error("All fields must be arrays of the same length"); - } - length = df[name].length; - } - var results = []; - var item; - for (var row = 0; row < length; row++) { - item = {}; - for (var col = 0; col < names.length; col++) { - item[names[col]] = df[names[col]][row]; - } - results.push(item); - } - return results; - }; - - window.HTMLWidgets.transposeArray2D = function(array) { - if (array.length === 0) return array; - var newArray = array[0].map(function(col, i) { - return array.map(function(row) { - return row[i] - }) - }); - return newArray; - }; - // Split value at splitChar, but allow splitChar to be escaped - // using escapeChar. Any other characters escaped by escapeChar - // will be included as usual (including escapeChar itself). - function splitWithEscape(value, splitChar, escapeChar) { - var results = []; - var escapeMode = false; - var currentResult = ""; - for (var pos = 0; pos < value.length; pos++) { - if (!escapeMode) { - if (value[pos] === splitChar) { - results.push(currentResult); - currentResult = ""; - } else if (value[pos] === escapeChar) { - escapeMode = true; - } else { - currentResult += value[pos]; - } - } else { - currentResult += value[pos]; - escapeMode = false; - } - } - if (currentResult !== "") { - results.push(currentResult); - } - return results; - } - // Function authored by Yihui/JJ Allaire - window.HTMLWidgets.evaluateStringMember = function(o, member) { - var parts = splitWithEscape(member, '.', '\\'); - for (var i = 0, l = parts.length; i < l; i++) { - var part = parts[i]; - // part may be a character or 'numeric' member name - if (o !== null && typeof o === "object" && part in o) { - if (i == (l - 1)) { // if we are at the end of the line then evalulate - if (typeof o[part] === "string") - o[part] = tryEval(o[part]); - } else { // otherwise continue to next embedded object - o = o[part]; - } - } - } - }; - - // Retrieve the HTMLWidget instance (i.e. the return value of an - // HTMLWidget binding's initialize() or factory() function) - // associated with an element, or null if none. - window.HTMLWidgets.getInstance = function(el) { - return elementData(el, "init_result"); - }; - - // Finds the first element in the scope that matches the selector, - // and returns the HTMLWidget instance (i.e. the return value of - // an HTMLWidget binding's initialize() or factory() function) - // associated with that element, if any. If no element matches the - // selector, or the first matching element has no HTMLWidget - // instance associated with it, then null is returned. - // - // The scope argument is optional, and defaults to window.document. - window.HTMLWidgets.find = function(scope, selector) { - if (arguments.length == 1) { - selector = scope; - scope = document; - } - - var el = scope.querySelector(selector); - if (el === null) { - return null; - } else { - return window.HTMLWidgets.getInstance(el); - } - }; - - // Finds all elements in the scope that match the selector, and - // returns the HTMLWidget instances (i.e. the return values of - // an HTMLWidget binding's initialize() or factory() function) - // associated with the elements, in an array. If elements that - // match the selector don't have an associated HTMLWidget - // instance, the returned array will contain nulls. - // - // The scope argument is optional, and defaults to window.document. - window.HTMLWidgets.findAll = function(scope, selector) { - if (arguments.length == 1) { - selector = scope; - scope = document; - } - - var nodes = scope.querySelectorAll(selector); - var results = []; - for (var i = 0; i < nodes.length; i++) { - results.push(window.HTMLWidgets.getInstance(nodes[i])); - } - return results; - }; - - var postRenderHandlers = []; - function invokePostRenderHandlers() { - while (postRenderHandlers.length) { - var handler = postRenderHandlers.shift(); - if (handler) { - handler(); - } - } - } - - // Register the given callback function to be invoked after the - // next time static widgets are rendered. - window.HTMLWidgets.addPostRenderHandler = function(callback) { - postRenderHandlers.push(callback); - }; - - // Takes a new-style instance-bound definition, and returns an - // old-style class-bound definition. This saves us from having - // to rewrite all the logic in this file to accomodate both - // types of definitions. - function createLegacyDefinitionAdapter(defn) { - var result = { - name: defn.name, - type: defn.type, - initialize: function(el, width, height) { - return defn.factory(el, width, height); - }, - renderValue: function(el, x, instance) { - return instance.renderValue(x); - }, - resize: function(el, width, height, instance) { - return instance.resize(width, height); - } - }; - - if (defn.find) - result.find = defn.find; - if (defn.renderError) - result.renderError = defn.renderError; - if (defn.clearError) - result.clearError = defn.clearError; - - return result; - } -})(); - diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers-2x.png b/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers-2x.png deleted file mode 100644 index 200c333..0000000 Binary files a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers-2x.png and /dev/null differ diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers.png b/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers.png deleted file mode 100644 index 1a72e57..0000000 Binary files a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/layers.png and /dev/null differ diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon-2x.png b/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon-2x.png deleted file mode 100644 index 88f9e50..0000000 Binary files a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon-2x.png and /dev/null differ diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon.png b/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon.png deleted file mode 100644 index 950edf2..0000000 Binary files a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-icon.png and /dev/null differ diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-shadow.png b/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-shadow.png deleted file mode 100644 index 9fd2979..0000000 Binary files a/inst/doc/neotoma2-package_files/leaflet-1.3.1/images/marker-shadow.png and /dev/null differ diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.css b/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.css deleted file mode 100644 index 230e5ba..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.css +++ /dev/null @@ -1,636 +0,0 @@ -/* required styles */ - -.leaflet-pane, -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-tile-container, -.leaflet-pane > svg, -.leaflet-pane > canvas, -.leaflet-zoom-box, -.leaflet-image-layer, -.leaflet-layer { - position: absolute; - left: 0; - top: 0; - } -.leaflet-container { - overflow: hidden; - } -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - -webkit-user-drag: none; - } -/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ -.leaflet-safari .leaflet-tile { - image-rendering: -webkit-optimize-contrast; - } -/* hack that prevents hw layers "stretching" when loading new tiles */ -.leaflet-safari .leaflet-tile-container { - width: 1600px; - height: 1600px; - -webkit-transform-origin: 0 0; - } -.leaflet-marker-icon, -.leaflet-marker-shadow { - display: block; - } -/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ -/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ -.leaflet-container .leaflet-overlay-pane svg, -.leaflet-container .leaflet-marker-pane img, -.leaflet-container .leaflet-shadow-pane img, -.leaflet-container .leaflet-tile-pane img, -.leaflet-container img.leaflet-image-layer { - max-width: none !important; - max-height: none !important; - } - -.leaflet-container.leaflet-touch-zoom { - -ms-touch-action: pan-x pan-y; - touch-action: pan-x pan-y; - } -.leaflet-container.leaflet-touch-drag { - -ms-touch-action: pinch-zoom; - /* Fallback for FF which doesn't support pinch-zoom */ - touch-action: none; - touch-action: pinch-zoom; -} -.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { - -ms-touch-action: none; - touch-action: none; -} -.leaflet-container { - -webkit-tap-highlight-color: transparent; -} -.leaflet-container a { - -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); -} -.leaflet-tile { - filter: inherit; - visibility: hidden; - } -.leaflet-tile-loaded { - visibility: inherit; - } -.leaflet-zoom-box { - width: 0; - height: 0; - -moz-box-sizing: border-box; - box-sizing: border-box; - z-index: 800; - } -/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ -.leaflet-overlay-pane svg { - -moz-user-select: none; - } - -.leaflet-pane { z-index: 400; } - -.leaflet-tile-pane { z-index: 200; } -.leaflet-overlay-pane { z-index: 400; } -.leaflet-shadow-pane { z-index: 500; } -.leaflet-marker-pane { z-index: 600; } -.leaflet-tooltip-pane { z-index: 650; } -.leaflet-popup-pane { z-index: 700; } - -.leaflet-map-pane canvas { z-index: 100; } -.leaflet-map-pane svg { z-index: 200; } - -.leaflet-vml-shape { - width: 1px; - height: 1px; - } -.lvml { - behavior: url(#default#VML); - display: inline-block; - position: absolute; - } - - -/* control positioning */ - -.leaflet-control { - position: relative; - z-index: 800; - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } -.leaflet-top, -.leaflet-bottom { - position: absolute; - z-index: 1000; - pointer-events: none; - } -.leaflet-top { - top: 0; - } -.leaflet-right { - right: 0; - } -.leaflet-bottom { - bottom: 0; - } -.leaflet-left { - left: 0; - } -.leaflet-control { - float: left; - clear: both; - } -.leaflet-right .leaflet-control { - float: right; - } -.leaflet-top .leaflet-control { - margin-top: 10px; - } -.leaflet-bottom .leaflet-control { - margin-bottom: 10px; - } -.leaflet-left .leaflet-control { - margin-left: 10px; - } -.leaflet-right .leaflet-control { - margin-right: 10px; - } - - -/* zoom and fade animations */ - -.leaflet-fade-anim .leaflet-tile { - will-change: opacity; - } -.leaflet-fade-anim .leaflet-popup { - opacity: 0; - -webkit-transition: opacity 0.2s linear; - -moz-transition: opacity 0.2s linear; - -o-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; - } -.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { - opacity: 1; - } -.leaflet-zoom-animated { - -webkit-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; - } -.leaflet-zoom-anim .leaflet-zoom-animated { - will-change: transform; - } -.leaflet-zoom-anim .leaflet-zoom-animated { - -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); - -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); - -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1); - transition: transform 0.25s cubic-bezier(0,0,0.25,1); - } -.leaflet-zoom-anim .leaflet-tile, -.leaflet-pan-anim .leaflet-tile { - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; - } - -.leaflet-zoom-anim .leaflet-zoom-hide { - visibility: hidden; - } - - -/* cursors */ - -.leaflet-interactive { - cursor: pointer; - } -.leaflet-grab { - cursor: -webkit-grab; - cursor: -moz-grab; - } -.leaflet-crosshair, -.leaflet-crosshair .leaflet-interactive { - cursor: crosshair; - } -.leaflet-popup-pane, -.leaflet-control { - cursor: auto; - } -.leaflet-dragging .leaflet-grab, -.leaflet-dragging .leaflet-grab .leaflet-interactive, -.leaflet-dragging .leaflet-marker-draggable { - cursor: move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; - } - -/* marker & overlays interactivity */ -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-image-layer, -.leaflet-pane > svg path, -.leaflet-tile-container { - pointer-events: none; - } - -.leaflet-marker-icon.leaflet-interactive, -.leaflet-image-layer.leaflet-interactive, -.leaflet-pane > svg path.leaflet-interactive { - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } - -/* visual tweaks */ - -.leaflet-container { - background: #ddd; - outline: 0; - } -.leaflet-container a { - color: #0078A8; - } -.leaflet-container a.leaflet-active { - outline: 2px solid orange; - } -.leaflet-zoom-box { - border: 2px dotted #38f; - background: rgba(255,255,255,0.5); - } - - -/* general typography */ -.leaflet-container { - font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; - } - - -/* general toolbar styles */ - -.leaflet-bar { - box-shadow: 0 1px 5px rgba(0,0,0,0.65); - border-radius: 4px; - } -.leaflet-bar a, -.leaflet-bar a:hover { - background-color: #fff; - border-bottom: 1px solid #ccc; - width: 26px; - height: 26px; - line-height: 26px; - display: block; - text-align: center; - text-decoration: none; - color: black; - } -.leaflet-bar a, -.leaflet-control-layers-toggle { - background-position: 50% 50%; - background-repeat: no-repeat; - display: block; - } -.leaflet-bar a:hover { - background-color: #f4f4f4; - } -.leaflet-bar a:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - } -.leaflet-bar a:last-child { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom: none; - } -.leaflet-bar a.leaflet-disabled { - cursor: default; - background-color: #f4f4f4; - color: #bbb; - } - -.leaflet-touch .leaflet-bar a { - width: 30px; - height: 30px; - line-height: 30px; - } -.leaflet-touch .leaflet-bar a:first-child { - border-top-left-radius: 2px; - border-top-right-radius: 2px; - } -.leaflet-touch .leaflet-bar a:last-child { - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - } - -/* zoom control */ - -.leaflet-control-zoom-in, -.leaflet-control-zoom-out { - font: bold 18px 'Lucida Console', Monaco, monospace; - text-indent: 1px; - } - -.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { - font-size: 22px; - } - - -/* layers control */ - -.leaflet-control-layers { - box-shadow: 0 1px 5px rgba(0,0,0,0.4); - background: #fff; - border-radius: 5px; - } -.leaflet-control-layers-toggle { - background-image: url(images/layers.png); - width: 36px; - height: 36px; - } -.leaflet-retina .leaflet-control-layers-toggle { - background-image: url(images/layers-2x.png); - background-size: 26px 26px; - } -.leaflet-touch .leaflet-control-layers-toggle { - width: 44px; - height: 44px; - } -.leaflet-control-layers .leaflet-control-layers-list, -.leaflet-control-layers-expanded .leaflet-control-layers-toggle { - display: none; - } -.leaflet-control-layers-expanded .leaflet-control-layers-list { - display: block; - position: relative; - } -.leaflet-control-layers-expanded { - padding: 6px 10px 6px 6px; - color: #333; - background: #fff; - } -.leaflet-control-layers-scrollbar { - overflow-y: scroll; - overflow-x: hidden; - padding-right: 5px; - } -.leaflet-control-layers-selector { - margin-top: 2px; - position: relative; - top: 1px; - } -.leaflet-control-layers label { - display: block; - } -.leaflet-control-layers-separator { - height: 0; - border-top: 1px solid #ddd; - margin: 5px -10px 5px -6px; - } - -/* Default icon URLs */ -.leaflet-default-icon-path { - background-image: url(images/marker-icon.png); - } - - -/* attribution and scale controls */ - -.leaflet-container .leaflet-control-attribution { - background: #fff; - background: rgba(255, 255, 255, 0.7); - margin: 0; - } -.leaflet-control-attribution, -.leaflet-control-scale-line { - padding: 0 5px; - color: #333; - } -.leaflet-control-attribution a { - text-decoration: none; - } -.leaflet-control-attribution a:hover { - text-decoration: underline; - } -.leaflet-container .leaflet-control-attribution, -.leaflet-container .leaflet-control-scale { - font-size: 11px; - } -.leaflet-left .leaflet-control-scale { - margin-left: 5px; - } -.leaflet-bottom .leaflet-control-scale { - margin-bottom: 5px; - } -.leaflet-control-scale-line { - border: 2px solid #777; - border-top: none; - line-height: 1.1; - padding: 2px 5px 1px; - font-size: 11px; - white-space: nowrap; - overflow: hidden; - -moz-box-sizing: border-box; - box-sizing: border-box; - - background: #fff; - background: rgba(255, 255, 255, 0.5); - } -.leaflet-control-scale-line:not(:first-child) { - border-top: 2px solid #777; - border-bottom: none; - margin-top: -2px; - } -.leaflet-control-scale-line:not(:first-child):not(:last-child) { - border-bottom: 2px solid #777; - } - -.leaflet-touch .leaflet-control-attribution, -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - box-shadow: none; - } -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - border: 2px solid rgba(0,0,0,0.2); - background-clip: padding-box; - } - - -/* popup */ - -.leaflet-popup { - position: absolute; - text-align: center; - margin-bottom: 20px; - } -.leaflet-popup-content-wrapper { - padding: 1px; - text-align: left; - border-radius: 12px; - } -.leaflet-popup-content { - margin: 13px 19px; - line-height: 1.4; - } -.leaflet-popup-content p { - margin: 18px 0; - } -.leaflet-popup-tip-container { - width: 40px; - height: 20px; - position: absolute; - left: 50%; - margin-left: -20px; - overflow: hidden; - pointer-events: none; - } -.leaflet-popup-tip { - width: 17px; - height: 17px; - padding: 1px; - - margin: -10px auto 0; - - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); - } -.leaflet-popup-content-wrapper, -.leaflet-popup-tip { - background: white; - color: #333; - box-shadow: 0 3px 14px rgba(0,0,0,0.4); - } -.leaflet-container a.leaflet-popup-close-button { - position: absolute; - top: 0; - right: 0; - padding: 4px 4px 0 0; - border: none; - text-align: center; - width: 18px; - height: 14px; - font: 16px/14px Tahoma, Verdana, sans-serif; - color: #c3c3c3; - text-decoration: none; - font-weight: bold; - background: transparent; - } -.leaflet-container a.leaflet-popup-close-button:hover { - color: #999; - } -.leaflet-popup-scrolled { - overflow: auto; - border-bottom: 1px solid #ddd; - border-top: 1px solid #ddd; - } - -.leaflet-oldie .leaflet-popup-content-wrapper { - zoom: 1; - } -.leaflet-oldie .leaflet-popup-tip { - width: 24px; - margin: 0 auto; - - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; - filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); - } -.leaflet-oldie .leaflet-popup-tip-container { - margin-top: -1px; - } - -.leaflet-oldie .leaflet-control-zoom, -.leaflet-oldie .leaflet-control-layers, -.leaflet-oldie .leaflet-popup-content-wrapper, -.leaflet-oldie .leaflet-popup-tip { - border: 1px solid #999; - } - - -/* div icon */ - -.leaflet-div-icon { - background: #fff; - border: 1px solid #666; - } - - -/* Tooltip */ -/* Base styles for the element that has a tooltip */ -.leaflet-tooltip { - position: absolute; - padding: 6px; - background-color: #fff; - border: 1px solid #fff; - border-radius: 3px; - color: #222; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - pointer-events: none; - box-shadow: 0 1px 3px rgba(0,0,0,0.4); - } -.leaflet-tooltip.leaflet-clickable { - cursor: pointer; - pointer-events: auto; - } -.leaflet-tooltip-top:before, -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - position: absolute; - pointer-events: none; - border: 6px solid transparent; - background: transparent; - content: ""; - } - -/* Directions */ - -.leaflet-tooltip-bottom { - margin-top: 6px; -} -.leaflet-tooltip-top { - margin-top: -6px; -} -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-top:before { - left: 50%; - margin-left: -6px; - } -.leaflet-tooltip-top:before { - bottom: 0; - margin-bottom: -12px; - border-top-color: #fff; - } -.leaflet-tooltip-bottom:before { - top: 0; - margin-top: -12px; - margin-left: -6px; - border-bottom-color: #fff; - } -.leaflet-tooltip-left { - margin-left: -6px; -} -.leaflet-tooltip-right { - margin-left: 6px; -} -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - top: 50%; - margin-top: -6px; - } -.leaflet-tooltip-left:before { - right: 0; - margin-right: -12px; - border-left-color: #fff; - } -.leaflet-tooltip-right:before { - left: 0; - margin-left: -12px; - border-right-color: #fff; - } diff --git a/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.js b/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.js deleted file mode 100644 index 4eca8af..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-1.3.1/leaflet.js +++ /dev/null @@ -1,5 +0,0 @@ -/* @preserve - * Leaflet 1.3.1+Detached: ba6f97fff8647e724e4dfe66d2ed7da11f908989.ba6f97f, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e=0}function I(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function B(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(Qi,n,!1):"touchmove"===i?t.removeEventListener(te,n,!1):"touchend"===i&&(t.removeEventListener(ie,n,!1),t.removeEventListener(ee,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(ne.indexOf(t.target.tagName)<0))return;$(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(Qi,o,!1),se||(document.documentElement.addEventListener(Qi,R,!0),document.documentElement.addEventListener(te,D,!0),document.documentElement.addEventListener(ie,N,!0),document.documentElement.addEventListener(ee,N,!0),se=!0)}function R(t){oe[t.pointerId]=t,re++}function D(t){oe[t.pointerId]&&(oe[t.pointerId]=t)}function N(t){delete oe[t.pointerId],re--}function j(t,i){t.touches=[];for(var e in oe)t.touches.push(oe[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(te,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(ie,n,!1),t.addEventListener(ee,n,!1)}function F(t,i,e){function n(t){var i;if(Ui){if(!Pi||"mouse"===t.pointerType)return;i=re}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:t,a=n>0&&n<=h,s=e}}function o(t){if(a&&!r.cancelBubble){if(Ui){if(!Pi||"mouse"===t.pointerType)return;var e,n,o={};for(n in r)e=r[n],o[n]=e&&e.bind?e.bind(r):e;r=o}r.type="dblclick",i(r),s=null}}var s,r,a=!1,h=250;return t[ue+ae+e]=n,t[ue+he+e]=o,t[ue+"dblclick"+e]=i,t.addEventListener(ae,n,!1),t.addEventListener(he,o,!1),t.addEventListener("dblclick",i,!1),this}function U(t,i){var e=t[ue+ae+i],n=t[ue+he+i],o=t[ue+"dblclick"+i];return t.removeEventListener(ae,e,!1),t.removeEventListener(he,n,!1),Pi||t.removeEventListener("dblclick",o,!1),this}function V(t,i,e,n){if("object"==typeof i)for(var o in i)G(t,o,i[o],e);else for(var s=0,r=(i=u(i)).length;s100&&n<500||t.target._simulatedClick&&!t._simulated?Q(t):(pi=e,i(t))}function rt(t){return"string"==typeof t?document.getElementById(t):t}function at(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function ht(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ut(t){var i=t.parentNode;i&&i.removeChild(t)}function lt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ct(t){var i=t.parentNode;i.lastChild!==t&&i.appendChild(t)}function _t(t){var i=t.parentNode;i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function dt(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=gt(t);return e.length>0&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function pt(t,i){if(void 0!==t.classList)for(var e=u(i),n=0,o=e.length;nh&&(s=r,h=a);h>e&&(i[s]=1,Et(t,i,e,n,s),Et(t,i,e,s,o))}function kt(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;ni&&(e.push(t[n]),o=n);return oi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function Ot(t,i){var e=i.x-t.x,n=i.y-t.y;return e*e+n*n}function Rt(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return u>0&&((o=((t.x-s)*a+(t.y-r)*h)/u)>1?(s=e.x,r=e.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new x(s,r)}function Dt(t){return!ei(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Nt(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dt(t)}function jt(t,i,e){var n,o,s,r,a,h,u,l,c,_=[1,4,2,8];for(o=0,u=t.length;o0?Math.floor(t):Math.ceil(t)};x.prototype={clone:function(){return new x(this.x,this.y)},add:function(t){return this.clone()._add(w(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(w(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new x(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new x(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=li(this.x),this.y=li(this.y),this},distanceTo:function(t){var i=(t=w(t)).x-this.x,e=t.y-this.y;return Math.sqrt(i*i+e*e)},equals:function(t){return(t=w(t)).x===this.x&&t.y===this.y},contains:function(t){return t=w(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+a(this.x)+", "+a(this.y)+")"}},P.prototype={extend:function(t){return t=w(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new x(this.min.x,this.max.y)},getTopRight:function(){return new x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t="number"==typeof t[0]||t instanceof x?w(t):b(t))instanceof P?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng1,Yi=!!document.createElement("canvas").getContext,Xi=!(!document.createElementNS||!E("svg").createSVGRect),Ji=!Xi&&function(){try{var t=document.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),$i=(Object.freeze||Object)({ie:wi,ielt9:Li,edge:Pi,webkit:bi,android:Ti,android23:zi,androidStock:Ci,opera:Zi,chrome:Si,gecko:Ei,safari:ki,phantom:Ai,opera12:Ii,win:Bi,ie3d:Oi,webkit3d:Ri,gecko3d:Di,any3d:Ni,mobile:ji,mobileWebkit:Wi,mobileWebkit3d:Hi,msPointer:Fi,pointer:Ui,touch:Vi,mobileOpera:qi,mobileGecko:Gi,retina:Ki,canvas:Yi,svg:Xi,vml:Ji}),Qi=Fi?"MSPointerDown":"pointerdown",te=Fi?"MSPointerMove":"pointermove",ie=Fi?"MSPointerUp":"pointerup",ee=Fi?"MSPointerCancel":"pointercancel",ne=["INPUT","SELECT","OPTION"],oe={},se=!1,re=0,ae=Fi?"MSPointerDown":Ui?"pointerdown":"touchstart",he=Fi?"MSPointerUp":Ui?"pointerup":"touchend",ue="_leaflet_",le="_leaflet_events",ce=Bi&&Si?2*window.devicePixelRatio:Ei?window.devicePixelRatio:1,_e={},de=(Object.freeze||Object)({on:V,off:q,stopPropagation:Y,disableScrollPropagation:X,disableClickPropagation:J,preventDefault:$,stop:Q,getMousePosition:tt,getWheelDelta:it,fakeStop:et,skipped:nt,isExternalTarget:ot,addListener:V,removeListener:q}),pe=xt(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),me=xt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fe="webkitTransition"===me||"OTransition"===me?me+"End":"transitionend";if("onselectstart"in document)mi=function(){V(window,"selectstart",$)},fi=function(){q(window,"selectstart",$)};else{var ge=xt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);mi=function(){if(ge){var t=document.documentElement.style;gi=t[ge],t[ge]="none"}},fi=function(){ge&&(document.documentElement.style[ge]=gi,gi=void 0)}}var ve,ye,xe=(Object.freeze||Object)({TRANSFORM:pe,TRANSITION:me,TRANSITION_END:fe,get:rt,getStyle:at,create:ht,remove:ut,empty:lt,toFront:ct,toBack:_t,hasClass:dt,addClass:pt,removeClass:mt,setClass:ft,getClass:gt,setOpacity:vt,testProp:xt,setTransform:wt,setPosition:Lt,getPosition:Pt,disableTextSelection:mi,enableTextSelection:fi,disableImageDrag:bt,enableImageDrag:Tt,preventOutline:zt,restoreOutline:Mt}),we=ui.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pt(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=f(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;ithis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,z(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=n.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(e(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=e(this._handleGeolocationResponse,this),o=e(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,t):navigator.geolocation.getCurrentPosition(n,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})},_handleGeolocationResponse:function(t){var i=new M(t.coords.latitude,t.coords.longitude),e=i.toBounds(t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)ut(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=ht("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new T(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=z(t),e=w(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),u=b(this.project(a,n),this.project(r,n)).getSize(),l=Ni?this.options.zoomSnap:1,c=h.x/u.x,_=h.y/u.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=i?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new x(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new P(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(C(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(w(t),i)},layerPointToLatLng:function(t){var i=w(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(z(t))},distance:function(t,i){return this.options.crs.distance(C(t),C(i))},containerPointToLayerPoint:function(t){return w(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return w(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(w(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return tt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=rt(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");V(i,"scroll",this._onScroll,this),this._containerId=n(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ni,pt(t,"leaflet-container"+(Vi?" leaflet-touch":"")+(Ki?" leaflet-retina":"")+(Li?" leaflet-oldie":"")+(ki?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=at(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Lt(this._mapPane,new x(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(pt(t.markerPane,"leaflet-zoom-hide"),pt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){Lt(this._mapPane,new x(0,0));var e=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var n=this._zoom!==i;this._moveStart(n,!1)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t,i){return t&&this.fire("zoomstart"),i||this.fire("movestart"),this},_move:function(t,i,e){void 0===i&&(i=this._zoom);var n=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return g(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Lt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[n(this._container)]=this;var i=t?q:V;i(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),Ni&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){g(this._resizeRequest),this._resizeRequest=f(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,o=[],s="mouseout"===i||"mouseover"===i,r=t.target||t.srcElement,a=!1;r;){if((e=this._targets[n(r)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){a=!0;break}if(e&&e.listens(i,!0)){if(s&&!ot(r,t))break;if(o.push(e),s)break}if(r===this._container)break;r=r.parentNode}return o.length||a||s||!ot(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!nt(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i||zt(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var s=n[0];"contextmenu"===e&&s.listens(e,!0)&&$(t);var r={originalEvent:t};if("keypress"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h0?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=Ni?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._trunc();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e))&&(this.panBy(e,i),!0)},_createAnimProxy:function(){var t=this._proxy=ht("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=pe,e=this._proxy.style[i];wt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),i=this.getZoom();wt(this._proxy,this.project(t,i),this.getZoomScale(i,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(f(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,n,o){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,pt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:o}),setTimeout(e(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&mt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),f(function(){this._moveEnd(!0)},this))}}),Pe=v.extend({options:{position:"topright"},initialize:function(t){l(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return pt(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),be=function(t){return new Pe(t)};Le.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){var s=e+t+" "+e+o;i[t+o]=ht("div",s,n)}var i=this._controlCorners={},e="leaflet-",n=this._controlContainer=ht("div",e+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ut(this._controlCorners[t]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Te=Pe.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(n(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=o):i=this._createRadioElement("leaflet-base-layers",o),this._layerControlInputs.push(i),i.layerId=n(t.layer),V(i,"click",this._onInputClick,this);var s=document.createElement("span");s.innerHTML=" "+t.name;var r=document.createElement("div");return e.appendChild(r),r.appendChild(i),r.appendChild(s),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;s>=0;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;s=0;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ze=Pe.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=ht("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=ht("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),J(s),V(s,"click",Q),V(s,"click",o,this),V(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";mt(this._zoomInButton,i),mt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMinZoom())&&pt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMaxZoom())&&pt(this._zoomInButton,i)}});Le.mergeOptions({zoomControl:!0}),Le.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ze,this.addControl(this.zoomControl))});var Me=Pe.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i=ht("div","leaflet-control-scale"),e=this.options;return this._addScales(e,"leaflet-control-scale-line",i),t.on(e.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=ht("div",i,e)),t.imperial&&(this._iScale=ht("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;o>5280?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return e=e>=10?10:e>=5?5:e>=3?3:e>=2?2:1,i*e}}),Ce=Pe.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){l(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=ht("div","leaflet-control-attribution"),J(this._container);for(var i in t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});Le.mergeOptions({attributionControl:!0}),Le.addInitHook(function(){this.options.attributionControl&&(new Ce).addTo(this)});Pe.Layers=Te,Pe.Zoom=ze,Pe.Scale=Me,Pe.Attribution=Ce,be.layers=function(t,i,e){return new Te(t,i,e)},be.zoom=function(t){return new ze(t)},be.scale=function(t){return new Me(t)},be.attribution=function(t){return new Ce(t)};var Ze=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ze.addTo=function(t,i){return t.addHandler(i,this),this};var Se,Ee={Events:hi},ke=Vi?"touchstart mousedown":"mousedown",Ae={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},Ie={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Be=ui.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){l(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(V(this._dragStartTarget,ke,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Be._dragging===this&&this.finishDrag(),q(this._dragStartTarget,ke,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!dt(this._element,"leaflet-zoom-anim")&&!(Be._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Be._dragging=this,this._preventOutline&&zt(this._element),bt(),mi(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t;this._startPoint=new x(i.clientX,i.clientY),V(document,Ie[t.type],this._onMove,this),V(document,Ae[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new x(i.clientX,i.clientY).subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)1e-7;h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=u=Math.PI/2-2*Math.atan(r*i)-a;return new M(a*e,t.x*e/n)}},je=(Object.freeze||Object)({LonLat:De,Mercator:Ne,SphericalMercator:di}),We=i({},_i,{code:"EPSG:3395",projection:Ne,transformation:function(){var t=.5/(Math.PI*Ne.R);return S(t,.5,-t,.5)}()}),He=i({},_i,{code:"EPSG:4326",projection:De,transformation:S(1/180,1,-1/180,.5)}),Fe=i({},ci,{projection:De,transformation:S(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});ci.Earth=_i,ci.EPSG3395=We,ci.EPSG3857=vi,ci.EPSG900913=yi,ci.EPSG4326=He,ci.Simple=Fe;var Ue=ui.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[n(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[n(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",function(){i.off(e,this)},this)}this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this})}}});Le.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var i=n(t);return this._layers[i]?this:(this._layers[i]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var i=n(t);return this._layers[i]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&n(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?ei(t)?t:[t]:[]).length;ithis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()i)return r=(n-i)/e,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=C(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new T,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Dt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=[],e=Dt(t),n=0,o=t.length;n=2&&i[0]instanceof M&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){tn.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,e=new x(i,i);if(t=new P(t.min.subtract(e),t.max.add(e)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||tn.prototype._containsPoint.call(this,t,!0)}}),nn=qe.extend({initialize:function(t,i){l(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=ei(t)?t:t.features;if(o){for(i=0,e=o.length;i0?o:[i.src]}else{ei(this._url)||(this._url=[this._url]),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop;for(var a=0;ao?(i.height=o+"px",pt(t,"leaflet-popup-scrolled")):mt(t,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Lt(this._container,i.add(e))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,i=parseInt(at(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new x(this._containerLeft,-e-this._containerBottom);o._add(Pt(this._container));var s=t.layerPointToContainerPoint(o),r=w(this.options.autoPanPadding),a=w(this.options.autoPanPaddingTopLeft||r),h=w(this.options.autoPanPaddingBottomRight||r),u=t.getSize(),l=0,c=0;s.x+n+h.x>u.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Q(t)},_getAnchor:function(){return w(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Le.mergeOptions({closePopupOnClick:!0}),Le.include({openPopup:function(t,i,e){return t instanceof un||(t=new un(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ue.include({bindPopup:function(t,i){return t instanceof un?(l(t,i),this._popup=t,t._source=this):(this._popup&&!i||(this._popup=new un(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){if(t instanceof Ue||(i=t,t=this),t instanceof qe)for(var e in this._layers){t=this._layers[e];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Q(t),i instanceof Je?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var ln=hn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){hn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){hn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=hn.prototype.getEvents.call(this);return Vi&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ht("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=w(this.options.offset),u=this._getAnchor();"top"===s?t=t.add(w(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t=t.subtract(w(r/2-h.x,-h.y,!0)):"center"===s?t=t.subtract(w(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.xthis.options.maxZoom||en&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new x(o,s);r.z=e+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),e+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,e);else{for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d=new x(_,c);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:r.push(d)}}if(r.sort(function(t,i){return t.distanceTo(s)-i.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(_=0;_e.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return z(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new T(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new x(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(Ci||i.el.setAttribute("src",ni),ut(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){pt(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=r,t.onmousemove=r,Li&&this.options.opacity<1&&vt(t,this.options.opacity),Ti&&!zi&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var n=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),e(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&f(e(this._tileReady,this,t,null,s)),Lt(s,n),this._tiles[o]={el:s,coords:t,current:!0},i.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,i,n){if(this._map){i&&this.fire("tileerror",{error:i,tile:n,coords:t});var o=this._tileCoordsToKey(t);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(vt(n.el,0),g(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),i||(pt(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Li||!this._map._fadeAnimated?f(this._pruneTiles,this):setTimeout(e(this._pruneTiles,this),250)))}},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new x(this._wrapX?s(t.x,this._wrapX):t.x,this._wrapY?s(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new P(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),dn=_n.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=l(this,i)).detectRetina&&Ki&&i.maxZoom>0&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),Ti||this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url=t,i||this.redraw(),this},createTile:function(t,i){var n=document.createElement("img");return V(n,"load",e(this._tileOnLoad,this,i,n)),V(n,"error",e(this._tileOnError,this,i,n)),this.options.crossOrigin&&(n.crossOrigin=""),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Ki?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,i){Li?setTimeout(e(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.getAttribute("src")!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom,e=this.options.zoomReverse,n=this.options.zoomOffset;return e&&(t=i-t),t+n},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=r,i.onerror=r,i.complete||(i.src=ni,ut(i),delete this._tiles[t]))}}),pn=dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=l(this,e)).detectRetina&&Ki?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=this._crs.code,dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToNwSe(t),e=this._crs,n=b(e.project(i[0]),e.project(i[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===He?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=L.TileLayer.prototype.getTileUrl.call(this,t);return a+c(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});dn.WMS=pn,Yt.wms=function(t,i){return new pn(t,i)};var mn=Ue.extend({options:{padding:.1,tolerance:0},initialize:function(t){l(this,t),n(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&pt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=Pt(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,i),r=this._map.project(t,i).subtract(s),a=o.multiplyBy(-e).add(n).add(o).subtract(r);Ni?wt(this._container,a,e):Lt(this._container,a)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new P(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),fn=mn.extend({getEvents:function(){var t=mn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){mn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");V(t,"mousemove",o(this._onMouseMove,32,this),this),V(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),V(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){delete this._ctx,ut(this._container),q(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var t in this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},mn.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=Ki?2:1;Lt(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",Ki&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){mn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[n(t)]=t;var i=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,n=i.prev;e?e.prev=n:this._drawLast=n,n?n.next=e:this._drawFirst=e,delete t._order,delete this._layers[L.stamp(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(t.options.dashArray){var i,e=t.options.dashArray.split(","),n=[];for(i=0;i')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),vn={_initContainer:function(){this._container=ht("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(mn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=gn("shape");pt(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=gn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ut(i),t.removeInteractiveTarget(i),delete this._layers[n(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=gn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=ei(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=gn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){ct(t._container)},_bringToBack:function(t){_t(t._container)}},yn=Ji?gn:E,xn=mn.extend({getEvents:function(){var t=mn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=yn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=yn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),q(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){mn.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),Lt(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=yn("path");t.options.className&&pt(i,t.options.className),t.options.interactive&&pt(i,"leaflet-interactive"),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ut(t._path),t.removeInteractiveTarget(t._path),delete this._layers[n(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,k(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){ct(t._path)},_bringToBack:function(t){_t(t._path)}});Ji&&xn.include(vn),Le.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this.options.preferCanvas&&Xt()||Jt()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=xn&&Jt({pane:t})||fn&&Xt({pane:t}),this._paneRenderers[t]=i),i}});var wn=en.extend({initialize:function(t,i){en.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=z(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});xn.create=yn,xn.pointsToPath=k,nn.geometryToLayer=Wt,nn.coordsToLatLng=Ht,nn.coordsToLatLngs=Ft,nn.latLngToCoords=Ut,nn.latLngsToCoords=Vt,nn.getFeature=qt,nn.asFeature=Gt,Le.mergeOptions({boxZoom:!0});var Ln=Ze.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){V(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){q(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),mi(),bt(),this._startPoint=this._map.mouseEventToContainerPoint(t),V(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ht("div","leaflet-zoom-box",this._container),pt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new P(this._point,this._startPoint),e=i.getSize();Lt(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ut(this._box),mt(this._container,"leaflet-crosshair")),fi(),Tt(),q(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(e(this._resetState,this),0);var i=new T(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Le.addInitHook("addHandler","boxZoom",Ln),Le.mergeOptions({doubleClickZoom:!0});var Pn=Ze.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Le.addInitHook("addHandler","doubleClickZoom",Pn),Le.mergeOptions({dragging:!0,inertia:!zi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var bn=Ze.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Be(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}pt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){mt(this._map._container,"leaflet-grab"),mt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=z(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),this._prunePositions(i)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.xi.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)0?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});Le.addInitHook("addHandler","scrollWheelZoom",zn),Le.mergeOptions({tap:!0,tapTolerance:15});var Mn=Ze.extend({addHooks:function(){V(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){q(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if($(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new x(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&pt(n,"leaflet-active"),this._holdTimeout=setTimeout(e(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),V(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),q(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],e=i.target;e&&e.tagName&&"a"===e.tagName.toLowerCase()&&mt(e,"leaflet-active"),this._simulateEvent("mouseup",i),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var i=t.touches[0];this._newPos=new x(i.clientX,i.clientY),this._simulateEvent("mousemove",i)},_simulateEvent:function(t,i){var e=document.createEvent("MouseEvents");e._simulated=!0,i.target._simulatedClick=!0,e.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),i.target.dispatchEvent(e)}});Vi&&!Ui&&Le.addInitHook("addHandler","tap",Mn),Le.mergeOptions({touchZoom:Vi&&!zi,bounceAtZoomLimits:!0});var Cn=Ze.extend({addHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),V(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){mt(this._map._container,"leaflet-touch-zoom"),q(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),V(document,"touchmove",this._onTouchMove,this),V(document,"touchend",this._onTouchEnd,this),$(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,n=i.mouseEventToContainerPoint(t.touches[0]),o=i.mouseEventToContainerPoint(t.touches[1]),s=n.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(s,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoomi.getMaxZoom()&&s>1)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),g(this._animRequest);var a=e(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=f(a,this,!0),$(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,g(this._animRequest),q(document,"touchmove",this._onTouchMove),q(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Le.addInitHook("addHandler","touchZoom",Cn),Le.BoxZoom=Ln,Le.DoubleClickZoom=Pn,Le.Drag=bn,Le.Keyboard=Tn,Le.ScrollWheelZoom=zn,Le.Tap=Mn,Le.TouchZoom=Cn;var Zn=window.L;window.L=t,Object.freeze=$t,t.version="1.3.1+HEAD.ba6f97f",t.noConflict=function(){return window.L=Zn,this},t.Control=Pe,t.control=be,t.Browser=$i,t.Evented=ui,t.Mixin=Ee,t.Util=ai,t.Class=v,t.Handler=Ze,t.extend=i,t.bind=e,t.stamp=n,t.setOptions=l,t.DomEvent=de,t.DomUtil=xe,t.PosAnimation=we,t.Draggable=Be,t.LineUtil=Oe,t.PolyUtil=Re,t.Point=x,t.point=w,t.Bounds=P,t.bounds=b,t.Transformation=Z,t.transformation=S,t.Projection=je,t.LatLng=M,t.latLng=C,t.LatLngBounds=T,t.latLngBounds=z,t.CRS=ci,t.GeoJSON=nn,t.geoJSON=Kt,t.geoJson=sn,t.Layer=Ue,t.LayerGroup=Ve,t.layerGroup=function(t,i){return new Ve(t,i)},t.FeatureGroup=qe,t.featureGroup=function(t){return new qe(t)},t.ImageOverlay=rn,t.imageOverlay=function(t,i,e){return new rn(t,i,e)},t.VideoOverlay=an,t.videoOverlay=function(t,i,e){return new an(t,i,e)},t.DivOverlay=hn,t.Popup=un,t.popup=function(t,i){return new un(t,i)},t.Tooltip=ln,t.tooltip=function(t,i){return new ln(t,i)},t.Icon=Ge,t.icon=function(t){return new Ge(t)},t.DivIcon=cn,t.divIcon=function(t){return new cn(t)},t.Marker=Xe,t.marker=function(t,i){return new Xe(t,i)},t.TileLayer=dn,t.tileLayer=Yt,t.GridLayer=_n,t.gridLayer=function(t){return new _n(t)},t.SVG=xn,t.svg=Jt,t.Renderer=mn,t.Canvas=fn,t.canvas=Xt,t.Path=Je,t.CircleMarker=$e,t.circleMarker=function(t,i){return new $e(t,i)},t.Circle=Qe,t.circle=function(t,i,e){return new Qe(t,i,e)},t.Polyline=tn,t.polyline=function(t,i){return new tn(t,i)},t.Polygon=en,t.polygon=function(t,i){return new en(t,i)},t.Rectangle=wn,t.rectangle=function(t,i){return new wn(t,i)},t.Map=Le,t.map=function(t,i){return new Le(t,i)}}); \ No newline at end of file diff --git a/inst/doc/neotoma2-package_files/leaflet-binding-2.1.2/leaflet.js b/inst/doc/neotoma2-package_files/leaflet-binding-2.1.2/leaflet.js deleted file mode 100644 index 1eafcbe..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-binding-2.1.2/leaflet.js +++ /dev/null @@ -1,2785 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i this.effectiveLength) throw new Error("Row argument was out of bounds: " + row + " > " + this.effectiveLength); - var colIndex = -1; - - if (typeof col === "undefined") { - var rowData = {}; - this.colnames.forEach(function (name, i) { - rowData[name] = _this3.columns[i][row % _this3.columns[i].length]; - }); - return rowData; - } else if (typeof col === "string") { - colIndex = this._colIndex(col); - } else if (typeof col === "number") { - colIndex = col; - } - - if (colIndex < 0 || colIndex > this.columns.length) { - if (missingOK) return void 0;else throw new Error("Unknown column index: " + col); - } - - return this.columns[colIndex][row % this.columns[colIndex].length]; - } - }, { - key: "nrow", - value: function nrow() { - return this.effectiveLength; - } - }]); - - return DataFrame; -}(); - -exports["default"] = DataFrame; - - -},{"./util":17}],5:[function(require,module,exports){ -"use strict"; - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// In RMarkdown's self-contained mode, we don't have a way to carry around the -// images that Leaflet needs but doesn't load into the page. Instead, we'll use -// the unpkg CDN. -if (typeof _leaflet2["default"].Icon.Default.imagePath === "undefined") { - _leaflet2["default"].Icon.Default.imagePath = "https://unpkg.com/leaflet@1.3.1/dist/images/"; -} - - -},{"./global/leaflet":10}],6:[function(require,module,exports){ -"use strict"; - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// add texxtsize, textOnly, and style -_leaflet2["default"].Tooltip.prototype.options.textsize = "10px"; -_leaflet2["default"].Tooltip.prototype.options.textOnly = false; -_leaflet2["default"].Tooltip.prototype.options.style = null; // copy original layout to not completely stomp it. - -var initLayoutOriginal = _leaflet2["default"].Tooltip.prototype._initLayout; - -_leaflet2["default"].Tooltip.prototype._initLayout = function () { - initLayoutOriginal.call(this); - this._container.style.fontSize = this.options.textsize; - - if (this.options.textOnly) { - _leaflet2["default"].DomUtil.addClass(this._container, "leaflet-tooltip-text-only"); - } - - if (this.options.style) { - for (var property in this.options.style) { - this._container.style[property] = this.options.style[property]; - } - } -}; - - -},{"./global/leaflet":10}],7:[function(require,module,exports){ -"use strict"; - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var protocolRegex = /^\/\//; - -var upgrade_protocol = function upgrade_protocol(urlTemplate) { - if (protocolRegex.test(urlTemplate)) { - if (window.location.protocol === "file:") { - // if in a local file, support http - // http should auto upgrade if necessary - urlTemplate = "http:" + urlTemplate; - } - } - - return urlTemplate; -}; - -var originalLTileLayerInitialize = _leaflet2["default"].TileLayer.prototype.initialize; - -_leaflet2["default"].TileLayer.prototype.initialize = function (urlTemplate, options) { - urlTemplate = upgrade_protocol(urlTemplate); - originalLTileLayerInitialize.call(this, urlTemplate, options); -}; - -var originalLTileLayerWMSInitialize = _leaflet2["default"].TileLayer.WMS.prototype.initialize; - -_leaflet2["default"].TileLayer.WMS.prototype.initialize = function (urlTemplate, options) { - urlTemplate = upgrade_protocol(urlTemplate); - originalLTileLayerWMSInitialize.call(this, urlTemplate, options); -}; - - -},{"./global/leaflet":10}],8:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = global.HTMLWidgets; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],9:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = global.jQuery; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],10:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = global.L; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],11:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = global.L.Proj; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],12:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = global.Shiny; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],13:[function(require,module,exports){ -"use strict"; - -var _jquery = require("./global/jquery"); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -var _shiny = require("./global/shiny"); - -var _shiny2 = _interopRequireDefault(_shiny); - -var _htmlwidgets = require("./global/htmlwidgets"); - -var _htmlwidgets2 = _interopRequireDefault(_htmlwidgets); - -var _util = require("./util"); - -var _crs_utils = require("./crs_utils"); - -var _controlStore = require("./control-store"); - -var _controlStore2 = _interopRequireDefault(_controlStore); - -var _layerManager = require("./layer-manager"); - -var _layerManager2 = _interopRequireDefault(_layerManager); - -var _methods = require("./methods"); - -var _methods2 = _interopRequireDefault(_methods); - -require("./fixup-default-icon"); - -require("./fixup-default-tooltip"); - -require("./fixup-url-protocol"); - -var _dataframe = require("./dataframe"); - -var _dataframe2 = _interopRequireDefault(_dataframe); - -var _clusterLayerStore = require("./cluster-layer-store"); - -var _clusterLayerStore2 = _interopRequireDefault(_clusterLayerStore); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -window.LeafletWidget = {}; -window.LeafletWidget.utils = {}; - -var methods = window.LeafletWidget.methods = _jquery2["default"].extend({}, _methods2["default"]); - -window.LeafletWidget.DataFrame = _dataframe2["default"]; -window.LeafletWidget.ClusterLayerStore = _clusterLayerStore2["default"]; -window.LeafletWidget.utils.getCRS = _crs_utils.getCRS; // Send updated bounds back to app. Takes a leaflet event object as input. - -function updateBounds(map) { - var id = map.getContainer().id; - var bounds = map.getBounds(); - - _shiny2["default"].onInputChange(id + "_bounds", { - north: bounds.getNorthEast().lat, - east: bounds.getNorthEast().lng, - south: bounds.getSouthWest().lat, - west: bounds.getSouthWest().lng - }); - - _shiny2["default"].onInputChange(id + "_center", { - lng: map.getCenter().lng, - lat: map.getCenter().lat - }); - - _shiny2["default"].onInputChange(id + "_zoom", map.getZoom()); -} - -function preventUnintendedZoomOnScroll(map) { - // Prevent unwanted scroll capturing. Similar in purpose to - // https://github.com/CliffCloud/Leaflet.Sleep but with a - // different set of heuristics. - // The basic idea is that when a mousewheel/DOMMouseScroll - // event is seen, we disable scroll wheel zooming until the - // user moves their mouse cursor or clicks on the map. This - // is slightly trickier than just listening for mousemove, - // because mousemove is fired when the page is scrolled, - // even if the user did not physically move the mouse. We - // handle this by examining the mousemove event's screenX - // and screenY properties; if they change, we know it's a - // "true" move. - // lastScreen can never be null, but its x and y can. - var lastScreen = { - x: null, - y: null - }; - (0, _jquery2["default"])(document).on("mousewheel DOMMouseScroll", "*", function (e) { - // Disable zooming (until the mouse moves or click) - map.scrollWheelZoom.disable(); // Any mousemove events at this screen position will be ignored. - - lastScreen = { - x: e.originalEvent.screenX, - y: e.originalEvent.screenY - }; - }); - (0, _jquery2["default"])(document).on("mousemove", "*", function (e) { - // Did the mouse really move? - if (lastScreen.x !== null && e.screenX !== lastScreen.x || e.screenY !== lastScreen.y) { - // It really moved. Enable zooming. - map.scrollWheelZoom.enable(); - lastScreen = { - x: null, - y: null - }; - } - }); - (0, _jquery2["default"])(document).on("mousedown", ".leaflet", function (e) { - // Clicking always enables zooming. - map.scrollWheelZoom.enable(); - lastScreen = { - x: null, - y: null - }; - }); -} - -_htmlwidgets2["default"].widget({ - name: "leaflet", - type: "output", - factory: function factory(el, width, height) { - var map = null; - return { - // we need to store our map in our returned object. - getMap: function getMap() { - return map; - }, - renderValue: function renderValue(data) { - // Create an appropriate CRS Object if specified - if (data && data.options && data.options.crs) { - data.options.crs = (0, _crs_utils.getCRS)(data.options.crs); - } // As per https://github.com/rstudio/leaflet/pull/294#discussion_r79584810 - - - if (map) { - map.remove(); - - map = function () { - return; - }(); // undefine map - - } - - if (data.options.mapFactory && typeof data.options.mapFactory === "function") { - map = data.options.mapFactory(el, data.options); - } else { - map = _leaflet2["default"].map(el, data.options); - } - - preventUnintendedZoomOnScroll(map); // Store some state in the map object - - map.leafletr = { - // Has the map ever rendered successfully? - hasRendered: false, - // Data to be rendered when resize is called with area != 0 - pendingRenderData: null - }; // Check if the map is rendered statically (no output binding) - - if (_htmlwidgets2["default"].shinyMode && /\bshiny-bound-output\b/.test(el.className)) { - map.id = el.id; // Store the map on the element so we can find it later by ID - - (0, _jquery2["default"])(el).data("leaflet-map", map); // When the map is clicked, send the coordinates back to the app - - map.on("click", function (e) { - _shiny2["default"].onInputChange(map.id + "_click", { - lat: e.latlng.lat, - lng: e.latlng.lng, - ".nonce": Math.random() // Force reactivity if lat/lng hasn't changed - - }); - }); - var groupTimerId = null; - map.on("moveend", function (e) { - updateBounds(e.target); - }).on("layeradd layerremove", function (e) { - // If the layer that's coming or going is a group we created, tell - // the server. - if (map.layerManager.getGroupNameFromLayerGroup(e.layer)) { - // But to avoid chattiness, coalesce events - if (groupTimerId) { - clearTimeout(groupTimerId); - groupTimerId = null; - } - - groupTimerId = setTimeout(function () { - groupTimerId = null; - - _shiny2["default"].onInputChange(map.id + "_groups", map.layerManager.getVisibleGroups()); - }, 100); - } - }); - } - - this.doRenderValue(data, map); - }, - doRenderValue: function doRenderValue(data, map) { - // Leaflet does not behave well when you set up a bunch of layers when - // the map is not visible (width/height == 0). Popups get misaligned - // relative to their owning markers, and the fitBounds calculations - // are off. Therefore we wait until the map is actually showing to - // render the value (we rely on the resize() callback being invoked - // at the appropriate time). - if (el.offsetWidth === 0 || el.offsetHeight === 0) { - map.leafletr.pendingRenderData = data; - return; - } - - map.leafletr.pendingRenderData = null; // Merge data options into defaults - - var options = _jquery2["default"].extend({ - zoomToLimits: "always" - }, data.options); - - if (!map.layerManager) { - map.controls = new _controlStore2["default"](map); - map.layerManager = new _layerManager2["default"](map); - } else { - map.controls.clear(); - map.layerManager.clear(); - } - - var explicitView = false; - - if (data.setView) { - explicitView = true; - map.setView.apply(map, data.setView); - } - - if (data.fitBounds) { - explicitView = true; - methods.fitBounds.apply(map, data.fitBounds); - } - - if (data.flyTo) { - if (!explicitView && !map.leafletr.hasRendered) { - // must be done to give a initial starting point - map.fitWorld(); - } - - explicitView = true; - map.flyTo.apply(map, data.flyTo); - } - - if (data.flyToBounds) { - if (!explicitView && !map.leafletr.hasRendered) { - // must be done to give a initial starting point - map.fitWorld(); - } - - explicitView = true; - methods.flyToBounds.apply(map, data.flyToBounds); - } - - if (data.options.center) { - explicitView = true; - } // Returns true if the zoomToLimits option says that the map should be - // zoomed to map elements. - - - function needsZoom() { - return options.zoomToLimits === "always" || options.zoomToLimits === "first" && !map.leafletr.hasRendered; - } - - if (!explicitView && needsZoom() && !map.getZoom()) { - if (data.limits && !_jquery2["default"].isEmptyObject(data.limits)) { - // Use the natural limits of what's being drawn on the map - // If the size of the bounding box is 0, leaflet gets all weird - var pad = 0.006; - - if (data.limits.lat[0] === data.limits.lat[1]) { - data.limits.lat[0] = data.limits.lat[0] - pad; - data.limits.lat[1] = data.limits.lat[1] + pad; - } - - if (data.limits.lng[0] === data.limits.lng[1]) { - data.limits.lng[0] = data.limits.lng[0] - pad; - data.limits.lng[1] = data.limits.lng[1] + pad; - } - - map.fitBounds([[data.limits.lat[0], data.limits.lng[0]], [data.limits.lat[1], data.limits.lng[1]]]); - } else { - map.fitWorld(); - } - } - - for (var i = 0; data.calls && i < data.calls.length; i++) { - var call = data.calls[i]; - if (methods[call.method]) methods[call.method].apply(map, call.args);else (0, _util.log)("Unknown method " + call.method); - } - - map.leafletr.hasRendered = true; - - if (_htmlwidgets2["default"].shinyMode) { - setTimeout(function () { - updateBounds(map); - }, 1); - } - }, - resize: function resize(width, height) { - if (map) { - map.invalidateSize(); - - if (map.leafletr.pendingRenderData) { - this.doRenderValue(map.leafletr.pendingRenderData, map); - } - } - } - }; - } -}); - -if (_htmlwidgets2["default"].shinyMode) { - _shiny2["default"].addCustomMessageHandler("leaflet-calls", function (data) { - var id = data.id; - var el = document.getElementById(id); - var map = el ? (0, _jquery2["default"])(el).data("leaflet-map") : null; - - if (!map) { - (0, _util.log)("Couldn't find map with id " + id); - return; - } // If the map has not rendered, stash the proposed `leafletProxy()` calls - // in `pendingRenderData.calls` to be run on display via `doRenderValue()`. - // This is necessary if the map has not been rendered. - // If new pendingRenderData is set via a new `leaflet()`, the previous calls will be discarded. - - - if (!map.leafletr.hasRendered) { - map.leafletr.pendingRenderData.calls = map.leafletr.pendingRenderData.calls.concat(data.calls); - return; - } - - for (var i = 0; i < data.calls.length; i++) { - var call = data.calls[i]; - var args = call.args; - - for (var _i = 0; _i < call.evals.length; _i++) { - window.HTMLWidgets.evaluateStringMember(args, call.evals[_i]); - } - - if (call.dependencies) { - _shiny2["default"].renderDependencies(call.dependencies); - } - - if (methods[call.method]) methods[call.method].apply(map, args);else (0, _util.log)("Unknown method " + call.method); - } - }); -} - - -},{"./cluster-layer-store":1,"./control-store":2,"./crs_utils":3,"./dataframe":4,"./fixup-default-icon":5,"./fixup-default-tooltip":6,"./fixup-url-protocol":7,"./global/htmlwidgets":8,"./global/jquery":9,"./global/leaflet":10,"./global/shiny":12,"./layer-manager":14,"./methods":15,"./util":17}],14:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = undefined; - -var _jquery = require("./global/jquery"); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -var _util = require("./util"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var LayerManager = /*#__PURE__*/function () { - function LayerManager(map) { - _classCallCheck(this, LayerManager); - - this._map = map; // BEGIN layer indices - // {: {: layer}} - - this._byGroup = {}; // {: {: layer}} - - this._byCategory = {}; // {: layer} - - this._byLayerId = {}; // {: { - // "group": , - // "layerId": , - // "category": , - // "container": - // } - // } - - this._byStamp = {}; // {: {: [, , ...], ...}} - - this._byCrosstalkGroup = {}; // END layer indices - // {: L.layerGroup} - - this._categoryContainers = {}; // {: L.layerGroup} - - this._groupContainers = {}; - } - - _createClass(LayerManager, [{ - key: "addLayer", - value: function addLayer(layer, category, layerId, group, ctGroup, ctKey) { - var _this = this; - - // Was a group provided? - var hasId = typeof layerId === "string"; - var grouped = typeof group === "string"; - var stamp = _leaflet2["default"].Util.stamp(layer) + ""; // This will be the default layer group to add the layer to. - // We may overwrite this let before using it (i.e. if a group is assigned). - // This one liner creates the _categoryContainers[category] entry if it - // doesn't already exist. - - var container = this._categoryContainers[category] = this._categoryContainers[category] || _leaflet2["default"].layerGroup().addTo(this._map); - - var oldLayer = null; - - if (hasId) { - // First, remove any layer with the same category and layerId - var prefixedLayerId = this._layerIdKey(category, layerId); - - oldLayer = this._byLayerId[prefixedLayerId]; - - if (oldLayer) { - this._removeLayer(oldLayer); - } // Update layerId index - - - this._byLayerId[prefixedLayerId] = layer; - } // Update group index - - - if (grouped) { - this._byGroup[group] = this._byGroup[group] || {}; - this._byGroup[group][stamp] = layer; // Since a group is assigned, don't add the layer to the category's layer - // group; instead, use the group's layer group. - // This one liner creates the _groupContainers[group] entry if it doesn't - // already exist. - - container = this.getLayerGroup(group, true); - } // Update category index - - - this._byCategory[category] = this._byCategory[category] || {}; - this._byCategory[category][stamp] = layer; // Update stamp index - - var layerInfo = this._byStamp[stamp] = { - layer: layer, - group: group, - ctGroup: ctGroup, - ctKey: ctKey, - layerId: layerId, - category: category, - container: container, - hidden: false - }; // Update crosstalk group index - - if (ctGroup) { - if (layer.setStyle) { - // Need to save this info so we know what to set opacity to later - layer.options.origOpacity = typeof layer.options.opacity !== "undefined" ? layer.options.opacity : 0.5; - layer.options.origFillOpacity = typeof layer.options.fillOpacity !== "undefined" ? layer.options.fillOpacity : 0.2; - } - - var ctg = this._byCrosstalkGroup[ctGroup]; - - if (!ctg) { - ctg = this._byCrosstalkGroup[ctGroup] = {}; - var crosstalk = global.crosstalk; - - var handleFilter = function handleFilter(e) { - if (!e.value) { - var groupKeys = Object.keys(ctg); - - for (var i = 0; i < groupKeys.length; i++) { - var key = groupKeys[i]; - var _layerInfo = _this._byStamp[ctg[key]]; - - _this._setVisibility(_layerInfo, true); - } - } else { - var selectedKeys = {}; - - for (var _i = 0; _i < e.value.length; _i++) { - selectedKeys[e.value[_i]] = true; - } - - var _groupKeys = Object.keys(ctg); - - for (var _i2 = 0; _i2 < _groupKeys.length; _i2++) { - var _key = _groupKeys[_i2]; - var _layerInfo2 = _this._byStamp[ctg[_key]]; - - _this._setVisibility(_layerInfo2, selectedKeys[_groupKeys[_i2]]); - } - } - }; - - var filterHandle = new crosstalk.FilterHandle(ctGroup); - filterHandle.on("change", handleFilter); - - var handleSelection = function handleSelection(e) { - if (!e.value || !e.value.length) { - var groupKeys = Object.keys(ctg); - - for (var i = 0; i < groupKeys.length; i++) { - var key = groupKeys[i]; - var _layerInfo3 = _this._byStamp[ctg[key]]; - - _this._setOpacity(_layerInfo3, 1.0); - } - } else { - var selectedKeys = {}; - - for (var _i3 = 0; _i3 < e.value.length; _i3++) { - selectedKeys[e.value[_i3]] = true; - } - - var _groupKeys2 = Object.keys(ctg); - - for (var _i4 = 0; _i4 < _groupKeys2.length; _i4++) { - var _key2 = _groupKeys2[_i4]; - var _layerInfo4 = _this._byStamp[ctg[_key2]]; - - _this._setOpacity(_layerInfo4, selectedKeys[_groupKeys2[_i4]] ? 1.0 : 0.2); - } - } - }; - - var selHandle = new crosstalk.SelectionHandle(ctGroup); - selHandle.on("change", handleSelection); - setTimeout(function () { - handleFilter({ - value: filterHandle.filteredKeys - }); - handleSelection({ - value: selHandle.value - }); - }, 100); - } - - if (!ctg[ctKey]) ctg[ctKey] = []; - ctg[ctKey].push(stamp); - } // Add to container - - - if (!layerInfo.hidden) container.addLayer(layer); - return oldLayer; - } - }, { - key: "brush", - value: function brush(bounds, extraInfo) { - var _this2 = this; - - /* eslint-disable no-console */ - // For each Crosstalk group... - Object.keys(this._byCrosstalkGroup).forEach(function (ctGroupName) { - var ctg = _this2._byCrosstalkGroup[ctGroupName]; - var selection = []; // ...iterate over each Crosstalk key (each of which may have multiple - // layers)... - - Object.keys(ctg).forEach(function (ctKey) { - // ...and for each layer... - ctg[ctKey].forEach(function (stamp) { - var layerInfo = _this2._byStamp[stamp]; // ...if it's something with a point... - - if (layerInfo.layer.getLatLng) { - // ... and it's inside the selection bounds... - // TODO: Use pixel containment, not lat/lng containment - if (bounds.contains(layerInfo.layer.getLatLng())) { - // ...add the key to the selection. - selection.push(ctKey); - } - } - }); - }); - new global.crosstalk.SelectionHandle(ctGroupName).set(selection, extraInfo); - }); - } - }, { - key: "unbrush", - value: function unbrush(extraInfo) { - Object.keys(this._byCrosstalkGroup).forEach(function (ctGroupName) { - new global.crosstalk.SelectionHandle(ctGroupName).clear(extraInfo); - }); - } - }, { - key: "_setVisibility", - value: function _setVisibility(layerInfo, visible) { - if (layerInfo.hidden ^ visible) { - return; - } else if (visible) { - layerInfo.container.addLayer(layerInfo.layer); - layerInfo.hidden = false; - } else { - layerInfo.container.removeLayer(layerInfo.layer); - layerInfo.hidden = true; - } - } - }, { - key: "_setOpacity", - value: function _setOpacity(layerInfo, opacity) { - if (layerInfo.layer.setOpacity) { - layerInfo.layer.setOpacity(opacity); - } else if (layerInfo.layer.setStyle) { - layerInfo.layer.setStyle({ - opacity: opacity * layerInfo.layer.options.origOpacity, - fillOpacity: opacity * layerInfo.layer.options.origFillOpacity - }); - } - } - }, { - key: "getLayer", - value: function getLayer(category, layerId) { - return this._byLayerId[this._layerIdKey(category, layerId)]; - } - }, { - key: "removeLayer", - value: function removeLayer(category, layerIds) { - var _this3 = this; - - // Find layer info - _jquery2["default"].each((0, _util.asArray)(layerIds), function (i, layerId) { - var layer = _this3._byLayerId[_this3._layerIdKey(category, layerId)]; - - if (layer) { - _this3._removeLayer(layer); - } - }); - } - }, { - key: "clearLayers", - value: function clearLayers(category) { - var _this4 = this; - - // Find all layers in _byCategory[category] - var catTable = this._byCategory[category]; - - if (!catTable) { - return false; - } // Remove all layers. Make copy of keys to avoid mutating the collection - // behind the iterator you're accessing. - - - var stamps = []; - - _jquery2["default"].each(catTable, function (k, v) { - stamps.push(k); - }); - - _jquery2["default"].each(stamps, function (i, stamp) { - _this4._removeLayer(stamp); - }); - } - }, { - key: "getLayerGroup", - value: function getLayerGroup(group, ensureExists) { - var g = this._groupContainers[group]; - - if (ensureExists && !g) { - this._byGroup[group] = this._byGroup[group] || {}; - g = this._groupContainers[group] = _leaflet2["default"].featureGroup(); - g.groupname = group; - g.addTo(this._map); - } - - return g; - } - }, { - key: "getGroupNameFromLayerGroup", - value: function getGroupNameFromLayerGroup(layerGroup) { - return layerGroup.groupname; - } - }, { - key: "getVisibleGroups", - value: function getVisibleGroups() { - var _this5 = this; - - var result = []; - - _jquery2["default"].each(this._groupContainers, function (k, v) { - if (_this5._map.hasLayer(v)) { - result.push(k); - } - }); - - return result; - } - }, { - key: "getAllGroupNames", - value: function getAllGroupNames() { - var result = []; - - _jquery2["default"].each(this._groupContainers, function (k, v) { - result.push(k); - }); - - return result; - } - }, { - key: "clearGroup", - value: function clearGroup(group) { - var _this6 = this; - - // Find all layers in _byGroup[group] - var groupTable = this._byGroup[group]; - - if (!groupTable) { - return false; - } // Remove all layers. Make copy of keys to avoid mutating the collection - // behind the iterator you're accessing. - - - var stamps = []; - - _jquery2["default"].each(groupTable, function (k, v) { - stamps.push(k); - }); - - _jquery2["default"].each(stamps, function (i, stamp) { - _this6._removeLayer(stamp); - }); - } - }, { - key: "clear", - value: function clear() { - function clearLayerGroup(key, layerGroup) { - layerGroup.clearLayers(); - } // Clear all indices and layerGroups - - - this._byGroup = {}; - this._byCategory = {}; - this._byLayerId = {}; - this._byStamp = {}; - this._byCrosstalkGroup = {}; - - _jquery2["default"].each(this._categoryContainers, clearLayerGroup); - - this._categoryContainers = {}; - - _jquery2["default"].each(this._groupContainers, clearLayerGroup); - - this._groupContainers = {}; - } - }, { - key: "_removeLayer", - value: function _removeLayer(layer) { - var stamp; - - if (typeof layer === "string") { - stamp = layer; - } else { - stamp = _leaflet2["default"].Util.stamp(layer); - } - - var layerInfo = this._byStamp[stamp]; - - if (!layerInfo) { - return false; - } - - layerInfo.container.removeLayer(stamp); - - if (typeof layerInfo.group === "string") { - delete this._byGroup[layerInfo.group][stamp]; - } - - if (typeof layerInfo.layerId === "string") { - delete this._byLayerId[this._layerIdKey(layerInfo.category, layerInfo.layerId)]; - } - - delete this._byCategory[layerInfo.category][stamp]; - delete this._byStamp[stamp]; - - if (layerInfo.ctGroup) { - var ctGroup = this._byCrosstalkGroup[layerInfo.ctGroup]; - var layersForKey = ctGroup[layerInfo.ctKey]; - var idx = layersForKey ? layersForKey.indexOf(stamp) : -1; - - if (idx >= 0) { - if (layersForKey.length === 1) { - delete ctGroup[layerInfo.ctKey]; - } else { - layersForKey.splice(idx, 1); - } - } - } - } - }, { - key: "_layerIdKey", - value: function _layerIdKey(category, layerId) { - return category + "\n" + layerId; - } - }]); - - return LayerManager; -}(); - -exports["default"] = LayerManager; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./global/jquery":9,"./global/leaflet":10,"./util":17}],15:[function(require,module,exports){ -(function (global){(function (){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = require("./global/jquery"); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _leaflet = require("./global/leaflet"); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -var _shiny = require("./global/shiny"); - -var _shiny2 = _interopRequireDefault(_shiny); - -var _htmlwidgets = require("./global/htmlwidgets"); - -var _htmlwidgets2 = _interopRequireDefault(_htmlwidgets); - -var _util = require("./util"); - -var _crs_utils = require("./crs_utils"); - -var _dataframe = require("./dataframe"); - -var _dataframe2 = _interopRequireDefault(_dataframe); - -var _clusterLayerStore = require("./cluster-layer-store"); - -var _clusterLayerStore2 = _interopRequireDefault(_clusterLayerStore); - -var _mipmapper = require("./mipmapper"); - -var _mipmapper2 = _interopRequireDefault(_mipmapper); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var methods = {}; -exports["default"] = methods; - -function mouseHandler(mapId, layerId, group, eventName, extraInfo) { - return function (e) { - if (!_htmlwidgets2["default"].shinyMode) return; - var latLng = e.target.getLatLng ? e.target.getLatLng() : e.latlng; - - if (latLng) { - // retrieve only lat, lon values to remove prototype - // and extra parameters added by 3rd party modules - // these objects are for json serialization, not javascript - var latLngVal = _leaflet2["default"].latLng(latLng); // make sure it has consistent shape - - - latLng = { - lat: latLngVal.lat, - lng: latLngVal.lng - }; - } - - var eventInfo = _jquery2["default"].extend({ - id: layerId, - ".nonce": Math.random() // force reactivity - - }, group !== null ? { - group: group - } : null, latLng, extraInfo); - - _shiny2["default"].onInputChange(mapId + "_" + eventName, eventInfo); - }; -} - -methods.mouseHandler = mouseHandler; - -methods.clearGroup = function (group) { - var _this = this; - - _jquery2["default"].each((0, _util.asArray)(group), function (i, v) { - _this.layerManager.clearGroup(v); - }); -}; - -methods.setView = function (center, zoom, options) { - this.setView(center, zoom, options); -}; - -methods.fitBounds = function (lat1, lng1, lat2, lng2, options) { - this.fitBounds([[lat1, lng1], [lat2, lng2]], options); -}; - -methods.flyTo = function (center, zoom, options) { - this.flyTo(center, zoom, options); -}; - -methods.flyToBounds = function (lat1, lng1, lat2, lng2, options) { - this.flyToBounds([[lat1, lng1], [lat2, lng2]], options); -}; - -methods.setMaxBounds = function (lat1, lng1, lat2, lng2) { - this.setMaxBounds([[lat1, lng1], [lat2, lng2]]); -}; - -methods.addPopups = function (lat, lng, popup, layerId, group, options) { - var _this2 = this; - - var df = new _dataframe2["default"]().col("lat", lat).col("lng", lng).col("popup", popup).col("layerId", layerId).col("group", group).cbind(options); - - var _loop = function _loop(i) { - if (_jquery2["default"].isNumeric(df.get(i, "lat")) && _jquery2["default"].isNumeric(df.get(i, "lng"))) { - (function () { - var popup = _leaflet2["default"].popup(df.get(i)).setLatLng([df.get(i, "lat"), df.get(i, "lng")]).setContent(df.get(i, "popup")); - - var thisId = df.get(i, "layerId"); - var thisGroup = df.get(i, "group"); - this.layerManager.addLayer(popup, "popup", thisId, thisGroup); - }).call(_this2); - } - }; - - for (var i = 0; i < df.nrow(); i++) { - _loop(i); - } -}; - -methods.removePopup = function (layerId) { - this.layerManager.removeLayer("popup", layerId); -}; - -methods.clearPopups = function () { - this.layerManager.clearLayers("popup"); -}; - -methods.addTiles = function (urlTemplate, layerId, group, options) { - this.layerManager.addLayer(_leaflet2["default"].tileLayer(urlTemplate, options), "tile", layerId, group); -}; - -methods.removeTiles = function (layerId) { - this.layerManager.removeLayer("tile", layerId); -}; - -methods.clearTiles = function () { - this.layerManager.clearLayers("tile"); -}; - -methods.addWMSTiles = function (baseUrl, layerId, group, options) { - if (options && options.crs) { - options.crs = (0, _crs_utils.getCRS)(options.crs); - } - - this.layerManager.addLayer(_leaflet2["default"].tileLayer.wms(baseUrl, options), "tile", layerId, group); -}; // Given: -// {data: ["a", "b", "c"], index: [0, 1, 0, 2]} -// returns: -// ["a", "b", "a", "c"] - - -function unpackStrings(iconset) { - if (!iconset) { - return iconset; - } - - if (typeof iconset.index === "undefined") { - return iconset; - } - - iconset.data = (0, _util.asArray)(iconset.data); - iconset.index = (0, _util.asArray)(iconset.index); - return _jquery2["default"].map(iconset.index, function (e, i) { - return iconset.data[e]; - }); -} - -function addMarkers(map, df, group, clusterOptions, clusterId, markerFunc) { - (function () { - var _this3 = this; - - var clusterGroup = this.layerManager.getLayer("cluster", clusterId), - cluster = clusterOptions !== null; - - if (cluster && !clusterGroup) { - clusterGroup = _leaflet2["default"].markerClusterGroup.layerSupport(clusterOptions); - - if (clusterOptions.freezeAtZoom) { - var freezeAtZoom = clusterOptions.freezeAtZoom; - delete clusterOptions.freezeAtZoom; - clusterGroup.freezeAtZoom(freezeAtZoom); - } - - clusterGroup.clusterLayerStore = new _clusterLayerStore2["default"](clusterGroup); - } - - var extraInfo = cluster ? { - clusterId: clusterId - } : {}; - - var _loop2 = function _loop2(i) { - if (_jquery2["default"].isNumeric(df.get(i, "lat")) && _jquery2["default"].isNumeric(df.get(i, "lng"))) { - (function () { - var marker = markerFunc(df, i); - var thisId = df.get(i, "layerId"); - var thisGroup = cluster ? null : df.get(i, "group"); - - if (cluster) { - clusterGroup.clusterLayerStore.add(marker, thisId); - } else { - this.layerManager.addLayer(marker, "marker", thisId, thisGroup, df.get(i, "ctGroup", true), df.get(i, "ctKey", true)); - } - - var popup = df.get(i, "popup"); - var popupOptions = df.get(i, "popupOptions"); - - if (popup !== null) { - if (popupOptions !== null) { - marker.bindPopup(popup, popupOptions); - } else { - marker.bindPopup(popup); - } - } - - var label = df.get(i, "label"); - var labelOptions = df.get(i, "labelOptions"); - - if (label !== null) { - if (labelOptions !== null) { - if (labelOptions.permanent) { - marker.bindTooltip(label, labelOptions).openTooltip(); - } else { - marker.bindTooltip(label, labelOptions); - } - } else { - marker.bindTooltip(label); - } - } - - marker.on("click", mouseHandler(this.id, thisId, thisGroup, "marker_click", extraInfo), this); - marker.on("mouseover", mouseHandler(this.id, thisId, thisGroup, "marker_mouseover", extraInfo), this); - marker.on("mouseout", mouseHandler(this.id, thisId, thisGroup, "marker_mouseout", extraInfo), this); - marker.on("dragend", mouseHandler(this.id, thisId, thisGroup, "marker_dragend", extraInfo), this); - }).call(_this3); - } - }; - - for (var i = 0; i < df.nrow(); i++) { - _loop2(i); - } - - if (cluster) { - this.layerManager.addLayer(clusterGroup, "cluster", clusterId, group); - } - }).call(map); -} - -methods.addGenericMarkers = addMarkers; - -methods.addMarkers = function (lat, lng, icon, layerId, group, options, popup, popupOptions, clusterOptions, clusterId, label, labelOptions, crosstalkOptions) { - var icondf; - var getIcon; - - if (icon) { - // Unpack icons - icon.iconUrl = unpackStrings(icon.iconUrl); - icon.iconRetinaUrl = unpackStrings(icon.iconRetinaUrl); - icon.shadowUrl = unpackStrings(icon.shadowUrl); - icon.shadowRetinaUrl = unpackStrings(icon.shadowRetinaUrl); // This cbinds the icon URLs and any other icon options; they're all - // present on the icon object. - - icondf = new _dataframe2["default"]().cbind(icon); // Constructs an icon from a specified row of the icon dataframe. - - getIcon = function getIcon(i) { - var opts = icondf.get(i); - - if (!opts.iconUrl) { - return new _leaflet2["default"].Icon.Default(); - } // Composite options (like points or sizes) are passed from R with each - // individual component as its own option. We need to combine them now - // into their composite form. - - - if (opts.iconWidth) { - opts.iconSize = [opts.iconWidth, opts.iconHeight]; - } - - if (opts.shadowWidth) { - opts.shadowSize = [opts.shadowWidth, opts.shadowHeight]; - } - - if (opts.iconAnchorX) { - opts.iconAnchor = [opts.iconAnchorX, opts.iconAnchorY]; - } - - if (opts.shadowAnchorX) { - opts.shadowAnchor = [opts.shadowAnchorX, opts.shadowAnchorY]; - } - - if (opts.popupAnchorX) { - opts.popupAnchor = [opts.popupAnchorX, opts.popupAnchorY]; - } - - return new _leaflet2["default"].Icon(opts); - }; - } - - if (!(_jquery2["default"].isEmptyObject(lat) || _jquery2["default"].isEmptyObject(lng)) || _jquery2["default"].isNumeric(lat) && _jquery2["default"].isNumeric(lng)) { - var df = new _dataframe2["default"]().col("lat", lat).col("lng", lng).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).cbind(options).cbind(crosstalkOptions || {}); - if (icon) icondf.effectiveLength = df.nrow(); - addMarkers(this, df, group, clusterOptions, clusterId, function (df, i) { - var options = df.get(i); - if (icon) options.icon = getIcon(i); - return _leaflet2["default"].marker([df.get(i, "lat"), df.get(i, "lng")], options); - }); - } -}; - -methods.addAwesomeMarkers = function (lat, lng, icon, layerId, group, options, popup, popupOptions, clusterOptions, clusterId, label, labelOptions, crosstalkOptions) { - var icondf; - var getIcon; - - if (icon) { - // This cbinds the icon URLs and any other icon options; they're all - // present on the icon object. - icondf = new _dataframe2["default"]().cbind(icon); // Constructs an icon from a specified row of the icon dataframe. - - getIcon = function getIcon(i) { - var opts = icondf.get(i); - - if (!opts) { - return new _leaflet2["default"].AwesomeMarkers.icon(); - } - - if (opts.squareMarker) { - opts.className = "awesome-marker awesome-marker-square"; - } - - return new _leaflet2["default"].AwesomeMarkers.icon(opts); - }; - } - - if (!(_jquery2["default"].isEmptyObject(lat) || _jquery2["default"].isEmptyObject(lng)) || _jquery2["default"].isNumeric(lat) && _jquery2["default"].isNumeric(lng)) { - var df = new _dataframe2["default"]().col("lat", lat).col("lng", lng).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).cbind(options).cbind(crosstalkOptions || {}); - if (icon) icondf.effectiveLength = df.nrow(); - addMarkers(this, df, group, clusterOptions, clusterId, function (df, i) { - var options = df.get(i); - if (icon) options.icon = getIcon(i); - return _leaflet2["default"].marker([df.get(i, "lat"), df.get(i, "lng")], options); - }); - } -}; - -function addLayers(map, category, df, layerFunc) { - var _loop3 = function _loop3(i) { - (function () { - var layer = layerFunc(df, i); - - if (!_jquery2["default"].isEmptyObject(layer)) { - var thisId = df.get(i, "layerId"); - var thisGroup = df.get(i, "group"); - this.layerManager.addLayer(layer, category, thisId, thisGroup, df.get(i, "ctGroup", true), df.get(i, "ctKey", true)); - - if (layer.bindPopup) { - var popup = df.get(i, "popup"); - var popupOptions = df.get(i, "popupOptions"); - - if (popup !== null) { - if (popupOptions !== null) { - layer.bindPopup(popup, popupOptions); - } else { - layer.bindPopup(popup); - } - } - } - - if (layer.bindTooltip) { - var label = df.get(i, "label"); - var labelOptions = df.get(i, "labelOptions"); - - if (label !== null) { - if (labelOptions !== null) { - layer.bindTooltip(label, labelOptions); - } else { - layer.bindTooltip(label); - } - } - } - - layer.on("click", mouseHandler(this.id, thisId, thisGroup, category + "_click"), this); - layer.on("mouseover", mouseHandler(this.id, thisId, thisGroup, category + "_mouseover"), this); - layer.on("mouseout", mouseHandler(this.id, thisId, thisGroup, category + "_mouseout"), this); - var highlightStyle = df.get(i, "highlightOptions"); - - if (!_jquery2["default"].isEmptyObject(highlightStyle)) { - var defaultStyle = {}; - - _jquery2["default"].each(highlightStyle, function (k, v) { - if (k != "bringToFront" && k != "sendToBack") { - if (df.get(i, k)) { - defaultStyle[k] = df.get(i, k); - } - } - }); - - layer.on("mouseover", function (e) { - this.setStyle(highlightStyle); - - if (highlightStyle.bringToFront) { - this.bringToFront(); - } - }); - layer.on("mouseout", function (e) { - this.setStyle(defaultStyle); - - if (highlightStyle.sendToBack) { - this.bringToBack(); - } - }); - } - } - }).call(map); - }; - - for (var i = 0; i < df.nrow(); i++) { - _loop3(i); - } -} - -methods.addGenericLayers = addLayers; - -methods.addCircles = function (lat, lng, radius, layerId, group, options, popup, popupOptions, label, labelOptions, highlightOptions, crosstalkOptions) { - if (!(_jquery2["default"].isEmptyObject(lat) || _jquery2["default"].isEmptyObject(lng)) || _jquery2["default"].isNumeric(lat) && _jquery2["default"].isNumeric(lng)) { - var df = new _dataframe2["default"]().col("lat", lat).col("lng", lng).col("radius", radius).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).col("highlightOptions", highlightOptions).cbind(options).cbind(crosstalkOptions || {}); - addLayers(this, "shape", df, function (df, i) { - if (_jquery2["default"].isNumeric(df.get(i, "lat")) && _jquery2["default"].isNumeric(df.get(i, "lng")) && _jquery2["default"].isNumeric(df.get(i, "radius"))) { - return _leaflet2["default"].circle([df.get(i, "lat"), df.get(i, "lng")], df.get(i, "radius"), df.get(i)); - } else { - return null; - } - }); - } -}; - -methods.addCircleMarkers = function (lat, lng, radius, layerId, group, options, clusterOptions, clusterId, popup, popupOptions, label, labelOptions, crosstalkOptions) { - if (!(_jquery2["default"].isEmptyObject(lat) || _jquery2["default"].isEmptyObject(lng)) || _jquery2["default"].isNumeric(lat) && _jquery2["default"].isNumeric(lng)) { - var df = new _dataframe2["default"]().col("lat", lat).col("lng", lng).col("radius", radius).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).cbind(crosstalkOptions || {}).cbind(options); - addMarkers(this, df, group, clusterOptions, clusterId, function (df, i) { - return _leaflet2["default"].circleMarker([df.get(i, "lat"), df.get(i, "lng")], df.get(i)); - }); - } -}; -/* - * @param lat Array of arrays of latitude coordinates for polylines - * @param lng Array of arrays of longitude coordinates for polylines - */ - - -methods.addPolylines = function (polygons, layerId, group, options, popup, popupOptions, label, labelOptions, highlightOptions) { - if (polygons.length > 0) { - var df = new _dataframe2["default"]().col("shapes", polygons).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).col("highlightOptions", highlightOptions).cbind(options); - addLayers(this, "shape", df, function (df, i) { - var shapes = df.get(i, "shapes"); - shapes = shapes.map(function (shape) { - return _htmlwidgets2["default"].dataframeToD3(shape[0]); - }); - - if (shapes.length > 1) { - return _leaflet2["default"].polyline(shapes, df.get(i)); - } else { - return _leaflet2["default"].polyline(shapes[0], df.get(i)); - } - }); - } -}; - -methods.removeMarker = function (layerId) { - this.layerManager.removeLayer("marker", layerId); -}; - -methods.clearMarkers = function () { - this.layerManager.clearLayers("marker"); -}; - -methods.removeMarkerCluster = function (layerId) { - this.layerManager.removeLayer("cluster", layerId); -}; - -methods.removeMarkerFromCluster = function (layerId, clusterId) { - var cluster = this.layerManager.getLayer("cluster", clusterId); - if (!cluster) return; - cluster.clusterLayerStore.remove(layerId); -}; - -methods.clearMarkerClusters = function () { - this.layerManager.clearLayers("cluster"); -}; - -methods.removeShape = function (layerId) { - this.layerManager.removeLayer("shape", layerId); -}; - -methods.clearShapes = function () { - this.layerManager.clearLayers("shape"); -}; - -methods.addRectangles = function (lat1, lng1, lat2, lng2, layerId, group, options, popup, popupOptions, label, labelOptions, highlightOptions) { - var df = new _dataframe2["default"]().col("lat1", lat1).col("lng1", lng1).col("lat2", lat2).col("lng2", lng2).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).col("highlightOptions", highlightOptions).cbind(options); - addLayers(this, "shape", df, function (df, i) { - if (_jquery2["default"].isNumeric(df.get(i, "lat1")) && _jquery2["default"].isNumeric(df.get(i, "lng1")) && _jquery2["default"].isNumeric(df.get(i, "lat2")) && _jquery2["default"].isNumeric(df.get(i, "lng2"))) { - return _leaflet2["default"].rectangle([[df.get(i, "lat1"), df.get(i, "lng1")], [df.get(i, "lat2"), df.get(i, "lng2")]], df.get(i)); - } else { - return null; - } - }); -}; -/* - * @param lat Array of arrays of latitude coordinates for polygons - * @param lng Array of arrays of longitude coordinates for polygons - */ - - -methods.addPolygons = function (polygons, layerId, group, options, popup, popupOptions, label, labelOptions, highlightOptions) { - if (polygons.length > 0) { - var df = new _dataframe2["default"]().col("shapes", polygons).col("layerId", layerId).col("group", group).col("popup", popup).col("popupOptions", popupOptions).col("label", label).col("labelOptions", labelOptions).col("highlightOptions", highlightOptions).cbind(options); - addLayers(this, "shape", df, function (df, i) { - // This code used to use L.multiPolygon, but that caused - // double-click on a multipolygon to fail to zoom in on the - // map. Surprisingly, putting all the rings in a single - // polygon seems to still work; complicated multipolygons - // are still rendered correctly. - var shapes = df.get(i, "shapes").map(function (polygon) { - return polygon.map(_htmlwidgets2["default"].dataframeToD3); - }).reduce(function (acc, val) { - return acc.concat(val); - }, []); - return _leaflet2["default"].polygon(shapes, df.get(i)); - }); - } -}; - -methods.addGeoJSON = function (data, layerId, group, style) { - // This time, self is actually needed because the callbacks below need - // to access both the inner and outer senses of "this" - var self = this; - - if (typeof data === "string") { - data = JSON.parse(data); - } - - var globalStyle = _jquery2["default"].extend({}, style, data.style || {}); - - var gjlayer = _leaflet2["default"].geoJson(data, { - style: function style(feature) { - if (feature.style || feature.properties.style) { - return _jquery2["default"].extend({}, globalStyle, feature.style, feature.properties.style); - } else { - return globalStyle; - } - }, - onEachFeature: function onEachFeature(feature, layer) { - var extraInfo = { - featureId: feature.id, - properties: feature.properties - }; - var popup = feature.properties ? feature.properties.popup : null; - if (typeof popup !== "undefined" && popup !== null) layer.bindPopup(popup); - layer.on("click", mouseHandler(self.id, layerId, group, "geojson_click", extraInfo), this); - layer.on("mouseover", mouseHandler(self.id, layerId, group, "geojson_mouseover", extraInfo), this); - layer.on("mouseout", mouseHandler(self.id, layerId, group, "geojson_mouseout", extraInfo), this); - } - }); - - this.layerManager.addLayer(gjlayer, "geojson", layerId, group); -}; - -methods.removeGeoJSON = function (layerId) { - this.layerManager.removeLayer("geojson", layerId); -}; - -methods.clearGeoJSON = function () { - this.layerManager.clearLayers("geojson"); -}; - -methods.addTopoJSON = function (data, layerId, group, style) { - // This time, self is actually needed because the callbacks below need - // to access both the inner and outer senses of "this" - var self = this; - - if (typeof data === "string") { - data = JSON.parse(data); - } - - var globalStyle = _jquery2["default"].extend({}, style, data.style || {}); - - var gjlayer = _leaflet2["default"].geoJson(null, { - style: function style(feature) { - if (feature.style || feature.properties.style) { - return _jquery2["default"].extend({}, globalStyle, feature.style, feature.properties.style); - } else { - return globalStyle; - } - }, - onEachFeature: function onEachFeature(feature, layer) { - var extraInfo = { - featureId: feature.id, - properties: feature.properties - }; - var popup = feature.properties.popup; - if (typeof popup !== "undefined" && popup !== null) layer.bindPopup(popup); - layer.on("click", mouseHandler(self.id, layerId, group, "topojson_click", extraInfo), this); - layer.on("mouseover", mouseHandler(self.id, layerId, group, "topojson_mouseover", extraInfo), this); - layer.on("mouseout", mouseHandler(self.id, layerId, group, "topojson_mouseout", extraInfo), this); - } - }); - - global.omnivore.topojson.parse(data, null, gjlayer); - this.layerManager.addLayer(gjlayer, "topojson", layerId, group); -}; - -methods.removeTopoJSON = function (layerId) { - this.layerManager.removeLayer("topojson", layerId); -}; - -methods.clearTopoJSON = function () { - this.layerManager.clearLayers("topojson"); -}; - -methods.addControl = function (html, position, layerId, classes) { - function onAdd(map) { - var div = _leaflet2["default"].DomUtil.create("div", classes); - - if (typeof layerId !== "undefined" && layerId !== null) { - div.setAttribute("id", layerId); - } - - this._div = div; // It's possible for window.Shiny to be true but Shiny.initializeInputs to - // not be, when a static leaflet widget is included as part of the shiny - // UI directly (not through leafletOutput or uiOutput). In this case we - // don't do the normal Shiny stuff as that will all happen when Shiny - // itself loads and binds the entire doc. - - if (window.Shiny && _shiny2["default"].initializeInputs) { - _shiny2["default"].renderHtml(html, this._div); - - _shiny2["default"].initializeInputs(this._div); - - _shiny2["default"].bindAll(this._div); - } else { - this._div.innerHTML = html; - } - - return this._div; - } - - function onRemove(map) { - if (window.Shiny && _shiny2["default"].unbindAll) { - _shiny2["default"].unbindAll(this._div); - } - } - - var Control = _leaflet2["default"].Control.extend({ - options: { - position: position - }, - onAdd: onAdd, - onRemove: onRemove - }); - - this.controls.add(new Control(), layerId, html); -}; - -methods.addCustomControl = function (control, layerId) { - this.controls.add(control, layerId); -}; - -methods.removeControl = function (layerId) { - this.controls.remove(layerId); -}; - -methods.getControl = function (layerId) { - this.controls.get(layerId); -}; - -methods.clearControls = function () { - this.controls.clear(); -}; - -methods.addLegend = function (options) { - var legend = _leaflet2["default"].control({ - position: options.position - }); - - var gradSpan; - - legend.onAdd = function (map) { - var div = _leaflet2["default"].DomUtil.create("div", options.className), - colors = options.colors, - labels = options.labels, - legendHTML = ""; - - if (options.type === "numeric") { - // # Formatting constants. - var singleBinHeight = 20; // The distance between tick marks, in px - - var vMargin = 8; // If 1st tick mark starts at top of gradient, how - // many extra px are needed for the top half of the - // 1st label? (ditto for last tick mark/label) - - var tickWidth = 4; // How wide should tick marks be, in px? - - var labelPadding = 6; // How much distance to reserve for tick mark? - // (Must be >= tickWidth) - // # Derived formatting parameters. - // What's the height of a single bin, in percentage (of gradient height)? - // It might not just be 1/(n-1), if the gradient extends past the tick - // marks (which can be the case for pretty cut points). - - var singleBinPct = (options.extra.p_n - options.extra.p_1) / (labels.length - 1); // Each bin is `singleBinHeight` high. How tall is the gradient? - - var totalHeight = 1 / singleBinPct * singleBinHeight + 1; // How far should the first tick be shifted down, relative to the top - // of the gradient? - - var tickOffset = singleBinHeight / singleBinPct * options.extra.p_1; - gradSpan = (0, _jquery2["default"])("").css({ - "background": "linear-gradient(" + colors + ")", - "opacity": options.opacity, - "height": totalHeight + "px", - "width": "18px", - "display": "block", - "margin-top": vMargin + "px" - }); - var leftDiv = (0, _jquery2["default"])("
").css("float", "left"), - rightDiv = (0, _jquery2["default"])("
").css("float", "left"); - leftDiv.append(gradSpan); - (0, _jquery2["default"])(div).append(leftDiv).append(rightDiv).append((0, _jquery2["default"])("
")); // Have to attach the div to the body at this early point, so that the - // svg text getComputedTextLength() actually works, below. - - document.body.appendChild(div); - var ns = "http://www.w3.org/2000/svg"; - var svg = document.createElementNS(ns, "svg"); - rightDiv.append(svg); - var g = document.createElementNS(ns, "g"); - (0, _jquery2["default"])(g).attr("transform", "translate(0, " + vMargin + ")"); - svg.appendChild(g); // max label width needed to set width of svg, and right-justify text - - var maxLblWidth = 0; // Create tick marks and labels - - _jquery2["default"].each(labels, function (i, label) { - var y = tickOffset + i * singleBinHeight + 0.5; - var thisLabel = document.createElementNS(ns, "text"); - (0, _jquery2["default"])(thisLabel).text(labels[i]).attr("y", y).attr("dx", labelPadding).attr("dy", "0.5ex"); - g.appendChild(thisLabel); - maxLblWidth = Math.max(maxLblWidth, thisLabel.getComputedTextLength()); - var thisTick = document.createElementNS(ns, "line"); - (0, _jquery2["default"])(thisTick).attr("x1", 0).attr("x2", tickWidth).attr("y1", y).attr("y2", y).attr("stroke-width", 1); - g.appendChild(thisTick); - }); // Now that we know the max label width, we can right-justify - - - (0, _jquery2["default"])(svg).find("text").attr("dx", labelPadding + maxLblWidth).attr("text-anchor", "end"); // Final size for - - (0, _jquery2["default"])(svg).css({ - width: maxLblWidth + labelPadding + "px", - height: totalHeight + vMargin * 2 + "px" - }); - - if (options.na_color && _jquery2["default"].inArray(options.na_label, labels) < 0) { - (0, _jquery2["default"])(div).append("
" + options.na_label + "
"); - } - } else { - if (options.na_color && _jquery2["default"].inArray(options.na_label, labels) < 0) { - colors.push(options.na_color); - labels.push(options.na_label); - } - - for (var i = 0; i < colors.length; i++) { - legendHTML += " " + labels[i] + "
"; - } - - div.innerHTML = legendHTML; - } - - if (options.title) (0, _jquery2["default"])(div).prepend("
" + options.title + "
"); - return div; - }; - - if (options.group) { - // Auto generate a layerID if not provided - if (!options.layerId) { - options.layerId = _leaflet2["default"].Util.stamp(legend); - } - - var map = this; - map.on("overlayadd", function (e) { - if (e.name === options.group) { - map.controls.add(legend, options.layerId); - } - }); - map.on("overlayremove", function (e) { - if (e.name === options.group) { - map.controls.remove(options.layerId); - } - }); - map.on("groupadd", function (e) { - if (e.name === options.group) { - map.controls.add(legend, options.layerId); - } - }); - map.on("groupremove", function (e) { - if (e.name === options.group) { - map.controls.remove(options.layerId); - } - }); - } - - this.controls.add(legend, options.layerId); -}; - -methods.addLayersControl = function (baseGroups, overlayGroups, options) { - var _this4 = this; - - // Only allow one layers control at a time - methods.removeLayersControl.call(this); - var firstLayer = true; - var base = {}; - - _jquery2["default"].each((0, _util.asArray)(baseGroups), function (i, g) { - var layer = _this4.layerManager.getLayerGroup(g, true); - - if (layer) { - base[g] = layer; // Check if >1 base layers are visible; if so, hide all but the first one - - if (_this4.hasLayer(layer)) { - if (firstLayer) { - firstLayer = false; - } else { - _this4.removeLayer(layer); - } - } - } - }); - - var overlay = {}; - - _jquery2["default"].each((0, _util.asArray)(overlayGroups), function (i, g) { - var layer = _this4.layerManager.getLayerGroup(g, true); - - if (layer) { - overlay[g] = layer; - } - }); - - this.currentLayersControl = _leaflet2["default"].control.layers(base, overlay, options); - this.addControl(this.currentLayersControl); -}; - -methods.removeLayersControl = function () { - if (this.currentLayersControl) { - this.removeControl(this.currentLayersControl); - this.currentLayersControl = null; - } -}; - -methods.addScaleBar = function (options) { - // Only allow one scale bar at a time - methods.removeScaleBar.call(this); - - var scaleBar = _leaflet2["default"].control.scale(options).addTo(this); - - this.currentScaleBar = scaleBar; -}; - -methods.removeScaleBar = function () { - if (this.currentScaleBar) { - this.currentScaleBar.remove(); - this.currentScaleBar = null; - } -}; - -methods.hideGroup = function (group) { - var _this5 = this; - - _jquery2["default"].each((0, _util.asArray)(group), function (i, g) { - var layer = _this5.layerManager.getLayerGroup(g, true); - - if (layer) { - _this5.removeLayer(layer); - } - }); -}; - -methods.showGroup = function (group) { - var _this6 = this; - - _jquery2["default"].each((0, _util.asArray)(group), function (i, g) { - var layer = _this6.layerManager.getLayerGroup(g, true); - - if (layer) { - _this6.addLayer(layer); - } - }); -}; - -function setupShowHideGroupsOnZoom(map) { - if (map.leafletr._hasInitializedShowHideGroups) { - return; - } - - map.leafletr._hasInitializedShowHideGroups = true; - - function setVisibility(layer, visible, group) { - if (visible !== map.hasLayer(layer)) { - if (visible) { - map.addLayer(layer); - map.fire("groupadd", { - "name": group, - "layer": layer - }); - } else { - map.removeLayer(layer); - map.fire("groupremove", { - "name": group, - "layer": layer - }); - } - } - } - - function showHideGroupsOnZoom() { - if (!map.layerManager) return; - var zoom = map.getZoom(); - map.layerManager.getAllGroupNames().forEach(function (group) { - var layer = map.layerManager.getLayerGroup(group, false); - - if (layer && typeof layer.zoomLevels !== "undefined") { - setVisibility(layer, layer.zoomLevels === true || layer.zoomLevels.indexOf(zoom) >= 0, group); - } - }); - } - - map.showHideGroupsOnZoom = showHideGroupsOnZoom; - map.on("zoomend", showHideGroupsOnZoom); -} - -methods.setGroupOptions = function (group, options) { - var _this7 = this; - - _jquery2["default"].each((0, _util.asArray)(group), function (i, g) { - var layer = _this7.layerManager.getLayerGroup(g, true); // This slightly tortured check is because 0 is a valid value for zoomLevels - - - if (typeof options.zoomLevels !== "undefined" && options.zoomLevels !== null) { - layer.zoomLevels = (0, _util.asArray)(options.zoomLevels); - } - }); - - setupShowHideGroupsOnZoom(this); - this.showHideGroupsOnZoom(); -}; - -methods.addRasterImage = function (uri, bounds, opacity, attribution, layerId, group) { - // uri is a data URI containing an image. We want to paint this image as a - // layer at (top-left) bounds[0] to (bottom-right) bounds[1]. - // We can't simply use ImageOverlay, as it uses bilinear scaling which looks - // awful as you zoom in (and sometimes shifts positions or disappears). - // Instead, we'll use a TileLayer.Canvas to draw pieces of the image. - // First, some helper functions. - // degree2tile converts latitude, longitude, and zoom to x and y tile - // numbers. The tile numbers returned can be non-integral, as there's no - // reason to expect that the lat/lng inputs are exactly on the border of two - // tiles. - // - // We'll use this to convert the bounds we got from the server, into coords - // in tile-space at a given zoom level. Note that once we do the conversion, - // we don't to do any more trigonometry to convert between pixel coordinates - // and tile coordinates; the source image pixel coords, destination canvas - // pixel coords, and tile coords all can be scaled linearly. - function degree2tile(lat, lng, zoom) { - // See http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames - var latRad = lat * Math.PI / 180; - var n = Math.pow(2, zoom); - var x = (lng + 180) / 360 * n; - var y = (1 - Math.log(Math.tan(latRad) + 1 / Math.cos(latRad)) / Math.PI) / 2 * n; - return { - x: x, - y: y - }; - } // Given a range [from,to) and either one or two numbers, returns true if - // there is any overlap between [x,x1) and the range--or if x1 is omitted, - // then returns true if x is within [from,to). - - - function overlap(from, to, x, - /* optional */ - x1) { - if (arguments.length == 3) x1 = x; - return x < to && x1 >= from; - } - - function getCanvasSmoothingProperty(ctx) { - var candidates = ["imageSmoothingEnabled", "mozImageSmoothingEnabled", "webkitImageSmoothingEnabled", "msImageSmoothingEnabled"]; - - for (var i = 0; i < candidates.length; i++) { - if (typeof ctx[candidates[i]] !== "undefined") { - return candidates[i]; - } - } - - return null; - } // Our general strategy is to: - // 1. Load the data URI in an Image() object, so we can get its pixel - // dimensions and the underlying image data. (We could have done this - // by not encoding as PNG at all but just send an array of RGBA values - // from the server, but that would inflate the JSON too much.) - // 2. Create a hidden canvas that we use just to extract the image data - // from the Image (using Context2D.getImageData()). - // 3. Create a TileLayer.Canvas and add it to the map. - // We want to synchronously create and attach the TileLayer.Canvas (so an - // immediate call to clearRasters() will be respected, for example), but - // Image loads its data asynchronously. Fortunately we can resolve this - // by putting TileLayer.Canvas into async mode, which will let us create - // and attach the layer but have it wait until the image is loaded before - // it actually draws anything. - // These are the variables that we will populate once the image is loaded. - - - var imgData = null; // 1d row-major array, four [0-255] integers per pixel - - var imgDataMipMapper = null; - var w = null; // image width in pixels - - var h = null; // image height in pixels - // We'll use this array to store callbacks that need to be invoked once - // imgData, w, and h have been resolved. - - var imgDataCallbacks = []; // Consumers of imgData, w, and h can call this to be notified when data - // is available. - - function getImageData(callback) { - if (imgData != null) { - // Must not invoke the callback immediately; it's too confusing and - // fragile to have a function invoke the callback *either* immediately - // or in the future. Better to be consistent here. - setTimeout(function () { - callback(imgData, w, h, imgDataMipMapper); - }, 0); - } else { - imgDataCallbacks.push(callback); - } - } - - var img = new Image(); - - img.onload = function () { - // Save size - w = img.width; - h = img.height; // Create a dummy canvas to extract the image data - - var imgDataCanvas = document.createElement("canvas"); - imgDataCanvas.width = w; - imgDataCanvas.height = h; - imgDataCanvas.style.display = "none"; - document.body.appendChild(imgDataCanvas); - var imgDataCtx = imgDataCanvas.getContext("2d"); - imgDataCtx.drawImage(img, 0, 0); // Save the image data. - - imgData = imgDataCtx.getImageData(0, 0, w, h).data; - imgDataMipMapper = new _mipmapper2["default"](img); // Done with the canvas, remove it from the page so it can be gc'd. - - document.body.removeChild(imgDataCanvas); // Alert any getImageData callers who are waiting. - - for (var i = 0; i < imgDataCallbacks.length; i++) { - imgDataCallbacks[i](imgData, w, h, imgDataMipMapper); - } - - imgDataCallbacks = []; - }; - - img.src = uri; - - var canvasTiles = _leaflet2["default"].gridLayer({ - opacity: opacity, - attribution: attribution, - detectRetina: true, - async: true - }); // NOTE: The done() function MUST NOT be invoked until after the current - // tick; done() looks in Leaflet's tile cache for the current tile, and - // since it's still being constructed, it won't be found. - - - canvasTiles.createTile = function (tilePoint, done) { - var zoom = tilePoint.z; - - var canvas = _leaflet2["default"].DomUtil.create("canvas"); - - var error; // setup tile width and height according to the options - - var size = this.getTileSize(); - canvas.width = size.x; - canvas.height = size.y; - getImageData(function (imgData, w, h, mipmapper) { - try { - // The Context2D we'll being drawing onto. It's always 256x256. - var ctx = canvas.getContext("2d"); // Convert our image data's top-left and bottom-right locations into - // x/y tile coordinates. This is essentially doing a spherical mercator - // projection, then multiplying by 2^zoom. - - var topLeft = degree2tile(bounds[0][0], bounds[0][1], zoom); - var bottomRight = degree2tile(bounds[1][0], bounds[1][1], zoom); // The size of the image in x/y tile coordinates. - - var extent = { - x: bottomRight.x - topLeft.x, - y: bottomRight.y - topLeft.y - }; // Short circuit if tile is totally disjoint from image. - - if (!overlap(tilePoint.x, tilePoint.x + 1, topLeft.x, bottomRight.x)) return; - if (!overlap(tilePoint.y, tilePoint.y + 1, topLeft.y, bottomRight.y)) return; // The linear resolution of the tile we're drawing is always 256px per tile unit. - // If the linear resolution (in either direction) of the image is less than 256px - // per tile unit, then use nearest neighbor; otherwise, use the canvas's built-in - // scaling. - - var imgRes = { - x: w / extent.x, - y: h / extent.y - }; // We can do the actual drawing in one of three ways: - // - Call drawImage(). This is easy and fast, and results in smooth - // interpolation (bilinear?). This is what we want when we are - // reducing the image from its native size. - // - Call drawImage() with imageSmoothingEnabled=false. This is easy - // and fast and gives us nearest-neighbor interpolation, which is what - // we want when enlarging the image. However, it's unsupported on many - // browsers (including QtWebkit). - // - Do a manual nearest-neighbor interpolation. This is what we'll fall - // back to when enlarging, and imageSmoothingEnabled isn't supported. - // In theory it's slower, but still pretty fast on my machine, and the - // results look the same AFAICT. - // Is imageSmoothingEnabled supported? If so, we can let canvas do - // nearest-neighbor interpolation for us. - - var smoothingProperty = getCanvasSmoothingProperty(ctx); - - if (smoothingProperty || imgRes.x >= 256 && imgRes.y >= 256) { - // Use built-in scaling - // Turn off anti-aliasing if necessary - if (smoothingProperty) { - ctx[smoothingProperty] = imgRes.x >= 256 && imgRes.y >= 256; - } // Don't necessarily draw with the full-size image; if we're - // downscaling, use the mipmapper to get a pre-downscaled image - // (see comments on Mipmapper class for why this matters). - - - mipmapper.getBySize(extent.x * 256, extent.y * 256, function (mip) { - // It's possible that the image will go off the edge of the canvas-- - // that's OK, the canvas should clip appropriately. - ctx.drawImage(mip, // Convert abs tile coords to rel tile coords, then *256 to convert - // to rel pixel coords - (topLeft.x - tilePoint.x) * 256, (topLeft.y - tilePoint.y) * 256, // Always draw the whole thing and let canvas clip; so we can just - // convert from size in tile coords straight to pixels - extent.x * 256, extent.y * 256); - }); - } else { - // Use manual nearest-neighbor interpolation - // Calculate the source image pixel coordinates that correspond with - // the top-left and bottom-right of this tile. (If the source image - // only partially overlaps the tile, we use max/min to limit the - // sourceStart/End to only reflect the overlapping portion.) - var sourceStart = { - x: Math.max(0, Math.floor((tilePoint.x - topLeft.x) * imgRes.x)), - y: Math.max(0, Math.floor((tilePoint.y - topLeft.y) * imgRes.y)) - }; - var sourceEnd = { - x: Math.min(w, Math.ceil((tilePoint.x + 1 - topLeft.x) * imgRes.x)), - y: Math.min(h, Math.ceil((tilePoint.y + 1 - topLeft.y) * imgRes.y)) - }; // The size, in dest pixels, that each source pixel should occupy. - // This might be greater or less than 1 (e.g. if x and y resolution - // are very different). - - var pixelSize = { - x: 256 / imgRes.x, - y: 256 / imgRes.y - }; // For each pixel in the source image that overlaps the tile... - - for (var row = sourceStart.y; row < sourceEnd.y; row++) { - for (var col = sourceStart.x; col < sourceEnd.x; col++) { - // ...extract the pixel data... - var i = (row * w + col) * 4; - var r = imgData[i]; - var g = imgData[i + 1]; - var b = imgData[i + 2]; - var a = imgData[i + 3]; - ctx.fillStyle = "rgba(" + [r, g, b, a / 255].join(",") + ")"; // ...calculate the corresponding pixel coord in the dest image - // where it should be drawn... - - var pixelPos = { - x: (col / imgRes.x + topLeft.x - tilePoint.x) * 256, - y: (row / imgRes.y + topLeft.y - tilePoint.y) * 256 - }; // ...and draw a rectangle there. - - ctx.fillRect(Math.round(pixelPos.x), Math.round(pixelPos.y), // Looks crazy, but this is necessary to prevent rounding from - // causing overlap between this rect and its neighbors. The - // minuend is the location of the next pixel, while the - // subtrahend is the position of the current pixel (to turn an - // absolute coordinate to a width/height). Yes, I had to look - // up minuend and subtrahend. - Math.round(pixelPos.x + pixelSize.x) - Math.round(pixelPos.x), Math.round(pixelPos.y + pixelSize.y) - Math.round(pixelPos.y)); - } - } - } - } catch (e) { - error = e; - } finally { - done(error, canvas); - } - }); - return canvas; - }; - - this.layerManager.addLayer(canvasTiles, "image", layerId, group); -}; - -methods.removeImage = function (layerId) { - this.layerManager.removeLayer("image", layerId); -}; - -methods.clearImages = function () { - this.layerManager.clearLayers("image"); -}; - -methods.addMeasure = function (options) { - // if a measureControl already exists, then remove it and - // replace with a new one - methods.removeMeasure.call(this); - this.measureControl = _leaflet2["default"].control.measure(options); - this.addControl(this.measureControl); -}; - -methods.removeMeasure = function () { - if (this.measureControl) { - this.removeControl(this.measureControl); - this.measureControl = null; - } -}; - -methods.addSelect = function (ctGroup) { - var _this8 = this; - - methods.removeSelect.call(this); - this._selectButton = _leaflet2["default"].easyButton({ - states: [{ - stateName: "select-inactive", - icon: "ion-qr-scanner", - title: "Make a selection", - onClick: function onClick(btn, map) { - btn.state("select-active"); - _this8._locationFilter = new _leaflet2["default"].LocationFilter2(); - - if (ctGroup) { - var selectionHandle = new global.crosstalk.SelectionHandle(ctGroup); - selectionHandle.on("change", function (e) { - if (e.sender !== selectionHandle) { - if (_this8._locationFilter) { - _this8._locationFilter.disable(); - - btn.state("select-inactive"); - } - } - }); - - var handler = function handler(e) { - _this8.layerManager.brush(_this8._locationFilter.getBounds(), { - sender: selectionHandle - }); - }; - - _this8._locationFilter.on("enabled", handler); - - _this8._locationFilter.on("change", handler); - - _this8._locationFilter.on("disabled", function () { - selectionHandle.close(); - _this8._locationFilter = null; - }); - } - - _this8._locationFilter.addTo(map); - } - }, { - stateName: "select-active", - icon: "ion-close-round", - title: "Dismiss selection", - onClick: function onClick(btn, map) { - btn.state("select-inactive"); - - _this8._locationFilter.disable(); // If explicitly dismissed, clear the crosstalk selections - - - _this8.layerManager.unbrush(); - } - }] - }); - - this._selectButton.addTo(this); -}; - -methods.removeSelect = function () { - if (this._locationFilter) { - this._locationFilter.disable(); - } - - if (this._selectButton) { - this.removeControl(this._selectButton); - this._selectButton = null; - } -}; - -methods.createMapPane = function (name, zIndex) { - this.createPane(name); - this.getPane(name).style.zIndex = zIndex; -}; - - -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./cluster-layer-store":1,"./crs_utils":3,"./dataframe":4,"./global/htmlwidgets":8,"./global/jquery":9,"./global/leaflet":10,"./global/shiny":12,"./mipmapper":16,"./util":17}],16:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -// This class simulates a mipmap, which shrinks images by powers of two. This -// stepwise reduction results in "pixel-perfect downscaling" (where every -// pixel of the original image has some contribution to the downscaled image) -// as opposed to a single-step downscaling which will discard a lot of data -// (and with sparse images at small scales can give very surprising results). -var Mipmapper = /*#__PURE__*/function () { - function Mipmapper(img) { - _classCallCheck(this, Mipmapper); - - this._layers = [img]; - } // The various functions on this class take a callback function BUT MAY OR MAY - // NOT actually behave asynchronously. - - - _createClass(Mipmapper, [{ - key: "getBySize", - value: function getBySize(desiredWidth, desiredHeight, callback) { - var _this = this; - - var i = 0; - var lastImg = this._layers[0]; - - var testNext = function testNext() { - _this.getByIndex(i, function (img) { - // If current image is invalid (i.e. too small to be rendered) or - // it's smaller than what we wanted, return the last known good image. - if (!img || img.width < desiredWidth || img.height < desiredHeight) { - callback(lastImg); - return; - } else { - lastImg = img; - i++; - testNext(); - return; - } - }); - }; - - testNext(); - } - }, { - key: "getByIndex", - value: function getByIndex(i, callback) { - var _this2 = this; - - if (this._layers[i]) { - callback(this._layers[i]); - return; - } - - this.getByIndex(i - 1, function (prevImg) { - if (!prevImg) { - // prevImg could not be calculated (too small, possibly) - callback(null); - return; - } - - if (prevImg.width < 2 || prevImg.height < 2) { - // Can't reduce this image any further - callback(null); - return; - } // If reduce ever becomes truly asynchronous, we should stuff a promise or - // something into this._layers[i] before calling this.reduce(), to prevent - // redundant reduce operations from happening. - - - _this2.reduce(prevImg, function (reducedImg) { - _this2._layers[i] = reducedImg; - callback(reducedImg); - return; - }); - }); - } - }, { - key: "reduce", - value: function reduce(img, callback) { - var imgDataCanvas = document.createElement("canvas"); - imgDataCanvas.width = Math.ceil(img.width / 2); - imgDataCanvas.height = Math.ceil(img.height / 2); - imgDataCanvas.style.display = "none"; - document.body.appendChild(imgDataCanvas); - - try { - var imgDataCtx = imgDataCanvas.getContext("2d"); - imgDataCtx.drawImage(img, 0, 0, img.width / 2, img.height / 2); - callback(imgDataCanvas); - } finally { - document.body.removeChild(imgDataCanvas); - } - } - }]); - - return Mipmapper; -}(); - -exports["default"] = Mipmapper; - - -},{}],17:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.log = log; -exports.recycle = recycle; -exports.asArray = asArray; - -function log(message) { - /* eslint-disable no-console */ - if (console && console.log) console.log(message); - /* eslint-enable no-console */ -} - -function recycle(values, length, inPlace) { - if (length === 0 && !inPlace) return []; - - if (!(values instanceof Array)) { - if (inPlace) { - throw new Error("Can't do in-place recycling of a non-Array value"); - } - - values = [values]; - } - - if (typeof length === "undefined") length = values.length; - var dest = inPlace ? values : []; - var origLength = values.length; - - while (dest.length < length) { - dest.push(values[dest.length % origLength]); - } - - if (dest.length > length) { - dest.splice(length, dest.length - length); - } - - return dest; -} - -function asArray(value) { - if (value instanceof Array) return value;else return [value]; -} - - -},{}]},{},[13]); diff --git a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MIT-LICENCE.txt b/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MIT-LICENCE.txt deleted file mode 100644 index 19af068..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MIT-LICENCE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2012 David Leaver - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.Default.css b/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.Default.css deleted file mode 100644 index bbc8c9f..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.Default.css +++ /dev/null @@ -1,60 +0,0 @@ -.marker-cluster-small { - background-color: rgba(181, 226, 140, 0.6); - } -.marker-cluster-small div { - background-color: rgba(110, 204, 57, 0.6); - } - -.marker-cluster-medium { - background-color: rgba(241, 211, 87, 0.6); - } -.marker-cluster-medium div { - background-color: rgba(240, 194, 12, 0.6); - } - -.marker-cluster-large { - background-color: rgba(253, 156, 115, 0.6); - } -.marker-cluster-large div { - background-color: rgba(241, 128, 23, 0.6); - } - - /* IE 6-8 fallback colors */ -.leaflet-oldie .marker-cluster-small { - background-color: rgb(181, 226, 140); - } -.leaflet-oldie .marker-cluster-small div { - background-color: rgb(110, 204, 57); - } - -.leaflet-oldie .marker-cluster-medium { - background-color: rgb(241, 211, 87); - } -.leaflet-oldie .marker-cluster-medium div { - background-color: rgb(240, 194, 12); - } - -.leaflet-oldie .marker-cluster-large { - background-color: rgb(253, 156, 115); - } -.leaflet-oldie .marker-cluster-large div { - background-color: rgb(241, 128, 23); -} - -.marker-cluster { - background-clip: padding-box; - border-radius: 20px; - } -.marker-cluster div { - width: 30px; - height: 30px; - margin-left: 5px; - margin-top: 5px; - - text-align: center; - border-radius: 15px; - font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif; - } -.marker-cluster span { - line-height: 30px; - } \ No newline at end of file diff --git a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.css b/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.css deleted file mode 100644 index c60d71b..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/MarkerCluster.css +++ /dev/null @@ -1,14 +0,0 @@ -.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { - -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in; - -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in; - -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in; - transition: transform 0.3s ease-out, opacity 0.3s ease-in; -} - -.leaflet-cluster-spider-leg { - /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */ - -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in; - -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in; - -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in; - transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; -} diff --git a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.freezable.js b/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.freezable.js deleted file mode 100644 index 093a72a..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.freezable.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - Leaflet.MarkerCluster.Freezable 1.0.0+9db80a3 - (c) 2015-2016 Boris Seang - License MIT - */ -!function(e,i){"function"==typeof define&&define.amd?define(["leaflet"],i):i("object"==typeof module&&module.exports?require("leaflet"):e.L)}(this,function(e,i){e.MarkerClusterGroup.include({_originalOnAddFreezable:e.MarkerClusterGroup.prototype.onAdd,onAdd:function(e){var i=this._zoom;this._originalOnAddFreezable(e),this._frozen&&(i>=0&&i!==this._zoom&&(this._featureGroup.clearLayers(),this._zoom=i,this.addLayers([])),e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),e.on("zoomend moveend",this._viewChangeEndNotClustering,this))},_originalOnRemove:e.MarkerClusterGroup.prototype.onRemove,onRemove:function(e){e.off("zoomend moveend",this._viewChangeEndNotClustering,this),this._originalOnRemove(e)},disableClustering:function(){return this.freezeAtZoom(this._maxZoom+1)},disableClusteringKeepSpiderfy:function(){return this.freezeAtZoom(this._maxZoom)},enableClustering:function(){return this.unfreeze()},unfreeze:function(){return this.freezeAtZoom(!1)},freezeAtZoom:function(e){this._processQueue();var o=this._map;e===i||e===!0||e!==e?e=o?Math.round(o.getZoom()):-1:"max"===e?e=this._maxZoom+1:"maxKeepSpiderfy"===e&&(e=this._maxZoom);var t="number"==typeof e;if(this._frozen){if(!t)return this._unfreeze(),this}else{if(!t)return this;this._initiateFreeze()}return this._artificialZoomSafe(this._zoom,e),this},_initiateFreeze:function(){var e=this._map;this._frozen=!0,e&&(e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),e.on("zoomend moveend",this._viewChangeEndNotClustering,this))},_unfreeze:function(){var e=this._map;this._frozen=!1,e&&(e.off("zoomend moveend",this._viewChangeEndNotClustering,this),e.on("zoomend",this._zoomEnd,this),e.on("moveend",this._moveEnd,this),this._executeAfterUnspiderfy(function(){this._zoomEnd()},this))},_executeAfterUnspiderfy:function(e,i){return this._unspiderfy&&this._spiderfied?(this.once("animationend",function(){e.call(i)}),void this._unspiderfy()):void e.call(i)},_artificialZoomSafe:function(e,i){this._zoom=i,this._map&&e!==i&&this._executeAfterUnspiderfy(function(){this._artificialZoom(e,i)},this)},_artificialZoom:function(e,i){ei&&(this._animationStart(),this._animationZoomOut(e,i))},_viewChangeEndNotClustering:function(){var e=this._featureGroup,i=this._getExpandedVisibleBounds(),o=this._zoom;e.eachLayer(function(t){!i.contains(t._latlng)&&t.__parent&&t.__parent._zoom=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,n=this._featureGroup,r=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){for(var c=(new Date).getTime();h>l;l++){if(s&&0===l%200){var p=(new Date).getTime()-c;if(p>o)break}if(i=e[l],i instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];n.removeLayer(m)}}else r.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(l,h,(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;h>l;l++)i=e[l],i instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):r.addLayer(i);return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=n;for(t=0;h>t;t++)i=a[t],i instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,n,r,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),n=s.length-1;n>=0;n--){for(i=!0,r=o.length-1;r>=0;r--)if(o[r].layer===s[n]){i=!1;break}i&&e.call(t,s[n])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){"function"!=typeof t&&(t=function(){});var i=function(){!e._icon&&!e.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),e._icon?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoomt;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){e.target.__dragStart&&this._moveChild(e.target,e.target.__dragStart,e.target._latlng),delete e.target.__dragStart},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoomt?"small":100>t?"medium":"large",new L.DivIcon({html:"
"+t+"
",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(t||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){for(var t=e.layer,i=t;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(e||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,n,r=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=r[t].getNearObject(i);if(a)return a._addChild(e),e.__parent=a,void 0;if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);r[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(n=t-1;n>h._zoom;n--)u=new this._markerCluster(this,n,u),r[n].addObject(u,this._map.project(a.getLatLng(),n));return h._addChild(u),this._removeFromGridUnclustered(a,t),void 0}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;ee?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==i&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,n=e.getLayers(),r=0;for(t=t||[];r=0;i--)o=h[i],n.contains(o._latlng)||r.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),r.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,s,function(e){r.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(n,i,r,function(e){e._recursivelyRemoveChildrenFromMap(n,r,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(t.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)},L.MarkerCluster=L.Marker.extend({initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e){e=e||[];for(var t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(e);for(var i=this._markers.length-1;i>=0;i--)e.push(this._markers[i]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),n=this._group._map,r=n.getBoundsZoom(this._bounds),s=this._zoom+1,o=n.getZoom();i.length>0&&r>s;){s++;var a=[];for(t=0;ts?this._group._map.setView(this._latlng,s):o>=r?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,n,r=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())},function(e){var i,n,r=e._childClusters;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var s=n._markers[r];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),n._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)r=e._markers[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)r=e._childClusters[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var s,o,a=this._childClusters,h=this._zoom;if(h>=t&&(n&&n(this),r&&h===i&&r(this)),t>h||i>h)for(s=a.length-1;s>=0;s--)o=a[s],e.intersects(o._bounds)&&o._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var e=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,e}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,s=r[n]=r[n]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,n,r=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,n=h.length;n>i;i++)if(h[i]===e)return h.splice(i,1),1===n&&delete a[r],!0},eachObject:function(e,t){var i,n,r,s,o,a,h,l=this._grid;for(i in l){o=l[i];for(n in o)for(a=o[n],r=0,s=a.length;s>r;r++)h=e.call(t,a[r]),h&&(r--,s--)}},getNearObject:function(e){var t,i,n,r,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,c=null;for(t=u-1;u+1>=t;t++)if(r=this._grid[t])for(i=l-1;l+1>=i;i++)if(s=r[i])for(n=0,o=s.length;o>n;n++)a=s[n],h=this._sqDist(_[L.Util.stamp(a)],e),(d>h||d>=h&&null===c)&&(d=h,c=a);return c},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,n,r,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)n=t[i],r=this.getDistant(n,e),r>0&&(a.push(n),r>s&&(s=r,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints))):[e[0]]},getConvexHull:function(e){var t,i=!1,n=!1,r=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(i===!1||d.lat>i)&&(o=d,i=d.lat),(n===!1||d.latr)&&(h=d,r=d.lng),(s===!1||d.lng=0;t--)e=i[t].getLatLng(),n.push(e);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(),i=this._group,n=i._map,r=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,r):(r.y+=10,e=this._generatePointsCircle(t.length,r)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,n,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),s=r/this._2PI,o=this._2PI/e,a=[];for(a.length=e,i=e-1;i>=0;i--)n=this._circleStartAngle+i*o,a[i]=new L.Point(t.x+s*Math.cos(n),t.y+s*Math.sin(n))._round();return a},_generatePointsSpiral:function(e,t){var i,n=this._group.options.spiderfyDistanceMultiplier,r=n*this._spiralLengthStart,s=n*this._spiralFootSeparation,o=n*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e-1;i>=0;i--)a+=s/r+5e-4*i,h[i]=new L.Point(t.x+r*Math.cos(a),t.y+r*Math.sin(a))._round(),r+=o/a;return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,n=i._map,r=i._featureGroup,s=this.getAllChildMarkers();for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],r.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(n.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,n,r,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i=0;n--)h=_.layerPointToLatLng(t[n]),r=e[n],r._preSpiderfyLatlng=r._latlng,r.setLatLng(h),r.clusterShow&&r.clusterShow(),f&&(s=r._spiderLeg,o=s._path,o.style.strokeDashoffset=0,s.setStyle({opacity:g}));this.setOpacity(.3),u._ignoreMove=!1,setTimeout(function(){u._animationEnd(),u.fire("spiderfied",{cluster:l,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,n,r,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(),c=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)t=d[i],t._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),c&&(n=t._spiderLeg,r=n._path,s=r.getTotalLength()+.1,r.style.strokeDashoffset=s,n.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy() -},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}})}(window,document); \ No newline at end of file diff --git a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.layersupport.js b/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.layersupport.js deleted file mode 100644 index dd41e8c..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-markercluster-1.0.5/leaflet.markercluster.layersupport.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - Leaflet.MarkerCluster.LayerSupport 1.0.5+87f3848 - (c) 2015-2017 Boris Seang - License MIT - */ -!function(e,r){"function"==typeof define&&define.amd?define(["leaflet"],r):r("object"==typeof module&&module.exports?require("leaflet"):e.L)}(this,function(e,r){e.MarkerClusterGroup.LayerSupport=e.MarkerClusterGroup.extend({options:{singleAddRemoveBufferDuration:100},initialize:function(r){e.MarkerClusterGroup.prototype.initialize.call(this,r),this._featureGroup=new o,this._featureGroup.addEventParent(this),this._nonPointGroup=new o,this._nonPointGroup.addEventParent(this),this._layers={},this._proxyLayerGroups={},this._proxyLayerGroupsNeedRemoving={},this._singleAddRemoveBuffer=[]},checkIn:function(e){var r=this._toArray(e);return this._checkInGetSeparated(r),this},checkOut:function(r){var o,t,i=this._toArray(r),a=this._separateSingleFromGroupLayers(i,{groups:[],singles:[]}),s=a.groups,n=a.singles;for(o=0;o0?(this._singleAddRemoveBuffer.push({type:o,layer:r}),this._singleAddRemoveBufferTimeout||(t=e.bind(this._processSingleAddRemoveBuffer,this),this._singleAddRemoveBufferTimeout=setTimeout(t,i))):this[o](r)},_processSingleAddRemoveBuffer:function(){for(var e,r,o=this._singleAddRemoveBuffer,t=0,i=[];tOpenStreetMap contributors' - }, - variants: { - Mapnik: {}, - DE: { - url: '//{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', - options: { - maxZoom: 18 - } - }, - CH: { - url: '//tile.osm.ch/switzerland/{z}/{x}/{y}.png', - options: { - maxZoom: 18, - bounds: [[45, 5], [48, 11]] - } - }, - France: { - url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', - options: { - maxZoom: 20, - attribution: '© Openstreetmap France | {attribution.OpenStreetMap}' - } - }, - HOT: { - url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', - options: { - attribution: - '{attribution.OpenStreetMap}, ' + - 'Tiles style by Humanitarian OpenStreetMap Team ' + - 'hosted by OpenStreetMap France' - } - }, - BZH: { - url: '//tile.openstreetmap.bzh/br/{z}/{x}/{y}.png', - options: { - attribution: '{attribution.OpenStreetMap}, Tiles courtesy of Breton OpenStreetMap Team', - bounds: [[46.2, -5.5], [50, 0.7]] - } - } - } - }, - OpenSeaMap: { - url: '//tiles.openseamap.org/seamark/{z}/{x}/{y}.png', - options: { - attribution: 'Map data: © OpenSeaMap contributors' - } - }, - OpenPtMap: { - url: 'http://openptmap.org/tiles/{z}/{x}/{y}.png', - options: { - maxZoom: 17, - attribution: 'Map data: © OpenPtMap contributors' - } - }, - OpenTopoMap: { - url: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', - options: { - maxZoom: 17, - attribution: 'Map data: {attribution.OpenStreetMap}, SRTM | Map style: © OpenTopoMap (CC-BY-SA)' - } - }, - OpenRailwayMap: { - url: 'https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © OpenRailwayMap (CC-BY-SA)' - } - }, - OpenFireMap: { - url: 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © OpenFireMap (CC-BY-SA)' - } - }, - SafeCast: { - url: '//s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png', - options: { - maxZoom: 16, - attribution: 'Map data: {attribution.OpenStreetMap} | Map style: © SafeCast (CC-BY-SA)' - } - }, - Thunderforest: { - url: 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', - options: { - attribution: - '© Thunderforest, {attribution.OpenStreetMap}', - variant: 'cycle', - apikey: '', - maxZoom: 22 - }, - variants: { - OpenCycleMap: 'cycle', - Transport: { - options: { - variant: 'transport' - } - }, - TransportDark: { - options: { - variant: 'transport-dark' - } - }, - SpinalMap: { - options: { - variant: 'spinal-map' - } - }, - Landscape: 'landscape', - Outdoors: 'outdoors', - Pioneer: 'pioneer', - MobileAtlas: 'mobile-atlas', - Neighbourhood: 'neighbourhood' - } - }, - OpenMapSurfer: { - url: 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - variant: 'roads', - attribution: 'Imagery from GIScience Research Group @ University of Heidelberg | Map data ' - }, - variants: { - Roads: { - options: { - variant: 'roads', - attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}' - } - }, - Hybrid: { - options: { - variant: 'hybrid', - attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}' - } - }, - AdminBounds: { - options: { - variant: 'adminb', - maxZoom: 18, - attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}' - } - }, - ContourLines: { - options: { - variant: 'asterc', - maxZoom: 18, - minZoom: 13, - attribution: '{attribution.OpenMapSurfer} ASTER GDEM' - } - }, - Hillshade: { - options: { - variant: 'asterh', - maxZoom: 18, - attribution: '{attribution.OpenMapSurfer} ASTER GDEM, SRTM' - } - }, - ElementsAtRisk: { - options: { - variant: 'elements_at_risk', - attribution: '{attribution.OpenMapSurfer}{attribution.OpenStreetMap}' - } - } - } - }, - Hydda: { - url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', - options: { - maxZoom: 18, - variant: 'full', - attribution: 'Tiles courtesy of OpenStreetMap Sweden — Map data {attribution.OpenStreetMap}' - }, - variants: { - Full: 'full', - Base: 'base', - RoadsAndLabels: 'roads_and_labels' - } - }, - MapBox: { - url: 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}', - options: { - attribution: - '© Mapbox ' + - '{attribution.OpenStreetMap} ' + - 'Improve this map', - subdomains: 'abcd', - id: 'mapbox.streets', - accessToken: '', - } - }, - Stamen: { - url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', - options: { - attribution: - 'Map tiles by Stamen Design, ' + - 'CC BY 3.0 — ' + - 'Map data {attribution.OpenStreetMap}', - subdomains: 'abcd', - minZoom: 0, - maxZoom: 20, - variant: 'toner', - ext: 'png' - }, - variants: { - Toner: 'toner', - TonerBackground: 'toner-background', - TonerHybrid: 'toner-hybrid', - TonerLines: 'toner-lines', - TonerLabels: 'toner-labels', - TonerLite: 'toner-lite', - Watercolor: { - url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', - options: { - variant: 'watercolor', - ext: 'jpg', - minZoom: 1, - maxZoom: 16 - } - }, - Terrain: { - options: { - variant: 'terrain', - minZoom: 0, - maxZoom: 18 - } - }, - TerrainBackground: { - options: { - variant: 'terrain-background', - minZoom: 0, - maxZoom: 18 - } - }, - TerrainLabels: { - options: { - variant: 'terrain-labels', - minZoom: 0, - maxZoom: 18 - } - }, - TopOSMRelief: { - url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', - options: { - variant: 'toposm-color-relief', - ext: 'jpg', - bounds: [[22, -132], [51, -56]] - } - }, - TopOSMFeatures: { - options: { - variant: 'toposm-features', - bounds: [[22, -132], [51, -56]], - opacity: 0.9 - } - } - } - }, - TomTom: { - url: 'https://{s}.api.tomtom.com/map/1/tile/{variant}/{style}/{z}/{x}/{y}.{ext}?key={apikey}', - options: { - variant: 'basic', - maxZoom: 22, - attribution: - '© 1992 - ' + new Date().getFullYear() + ' TomTom. ', - subdomains: 'abcd', - style: 'main', - ext: 'png', - apikey: '', - }, - variants: { - Basic: 'basic', - Hybrid: 'hybrid', - Labels: 'labels' - } - }, - Esri: { - url: '//server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', - options: { - variant: 'World_Street_Map', - attribution: 'Tiles © Esri' - }, - variants: { - WorldStreetMap: { - options: { - attribution: - '{attribution.Esri} — ' + - 'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012' - } - }, - DeLorme: { - options: { - variant: 'Specialty/DeLorme_World_Base_Map', - minZoom: 1, - maxZoom: 11, - attribution: '{attribution.Esri} — Copyright: ©2012 DeLorme' - } - }, - WorldTopoMap: { - options: { - variant: 'World_Topo_Map', - attribution: - '{attribution.Esri} — ' + - 'Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community' - } - }, - WorldImagery: { - options: { - variant: 'World_Imagery', - attribution: - '{attribution.Esri} — ' + - 'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' - } - }, - WorldTerrain: { - options: { - variant: 'World_Terrain_Base', - maxZoom: 13, - attribution: - '{attribution.Esri} — ' + - 'Source: USGS, Esri, TANA, DeLorme, and NPS' - } - }, - WorldShadedRelief: { - options: { - variant: 'World_Shaded_Relief', - maxZoom: 13, - attribution: '{attribution.Esri} — Source: Esri' - } - }, - WorldPhysical: { - options: { - variant: 'World_Physical_Map', - maxZoom: 8, - attribution: '{attribution.Esri} — Source: US National Park Service' - } - }, - OceanBasemap: { - options: { - variant: 'Ocean_Basemap', - maxZoom: 13, - attribution: '{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri' - } - }, - NatGeoWorldMap: { - options: { - variant: 'NatGeo_World_Map', - maxZoom: 16, - attribution: '{attribution.Esri} — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC' - } - }, - WorldGrayCanvas: { - options: { - variant: 'Canvas/World_Light_Gray_Base', - maxZoom: 16, - attribution: '{attribution.Esri} — Esri, DeLorme, NAVTEQ' - } - } - } - }, - OpenWeatherMap: { - url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', - options: { - maxZoom: 19, - attribution: 'Map data © OpenWeatherMap', - apiKey:'', - opacity: 0.5 - }, - variants: { - Clouds: 'clouds', - CloudsClassic: 'clouds_cls', - Precipitation: 'precipitation', - PrecipitationClassic: 'precipitation_cls', - Rain: 'rain', - RainClassic: 'rain_cls', - Pressure: 'pressure', - PressureContour: 'pressure_cntr', - Wind: 'wind', - Temperature: 'temp', - Snow: 'snow' - } - }, - HERE: { - /* - * HERE maps, formerly Nokia maps. - * These basemaps are free, but you need an API key. Please sign up at - * https://developer.here.com/plans - */ - url: - 'https://{s}.{base}.maps.api.here.com/maptile/2.1/' + - '{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' + - 'app_id={app_id}&app_code={app_code}&lg={language}', - options: { - attribution: - 'Map © 1987-' + new Date().getFullYear() + ' HERE', - subdomains: '1234', - mapID: 'newest', - 'app_id': '', - 'app_code': '', - base: 'base', - variant: 'normal.day', - maxZoom: 20, - type: 'maptile', - language: 'eng', - format: 'png8', - size: '256' - }, - variants: { - normalDay: 'normal.day', - normalDayCustom: 'normal.day.custom', - normalDayGrey: 'normal.day.grey', - normalDayMobile: 'normal.day.mobile', - normalDayGreyMobile: 'normal.day.grey.mobile', - normalDayTransit: 'normal.day.transit', - normalDayTransitMobile: 'normal.day.transit.mobile', - normalDayTraffic: { - options: { - variant: 'normal.traffic.day', - base: 'traffic', - type: 'traffictile' - } - }, - normalNight: 'normal.night', - normalNightMobile: 'normal.night.mobile', - normalNightGrey: 'normal.night.grey', - normalNightGreyMobile: 'normal.night.grey.mobile', - normalNightTransit: 'normal.night.transit', - normalNightTransitMobile: 'normal.night.transit.mobile', - reducedDay: 'reduced.day', - reducedNight: 'reduced.night', - basicMap: { - options: { - type: 'basetile' - } - }, - mapLabels: { - options: { - type: 'labeltile', - format: 'png' - } - }, - trafficFlow: { - options: { - base: 'traffic', - type: 'flowtile' - } - }, - carnavDayGrey: 'carnav.day.grey', - hybridDay: { - options: { - base: 'aerial', - variant: 'hybrid.day' - } - }, - hybridDayMobile: { - options: { - base: 'aerial', - variant: 'hybrid.day.mobile' - } - }, - hybridDayTransit: { - options: { - base: 'aerial', - variant: 'hybrid.day.transit' - } - }, - hybridDayGrey: { - options: { - base: 'aerial', - variant: 'hybrid.grey.day' - } - }, - hybridDayTraffic: { - options: { - variant: 'hybrid.traffic.day', - base: 'traffic', - type: 'traffictile' - } - }, - pedestrianDay: 'pedestrian.day', - pedestrianNight: 'pedestrian.night', - satelliteDay: { - options: { - base: 'aerial', - variant: 'satellite.day' - } - }, - terrainDay: { - options: { - base: 'aerial', - variant: 'terrain.day' - } - }, - terrainDayMobile: { - options: { - base: 'aerial', - variant: 'terrain.day.mobile' - } - } - } - }, - FreeMapSK: { - url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg', - options: { - minZoom: 8, - maxZoom: 16, - subdomains: '1234', - bounds: [[47.204642, 15.996093], [49.830896, 22.576904]], - attribution: - '{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 Freemap.sk' - } - }, - MtbMap: { - url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', - options: { - attribution: - '{attribution.OpenStreetMap} & USGS' - } - }, - CartoDB: { - url: 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', - options: { - attribution: '{attribution.OpenStreetMap} © CARTO', - subdomains: 'abcd', - maxZoom: 19, - variant: 'light_all' - }, - variants: { - Positron: 'light_all', - PositronNoLabels: 'light_nolabels', - PositronOnlyLabels: 'light_only_labels', - DarkMatter: 'dark_all', - DarkMatterNoLabels: 'dark_nolabels', - DarkMatterOnlyLabels: 'dark_only_labels', - Voyager: 'rastertiles/voyager', - VoyagerNoLabels: 'rastertiles/voyager_nolabels', - VoyagerOnlyLabels: 'rastertiles/voyager_only_labels', - VoyagerLabelsUnder: 'rastertiles/voyager_labels_under' - } - }, - HikeBike: { - url: 'https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png', - options: { - maxZoom: 19, - attribution: '{attribution.OpenStreetMap}', - variant: 'hikebike' - }, - variants: { - HikeBike: {}, - HillShading: { - options: { - maxZoom: 15, - variant: 'hillshading' - } - } - } - }, - BasemapAT: { - url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', - options: { - maxZoom: 19, - attribution: 'Datenquelle: basemap.at', - subdomains: ['', '1', '2', '3', '4'], - format: 'png', - bounds: [[46.358770, 8.782379], [49.037872, 17.189532]], - variant: 'geolandbasemap' - }, - variants: { - basemap: { - options: { - maxZoom: 20, // currently only in Vienna - variant: 'geolandbasemap' - } - }, - grau: 'bmapgrau', - overlay: 'bmapoverlay', - highdpi: { - options: { - variant: 'bmaphidpi', - format: 'jpeg' - } - }, - orthofoto: { - options: { - maxZoom: 20, // currently only in Vienna - variant: 'bmaporthofoto30cm', - format: 'jpeg' - } - } - } - }, - nlmaps: { - url: '//geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png', - options: { - minZoom: 6, - maxZoom: 19, - bounds: [[50.5, 3.25], [54, 7.6]], - attribution: 'Kaartgegevens © Kadaster' - }, - variants: { - 'standaard': 'brtachtergrondkaart', - 'pastel': 'brtachtergrondkaartpastel', - 'grijs': 'brtachtergrondkaartgrijs', - 'luchtfoto': { - 'url': '//geodata.nationaalgeoregister.nl/luchtfoto/rgb/wmts/1.0.0/2016_ortho25/EPSG:3857/{z}/{x}/{y}.png', - } - } - }, - NASAGIBS: { - url: 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}', - options: { - attribution: - 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System ' + - '(ESDIS) with funding provided by NASA/HQ.', - bounds: [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], - minZoom: 1, - maxZoom: 9, - format: 'jpg', - time: '', - tilematrixset: 'GoogleMapsCompatible_Level' - }, - variants: { - ModisTerraTrueColorCR: 'MODIS_Terra_CorrectedReflectance_TrueColor', - ModisTerraBands367CR: 'MODIS_Terra_CorrectedReflectance_Bands367', - ViirsEarthAtNight2012: { - options: { - variant: 'VIIRS_CityLights_2012', - maxZoom: 8 - } - }, - ModisTerraLSTDay: { - options: { - variant: 'MODIS_Terra_Land_Surface_Temp_Day', - format: 'png', - maxZoom: 7, - opacity: 0.75 - } - }, - ModisTerraSnowCover: { - options: { - variant: 'MODIS_Terra_Snow_Cover', - format: 'png', - maxZoom: 8, - opacity: 0.75 - } - }, - ModisTerraAOD: { - options: { - variant: 'MODIS_Terra_Aerosol', - format: 'png', - maxZoom: 6, - opacity: 0.75 - } - }, - ModisTerraChlorophyll: { - options: { - variant: 'MODIS_Terra_Chlorophyll_A', - format: 'png', - maxZoom: 7, - opacity: 0.75 - } - } - } - }, - NLS: { - // NLS maps are copyright National library of Scotland. - // http://maps.nls.uk/projects/api/index.html - // Please contact NLS for anything other than non-commercial low volume usage - // - // Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s - // z0-9 - 1:1m - // z10-11 - quarter inch (1:253440) - // z12-18 - one inch (1:63360) - url: '//nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg', - options: { - attribution: 'National Library of Scotland Historic Maps', - bounds: [[49.6, -12], [61.7, 3]], - minZoom: 1, - maxZoom: 18, - subdomains: '0123', - } - }, - JusticeMap: { - // Justice Map (http://www.justicemap.org/) - // Visualize race and income data for your community, county and country. - // Includes tools for data journalists, bloggers and community activists. - url: 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', - options: { - attribution: 'Justice Map', - // one of 'county', 'tract', 'block' - size: 'county', - // Bounds for USA, including Alaska and Hawaii - bounds: [[14, -180], [72, -56]] - }, - variants: { - income: 'income', - americanIndian: 'indian', - asian: 'asian', - black: 'black', - hispanic: 'hispanic', - multi: 'multi', - nonWhite: 'nonwhite', - white: 'white', - plurality: 'plural' - } - }, - Wikimedia: { - url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', - options: { - attribution: 'Wikimedia', - minZoom: 1, - maxZoom: 19 - } - }, - GeoportailFrance: { - url: 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', - options: { - attribution: 'Geoportail France', - bounds: [[-75, -180], [81, 180]], - minZoom: 2, - maxZoom: 18, - // Get your own geoportail apikey here : http://professionnels.ign.fr/ign/contrats/ - // NB : 'choisirgeoportail' is a demonstration key that comes with no guarantee - apikey: 'choisirgeoportail', - format: 'image/jpeg', - style : 'normal', - variant: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD' - }, - variants: { - parcels: { - options : { - variant: 'CADASTRALPARCELS.PARCELS', - maxZoom: 20, - style : 'bdparcellaire', - format: 'image/png' - } - }, - ignMaps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS', - maps: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD', - orthos: { - options: { - maxZoom: 19, - variant: 'ORTHOIMAGERY.ORTHOPHOTOS' - } - } - } - }, - OneMapSG: { - url: '//maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', - options: { - variant: 'Default', - minZoom: 11, - maxZoom: 18, - bounds: [[1.56073, 104.11475], [1.16, 103.502]], - attribution: ' New OneMap | Map data © contributors, Singapore Land Authority' - }, - variants: { - Default: 'Default', - Night: 'Night', - Original: 'Original', - Grey: 'Grey', - LandLot: 'LandLot' - } - } - }; - - L.tileLayer.provider = function (provider, options) { - return new L.TileLayer.Provider(provider, options); - }; - - return L; -})); diff --git a/inst/doc/neotoma2-package_files/leaflet-providers-plugin-2.1.2/leaflet-providers-plugin.js b/inst/doc/neotoma2-package_files/leaflet-providers-plugin-2.1.2/leaflet-providers-plugin.js deleted file mode 100644 index 82cd630..0000000 --- a/inst/doc/neotoma2-package_files/leaflet-providers-plugin-2.1.2/leaflet-providers-plugin.js +++ /dev/null @@ -1,3 +0,0 @@ -LeafletWidget.methods.addProviderTiles = function(provider, layerId, group, options) { - this.layerManager.addLayer(L.tileLayer.provider(provider, options), "tile", layerId, group); -}; diff --git a/inst/doc/neotoma2-package_files/leafletfix-1.0.0/leafletfix.css b/inst/doc/neotoma2-package_files/leafletfix-1.0.0/leafletfix.css deleted file mode 100644 index 3ae60ff..0000000 --- a/inst/doc/neotoma2-package_files/leafletfix-1.0.0/leafletfix.css +++ /dev/null @@ -1,36 +0,0 @@ -/* Work around CSS properties introduced on img by bootstrap */ -img.leaflet-tile { - padding: 0; - margin: 0; - border-radius: 0; - border: none; -} -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; -} -.legend { - line-height: 18px; - color: #555; -} -.legend svg text { - fill: #555; -} -.legend svg line { - stroke: #555; -} -.legend i { - width: 18px; - height: 18px; - margin-right: 4px; - opacity: 0.7; - display: inline-block; - vertical-align: top; - /*For IE 7*/ - zoom: 1; - *display: inline; -} diff --git a/inst/doc/neotoma2-package_files/proj4-2.6.2/proj4.min.js b/inst/doc/neotoma2-package_files/proj4-2.6.2/proj4.min.js deleted file mode 100644 index 99865a5..0000000 --- a/inst/doc/neotoma2-package_files/proj4-2.6.2/proj4.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):t.proj4=s()}(this,function(){"use strict";function k(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(H,""),e=-1;++eMath.PI&&(r-=2*Math.PI),h=Math.sin(o),n=Math.cos(o),e=h*h,{x:((a=i/Math.sqrt(1-s*e))+l)*n*Math.cos(r),y:(a+l)*n*Math.sin(r),z:(a*(1-s)+l)*h}}function c(t,s,i,a){var h,e,n,r,o,l,M,c,u,f,m,p,d,y=t.x,_=t.y,x=t.z?t.z:0,g=Math.sqrt(y*y+_*_),b=Math.sqrt(y*y+_*_+x*x);if(g/i<1e-12){if(p=0,b/i<1e-12)return d=-a,{x:t.x,y:t.y,z:t.z}}else p=Math.atan2(_,y);for(h=x/b,l=(e=g/b)*(1-s)*(n=1/Math.sqrt(1-s*(2-s)*e*e)),M=h*n,m=0;m++,r=s*(o=i/Math.sqrt(1-s*M*M))/(o+(d=g*l+x*M-o*(1-s*M*M))),f=(u=h*(n=1/Math.sqrt(1-r*(2-r)*e*e)))*l-(c=e*(1-r)*n)*M,l=c,M=u,1e-24=this.text.length)return;t=this.text[this.place++]}switch(this.state){case K:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},e.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if($.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},e.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=K)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=K,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},e.prototype.number=function(t){if(!tt.test(t)){if($.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},e.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},e.prototype.keyword=function(t){if(Y.test(t))this.word+=t;else{if("["===t){var s=[];return s.push(this.word),this.level++,null===this.root?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,void(this.state=K)}if(!$.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},e.prototype.neutral=function(t){if(Z.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(tt.test(t))return this.word=t,void(this.state=3);if(!$.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},e.prototype.output=function(){for(;this.placeD?Math.tan(i):0,c=Math.pow(M,2),u=Math.pow(c,2),f=1-this.es*Math.pow(h,2);n/=Math.sqrt(f);var m=Gt(i,h,e,this.en),p=this.a*(this.k0*n*(1+r/6*(1-c+o+r/20*(5-18*c+u+14*o-58*c*o+r/42*(61+179*u-u*c-479*c)))))+this.x0,d=this.a*(this.k0*(m-this.ml0+h*a*n/2*(1+r/12*(5-c+9*o+4*l+r/30*(61+u-58*c+270*o-330*c*o+r/56*(1385+543*u-u*c-3111*c))))))+this.y0}else{var y=e*Math.sin(a);if(Math.abs(Math.abs(y)-1)D?Math.tan(s):0,e=this.ep2*Math.pow(a,2),n=Math.pow(e,2),r=Math.pow(h,2),o=Math.pow(r,2),l=1-this.es*Math.pow(i,2),M=_*Math.sqrt(l)/this.k0,u=s-(l*=h)*(c=Math.pow(M,2))/(1-this.es)*.5*(1-c/12*(5+3*r-9*e*r+e-4*n-c/30*(61+90*r-252*e*r+45*o+46*e-c/56*(1385+3633*r+4095*o+1574*o*r)))),nt(this.long0+M*(1-c/6*(1+2*r+e-c/20*(5+28*r+24*o+8*e*r+6*e-c/42*(61+662*r+1320*o+720*o*r))))/a)):(u=z*et(x),0)):(p=.5*((m=Math.exp(_/this.k0))-1/m),d=this.lat0+x/this.k0,y=Math.cos(d),l=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(p,2))),u=Math.asin(l),x<0&&(u=-u),0==p&&0===y?0:nt(Math.atan2(p,y)+this.long0)),t.x=f,t.y=u,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]},is={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),s=t/(2-t),i=s;this.cgb[0]=s*(2+s*(-2/3+s*(s*(116/45+s*(26/45+-2854/675*s))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+4642/4725*s))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+2323/945*s))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+-1522/945*s)))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+73814/2835*s))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+-12686/2835*s))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+-399572/14175*s)),this.cbg[3]=i*(1237/630+s*(-24832/14175*s-2.4)),i*=s,this.cgb[4]=i*(4174/315+-144838/6237*s),this.cbg[4]=i*(-734/315+109598/31185*s),i*=s,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+-96199/604800*s))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+7891/37800*s))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+1118711/3870720*s)))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+-1983433/1935360*s))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+-5569/90720*s))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+167603/181440*s))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+830251/7257600*s)),this.gtu[3]=i*(49561/161280+s*(-179/168+6601661/7257600*s)),i*=s,this.utg[4]=i*(-4583/161280+108847/3991680*s),this.gtu[4]=i*(34729/80640+-3418889/1995840*s),i*=s,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var a=Tt(this.cbg,this.lat0);this.Zb=-this.Qn*(a+function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;0<=--h;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i}(this.gtu,2*a))},forward:function(t){var s=nt(t.x-this.long0),i=t.y,i=Tt(this.cbg,i),a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*h),s=Math.atan2(e*h,Rt(a,h*n)),s=Lt(Math.tan(s));var r,o,l=Dt(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],o=Math.abs(s)<=2.623395162778?(r=this.a*(this.Qn*s)+this.x0,this.a*(this.Qn*i+this.Zb)+this.y0):r=1/0,t.x=r,t.y=o,t},inverse:function(t){var s,i,a,h,e,n,r,o=(t.x-this.x0)*(1/this.a),l=(t.y-this.y0)*(1/this.a);return l=(l-this.Zb)/this.Qn,o/=this.Qn,r=Math.abs(o)<=2.623395162778?(l+=(s=Dt(this.utg,2*l,2*o))[0],o+=s[1],o=Math.atan(zt(o)),i=Math.sin(l),a=Math.cos(l),h=Math.sin(o),e=Math.cos(o),l=Math.atan2(i*e,Rt(h,e*a)),o=Math.atan2(h,e*a),n=nt(o+this.long0),Tt(this.cgb,l)):n=1/0,t.x=n,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},as={init:function(){var t=function(t,s){if(void 0===t){if((t=Math.floor(30*(nt(s)+Math.PI)/Math.PI)+1)<0)return 0;if(60D?this.ns=Math.log(a/r)/Math.log(h/o):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic"))},forward:function(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=D&&(i=et(i)*(z-2*D));var a,h,e=Math.abs(Math.abs(i)-z);if(DD?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=Vt(this.e3,this.sin_phi,this.cos_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*nt(s-this.long0),n=h*Math.sin(e)+this.x0,r=this.rh-h*Math.cos(e)+this.y0;return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,a=0<=this.ns0?(s=Math.sqrt(t.x*t.x+t.y*t.y),1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),-1),(h=0)!==s&&(h=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,n=this.sphere?Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,this.phi1z(this.e3,i)),e=nt(h/this.ns0+this.long0),t.x=e,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,s){var i,a,h,e,n=Zt(.5*s);if(tMath.PI&&(a=Math.PI),i=(2*s+Math.sin(2*s))/Math.PI,12*z*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),e=this.long0,Math.abs(s)<=D?n=this.lat0:(n=Zt(h*this.sin_p12+t.y*a*this.cos_p12/s),r=Math.abs(this.lat0)-z,e=nt(Math.abs(r)<=D?0<=this.lat0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=e,t.y=n,t}return o=Ft(this.es),l=Qt(this.es),M=Wt(this.es),c=Xt(this.es),Math.abs(this.sin_p12-1)<=D?(u=this.a*Ut(o,l,M,c,z),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Kt((u-s)/this.a,o,l,M,c),e=nt(this.long0+Math.atan2(t.x,-1*t.y))):Math.abs(this.sin_p12+1)<=D?(u=this.a*Ut(o,l,M,c,z),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Kt((s-u)/this.a,o,l,M,c),e=nt(this.long0+Math.atan2(t.x,t.y))):(s=Math.sqrt(t.x*t.x+t.y*t.y),p=Math.atan2(t.x,t.y),f=Ht(this.a,this.e,this.sin_p12),d=Math.cos(p),_=-(y=this.e*this.cos_p12*d)*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*d/(1-this.es),v=1-_*(b=(g=s/f)-_*(1+_)*Math.pow(g,3)/6-x*(1+3*_)*Math.pow(g,4)/24)*b/2-g*b*b*b/6,m=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*d),e=nt(this.long0+Math.asin(Math.sin(p)*Math.sin(b)/Math.cos(m))),w=Math.sin(m),n=Math.atan2((w-this.es*v*this.sin_p12)*Math.tan(m),w*(1-this.es))),t.x=e,t.y=n,t},names:["Azimuthal_Equidistant","aeqd"]},Ps={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=nt(h-this.long0),r=Math.sin(e),o=Math.cos(e),l=Math.cos(n);return(0<(s=this.sin_p14*r+this.cos_p14*o*l)||Math.abs(s)<=D)&&(i=this.a*o*Math.sin(n),a=this.y0+this.a*(this.cos_p14*r-this.sin_p14*o*l)),t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,e,n,r;return t.x-=this.x0,t.y-=this.y0,s=Math.sqrt(t.x*t.x+t.y*t.y),i=Zt(s/this.a),a=Math.sin(i),h=Math.cos(i),n=this.long0,Math.abs(s)<=D?r=this.lat0:(r=Zt(h*this.sin_p14+t.y*a*this.cos_p14/s),e=Math.abs(this.lat0)-z,n=Math.abs(e)<=D?nt(0<=this.lat0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):nt(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a))),t.x=n,t.y=r,t},names:["ortho"]},Ss=1,Ns=2,ks=3,Es=4,qs=5,Is=6,Os=1,As=2,Gs=3,js=4,zs={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=z-U/2?this.face=qs:this.lat0<=-(z-U/2)?this.face=Is:Math.abs(this.long0)<=U?this.face=Ss:Math.abs(this.long0)<=z+U?this.face=0=Math.abs(t.y)?y.value=Os:0<=t.y&&t.y>=Math.abs(t.x)?(y.value=As,s-=z):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=Gs,s=s<0?s+Q:s-Q):(y.value=js,s+=z),c=Q/12*Math.tan(s),e=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),n=Math.atan(e),(r=1-(a=Math.cos(s))*a*(h=Math.tan(i))*h*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?r=-1:1a.y)--s;else{if(!(Ls[s+1][0]<=a.y))break;++s}var h=Ls[s],i=function(t,s,i,a){for(var h=s;a;--a){var e=t(h);if(h-=e,Math.abs(e)