Initial commit
No files matched your search
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/angular`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Angular JS ( http://angularjs.org ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 06 Feb 2019 21:12:43 GMT
|
||||
* Dependencies: none
|
||||
* Global values: angular
|
||||
|
||||
# Credits
|
||||
These definitions were written by Diego Vilar <https://github.com/diegovilar>, Georgii Dolzhykov <https://github.com/thorn0>, Caleb St-Denis <https://github.com/calebstdenis>, Leonard Thieu <https://github.com/leonard-thieu>, Steffen Kowalski <https://github.com/scipper>.
|
||||
@@ -0,0 +1,829 @@
|
||||
// Project: http://jquery.com/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Christian Hoffmeister <https://github.com/choffmeister>
|
||||
// Steve Fenton <https://github.com/Steve-Fenton>
|
||||
// Diullei Gomes <https://github.com/Diullei>
|
||||
// Tass Iliopoulos <https://github.com/tasoili>
|
||||
// Jason Swearingen <https://github.com/jasons-novaleaf>
|
||||
// Sean Hill <https://github.com/seanski>
|
||||
// Guus Goossens <https://github.com/Guuz>
|
||||
// Kelly Summerlin <https://github.com/ksummerlin>
|
||||
// Basarat Ali Syed <https://github.com/basarat>
|
||||
// Nicholas Wolverson <https://github.com/nwolverson>
|
||||
// Derek Cicerone <https://github.com/derekcicerone>
|
||||
// Andrew Gaspar <https://github.com/AndrewGaspar>
|
||||
// Seikichi Kondo <https://github.com/seikichi>
|
||||
// Benjamin Jackman <https://github.com/benjaminjackman>
|
||||
// Poul Sorensen <https://github.com/s093294>
|
||||
// Josh Strobl <https://github.com/JoshStrobl>
|
||||
// John Reilly <https://github.com/johnnyreilly/>
|
||||
// Dick van den Brink <https://github.com/DickvdBrink>
|
||||
// Thomas Schulz <https://github.com/King2500>
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Andre Wiggins <https://github.com/andrewiggins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Definitions copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0480c5ec87fab41aa23047a02b27f0ea71aaf975/types/jquery/v2/index.d.ts
|
||||
|
||||
interface JQLite extends JQuery {
|
||||
[index: number]: HTMLElement;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Adds the specified class(es) to each of the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
|
||||
* @see {@link https://api.jquery.com/addClass/#addClass-className}
|
||||
*/
|
||||
addClass(className: string): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/after/#after-content-content}
|
||||
*/
|
||||
after(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/after/#after-function}
|
||||
*/
|
||||
after(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/append/#append-content-content}
|
||||
*/
|
||||
append(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/append/#append-function}
|
||||
*/
|
||||
append(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the value of an attribute for the first element in the set of matched elements.
|
||||
*
|
||||
* @param attributeName The name of the attribute to get.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributeName}
|
||||
*/
|
||||
attr(attributeName: string): string;
|
||||
/**
|
||||
* Set one or more attributes for the set of matched elements.
|
||||
*
|
||||
* @param attributeName The name of the attribute to set.
|
||||
* @param value A value to set for the attribute. If this is `null`, the attribute will be deleted.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributeName-value}
|
||||
*/
|
||||
attr(attributeName: string, value: string | number | null): this;
|
||||
/**
|
||||
* Set one or more attributes for the set of matched elements.
|
||||
*
|
||||
* @param attributes An object of attribute-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributes}
|
||||
*/
|
||||
attr(attributes: Object): this;
|
||||
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute each time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler}
|
||||
*/
|
||||
bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble}
|
||||
*/
|
||||
bind(eventType: string, preventBubble: boolean): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param events An object containing one or more DOM event types and functions to execute for them.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-events}
|
||||
*/
|
||||
bind(events: any): this;
|
||||
|
||||
/**
|
||||
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/children/}
|
||||
*/
|
||||
children(): this;
|
||||
|
||||
/**
|
||||
* Create a deep copy of the set of matched elements.
|
||||
*
|
||||
* @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
|
||||
* @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
|
||||
* @see {@link https://api.jquery.com/clone/}
|
||||
*/
|
||||
clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this;
|
||||
|
||||
/**
|
||||
* Get the children of each element in the set of matched elements, including text and comment nodes.
|
||||
* @see {@link https://api.jquery.com/contents/}
|
||||
*/
|
||||
contents(): this;
|
||||
|
||||
/**
|
||||
* Get the value of style properties for the first element in the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName}
|
||||
*/
|
||||
css(propertyName: string): string;
|
||||
/**
|
||||
* Get the value of style properties for the first element in the set of matched elements.
|
||||
* Results in an object of property-value pairs.
|
||||
*
|
||||
* @param propertyNames An array of one or more CSS properties.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyNames}
|
||||
*/
|
||||
css(propertyNames: string[]): any;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property name.
|
||||
* @param value A value to set for the property.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName-value}
|
||||
*/
|
||||
css(propertyName: string, value: string | number): this;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property name.
|
||||
* @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName-function}
|
||||
*/
|
||||
css(propertyName: string, value: (index: number, value: string) => string | number): this;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param properties An object of property-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/css/#css-properties}
|
||||
*/
|
||||
css(properties: JQLiteCssProperties): this;
|
||||
|
||||
/**
|
||||
* Store arbitrary data associated with the matched elements.
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @param value The new data value; it can be any JavaScript type including Array or Object.
|
||||
* @see {@link https://api.jquery.com/data/#data-key-value}
|
||||
*/
|
||||
data(key: string, value: any): this;
|
||||
/**
|
||||
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
||||
*
|
||||
* @param key Name of the data stored.
|
||||
* @see {@link https://api.jquery.com/data/#data-key}
|
||||
*/
|
||||
data(key: string): any;
|
||||
/**
|
||||
* Store arbitrary data associated with the matched elements.
|
||||
*
|
||||
* @param obj An object of key-value pairs of data to update.
|
||||
* @see {@link https://api.jquery.com/data/#data-obj}
|
||||
*/
|
||||
data(obj: { [key: string]: any; }): this;
|
||||
/**
|
||||
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
||||
* @see {@link https://api.jquery.com/data/#data}
|
||||
*/
|
||||
data(): any;
|
||||
|
||||
/**
|
||||
* Remove the set of matched elements from the DOM.
|
||||
*
|
||||
* @param selector A selector expression that filters the set of matched elements to be removed.
|
||||
* @see {@link https://api.jquery.com/detach/}
|
||||
*/
|
||||
detach(selector?: string): this;
|
||||
|
||||
/**
|
||||
* Remove all child nodes of the set of matched elements from the DOM.
|
||||
* @see {@link https://api.jquery.com/empty/}
|
||||
*/
|
||||
empty(): this;
|
||||
|
||||
/**
|
||||
* Reduce the set of matched elements to the one at the specified index.
|
||||
*
|
||||
* @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
|
||||
* @see {@link https://api.jquery.com/eq/}
|
||||
*/
|
||||
eq(index: number): this;
|
||||
|
||||
/**
|
||||
* Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @see {@link https://api.jquery.com/find/#find-selector}
|
||||
*/
|
||||
find(selector: string): this;
|
||||
find(element: any): this;
|
||||
find(obj: JQuery): this;
|
||||
|
||||
/**
|
||||
* Determine whether any of the matched elements are assigned the given class.
|
||||
*
|
||||
* @param className The class name to search for.
|
||||
* @see {@link https://api.jquery.com/hasClass/}
|
||||
*/
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
/**
|
||||
* Get the HTML contents of the first element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/html/#html}
|
||||
*/
|
||||
html(): string;
|
||||
/**
|
||||
* Set the HTML contents of each element in the set of matched elements.
|
||||
*
|
||||
* @param htmlString A string of HTML to set as the content of each matched element.
|
||||
* @see {@link https://api.jquery.com/html/#html-htmlString}
|
||||
*/
|
||||
html(htmlString: string): this;
|
||||
/**
|
||||
* Set the HTML contents of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/html/#html-function}
|
||||
*/
|
||||
html(func: (index: number, oldhtml: string) => string): this;
|
||||
|
||||
/**
|
||||
* Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/next/}
|
||||
*/
|
||||
next(): this;
|
||||
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data}
|
||||
*/
|
||||
on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, selector?: string, data?: any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data}
|
||||
*/
|
||||
on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, data?: any): this;
|
||||
|
||||
/**
|
||||
* Remove an event handler.
|
||||
* @see {@link https://api.jquery.com/off/#off}
|
||||
*/
|
||||
off(): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on().
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
|
||||
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector}
|
||||
*/
|
||||
off(events: { [key: string]: any; }, selector?: string): this;
|
||||
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute at the time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-data-handler}
|
||||
*/
|
||||
one(events: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
||||
* @param data An object containing data that will be passed to the event handler.
|
||||
* @param handler A function to execute at the time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-data-handler}
|
||||
*/
|
||||
one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
|
||||
*/
|
||||
one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
|
||||
*/
|
||||
one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data}
|
||||
*/
|
||||
one(events: { [key: string]: any; }, selector?: string, data?: any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data}
|
||||
*/
|
||||
one(events: { [key: string]: any; }, data?: any): this;
|
||||
|
||||
/**
|
||||
* Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/parent/}
|
||||
*/
|
||||
parent(): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/prepend/#prepend-content-content}
|
||||
*/
|
||||
prepend(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/prepend/#prepend-function}
|
||||
*/
|
||||
prepend(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the value of a property for the first element in the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to get.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName}
|
||||
*/
|
||||
prop(propertyName: string): any;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to set.
|
||||
* @param value A value to set for the property.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName-value}
|
||||
*/
|
||||
prop(propertyName: string, value: string | number | boolean): this;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param properties An object of property-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-properties}
|
||||
*/
|
||||
prop(properties: Object): this;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to set.
|
||||
* @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName-function}
|
||||
*/
|
||||
prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): this;
|
||||
|
||||
/**
|
||||
* Specify a function to execute when the DOM is fully loaded.
|
||||
*
|
||||
* @param handler A function to execute after the DOM is ready.
|
||||
* @see {@link https://api.jquery.com/ready/}
|
||||
*/
|
||||
ready(handler: (jQueryAlias?: JQueryStatic) => any): this;
|
||||
|
||||
/**
|
||||
* Remove the set of matched elements from the DOM.
|
||||
*
|
||||
* @param selector A selector expression that filters the set of matched elements to be removed.
|
||||
* @see {@link https://api.jquery.com/remove/}
|
||||
*/
|
||||
remove(selector?: string): this;
|
||||
|
||||
/**
|
||||
* Remove an attribute from each element in the set of matched elements.
|
||||
*
|
||||
* @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
|
||||
* @see {@link https://api.jquery.com/removeAttr/}
|
||||
*/
|
||||
removeAttr(attributeName: string): this;
|
||||
|
||||
/**
|
||||
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
|
||||
* @see {@link https://api.jquery.com/removeClass/#removeClass-className}
|
||||
*/
|
||||
removeClass(className?: string): this;
|
||||
|
||||
/**
|
||||
* Remove a previously-stored piece of data.
|
||||
*
|
||||
* @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
|
||||
* @see {@link https://api.jquery.com/removeData/#removeData-name}
|
||||
*/
|
||||
removeData(name: string): this;
|
||||
/**
|
||||
* Remove a previously-stored piece of data.
|
||||
*
|
||||
* @param list An array of strings naming the pieces of data to delete.
|
||||
* @see {@link https://api.jquery.com/removeData/#removeData-list}
|
||||
*/
|
||||
removeData(list: string[]): this;
|
||||
/**
|
||||
* Remove all previously-stored piece of data.
|
||||
* @see {@link https://api.jquery.com/removeData/}
|
||||
*/
|
||||
removeData(): this;
|
||||
|
||||
/**
|
||||
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
||||
*
|
||||
* @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
|
||||
* @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent}
|
||||
*/
|
||||
replaceWith(newContent: JQuery | any[] | Element | Text | string): this;
|
||||
/**
|
||||
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
||||
*
|
||||
* @param func A function that returns content with which to replace the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/replaceWith/#replaceWith-function}
|
||||
*/
|
||||
replaceWith(func: () => Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the combined text contents of each element in the set of matched elements, including their descendants.
|
||||
* @see {@link https://api.jquery.com/text/#text}
|
||||
*/
|
||||
text(): string;
|
||||
/**
|
||||
* Set the content of each element in the set of matched elements to the specified text.
|
||||
*
|
||||
* @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
|
||||
* @see {@link https://api.jquery.com/text/#text-text}
|
||||
*/
|
||||
text(text: string | number | boolean): this;
|
||||
/**
|
||||
* Set the content of each element in the set of matched elements to the specified text.
|
||||
*
|
||||
* @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
|
||||
* @see {@link https://api.jquery.com/text/#text-function}
|
||||
*/
|
||||
text(func: (index: number, text: string) => string): this;
|
||||
|
||||
/**
|
||||
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
||||
*
|
||||
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
|
||||
* @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
|
||||
* @see {@link https://api.jquery.com/toggleClass/#toggleClass-className}
|
||||
*/
|
||||
toggleClass(className: string, swtch?: boolean): this;
|
||||
/**
|
||||
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
||||
*
|
||||
* @param swtch A boolean value to determine whether the class should be added or removed.
|
||||
* @see {@link https://api.jquery.com/toggleClass/#toggleClass-state}
|
||||
*/
|
||||
toggleClass(swtch?: boolean): this;
|
||||
|
||||
/**
|
||||
* Execute all handlers attached to an element for an event.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
||||
* @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters}
|
||||
*/
|
||||
triggerHandler(eventType: string, ...extraParameters: any[]): Object;
|
||||
/**
|
||||
* Execute all handlers attached to an element for an event.
|
||||
*
|
||||
* @param event A jQuery.Event object.
|
||||
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
||||
* @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters}
|
||||
*/
|
||||
triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
|
||||
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param handler The function that is to be no longer executed.
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler}
|
||||
*/
|
||||
unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-eventType-false}
|
||||
*/
|
||||
unbind(eventType: string, fls: boolean): this;
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param evt A JavaScript event object as passed to an event handler.
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-event}
|
||||
*/
|
||||
unbind(evt: any): this;
|
||||
|
||||
/**
|
||||
* Get the current value of the first element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/val/#val}
|
||||
*/
|
||||
val(): any;
|
||||
/**
|
||||
* Set the value of each element in the set of matched elements.
|
||||
*
|
||||
* @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
|
||||
* @see {@link https://api.jquery.com/val/#val-value}
|
||||
*/
|
||||
val(value: string | string[] | number): this;
|
||||
/**
|
||||
* Set the value of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
||||
* @see {@link https://api.jquery.com/val/#val-function}
|
||||
*/
|
||||
val(func: (index: number, value: string) => string): this;
|
||||
|
||||
/**
|
||||
* Wrap an HTML structure around each element in the set of matched elements.
|
||||
*
|
||||
* @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
|
||||
* @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement}
|
||||
*/
|
||||
wrap(wrappingElement: JQuery | Element | string): this;
|
||||
/**
|
||||
* Wrap an HTML structure around each element in the set of matched elements.
|
||||
*
|
||||
* @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/wrap/#wrap-function}
|
||||
*/
|
||||
wrap(func: (index: number) => string | JQuery): this;
|
||||
|
||||
// Undocumented
|
||||
length: number;
|
||||
|
||||
// TODO: events, how to define?
|
||||
// $destroy
|
||||
|
||||
controller(name?: string): any;
|
||||
injector(): ng.auto.IInjectorService;
|
||||
/**
|
||||
* Returns the `$scope` of the element.
|
||||
*
|
||||
* **IMPORTANT**: Requires `debugInfoEnabled` to be true.
|
||||
*
|
||||
* See https://docs.angularjs.org/guide/production#disabling-debug-data for more information.
|
||||
*/
|
||||
scope<T extends ng.IScope>(): T;
|
||||
/**
|
||||
* Returns the `$scope` of the element.
|
||||
*
|
||||
* **IMPORTANT**: Requires `debugInfoEnabled` to be true.
|
||||
*
|
||||
* See https://docs.angularjs.org/guide/production#disabling-debug-data for more information.
|
||||
*/
|
||||
isolateScope<T extends ng.IScope>(): T;
|
||||
|
||||
inheritedData(key: string, value: any): this;
|
||||
inheritedData(obj: { [key: string]: any; }): this;
|
||||
inheritedData(key?: string): any;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
(element: string | Element | Document | JQuery | ArrayLike<Element> | (() => void)): JQLite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface of the JQuery extension of the W3C event object
|
||||
* @see {@link https://api.jquery.com/category/events/event-object/}
|
||||
*/
|
||||
interface BaseJQueryEventObject extends Event {
|
||||
/**
|
||||
* The current DOM element within the event bubbling phase.
|
||||
* @see {@link https://api.jquery.com/event.currentTarget/}
|
||||
*/
|
||||
currentTarget: Element;
|
||||
/**
|
||||
* An optional object of data passed to an event method when the current executing handler is bound.
|
||||
* @see {@link https://api.jquery.com/event.data/}
|
||||
*/
|
||||
data: any;
|
||||
/**
|
||||
* The element where the currently-called jQuery event handler was attached.
|
||||
* @see {@link https://api.jquery.com/event.delegateTarget/}
|
||||
*/
|
||||
delegateTarget: Element;
|
||||
/**
|
||||
* Returns whether event.preventDefault() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isDefaultPrevented/}
|
||||
*/
|
||||
isDefaultPrevented(): boolean;
|
||||
/**
|
||||
* Returns whether event.stopImmediatePropagation() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/}
|
||||
*/
|
||||
isImmediatePropagationStopped(): boolean;
|
||||
/**
|
||||
* Returns whether event.stopPropagation() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isPropagationStopped/}
|
||||
*/
|
||||
isPropagationStopped(): boolean;
|
||||
/**
|
||||
* The namespace specified when the event was triggered.
|
||||
* @see {@link https://api.jquery.com/event.namespace/}
|
||||
*/
|
||||
namespace: string;
|
||||
/**
|
||||
* The browser's original Event object.
|
||||
* @see {@link https://api.jquery.com/category/events/event-object/}
|
||||
*/
|
||||
originalEvent: Event;
|
||||
/**
|
||||
* If this method is called, the default action of the event will not be triggered.
|
||||
* @see {@link https://api.jquery.com/event.preventDefault/}
|
||||
*/
|
||||
preventDefault(): any;
|
||||
/**
|
||||
* The other DOM element involved in the event, if any.
|
||||
* @see {@link https://api.jquery.com/event.relatedTarget/}
|
||||
*/
|
||||
relatedTarget: Element;
|
||||
/**
|
||||
* The last value returned by an event handler that was triggered by this event, unless the value was undefined.
|
||||
* @see {@link https://api.jquery.com/event.result/}
|
||||
*/
|
||||
result: any;
|
||||
/**
|
||||
* Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
|
||||
* @see {@link https://api.jquery.com/event.stopImmediatePropagation/}
|
||||
*/
|
||||
stopImmediatePropagation(): void;
|
||||
/**
|
||||
* Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
|
||||
* @see {@link https://api.jquery.com/event.stopPropagation/}
|
||||
*/
|
||||
stopPropagation(): void;
|
||||
/**
|
||||
* The DOM element that initiated the event.
|
||||
* @see {@link https://api.jquery.com/event.target/}
|
||||
*/
|
||||
target: Element;
|
||||
/**
|
||||
* The mouse position relative to the left edge of the document.
|
||||
* @see {@link https://api.jquery.com/event.pageX/}
|
||||
*/
|
||||
pageX: number;
|
||||
/**
|
||||
* The mouse position relative to the top edge of the document.
|
||||
* @see {@link https://api.jquery.com/event.pageY/}
|
||||
*/
|
||||
pageY: number;
|
||||
/**
|
||||
* For key or mouse events, this property indicates the specific key or button that was pressed.
|
||||
* @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead.
|
||||
* @see {@link https://api.jquery.com/event.which/}
|
||||
*/
|
||||
which: number;
|
||||
/**
|
||||
* Indicates whether the META key was pressed when the event fired.
|
||||
* @see {@link https://api.jquery.com/event.metaKey/}
|
||||
*/
|
||||
metaKey: boolean;
|
||||
}
|
||||
|
||||
interface JQueryInputEventObject extends BaseJQueryEventObject {
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
metaKey: boolean;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
interface JQueryMouseEventObject extends JQueryInputEventObject {
|
||||
button: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
offsetX: number;
|
||||
offsetY: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
}
|
||||
|
||||
interface JQueryKeyEventObject extends JQueryInputEventObject {
|
||||
/** @deprecated */
|
||||
char: string;
|
||||
/** @deprecated */
|
||||
charCode: number;
|
||||
key: string;
|
||||
/** @deprecated */
|
||||
keyCode: number;
|
||||
}
|
||||
|
||||
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* The interface used to specify the properties parameter in css()
|
||||
*/
|
||||
// tslint:disable-next-line:class-name
|
||||
interface cssPropertySetter {
|
||||
(index: number, value?: string): string | number;
|
||||
}
|
||||
interface JQLiteCssProperties {
|
||||
[propertyName: string]: string | number | cssPropertySetter;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/angular@1.6.54",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/angular@1.6.54",
|
||||
"_id": "@types/angular@1.6.54",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-xA1FuozWXeRQ7FClUbvk8ePL+dydBeDoCWRPFTHU5+8uvVtIIfLGiHA8CMkwsbddFCYnTDVbLxG85a/HBx7LtA==",
|
||||
"_location": "/@types/angular",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/angular@1.6.54",
|
||||
"name": "@types/angular",
|
||||
"escapedName": "@types%2fangular",
|
||||
"scope": "@types",
|
||||
"rawSpec": "1.6.54",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.6.54"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.54.tgz",
|
||||
"_spec": "1.6.54",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Diego Vilar",
|
||||
"url": "https://github.com/diegovilar"
|
||||
},
|
||||
{
|
||||
"name": "Georgii Dolzhykov",
|
||||
"url": "https://github.com/thorn0"
|
||||
},
|
||||
{
|
||||
"name": "Caleb St-Denis",
|
||||
"url": "https://github.com/calebstdenis"
|
||||
},
|
||||
{
|
||||
"name": "Leonard Thieu",
|
||||
"url": "https://github.com/leonard-thieu"
|
||||
},
|
||||
{
|
||||
"name": "Steffen Kowalski",
|
||||
"url": "https://github.com/scipper"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "TypeScript definitions for Angular JS",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/angular",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "0d6dd74d56b56b6a5d13d2e6c34e2ffd8a406fbe13fa7f38a2b85ccb1a82fdad",
|
||||
"version": "1.6.54"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/geojson`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for geojson ( https://geojson.org/ ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 13 Feb 2019 18:42:09 GMT
|
||||
* Dependencies: none
|
||||
* Global values: GeoJSON
|
||||
|
||||
# Credits
|
||||
These definitions were written by Jacob Bruun <https://github.com/cobster>, Arne Schubert <https://github.com/atd-schubert>, Jeff Jacobson <https://github.com/JeffJacobson>, Ilia Choly <https://github.com/icholy>, Dan Vanderkam <https://github.com/danvk>.
|
||||
@@ -0,0 +1,175 @@
|
||||
// Type definitions for geojson 7946.0
|
||||
// Project: https://geojson.org/, https://github.com/caseycesari/geojson.js
|
||||
// Definitions by: Jacob Bruun <https://github.com/cobster>
|
||||
// Arne Schubert <https://github.com/atd-schubert>
|
||||
// Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Ilia Choly <https://github.com/icholy>
|
||||
// Dan Vanderkam <https://github.com/danvk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
|
||||
// are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
|
||||
|
||||
export as namespace GeoJSON;
|
||||
|
||||
/**
|
||||
* The valid values for the "type" property of GeoJSON geometry objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonGeometryTypes = Geometry['type'];
|
||||
|
||||
/**
|
||||
* The value values for the "type" property of GeoJSON Objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonTypes = GeoJSON['type'];
|
||||
|
||||
/**
|
||||
* Bounding box
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
export type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
||||
|
||||
/**
|
||||
* A Position is an array of coordinates.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
||||
* Array should contain between two and three elements.
|
||||
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
||||
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
||||
*/
|
||||
export type Position = number[]; // [number, number] | [number, number, number];
|
||||
|
||||
/**
|
||||
* The base GeoJSON object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
* The GeoJSON specification also allows foreign members
|
||||
* (https://tools.ietf.org/html/rfc7946#section-6.1)
|
||||
* Developers should use "&" type in TypeScript or extend the interface
|
||||
* to add these foreign members.
|
||||
*/
|
||||
export interface GeoJsonObject {
|
||||
// Don't include foreign members directly into this type def.
|
||||
// in order to preserve type safety.
|
||||
// [key: string]: any;
|
||||
/**
|
||||
* Specifies the type of GeoJSON object.
|
||||
*/
|
||||
type: GeoJsonTypes;
|
||||
/**
|
||||
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
||||
* The value of the bbox member is an array of length 2*n where n is the number of dimensions
|
||||
* represented in the contained geometries, with all axes of the most southwesterly point
|
||||
* followed by all axes of the more northeasterly point.
|
||||
* The axes order of a bbox follows the axes order of geometries.
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
bbox?: BBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of GeoJSON objects.
|
||||
*/
|
||||
export type GeoJSON = Geometry | Feature | FeatureCollection;
|
||||
|
||||
/**
|
||||
* Geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
|
||||
export type GeometryObject = Geometry;
|
||||
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export interface Point extends GeoJsonObject {
|
||||
type: "Point";
|
||||
coordinates: Position;
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export interface MultiPoint extends GeoJsonObject {
|
||||
type: "MultiPoint";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/**
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export interface LineString extends GeoJsonObject {
|
||||
type: "LineString";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export interface MultiLineString extends GeoJsonObject {
|
||||
type: "MultiLineString";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/**
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export interface Polygon extends GeoJsonObject {
|
||||
type: "Polygon";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export interface MultiPolygon extends GeoJsonObject {
|
||||
type: "MultiPolygon";
|
||||
coordinates: Position[][][];
|
||||
}
|
||||
|
||||
/**
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export interface GeometryCollection extends GeoJsonObject {
|
||||
type: "GeometryCollection";
|
||||
geometries: Geometry[];
|
||||
}
|
||||
|
||||
export type GeoJsonProperties = { [name: string]: any; } | null;
|
||||
|
||||
/**
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
*/
|
||||
export interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "Feature";
|
||||
/**
|
||||
* The feature's geometry
|
||||
*/
|
||||
geometry: G;
|
||||
/**
|
||||
* A value that uniquely identifies this feature in a
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
||||
*/
|
||||
id?: string | number;
|
||||
/**
|
||||
* Properties associated with this feature.
|
||||
*/
|
||||
properties: P;
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
*/
|
||||
export interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "FeatureCollection";
|
||||
features: Array<Feature<G, P>>;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/geojson@7946.0.6",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/geojson@7946.0.6",
|
||||
"_id": "@types/geojson@7946.0.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-f6qai3iR62QuMPPdgyH+LyiXTL2n9Rf62UniJjV7KHrbiwzLTZUKsdq0mFSTxAHbO7JvwxwC4tH0m1UnweuLrA==",
|
||||
"_location": "/@types/geojson",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/geojson@7946.0.6",
|
||||
"name": "@types/geojson",
|
||||
"escapedName": "@types%2fgeojson",
|
||||
"scope": "@types",
|
||||
"rawSpec": "7946.0.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7946.0.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/",
|
||||
"/@types/leaflet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.6.tgz",
|
||||
"_spec": "7946.0.6",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jacob Bruun",
|
||||
"url": "https://github.com/cobster"
|
||||
},
|
||||
{
|
||||
"name": "Arne Schubert",
|
||||
"url": "https://github.com/atd-schubert"
|
||||
},
|
||||
{
|
||||
"name": "Jeff Jacobson",
|
||||
"url": "https://github.com/JeffJacobson"
|
||||
},
|
||||
{
|
||||
"name": "Ilia Choly",
|
||||
"url": "https://github.com/icholy"
|
||||
},
|
||||
{
|
||||
"name": "Dan Vanderkam",
|
||||
"url": "https://github.com/danvk"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "TypeScript definitions for geojson",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/geojson",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "6fa1b4d098782bf1b169ffa27e24d7b40e668c22633c8cd169b000c4fc08dc8a",
|
||||
"version": "7946.0.6"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/leaflet`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Leaflet.js ( https://github.com/Leaflet/Leaflet ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet
|
||||
|
||||
Additional Details
|
||||
* Last updated: Thu, 21 Feb 2019 18:40:08 GMT
|
||||
* Dependencies: @types/geojson
|
||||
* Global values: L
|
||||
|
||||
# Credits
|
||||
These definitions were written by Alejandro Sánchez <https://github.com/alejo90>, Arne Schubert <https://github.com/atd-schubert>, Michael Auer <https://github.com/mcauer>, Roni Karilkar <https://github.com/ronikar>.
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/leaflet@1.4.3",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/leaflet@1.4.3",
|
||||
"_id": "@types/leaflet@1.4.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-jFRBSsPHi1EwQSwrN0cOJLdPhwOZsRl4IMxvm/2ShLh0YM5GfCtQXCzsrv8RE7DWL+AykXdYSAd9bFLWbZT4CQ==",
|
||||
"_location": "/@types/leaflet",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/leaflet@1.4.3",
|
||||
"name": "@types/leaflet",
|
||||
"escapedName": "@types%2fleaflet",
|
||||
"scope": "@types",
|
||||
"rawSpec": "1.4.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.4.3.tgz",
|
||||
"_spec": "1.4.3",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alejandro Sánchez",
|
||||
"url": "https://github.com/alejo90"
|
||||
},
|
||||
{
|
||||
"name": "Arne Schubert",
|
||||
"url": "https://github.com/atd-schubert"
|
||||
},
|
||||
{
|
||||
"name": "Michael Auer",
|
||||
"url": "https://github.com/mcauer"
|
||||
},
|
||||
{
|
||||
"name": "Roni Karilkar",
|
||||
"url": "https://github.com/ronikar"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/geojson": "*"
|
||||
},
|
||||
"description": "TypeScript definitions for Leaflet.js",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/leaflet",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "d6ab1715fa8311f4f2c70d725cb407e3f3c595161e94c7ee85caaeeb496578cc",
|
||||
"version": "1.4.3"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Angular
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,64 @@
|
||||
# packaged angular
|
||||
|
||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
||||
[main AngularJS repo](https://github.com/angular/angular.js).
|
||||
Please file issues and pull requests against that repo.
|
||||
|
||||
## Install
|
||||
|
||||
You can install this package either with `npm` or with `bower`.
|
||||
|
||||
### npm
|
||||
|
||||
```shell
|
||||
npm install angular
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/node_modules/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
Or `require('angular')` from your code.
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/).
|
||||
|
||||
## License
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,25 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
[ng\:cloak],
|
||||
[ng-cloak],
|
||||
[data-ng-cloak],
|
||||
[x-ng-cloak],
|
||||
.ng-cloak,
|
||||
.x-ng-cloak,
|
||||
.ng-hide:not(.ng-hide-animate) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
ng\:form {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ng-animate-shim {
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
.ng-anchor {
|
||||
position:absolute;
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
AngularJS v1.7.7
|
||||
(c) 2010-2018 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(C){'use strict';function re(a){if(D(a))w(a.objectMaxDepth)&&(Wb.objectMaxDepth=Xb(a.objectMaxDepth)?a.objectMaxDepth:NaN),w(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Wb.urlErrorParamsEnabled=a.urlErrorParamsEnabled);else return Wb}function Xb(a){return W(a)&&0<a}function F(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.7.7/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,
|
||||
f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function ya(a){if(null==a||$a(a))return!1;if(H(a)||A(a)||x&&a instanceof x)return!0;var b="length"in Object(a)&&a.length;return W(b)&&(0<=b&&b-1 in a||"function"===typeof a.item)}function r(a,b,d){var c,e;if(a)if(B(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(H(a)||
|
||||
ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Nc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ta.call(a,c)&&b.call(d,a[c],c,a);return a}function Oc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Yb(a){return function(b,d){a(d,b)}}function se(){return++pb}
|
||||
function Zb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(D(g)||B(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&D(p)?ha(p)?a[m]=new Date(p.valueOf()):ab(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):$b(p)?a[m]=p.clone():(D(a[m])||(a[m]=H(p)?[]:{}),Zb(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function S(a){return Zb(a,Ha.call(arguments,1),!1)}function te(a){return Zb(a,Ha.call(arguments,1),!0)}function fa(a){return parseInt(a,
|
||||
10)}function ac(a,b){return S(Object.create(a),b)}function E(){}function Ta(a){return a}function ia(a){return function(){return a}}function bc(a){return B(a.toString)&&a.toString!==la}function z(a){return"undefined"===typeof a}function w(a){return"undefined"!==typeof a}function D(a){return null!==a&&"object"===typeof a}function Nc(a){return null!==a&&"object"===typeof a&&!Pc(a)}function A(a){return"string"===typeof a}function W(a){return"number"===typeof a}function ha(a){return"[object Date]"===la.call(a)}
|
||||
function H(a){return Array.isArray(a)||a instanceof Array}function cc(a){switch(la.call(a)){case "[object Error]":return!0;case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function B(a){return"function"===typeof a}function ab(a){return"[object RegExp]"===la.call(a)}function $a(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"===typeof a}function ue(a){return a&&W(a.length)&&ve.test(la.call(a))}
|
||||
function $b(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function we(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function ua(a){return K(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function Ia(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,f;if(H(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Nc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"===typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&
|
||||
(b[f]=e(a[f],c));else for(f in a)ta.call(a,f)&&(b[f]=e(a[f],c));d?b.$$hashKey=d:delete b.$$hashKey;return b}function e(a,b){if(!D(a))return a;var d=g.indexOf(a);if(-1!==d)return k[d];if($a(a)||bb(a))throw pa("cpws");var d=!1,e=f(a);void 0===e&&(e=H(a)?[]:Object.create(Pc(a)),d=!0);g.push(a);k.push(e);return d?c(a,e,b):e}function f(a){switch(la.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer),
|
||||
a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}
|
||||
var g=[],k=[];d=Xb(d)?d:NaN;if(b){if(ue(b)||"[object ArrayBuffer]"===la.call(b))throw pa("cpta");if(a===b)throw pa("cpi");H(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);k.push(b);return c(a,b,d)}return e(a,d)}function dc(a,b){return a===b||a!==a&&b!==b}function va(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(H(a)){if(!H(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!va(a[c],
|
||||
b[c]))return!1;return!0}}else{if(ha(a))return ha(b)?dc(a.getTime(),b.getTime()):!1;if(ab(a))return ab(b)?a.toString()===b.toString():!1;if(bb(a)||bb(b)||$a(a)||$a(b)||H(b)||ha(b)||ab(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!B(a[c])){if(!va(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&w(b[c])&&!B(b[c]))return!1;return!0}return!1}function db(a,b,d){return a.concat(Ha.call(b,d))}function Va(a,b){var d=2<arguments.length?Ha.call(arguments,2):[];return!B(b)||b instanceof
|
||||
RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Qc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:$a(b)?d="$WINDOW":b&&C.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE");return d}function eb(a,b){if(!z(a))return W(b)||(b=b?2:null),JSON.stringify(a,Qc,b)}function Rc(a){return A(a)?JSON.parse(a):a}function ec(a,b){a=a.replace(xe,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+
|
||||
a)/6E4;return X(d)?b:d}function Sc(a,b){a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function fc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=ec(b,c);return Sc(a,d*(b-c))}function za(a){a=x(a).clone().empty();var b=x("<div></div>").append(a).html();try{return a[0].nodeType===Pa?K(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+K(b)})}catch(d){return K(b)}}function Tc(a){try{return decodeURIComponent(a)}catch(b){}}function gc(a){var b={};r((a||"").split("&"),
|
||||
function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Tc(e),w(e)&&(f=w(f)?Tc(f):!0,ta.call(b,e)?H(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function ye(a){var b=[];r(a,function(a,c){H(a)?r(a,function(a){b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}):b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))});return b.length?b.join("&"):""}function hc(a){return ba(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ba(a,
|
||||
b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ze(a,b){var d,c,e=Qa.length;for(c=0;c<e;++c)if(d=Qa[c]+b,A(d=a.getAttribute(d)))return d;return null}function Ae(a,b){var d,c,e={};r(Qa,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});r(Qa,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});
|
||||
d&&(Be?(e.strictDi=null!==ze(d,"strict-di"),b(d,c?[c]:[],e)):C.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Uc(a,b,d){D(d)||(d={});d=S({strictDi:!1},d);var c=function(){a=x(a);if(a.injector()){var c=a[0]===C.document?"document":za(a);throw pa("btstrpd",c.replace(/</,"<").replace(/>/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",
|
||||
function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=fb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;C&&e.test(C.name)&&(d.debugInfoEnabled=!0,C.name=C.name.replace(e,""));if(C&&!f.test(C.name))return c();C.name=C.name.replace(f,"");ca.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};B(ca.resumeDeferredBootstrap)&&
|
||||
ca.resumeDeferredBootstrap()}function Ce(){C.name="NG_ENABLE_DEBUG_INFO!"+C.name;C.location.reload()}function De(a){a=ca.element(a).injector();if(!a)throw pa("test");return a.get("$$testability")}function Vc(a,b){b=b||"_";return a.replace(Ee,function(a,c){return(c?b:"")+a.toLowerCase()})}function Fe(){var a;if(!Wc){var b=qb();(rb=z(b)?C.jQuery:b?C[b]:void 0)&&rb.fn.on?(x=rb,S(rb.fn,{scope:Wa.scope,isolateScope:Wa.isolateScope,controller:Wa.controller,injector:Wa.injector,inheritedData:Wa.inheritedData})):
|
||||
x=Y;a=x.cleanData;x.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=(x._data(f)||{}).events)&&c.$destroy&&x(f).triggerHandler("$destroy");a(b)};ca.element=x;Wc=!0}}function gb(a,b,d){if(!a)throw pa("areq",b||"?",d||"required");return a}function sb(a,b,d){d&&H(a)&&(a=a[a.length-1]);gb(B(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ja(a,b){if("hasOwnProperty"===a)throw pa("badname",b);}function Ge(a,b,d){if(!b)return a;b=b.split(".");
|
||||
for(var c,e=a,f=b.length,g=0;g<f;g++)c=b[g],a&&(a=(e=a)[c]);return!d&&B(a)?Va(e,a):a}function tb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=x(Ha.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function ic(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!bc(a)||H(a)||ha(a)?eb(a):a.toString()}return a}function He(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=F("$injector"),
|
||||
c=F("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||F;return b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,f){f||(f=e);return function(){f[d||"push"]([b,c,arguments]);return t}}function b(a,c,d){d||(d=e);return function(b,e){e&&B(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return t}}if(!g)throw d("nomod",f);var e=[],n=[],s=[],G=a("$injector","invoke",
|
||||
"push",n),t={_invokeQueue:e,_configBlocks:n,_runBlocks:s,info:function(a){if(w(a)){if(!D(a))throw c("aobj","value");h=a;return this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider",
|
||||
"directive"),component:b("$compileProvider","component"),config:G,run:function(a){s.push(a);return this}};k&&G(k);return t})}})}function ja(a,b){if(H(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(D(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function Ie(a,b){var d=[];Xb(b)&&(a=ca.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Qc(a,b);if(D(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}function Je(a){S(a,{errorHandlingConfig:re,
|
||||
bootstrap:Uc,copy:Ia,extend:S,merge:te,equals:va,element:x,forEach:r,injector:fb,noop:E,bind:Va,toJson:eb,fromJson:Rc,identity:Ta,isUndefined:z,isDefined:w,isString:A,isFunction:B,isObject:D,isNumber:W,isElement:$b,isArray:H,version:Ke,isDate:ha,callbacks:{$$counter:0},getTestability:De,reloadWithDebugInfo:Ce,$$minErr:F,$$csp:Aa,$$encodeUriSegment:hc,$$encodeUriQuery:ba,$$lowercase:K,$$stringify:ic,$$uppercase:ub});kc=He(C);kc("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Le});
|
||||
a.provider("$compile",Xc).directive({a:Me,input:Yc,textarea:Yc,form:Ne,script:Oe,select:Pe,option:Qe,ngBind:Re,ngBindHtml:Se,ngBindTemplate:Te,ngClass:Ue,ngClassEven:Ve,ngClassOdd:We,ngCloak:Xe,ngController:Ye,ngForm:Ze,ngHide:$e,ngIf:af,ngInclude:bf,ngInit:cf,ngNonBindable:df,ngPluralize:ef,ngRef:ff,ngRepeat:gf,ngShow:hf,ngStyle:jf,ngSwitch:kf,ngSwitchWhen:lf,ngSwitchDefault:mf,ngOptions:nf,ngTransclude:of,ngModel:pf,ngList:qf,ngChange:rf,pattern:Zc,ngPattern:Zc,required:$c,ngRequired:$c,minlength:ad,
|
||||
ngMinlength:ad,maxlength:bd,ngMaxlength:bd,ngValue:sf,ngModelOptions:tf}).directive({ngInclude:uf,input:vf}).directive(vb).directive(cd);a.provider({$anchorScroll:wf,$animate:xf,$animateCss:yf,$$animateJs:zf,$$animateQueue:Af,$$AnimateRunner:Bf,$$animateAsyncRun:Cf,$browser:Df,$cacheFactory:Ef,$controller:Ff,$document:Gf,$$isDocumentHidden:Hf,$exceptionHandler:If,$filter:dd,$$forceReflow:Jf,$interpolate:Kf,$interval:Lf,$$intervalFactory:Mf,$http:Nf,$httpParamSerializer:Of,$httpParamSerializerJQLike:Pf,
|
||||
$httpBackend:Qf,$xhrFactory:Rf,$jsonpCallbacks:Sf,$location:Tf,$log:Uf,$parse:Vf,$rootScope:Wf,$q:Xf,$$q:Yf,$sce:Zf,$sceDelegate:$f,$sniffer:ag,$$taskTrackerFactory:bg,$templateCache:cg,$templateRequest:dg,$$testability:eg,$timeout:fg,$window:gg,$$rAF:hg,$$jqLite:ig,$$Map:jg,$$cookieReader:kg})}]).info({angularVersion:"1.7.7"})}function wb(a,b){return b.toUpperCase()}function xb(a){return a.replace(lg,wb)}function lc(a){a=a.nodeType;return 1===a||!a||9===a}function ed(a,b){var d,c,e=b.createDocumentFragment(),
|
||||
f=[];if(mc.test(a)){d=e.appendChild(b.createElement("div"));c=(mg.exec(a)||["",""])[1].toLowerCase();c=oa[c]||oa._default;d.innerHTML=c[1]+a.replace(ng,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function Y(a){if(a instanceof Y)return a;var b;A(a)&&(a=U(a),b=!0);if(!(this instanceof Y)){if(b&&"<"!==a.charAt(0))throw nc("nosel");return new Y(a)}if(b){b=
|
||||
C.document;var d;a=(d=og.exec(a))?[b.createElement(d[1])]:(d=ed(a,b))?d.childNodes:[];oc(this,a)}else B(a)?fd(a):oc(this,a)}function pc(a){return a.cloneNode(!0)}function yb(a,b){!b&&lc(a)&&x.cleanData([a]);a.querySelectorAll&&x.cleanData(a.querySelectorAll("*"))}function gd(a){for(var b in a)return!1;return!0}function hd(a){var b=a.ng339,d=b&&Ka[b],c=d&&d.events,d=d&&d.data;d&&!gd(d)||c&&!gd(c)||(delete Ka[b],a.ng339=void 0)}function id(a,b,d,c){if(w(c))throw nc("offargs");var e=(c=zb(a))&&c.events,
|
||||
f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];w(d)&&cb(c||[],d);w(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a);Ab[a]&&g(Ab[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];hd(a)}}function qc(a,b){var d=a.ng339;if(d=d&&Ka[d])b?delete d.data[b]:d.data={},hd(a)}function zb(a,b){var d=a.ng339,d=d&&Ka[d];b&&!d&&(a.ng339=d=++pg,d=Ka[d]={events:{},data:{},handle:void 0});return d}function rc(a,b,d){if(lc(a)){var c,e=w(d),
|
||||
f=!e&&b&&!D(b),g=!b;a=(a=zb(a,!f))&&a.data;if(e)a[xb(b)]=d;else{if(g)return a;if(f)return a&&a[xb(b)];for(c in b)a[xb(c)]=b[c]}}}function Bb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Cb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",U(c))}}function Db(a,b){if(b&&a.setAttribute){var d=
|
||||
(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",U(c))}}function oc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function jd(a,b){return Eb(a,"$"+(b||"ngController")+"Controller")}function Eb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=H(b)?b:[b];a;){for(var c=
|
||||
0,e=b.length;c<e;c++)if(w(d=x.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function kd(a){for(yb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Fb(a,b){b||yb(a);var d=a.parentNode;d&&d.removeChild(a)}function qg(a,b){b=b||C;if("complete"===b.document.readyState)b.setTimeout(a);else x(b).on("load",a)}function fd(a){function b(){C.document.removeEventListener("DOMContentLoaded",b);C.removeEventListener("load",b);a()}"complete"===C.document.readyState?C.setTimeout(a):(C.document.addEventListener("DOMContentLoaded",
|
||||
b),C.addEventListener("load",b))}function ld(a,b){var d=Gb[b.toLowerCase()];return d&&md[ua(a)]&&d}function rg(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(z(c.immediatePropagationStopped)){var k=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();k&&k.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};
|
||||
var h=f.specialHandlerWrapper||sg;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};d.elem=a;return d}function sg(a,b,d){d.call(a,b)}function tg(a,b,d){var c=b.relatedTarget;c&&(c===a||ug.call(a,c))||d.call(a,b)}function ig(){this.$get=function(){return S(Y,{hasClass:function(a,b){a.attr&&(a=a[0]);return Bb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Cb(a,b)}})}}function La(a,b){var d=a&&a.$$hashKey;
|
||||
if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||se)():d+":"+a}function nd(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function od(a){a=Function.prototype.toString.call(a).replace(vg,"");return a.match(wg)||a.match(xg)}function yg(a){return(a=od(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(a,b){function d(a){return function(b,c){if(D(b))r(b,Yb(a));else return a(b,
|
||||
c)}}function c(a,b){Ja(a,"service");if(B(b)||H(b))b=n.instantiate(b);if(!b.$get)throw Ba("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=t.invoke(b,this);if(z(c))throw Ba("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){gb(z(a)||H(a),"modulesToLoad","not an array");var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{A(a)?(c=kc(a),
|
||||
t.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):B(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):sb(a,"module")}catch(e){throw H(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ba("modulerr",a,e.stack||e.message||e);}}});return b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ba("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),
|
||||
a[b]}catch(f){throw a[b]===h&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=fb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ba("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);H(a)&&(a=a[a.length-1]);d=a;if(Ca||"function"!==typeof d)d=!1;else{var f=d.$$ngIsClass;Ga(f)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d)));d=f}return d?
|
||||
(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=H(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var h={},l=[],m=new Hb,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,
|
||||
ia(b),!1)}),constant:d(function(a,b){Ja(a,"constant");p[a]=b;s[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){ca.isString(b)&&l.push(b);throw Ba("unpr",l.join(" <- "));}),s={},G=k(s,function(a,b){var c=n.get(a+"Provider",b);return t.invoke(c.$get,c,void 0,a)}),t=G;p.$injectorProvider={$get:ia(G)};t.modules=n.modules=T();var N=g(a),t=G.get("$injector");t.strictDi=b;r(N,
|
||||
function(a){a&&t.invoke(a)});t.loadNewModules=function(a){r(g(a),function(a){a&&t.invoke(a)})};return t}function wf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;B(c)?c=c():$b(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):W(c)||
|
||||
(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=A(a)?a:W(a)?a.toString():d.hash();var b;a?(b=k.getElementById(a))?f(b):(b=e(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||qg(function(){c.$evalAsync(g)})});return g}]}function hb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;H(a)&&(a=a.join(" "));H(b)&&(b=b.join(" "));return a+" "+b}function zg(a){A(a)&&
|
||||
(a=a.split(" "));var b=T();r(a,function(a){a.length&&(b[a]=!0)});return b}function ra(a){return D(a)?a:{}}function Ag(a,b,d,c,e){function f(){qa=null;k()}function g(){t=y();t=z(t)?null:t;va(t,P)&&(t=P);N=P=t}function k(){var a=N;g();if(v!==h.url()||a!==t)v=h.url(),N=t,r(J,function(a){a(h.url(),t)})}var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,s={},G=e(d);h.isMock=!1;h.$$completeOutstandingRequest=G.completeTask;h.$$incOutstandingRequestCount=G.incTaskCount;h.notifyWhenNoOutstandingRequests=
|
||||
G.notifyWhenNoPendingTasks;var t,N,v=l.href,jc=b.find("base"),qa=null,y=c.history?function(){try{return m.state}catch(a){}}:E;g();h.url=function(b,d,e){z(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=N===e;b=ga(b).href;if(v===b&&(!c.history||f))return h;var k=v&&Da(v)===Da(b);v=b;N=e;!c.history||k&&f?(k||(qa=b),d?l.replace(b):k?(d=l,e=b,f=e.indexOf("#"),e=-1===f?"":e.substr(f),d.hash=e):l.href=b,l.href!==b&&(qa=b)):(m[d?"replaceState":"pushState"](e,"",b),g());
|
||||
qa&&(qa=b);return h}return(qa||l.href).replace(/#$/,"")};h.state=function(){return t};var J=[],I=!1,P=null;h.onUrlChange=function(b){if(!I){if(c.history)x(a).on("popstate",f);x(a).on("hashchange",f);I=!0}J.push(b);return b};h.$$applicationDestroyed=function(){x(a).off("hashchange popstate",f)};h.$$checkUrlChange=k;h.baseHref=function(){var a=jc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};h.defer=function(a,b,c){var d;b=b||0;c=c||G.DEFAULT_TASK_TYPE;G.incTaskCount(c);d=p(function(){delete s[d];
|
||||
G.completeTask(a,c)},b);s[d]=c;return d};h.defer.cancel=function(a){if(s.hasOwnProperty(a)){var b=s[a];delete s[a];n(a);G.completeTask(E,b);return!0}return!1}}function Df(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,d,c,e){return new Ag(a,c,b,d,e)}]}function Ef(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw F("$cacheFactory")("iid",
|
||||
a);var g=0,k=S({},c,{id:a}),h=T(),l=c&&c.capacity||Number.MAX_VALUE,m=T(),p=null,n=null;return b[a]={put:function(a,b){if(!z(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in h||g++;h[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=T();g=0;m=T();
|
||||
p=n=null},destroy:function(){m=k=h=null;delete b[a]},info:function(){return S({},k,{size:g})}}}var b={};a.info=function(){var a={};r(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function cg(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Xc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=T();r(a,function(a,f){a=a.trim();if(a in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw $("iscp",b,f,a,c?"controller bindings definition":
|
||||
"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(p[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==K(b))throw $("baddir",a);if(a!==a.trim())throw $("baddir",a);}function e(a){var b=a.require||a.controller&&a.name;!H(b)&&D(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=we("ngSrc,ngSrcset,src,srcset"),
|
||||
l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=T();this.directive=function qa(b,d){gb(b,"name");Ja(b,"directive");A(b)?(c(b),gb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];r(f[b],function(f,g){try{var h=a.invoke(f);B(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!A(l)||!/[EACM]/.test(l)))throw $("badrestrict",
|
||||
l,b);k.restrict=l||"EA";h.$$moduleName=f.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),f[b].push(d)):r(b,Yb(qa));return this};this.component=function y(a,b){function c(a){function e(b){return B(b)||H(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Bg(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
|
||||
require:b.require};r(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}if(!A(a))return r(a,Yb(Va(this,y))),this;var d=b.controller||function(){};r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,B(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return w(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};
|
||||
var n=!0;this.debugInfoEnabled=function(a){return w(a)?(n=a,this):n};var s=!1;this.strictComponentBindingsEnabled=function(a){return w(a)?(s=a,this):s};var G=10;this.onChangesTtl=function(a){return arguments.length?(G=a,this):G};var t=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};var N=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(N=a,this):N};var v=T();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();
|
||||
if(d in v&&v[d]!==c)throw $("ctxoverride",a,b,v[d],c);v[d]=c;return this};(function(){function a(b,c){r(c,function(a){v[a.toLowerCase()]=b})}a(V.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);a(V.CSS,["*|style"]);a(V.URL,"area|href area|ping a|href a|ping blockquote|cite body|background del|cite input|src ins|cite q|cite".split(" "));a(V.MEDIA_URL,"audio|src img|src img|srcset source|src source|srcset track|src video|src video|poster".split(" "));a(V.RESOURCE_URL,"*|formAction applet|code applet|codebase base|href embed|src frame|src form|action head|profile html|manifest iframe|src link|href media|src object|codebase object|data script|src".split(" "))})();
|
||||
this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,M,L,u,R){function q(){try{if(!--Ja)throw Ua=void 0,$("infchng",G);L.$apply(function(){for(var a=0,b=Ua.length;a<b;++a)try{Ua[a]()}catch(d){c(d)}Ua=void 0})}finally{Ja++}}function ma(a,b){if(!a)return a;if(!A(a))throw $("srcset",b,a.toString());for(var c="",d=U(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,e=/\s/.test(d)?e:/(,)/,d=d.split(e),e=Math.floor(d.length/
|
||||
2),f=0;f<e;f++)var g=2*f,c=c+u.getTrustedMediaUrl(U(d[g])),c=c+(" "+U(d[g+1]));d=U(d[2*f]).split(/\s/);c+=u.getTrustedMediaUrl(U(d[0]));2===d.length&&(c+=" "+U(d[1]));return c}function w(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function O(a,b,c){Fa.innerHTML="<span "+b+">";b=Fa.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function sa(a,b){try{a.addClass(b)}catch(c){}}
|
||||
function da(a,b,c,d,e){a instanceof x||(a=x(a));var f=Xa(a,b,a,c,d,e);da.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw $("multilink");gb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&la.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==g?x(ja(g,x("<div></div>").append(a).html())):c?Wa.clone.call(a):
|
||||
a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);c||(a=f=null);return d}}function Xa(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,I,t;if(n)for(t=Array(c.length),m=0;m<h.length;m+=3)f=h[m],t[f]=c[f];else t=c;m=0;for(p=h.length;m<p;)k=t[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(x(k),l)):l=a,I=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,I)):f&&f(a,k.childNodes,
|
||||
void 0,e)}for(var h=[],k=H(a)||a instanceof x,l,m,p,I,n,t=0;t<a.length;t++){l=new w;11===Ca&&ib(a,t,k);m=sc(a[t],[],l,0===t?d:void 0,e);(f=m.length?aa(m,a[t],l,b,c,null,[],[],f):null)&&f.scope&&da.$$addScopeClass(l.$$element);l=f&&f.terminal||!(p=a[t].childNodes)||!p.length?null:Xa(p,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(t,f,l),I=!0,n=n||f;f=null}return I?g:null}function ib(a,b,c){var d=a[b],e=d.parentNode,f;if(d.nodeType===Pa)for(;;){f=e?d.nextSibling:
|
||||
a[b+1];if(!f||f.nodeType!==Pa)break;d.nodeValue+=f.nodeValue;f.parentNode&&f.parentNode.removeChild(f);c&&f===a[b+1]&&a.splice(b+1,1)}}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function sc(a,b,d,e,f){var g=d.$attr,h;switch(a.nodeType){case 1:h=ua(a);X(b,wa(h),"E",e,f);for(var l,m,
|
||||
n,t,J,s=a.attributes,v=0,G=s&&s.length;v<G;v++){var P=!1,N=!1,r=!1,y=!1,u=!1,M;l=s[v];m=l.name;t=l.value;n=wa(m.toLowerCase());(J=n.match(Ra))?(r="Attr"===J[1],y="Prop"===J[1],u="On"===J[1],m=m.replace(pd,"").toLowerCase().substr(4+J[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):(M=n.match(Sa))&&ca(M[1])&&(P=m,N=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));if(y||u)d[n]=t,g[n]=l.name,y?Ea(a,b,n,m):b.push(qd(p,L,c,n,m,!1));else{n=wa(m.toLowerCase());g[n]=m;if(r||!d.hasOwnProperty(n))d[n]=
|
||||
t,ld(a,n)&&(d[n]=!0);Ia(a,b,t,n,r);X(b,n,"A",e,f,P,N)}}"input"===h&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!Qa)break;g=a.className;D(g)&&(g=g.animVal);if(A(g)&&""!==g)for(;a=k.exec(g);)n=wa(a[2]),X(b,n,"C",e,f)&&(d[n]=U(a[3])),g=g.substr(a.index+a[0].length);break;case Pa:na(b,a.nodeValue);break;case 8:if(!Oa)break;F(a,b,d,e,f)}b.sort(ia);return b}function F(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=wa(f[1]);X(b,h,"M",d,e)&&(c[h]=U(f[2]))}}catch(k){}}
|
||||
function V(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw $("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return x(d)}function Y(a,b,c){return function(d,e,f,g,h){e=V(e[0],b,c);return a(d,e,f,g,h)}}function Z(a,b,c,d,e,f){var g;return a?da(b,c,d,e,f):function(){g||(g=da(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function aa(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=
|
||||
Y(a,c,d));a.require=u.require;a.directiveName=Q;if(s===u||u.$$isolateScope)a=Aa(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Y(b,c,d));b.require=u.require;b.directiveName=Q;if(s===u||u.$$isolateScope)b=Aa(b,{isolateScope:!0});k.push(b)}}function p(a,e,f,g,l){function m(a,b,c,d){var e;bb(a)||(d=c,c=b,b=a,a=void 0);N&&(e=P);c||(c=N?Q.parent():Q);if(d){var f=l.$$slots[d];if(f)return f(a,b,e,c,R);if(z(f))throw $("noslot",d,za(Q));}else return l(a,b,e,c,R)}var n,u,L,y,G,P,M,Q;b===f?(g=d,Q=d.$$element):(Q=
|
||||
x(f),g=new w(Q,d));G=e;s?y=e.$new(!0):t&&(G=e.$parent);l&&(M=m,M.$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]});J&&(P=ea(Q,g,M,J,y,e,s));s&&(da.$$addScopeInfo(Q,y,!0,!(v&&(v===s||v===s.$$originalDirective))),da.$$addScopeClass(Q,!0),y.$$isolateBindings=s.$$isolateBindings,u=Da(e,g,y,y.$$isolateBindings,s),u.removeWatches&&y.$on("$destroy",u.removeWatches));for(n in P){u=J[n];L=P[n];var Cg=u.$$bindings.bindToController;L.instance=L();Q.data("$"+u.name+"Controller",L.instance);
|
||||
L.bindingInfo=Da(G,g,L.instance,Cg,u)}r(J,function(a,b){var c=a.require;a.bindToController&&!H(c)&&D(c)&&S(P[b].instance,W(b,c,Q,P))});r(P,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(B(b.$onInit))try{b.$onInit()}catch(e){c(e)}B(b.$doCheck)&&(G.$watch(function(){b.$doCheck()}),b.$doCheck());B(b.$onDestroy)&&G.$on("$destroy",function(){b.$onDestroy()})});n=0;for(u=h.length;n<u;n++)L=h[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,
|
||||
L.require,Q,P),M);var R=e;s&&(s.template||null===s.templateUrl)&&(R=y);a&&a(R,f.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)L=k[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,L.require,Q,P),M);r(P,function(a){a=a.instance;B(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,t=l.newScopeDirective,J=l.controllerDirectives,s=l.newIsolateScopeDirective,v=l.templateDirective,L=l.nonTlbTranscludeDirective,G=!1,P=!1,N=l.hasElementTranscludeDirective,y=d.$$element=x(b),u,Q,
|
||||
M,R=e,q,ma=!1,Ib=!1,O,sa=0,A=a.length;sa<A;sa++){u=a[sa];var E=u.$$start,ib=u.$$end;E&&(y=V(b,E,ib));M=void 0;if(n>u.priority)break;if(O=u.scope)u.templateUrl||(D(O)?(ba("new/isolated scope",s||t,u,y),s=u):ba("new/isolated scope",s,u,y)),t=t||u;Q=u.name;if(!ma&&(u.replace&&(u.templateUrl||u.template)||u.transclude&&!u.$$tlb)){for(O=sa+1;ma=a[O++];)if(ma.transclude&&!ma.$$tlb||ma.replace&&(ma.templateUrl||ma.template)){Ib=!0;break}ma=!0}!u.templateUrl&&u.controller&&(J=J||T(),ba("'"+Q+"' controller",
|
||||
J[Q],u,y),J[Q]=u);if(O=u.transclude)if(G=!0,u.$$tlb||(ba("transclusion",L,u,y),L=u),"element"===O)N=!0,n=u.priority,M=y,y=d.$$element=x(da.$$createComment(Q,d[Q])),b=y[0],pa(f,Ha.call(M,0),b),R=Z(Ib,M,e,n,g&&g.name,{nonTlbTranscludeDirective:L});else{var ka=T();if(D(O)){M=C.document.createDocumentFragment();var Xa=T(),F=T();r(O,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Xa[a]=b;ka[b]=null;F[b]=c});r(y.contents(),function(a){var b=Xa[wa(ua(a))];b?(F[b]=!0,ka[b]=ka[b]||C.document.createDocumentFragment(),
|
||||
ka[b].appendChild(a)):M.appendChild(a)});r(F,function(a,b){if(!a)throw $("reqslot",b);});for(var K in ka)ka[K]&&(R=x(ka[K].childNodes),ka[K]=Z(Ib,R,e));M=x(M.childNodes)}else M=x(pc(b)).contents();y.empty();R=Z(Ib,M,e,void 0,void 0,{needsNewScope:u.$$isolateScope||u.$$newScope});R.$$slots=ka}if(u.template)if(P=!0,ba("template",v,u,y),v=u,O=B(u.template)?u.template(y,d):u.template,O=Na(O),u.replace){g=u;M=mc.test(O)?rd(ja(u.templateNamespace,U(O))):[];b=M[0];if(1!==M.length||1!==b.nodeType)throw $("tplrt",
|
||||
Q,"");pa(f,y,b);A={$attr:{}};O=sc(b,[],A);var Dg=a.splice(sa+1,a.length-(sa+1));(s||t)&&fa(O,s,t);a=a.concat(O).concat(Dg);ga(d,A);A=a.length}else y.html(O);if(u.templateUrl)P=!0,ba("template",v,u,y),v=u,u.replace&&(g=u),p=ha(a.splice(sa,a.length-sa),y,d,f,G&&R,h,k,{controllerDirectives:J,newScopeDirective:t!==u&&t,newIsolateScopeDirective:s,templateDirective:v,nonTlbTranscludeDirective:L}),A=a.length;else if(u.compile)try{q=u.compile(y,d,R);var X=u.$$originalDirective||u;B(q)?m(null,Va(X,q),E,ib):
|
||||
q&&m(Va(X,q.pre),Va(X,q.post),E,ib)}catch(ca){c(ca,za(y))}u.terminal&&(p.terminal=!0,n=Math.max(n,u.priority))}p.scope=t&&!0===t.scope;p.transcludeOnThisElement=G;p.templateOnThisElement=P;p.transclude=R;l.hasElementTranscludeDirective=N;return p}function W(a,b,c,d){var e;if(A(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e="^^"===g&&c[0]&&9===c[0].nodeType?null:g?c.inheritedData(h):c.data(h)}if(!e&&
|
||||
!f)throw $("ctreq",b,a);}else if(H(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=W(a,b[g],c,d);else D(b)&&(e={},r(b,function(b,f){e[f]=W(a,b,c,d)}));return e||null}function ea(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]);m=M(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function fa(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=ac(a[d],{$$isolateScope:b,
|
||||
$$newScope:c})}function X(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c=h[p],(z(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=ac(c,{$$start:k,$$end:l}));if(!c.$$bindings){var I=m=c,t=c.name,u={isolateScope:null,bindToController:null};D(I.scope)&&(!0===I.bindToController?(u.bindToController=d(I.scope,t,!0),u.isolateScope={}):u.isolateScope=d(I.scope,t,!1));D(I.bindToController)&&(u.bindToController=d(I.bindToController,
|
||||
t,!0));if(u.bindToController&&!I.controller)throw $("noctrl",t);m=m.$$bindings=u;D(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c);m=c}}return m}function ca(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function ga(a,b){var c=b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,e){a.hasOwnProperty(e)||
|
||||
"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var m=[],p,n,t=b[0],u=a.shift(),J=ac(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),s=B(u.templateUrl)?u.templateUrl(b,d):u.templateUrl,L=u.templateNamespace;b.empty();e(s).then(function(c){var e,I;c=Na(c);if(u.replace){c=mc.test(c)?rd(ja(L,U(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw $("tplrt",u.name,s);c={$attr:{}};pa(f,b,e);var v=sc(e,[],c);D(u.scope)&&fa(v,!0);a=
|
||||
v.concat(a);ga(d,c)}else e=t,b.html(c);a.unshift(J);p=aa(a,e,d,g,b,u,h,k,l);r(f,function(a,c){a===e&&(f[c]=b[0])});for(n=Xa(b[0].childNodes,g);m.length;){c=m.shift();I=m.shift();var y=m.shift(),P=m.shift(),v=b[0];if(!c.$$destroyed){if(I!==t){var G=I.className;l.hasElementTranscludeDirective&&u.replace||(v=pc(e));pa(y,x(I),v);sa(x(v),G)}I=p.transcludeOnThisElement?ka(c,p.transclude,P):P;p(n,c,v,f,I)}}m=null}).catch(function(a){cc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,
|
||||
c,d,a):(p.transcludeOnThisElement&&(a=ka(b,p.transclude,e)),p(n,b,c,d,a)))}}function ia(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ba(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw $("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,za(d));}function na(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&da.$$addBindingClass(a);return function(a,c){var e=c.parent();
|
||||
b||da.$$addBindingClass(e);da.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ja(a,b){a=K(a||"html");switch(a){case "svg":case "math":var c=C.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function oa(a,b){if("srcdoc"===b)return u.HTML;if("src"===b||"ngSrc"===b)return-1===["img","video","audio","source","track"].indexOf(a)?u.RESOURCE_URL:u.MEDIA_URL;if("xlinkHref"===b)return"image"===a?u.MEDIA_URL:
|
||||
"a"===a?u.URL:u.RESOURCE_URL;if("form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b)return u.RESOURCE_URL;if("a"===a&&("href"===b||"ngHref"===b))return u.URL}function xa(a,b){var c=b.toLowerCase();return v[a+"|"+c]||v["*|"+c]}function ya(a){return ma(u.valueOf(a),"ng-prop-srcset")}function Ea(a,b,c,d){if(m.test(d))throw $("nodomevents");a=ua(a);var e=xa(a,d),f=Ta;"srcset"!==d||"img"!==a&&"source"!==a?e&&(f=u.getTrusted.bind(u,e)):f=ya;b.push({priority:100,compile:function(a,b){var e=
|
||||
p(b[c]),g=p(b[c],function(a){return u.valueOf(a)});return{pre:function(a,b){function c(){var g=e(a);b[0][d]=f(g)}c();a.$watch(g,c)}}}})}function Ia(a,c,d,e,f){var g=ua(a),k=oa(g,e),l=h[e]||f,p=b(d,!f,k,l);if(p){if("multiple"===e&&"select"===g)throw $("selmulti",za(a));if(m.test(e))throw $("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=T());var g=f[e];g!==d&&(p=g&&b(g,!0,k,l),d=g);p&&(f[e]=p(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&
|
||||
f.$$observers[e].$$scope||a).$watch(p,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function pa(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=C.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);x.hasData(d)&&(x.data(c,x.data(d)),x(d).off("$destroy"));x.cleanData(a.querySelectorAll("*"));
|
||||
for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function Aa(a,b){return S(function(){return a.apply(null,arguments)},a,b)}function Ba(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,za(d))}}function ra(a,b){if(s)throw $("missingattr",a,b);}function Da(a,c,d,e,f){function g(b,c,e){B(d.$onChanges)&&!dc(c,e)&&(Ua||(a.$$postDigest(q),Ua=[]),m||(m={},Ua.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Jb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;r(e,function(e,h){var m=e.attrName,n=e.optional,
|
||||
I,t,u,s;switch(e.mode){case "@":n||ta.call(c,m)||(ra(m,f.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(A(a)||Ga(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;I=c[m];A(I)?d[h]=b(I)(a):Ga(I)&&(d[h]=I);l[h]=new Jb(tc,d[h]);k.push(n);break;case "=":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);s=t.literal?va:dc;u=t.assign||function(){I=d[h]=t(a);throw $("nonassign",c[m],m,f.name);};I=d[h]=t(a);n=function(b){s(b,d[h])||(s(b,I)?u(a,b=d[h]):d[h]=b);return I=
|
||||
b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,t.literal);k.push(n);break;case "<":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);var v=t.literal,L=d[h]=t(a);l[h]=new Jb(tc,d[h]);n=a[e.collection?"$watchCollection":"$watch"](t,function(a,b){if(b===a){if(b===L||v&&va(b,L))return;b=L}g(h,a,b);d[h]=a});k.push(n);break;case "&":n||ta.call(c,m)||ra(m,f.name);t=c.hasOwnProperty(m)?p(c[m]):E;if(t===E&&n)break;d[h]=function(b){return t(a,
|
||||
b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ma=/^\w/,Fa=C.document.createElement("div"),Oa=t,Qa=N,Ja=G,Ua;w.prototype={$normalize:wa,$addClass:function(a){a&&0<a.length&&R.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&R.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=sd(a,b);c&&c.length&&R.addClass(this.$$element,c);(c=sd(b,a))&&c.length&&R.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=
|
||||
ld(this.$$element[0],a),g=td[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Vc(a,"-"));"img"===ua(this.$$element)&&"srcset"===a&&(this[a]=b=ma(b,"$set('srcset', value)"));!1!==d&&(null===b||z(b)?this.$$element.removeAttr(e):Ma.test(e)?f&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):O(this.$$element[0],e,b));(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,
|
||||
d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||z(c[a])||b(c[a])});return function(){cb(e,b)}}};var Ka=b.startSymbol(),La=b.endSymbol(),Na="{{"===Ka&&"}}"===La?Ta:function(a){return a.replace(/\{\{/g,Ka).replace(/}}/g,La)},Ra=/^ng(Attr|Prop|On)([A-Z].*)$/,Sa=/^(.+)Start$/;da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];H(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:E;da.$$addBindingClass=n?function(a){sa(a,
|
||||
"ng-binding")}:E;da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:E;da.$$addScopeClass=n?function(a,b){sa(a,b?"ng-isolate-scope":"ng-scope")}:E;da.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return C.document.createComment(c)};return da}]}function Jb(a,b){this.previousValue=a;this.currentValue=b}function wa(a){return a.replace(pd,"").replace(Eg,function(a,d,c){return c?d.toUpperCase():d})}function sd(a,b){var d=
|
||||
"",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function rd(a){a=x(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Pa&&""===d.nodeValue.trim())&&Fg.call(a,b,1)}return a}function Bg(a,b){if(b&&A(b))return b;if(A(a)){var d=ud.exec(a);if(d)return d[3]}}function Ff(){var a={};this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,d){Ja(b,
|
||||
"controller");D(b)?S(a,b):a[b]=d};this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!D(a.$scope))throw F("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;f=!0===f;g&&A(g)&&(l=g);if(A(c)){g=c.match(ud);if(!g)throw vd("ctrlfmt",c);h=g[1];l=l||g[3];c=a.hasOwnProperty(h)?a[h]:Ge(e.$scope,h,!0);if(!c)throw vd("ctrlreg",h);sb(c,h,!0)}if(f)return f=(H(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),S(function(){var a=b.invoke(c,k,e,h);
|
||||
a!==k&&(D(a)||B(a))&&(k=a,l&&d(e,l,k,h||c.name));return k},{instance:k,identifier:l});k=b.instantiate(c,e,h);l&&d(e,l,k,h||c.name);return k}}]}function Gf(){this.$get=["$window",function(a){return x(a.document)}]}function Hf(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]}function If(){this.$get=["$log",function(a){return function(b,
|
||||
d){a.error.apply(a,arguments)}}]}function uc(a){return D(a)?ha(a)?a.toISOString():eb(a):a}function Of(){this.$get=function(){return function(a){if(!a)return"";var b=[];Oc(a,function(a,c){null===a||z(a)||B(a)||(H(a)?r(a,function(a){b.push(ba(c)+"="+ba(uc(a)))}):b.push(ba(c)+"="+ba(uc(a))))});return b.join("&")}}}function Pf(){this.$get=function(){return function(a){function b(a,e,f){H(a)?r(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!ha(a)?Oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):
|
||||
(B(a)&&(a=a()),d.push(ba(e)+"="+(null==a?"":ba(uc(a)))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function vc(a,b){if(A(a)){var d=a.replace(Gg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(wd),e;(e=c)||(e=(e=d.match(Hg))&&Ig[e[0]].test(d));if(e)try{a=Rc(d)}catch(f){if(!c)return a;throw Kb("baddata",a,f);}}}return a}function xd(a){var b=T(),d;A(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=K(U(a.substr(0,d)));a=U(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&
|
||||
r(a,function(a,d){var f=K(d),g=U(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function yd(a){var b;return function(d){b||(b=xd(a));return d?(d=b[K(d)],void 0===d&&(d=null),d):b}}function zd(a,b,d,c){if(B(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Nf(){var a=this.defaults={transformResponse:[vc],transformRequest:[function(a){return D(a)&&"[object File]"!==la.call(a)&&"[object Blob]"!==la.call(a)&&"[object FormData]"!==la.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},
|
||||
post:ja(wc),put:ja(wc),patch:ja(wc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];
|
||||
a=a.then(f,g)}b.length=0;return a}function d(a,b){var c,e={};r(a,function(a,d){B(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}function f(a){var b=S({},a);b.data=zd(a.data,a.headers,a.status,g.transformResponse);a=a.status;return 200<=a&&300>a?b:l.reject(b)}if(!D(b))throw F("$http")("badreq",b);if(!A(p.valueOf(b.url)))throw F("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},
|
||||
b);g.headers=function(b){var c=a.headers,e=S({},b.headers),f,g,h,c=S({},c.common,c[K(b.method)]);a:for(f in c){g=K(f);for(h in e)if(K(h)===g)continue a;e[f]=c[f]}return d(e,ja(b))}(b);g.method=ub(g.method);g.paramSerializer=A(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer;e.$$incOutstandingRequestCount("$http");var h=[],k=[];b=l.resolve(g);r(v,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&k.push(a.response,a.responseError)});
|
||||
b=c(b,h);b=b.then(function(b){var c=b.headers,d=zd(b.data,yd(c),void 0,b.transformRequest);z(d)&&r(c,function(a,b){"content-type"===K(b)&&delete c[b]});z(b.withCredentials)&&!z(a.withCredentials)&&(b.withCredentials=a.withCredentials);return s(b,d).then(f,f)});b=c(b,k);return b=b.finally(function(){e.$$completeOutstandingRequest(E,"$http")})}function s(c,d){function e(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function k(a,
|
||||
c,d,e,f){function g(){m(c,a,d,e,f)}R&&(200<=a&&300>a?R.put(O,[a,c,xd(d),e,f]):R.remove(O));b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())}function m(a,b,d,e,f){b=-1<=b?b:0;(200<=b&&300>b?L.resolve:L.reject)({data:a,status:b,headers:yd(d),config:c,statusText:e,xhrStatus:f})}function s(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function v(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var L=l.defer(),u=L.promise,R,q,ma=c.headers,x="jsonp"===K(c.method),
|
||||
O=c.url;x?O=p.getTrustedResourceUrl(O):A(O)||(O=p.valueOf(O));O=G(O,c.paramSerializer(c.params));x&&(O=t(O,c.jsonpCallbackParam));n.pendingRequests.push(c);u.then(v,v);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(R=D(c.cache)?c.cache:D(a.cache)?a.cache:N);R&&(q=R.get(O),w(q)?q&&B(q.then)?q.then(s,s):H(q)?m(q[1],q[0],ja(q[2]),q[3],q[4]):m(q,200,{},"OK","complete"):R.put(O,u));z(q)&&((q=jc(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(ma[c.xsrfHeaderName||a.xsrfHeaderName]=
|
||||
q),f(c.method,O,d,k,ma,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers)));return u}function G(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b);return a}function t(a,b){var c=a.split("?");if(2<c.length)throw Kb("badjsonp",a);c=gc(c[1]);r(c,function(c,d){if("JSON_CALLBACK"===c)throw Kb("badjsonp",a);if(d===b)throw Kb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var N=k("$http");a.paramSerializer=A(a.paramSerializer)?m.get(a.paramSerializer):
|
||||
a.paramSerializer;var v=[];r(d,function(a){v.unshift(A(a)?m.get(a):m.invoke(a))});var jc=Jg(c);n.pendingRequests=[];(function(a){r(arguments,function(a){n[a]=function(b,c){return n(S({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){n[a]=function(b,c,d){return n(S({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function Rf(){this.$get=function(){return function(){return new C.XMLHttpRequest}}}function Qf(){this.$get=
|
||||
["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return Kg(a,c,a.defer,b,d[0])}]}function Kg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,s="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),s=a.type,g="error"===a.type?404:200);d&&d(g,s)};f.addEventListener("load",
|
||||
m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,k,h,l,m,p,n,s,G,t){function N(a){J="timeout"===a;qa&&qa();y&&y.abort()}function v(a,b,c,e,f,g){w(P)&&d.cancel(P);qa=y=null;a(b,c,e,f,g)}k=k||a.url();if("jsonp"===K(e))var q=c.createCallback(k),qa=f(k,q,function(a,b){var d=200===a&&c.getResponse(q);v(l,a,d,"",b,"complete");c.removeCallback(q)});else{var y=b(e,k),J=!1;y.open(e,k,!0);r(m,function(a,b){w(a)&&y.setRequestHeader(b,a)});y.onload=function(){var a=y.statusText||
|
||||
"",b="response"in y?y.response:y.responseText,c=1223===y.status?204:y.status;0===c&&(c=b?200:"file"===ga(k).protocol?404:0);v(l,c,b,y.getAllResponseHeaders(),a,"complete")};y.onerror=function(){v(l,-1,null,null,"","error")};y.ontimeout=function(){v(l,-1,null,null,"","timeout")};y.onabort=function(){v(l,-1,null,null,"",J?"timeout":"abort")};r(G,function(a,b){y.addEventListener(b,a)});r(t,function(a,b){y.upload.addEventListener(b,a)});n&&(y.withCredentials=!0);if(s)try{y.responseType=s}catch(I){if("json"!==
|
||||
s)throw I;}y.send(z(h)?null:h)}if(0<p)var P=d(function(){N("timeout")},p);else p&&B(p.then)&&p.then(function(){N(w(p.$$timeoutId)?"timeout":"abort")})}}function Kf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}
|
||||
function h(f,h,n,p){function v(a){try{return a=n&&!r?e.getTrusted(n,a):e.valueOf(a),p&&!w(a)?a:ic(a)}catch(b){c(Ma.interr(f,b))}}var r=n===e.URL||n===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a)){if(h)return;h=g(f);r&&(h=e.getTrusted(n,h));h=ia(h);h.exp=f;h.expressions=[];h.$$watchDelegate=k;return h}p=!!p;for(var q,y,J=0,I=[],P,Q=f.length,M=[],L=[],u;J<Q;)if(-1!==(q=f.indexOf(a,J))&&-1!==(y=f.indexOf(b,q+l)))J!==q&&M.push(g(f.substring(J,q))),J=f.substring(q+l,y),I.push(J),J=y+m,L.push(M.length),
|
||||
M.push("");else{J!==Q&&M.push(g(f.substring(J)));break}u=1===M.length&&1===L.length;var R=r&&u?void 0:v;P=I.map(function(a){return d(a,R)});if(!h||I.length){var x=function(a){for(var b=0,c=I.length;b<c;b++){if(p&&z(a[b]))return;M[L[b]]=a[b]}if(r)return e.getTrusted(n,u?M[0]:M.join(""));n&&1<M.length&&Ma.throwNoconcat(f);return M.join("")};return S(function(a){var b=0,d=I.length,e=Array(d);try{for(;b<d;b++)e[b]=P[b](a);return x(e)}catch(g){c(Ma.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,
|
||||
b){var c;return a.$watchGroup(P,function(d,e){var f=x(d);b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");h.startSymbol=function(){return a};h.endSymbol=function(){return b};return h}]}function Lf(){this.$get=["$$intervalFactory","$window",function(a,b){var d={},c=function(a){b.clearInterval(a);delete d[a]},e=a(function(a,c,e){a=b.setInterval(a,c);d[a]=e;return a},c);e.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Lg("badprom");
|
||||
if(!d.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var b=d[a],e=b.promise;e.$$state&&(e.$$state.pur=!0);b.reject("canceled");c(a);return!0};return e}]}function Mf(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,d,c){return function(e,f){return function(g,k,h,l){function m(){p?g.apply(null,n):g(s)}var p=4<arguments.length,n=p?Ha.call(arguments,4):[],s=0,G=w(l)&&!l,t=(G?d:b).defer(),r=t.promise;h=w(h)?h:0;r.$$intervalId=e(function(){G?a.defer(m):c.$evalAsync(m);t.notify(s++);
|
||||
0<h&&s>=h&&(t.resolve(s),f(r.$$intervalId));G||c.$apply()},k,t,G);return r}}}]}function Ad(a,b){var d=ga(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=fa(d.port)||Mg[d.protocol]||null}function Bd(a,b,d){if(Ng.test(a))throw jb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a);a=ga(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=gc(a.search);
|
||||
b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function xc(a,b){return a.slice(0,b.length)===b}function xa(a,b){if(xc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function yc(a,b,d){this.$$html5=!0;d=d||"";Ad(a,this);this.$$parse=function(a){var d=xa(b,a);if(!A(d))throw jb("ipthprfx",a,b);Bd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$normalizeUrl=function(a){return b+a.substr(1)};
|
||||
this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;w(f=xa(a,c))?(g=f,g=d&&w(f=xa(d,f))?b+(xa("/",f)||f):a+g):w(f=xa(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function zc(a,b,d){Ad(a,this);this.$$parse=function(c){var e=xa(a,c)||xa(b,c),f;z(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",z(e)&&(a=c,this.replace())):(f=xa(d,e),z(f)&&(f=e));Bd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;xc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?
|
||||
f[1]:c);this.$$path=c;this.$$compose()};this.$$normalizeUrl=function(b){return a+(b?d+b:"")};this.$$parseLinkUrl=function(b,d){return Da(a)===Da(b)?(this.$$parse(b),!0):!1}}function Cd(a,b,d){this.$$html5=!0;zc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===Da(c)?f=c:(g=xa(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$normalizeUrl=function(b){return a+d+b}}function Lb(a){return function(){return this[a]}}function Dd(a,
|
||||
b){return function(d){if(z(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Tf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this):a};this.html5Mode=function(a){if(Ga(a))return b.enabled=a,this;if(D(a)){Ga(a.enabled)&&(b.enabled=a.enabled);Ga(a.requireBase)&&(b.requireBase=a.requireBase);if(Ga(a.rewriteLinks)||A(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer",
|
||||
"$rootElement","$window",function(d,c,e,f,g){function k(a,b){return a===b||ga(a).href===ga(b).href}function h(a,b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state=c.state()}catch(g){throw m.url(e),m.$$state=f,g;}}function l(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var m,p;p=c.baseHref();var n=c.url(),s;if(b.enabled){if(!p&&b.requireBase)throw jb("nobase");s=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(p||"/");p=e.history?yc:Cd}else s=Da(n),p=zc;var r=s.substr(0,
|
||||
Da(s).lastIndexOf("/")+1);m=new p(s,r,"#"+a);m.$$parseLinkUrl(n,n);m.$$state=c.state();var t=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=x(a.target);"a"!==ua(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!A(e)||!z(g.attr(e))){var e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href");D(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ga(e.animVal).href);t.test(e)||!e||g.attr("target")||
|
||||
a.isDefaultPrevented()||!m.$$parseLinkUrl(e,h)||(a.preventDefault(),m.absUrl()!==c.url()&&d.$apply())}}});m.absUrl()!==n&&c.url(m.absUrl(),!0);var N=!0;c.onUrlChange(function(a,b){xc(a,r)?(d.$evalAsync(function(){var c=m.absUrl(),e=m.$$state,f;m.$$parse(a);m.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(N=!1,l(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(N||m.$$urlUpdatedByLocation){m.$$urlUpdatedByLocation=
|
||||
!1;var a=c.url(),b=m.absUrl(),f=c.state(),g=m.$$replace,n=!k(a,b)||m.$$html5&&e.history&&f!==m.$$state;if(N||n)N=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(n&&h(b,g,f===m.$$state?null:m.$$state),l(a,f)))})}m.$$replace=!1});return m}]}function Uf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){cc(a)&&(a.stack&&
|
||||
f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||E;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e,b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,
|
||||
arguments)}}()}}]}function Og(a){return a+""}function Pg(a,b){return"undefined"!==typeof a?a:b}function Ed(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Qg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!==a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Fd:b}function Z(a,b,d){var c,e,f=a.isPure=Qg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){Z(a.expression,
|
||||
b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=[];break;case q.UnaryExpression:Z(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:Z(a.test,
|
||||
b,f);Z(a.alternate,b,f);Z(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:Z(a.object,b,f);a.computed&&Z(a.property,b,f);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,
|
||||
a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){Z(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(Z(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,
|
||||
a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Gd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Hd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function Id(a){if(1===a.body.length&&Hd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}
|
||||
function Jd(a){this.$filter=a}function Kd(a){this.$filter=a}function Mb(a,b,d){this.ast=new q(a,d);this.astCompiler=d.csp?new Kd(b):new Jd(b)}function Ac(a){return B(a.valueOf)?a.valueOf():Rg.call(a)}function Vf(){var a=T(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral=function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case "string":return f=b=b.trim(),d=a[f],d||(d=new Nb(G),
|
||||
d=(new Mb(d,e,G)).parse(b),a[f]=p(d)),s(d,c);case "function":return s(b,c);default:return s(E,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Ac(a),"object"!==typeof a||c)?a===b||a!==a&&b!==b:!1}function k(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Ac(b));return h},b,c,e)}for(var l=[],m=[],n=0,p=f.length;n<p;n++)l[n]=g,m[n]=null;return a.$watch(function(a){for(var b=
|
||||
!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Ac(k)}b&&(h=d(a,void 0,void 0,m));return h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){m=u&&d?d[0]:n(a,b,c,d);h(m)&&a.$$postDigest(f);return s(m)}var h=d.literal?l:w,k,m,n=d.$$intercepted||d,s=d.$$interceptor||Ta,u=d.inputs&&!n.inputs;g.literal=d.literal;g.constant=d.constant;g.inputs=d.inputs;p(g);return k=a.$watch(g,b,c,e)}function l(a){var b=!0;r(a,function(a){w(a)||(b=!1)});return b}
|
||||
function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a){a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k);return a}function n(a,b){function c(d){return b(a(d))}c.$stateful=a.$stateful||b.$stateful;c.$$pure=a.$$pure&&b.$$pure;return c}function s(a,b){if(!b)return a;a.$$interceptor&&(b=n(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){d=c&&g?g[0]:a(d,e,f,g);return b(d)};d.$$intercepted=a;d.$$interceptor=
|
||||
b;d.literal=a.literal;d.oneTime=a.oneTime;d.constant=a.constant;b.$stateful||(c=!a.inputs,d.inputs=a.inputs?a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Fd?function(b){return a(b)}:a})));return p(d)}var G={csp:Aa().noUnsafeEval,literals:Ia(b),isIdentifierStart:B(d)&&d,isIdentifierContinue:B(c)&&c};f.$$getAst=function(a){var b=new Nb(G);return(new Mb(b,e,G)).getAst(a).ast};return f}]}function Xf(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Ld(function(a){b.$evalAsync(a)},
|
||||
d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Yf(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Ld(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Ld(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!w&&
|
||||
x.length;){var a=x.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):z(c)?"undefined":"string"!==typeof c?Ie(c,void 0):c);cc(a.value)?b(a.value,c):b(c)}}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===w&&0===x.length&&a(g),x.push(c));!c.processScheduled&&c.pending&&(c.processScheduled=!0,++w,a(function(){var e,f,k;k=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,n=k.length;l<n;++l){c.pur=
|
||||
!0;f=k[l][0];e=k[l][c.status];try{B(e)?h(f,e(c.value)):1===c.status?h(f,c.value):m(f,c.value)}catch(p){m(f,p),p&&!0===p.$$passToExceptionHandler&&b(p)}}}finally{--w,d&&0===w&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,v("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(D(b)||B(b))f=b.then;B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}function m(a,
|
||||
b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;k(a.$$state)}function n(c,d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0];a=e[f][3];try{n(c,B(a)?a(d):d)}catch(h){b(h)}}})}function s(a){var b=new f;m(b,a);return b}function G(a,b,c){var d=null;try{B(c)&&(d=c())}catch(e){return s(e)}return d&&B(d.then)?d.then(function(){return b(a)},s):b(a)}function t(a,b,c,d){var e=new f;h(e,a);return e.then(b,c,
|
||||
d)}function q(a){if(!B(a))throw v("norslvr",a);var b=new f;a(function(a){h(b,a)},function(a){m(b,a)});return b}var v=F("$q",TypeError),w=0,x=[];S(f.prototype,{then:function(a,b,c){if(z(a)&&z(b)&&z(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&k(this.$$state);return d},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return G(b,y,a)},function(b){return G(b,s,a)},
|
||||
b)}});var y=t;q.prototype=f.prototype;q.defer=c;q.reject=s;q.when=t;q.resolve=y;q.all=function(a){var b=new f,c=0,d=H(a)?[]:{};r(a,function(a,e){c++;t(a).then(function(a){d[e]=a;--c||h(b,d)},function(a){m(b,a)})});0===c&&h(b,d);return b};q.race=function(a){var b=c();r(a,function(a){t(a).then(b.resolve,b.reject)});return b.promise};return q}function hg(){this.$get=["$window","$timeout",function(a,b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||
|
||||
a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function Wf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++pb;this.$$ChildScope=null;this.$$suspended=!1}b.prototype=a;return b}var b=10,d=F("$rootScope"),c=null,e=null;this.digestTtl=
|
||||
function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++pb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=
|
||||
this;this.$$suspended=this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(v.$$phase)throw d("inprog",v.$$phase);v.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function s(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function G(){}function t(){for(;y.length;)try{y.shift()()}catch(a){f(a)}e=null}function q(){null===e&&(e=k.defer(function(){v.$apply(t)},
|
||||
null,"$applyAsync"))}m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",h);return d},$watch:function(a,b,d,e){var f=g(a);b=B(b)?b:E;if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l=
|
||||
{fn:b,last:G,get:f,exp:e||a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);k.$$digestWatchIndex++;n(this,1);return function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=
|
||||
!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,b){var d=g.$watch(a,function(a){e[b]=a;h||(h=!0,g.$evalAsync(c))});f.push(d)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!z(e)){if(D(e))if(ya(e))for(f!==n&&(f=n,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==p&&(f=p={},t=0,l++);a=0;for(b in e)ta.call(e,
|
||||
b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(a).literal;c.$stateful=!c.$$pure;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),n=[],p={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(D(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,
|
||||
g,h,l,m,n,s,r=b,q,y=w.length?v:this,N=[],z,A;p("$digest");k.$$checkUrlChange();this===v&&null!==e&&(k.defer.cancel(e),t());c=null;do{s=!1;q=y;for(n=0;n<w.length;n++){try{A=w[n],l=A.fn,l(A.scope,A.locals)}catch(C){f(C)}c=null}w.length=0;a:do{if(n=!q.$$suspended&&q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(q))!==(h=a.last)&&!(a.eq?va(g,h):X(g)&&X(h)))s=!0,c=a,a.last=a.eq?Ia(g,null):g,l=a.fn,l(g,h===G?g:h,q),5>r&&(z=4-r,N[z]||
|
||||
(N[z]=[]),N[z].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}));else if(a===c){s=!1;break a}}catch(E){f(E)}if(!(n=!q.$$suspended&&q.$$watchersCount&&q.$$childHead||q!==y&&q.$$nextSibling))for(;q!==y&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((s||w.length)&&!r--)throw v.$$phase=null,d("infdig",b,N);}while(s||w.length);for(v.$$phase=null;J<x.length;)try{x[J++]()}catch(D){f(D)}x.length=J=0;k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},
|
||||
$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===v&&k.$$applicationDestroyed();n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=
|
||||
this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=E;this.$on=this.$watch=this.$watchGroup=function(){return E};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){v.$$phase||w.length||k.defer(function(){w.length&&v.$digest()},null,"$evalAsync");w.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{v.$$phase=
|
||||
null}}catch(b){f(b)}finally{try{v.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&y.push(b);a=g(a);q()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=
|
||||
!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=db([e],arguments,
|
||||
1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var v=new m,w=v.$$asyncQueue=[],x=v.$$postDigestQueue=[],y=v.$$applyAsyncQueue=[],J=0;return v}]}function Le(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;
|
||||
this.aHrefSanitizationWhitelist=function(b){return w(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f=ga(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Sg(a){if("self"===a)return a;if(A(a)){if(-1<a.indexOf("***"))throw Ea("iwcard",a);a=Md(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if(ab(a))return new RegExp("^"+a.source+"$");throw Ea("imatcher");
|
||||
}function Nd(a){var b=[];w(a)&&r(a,function(a){b.push(Sg(a))});return b}function $f(){this.SCE_CONTEXTS=V;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=Nd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=Nd(a));return b};this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;"self"===a?(c=Bc(b,Od))||(C.document.baseURI?c=C.document.baseURI:(Na||(Na=C.document.createElement("a"),Na.href=".",Na=Na.cloneNode(!1)),c=Na.href),
|
||||
c=Bc(b,c)):c=!!a.exec(b.href);return c}function f(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var g=function(a){throw Ea("unsafe");};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};h[V.HTML]=f(k);h[V.CSS]=f(k);h[V.MEDIA_URL]=f(k);h[V.URL]=f(h[V.MEDIA_URL]);h[V.JS]=f(k);h[V.RESOURCE_URL]=
|
||||
f(h[V.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ea("icontext",a,b);if(null===b||z(b)||""===b)return b;if("string"!==typeof b)throw Ea("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||z(f)||""===f)return f;var k=h.hasOwnProperty(d)?h[d]:null;if(k&&f instanceof k)return f.$$unwrapTrustedValue();B(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue());if(d===V.MEDIA_URL||d===V.URL)return c(f.toString(),d===V.MEDIA_URL);if(d===V.RESOURCE_URL){var k=
|
||||
ga(f.toString()),n,s,r=!1;n=0;for(s=a.length;n<s;n++)if(e(a[n],k)){r=!0;break}if(r)for(n=0,s=b.length;n<s;n++)if(e(b[n],k)){r=!1;break}if(r)return f;throw Ea("insecurl",f.toString());}if(d===V.HTML)return g(f);throw Ea("unsafe");},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():a}}}]}function Zf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw Ea("iequirks");var c=ja(V);c.isEnabled=function(){return a};
|
||||
c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ta);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(V,function(a,b){var d=K(b);c[("parse_as_"+d).replace(Cc,wb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Cc,wb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Cc,wb)]=function(b){return g(a,b)}});
|
||||
return c}]}function ag(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=fa((/android (\d+)/.exec(K((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},k=g.body&&g.body.style,h=!1,l=!1;k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k));return{history:!(!c||
|
||||
4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(z(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Aa(),transitions:h,animations:l,android:e}}]}function bg(){this.$get=ia(function(a){return new Tg(a)})}function Tg(a){function b(){var a=e.pop();return a&&a.cb}function d(a){for(var b=e.length-1;0<=b;--b){var c=e[b];if(c.type===a)return e.splice(b,1),c.cb}}var c={},e=[],f=this.ALL_TASKS_TYPE="$$all$$",g=this.DEFAULT_TASK_TYPE="$$default$$";this.completeTask=function(e,
|
||||
h){h=h||g;try{e()}finally{var l;l=h||g;c[l]&&(c[l]--,c[f]--);l=c[h];var m=c[f];if(!m||!l)for(l=m?d:b;m=l(h);)try{m()}catch(p){a.error(p)}}};this.incTaskCount=function(a){a=a||g;c[a]=(c[a]||0)+1;c[f]=(c[f]||0)+1};this.notifyWhenNoPendingTasks=function(a,b){b=b||f;c[b]?e.push({type:b,cb:a}):a()}}function dg(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++;if(!A(k)||
|
||||
z(d.get(k)))k=f.getTrustedResourceUrl(k);var l=c.defaults&&c.defaults.transformResponse;H(l)?l=l.filter(function(a){return a!==vc}):l===vc&&(l=null);return c.get(k,S({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,a.data)},function(a){h||(a=Ug("tpload",k,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function eg(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,
|
||||
b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=ca.element(a).data("$binding");c&&r(c,function(c){d?(new RegExp("(^|\\s)"+Md(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},
|
||||
whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function fg(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,h,l){B(f)||(l=h,h=f,f=E);var m=Ha.call(arguments,3),p=w(l)&&!l,n=(p?c:d).defer(),s=n.promise,r;r=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[s.$$timeoutId]}p||a.$apply()},h,"$timeout");s.$$timeoutId=r;g[r]=n;return s}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw Vg("badprom");
|
||||
if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a],d=c.promise;d.$$state&&(d.$$state.pur=!0);c.reject("canceled");delete g[a];return b.defer.cancel(a)};return f}]}function ga(a){if(!A(a))return a;Ca&&(aa.setAttribute("href",a),a=aa.href);aa.setAttribute("href",a);a=aa.hostname;!Wg&&-1<a.indexOf(":")&&(a="["+a+"]");return{href:aa.href,protocol:aa.protocol?aa.protocol.replace(/:$/,""):"",host:aa.host,search:aa.search?aa.search.replace(/^\?/,""):"",hash:aa.hash?aa.hash.replace(/^#/,
|
||||
""):"",hostname:a,port:aa.port,pathname:"/"===aa.pathname.charAt(0)?aa.pathname:"/"+aa.pathname}}function Jg(a){var b=[Od].concat(a.map(ga));return function(a){a=ga(a);return b.some(Bc.bind(null,a))}}function Bc(a,b){a=ga(a);b=ga(b);return a.protocol===b.protocol&&a.host===b.host}function gg(){this.$get=ia(C)}function Pd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=
|
||||
e.split("; "),c={},k=0;k<a.length;k++)g=a[k],h=g.indexOf("="),0<h&&(l=b(g.substring(0,h)),z(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function kg(){this.$get=Pd}function dd(a){function b(d,c){if(D(d)){var e={};r(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",Qd);b("date",Rd);b("filter",Xg);b("json",Yg);b("limitTo",Zg);b("lowercase",$g);b("number",Sd);b("orderBy",
|
||||
Td);b("uppercase",ah)}function Xg(){return function(a,b,d,c){if(!ya(a)){if(null==a)return a;throw F("filter")("notarray",a);}c=c||"$";var e;switch(Dc(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=bh(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,b)}}function bh(a,b,d,c){var e=D(a)&&d in a;!0===b?b=va:B(b)||(b=function(a,b){if(z(a))return!1;if(null===a||null===b)return a===b;if(D(b)||D(a)&&!bc(a))return!1;a=K(""+a);b=K(""+
|
||||
b);return-1!==a.indexOf(b)});return function(f){return e&&!D(f)?Fa(f,a[d],b,d,!1):Fa(f,a,b,d,c)}}function Fa(a,b,d,c,e,f){var g=Dc(a),k=Dc(b);if("string"===k&&"!"===b.charAt(0))return!Fa(a,b.substring(1),d,c,e);if(H(a))return a.some(function(a){return Fa(a,b,d,c,e)});switch(g){case "object":var h;if(e){for(h in a)if(h.charAt&&"$"!==h.charAt(0)&&Fa(a[h],b,d,c,!0))return!0;return f?!1:Fa(a,b,d,c,!1)}if("object"===k){for(h in b)if(f=b[h],!B(f)&&!z(f)&&(g=h===c,!Fa(g?a:a[h],f,d,c,g,g)))return!1;return!0}return d(a,
|
||||
b);case "function":return!1;default:return d(a,b)}}function Dc(a){return null===a?"null":typeof a}function Qd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){z(c)&&(c=b.CURRENCY_SYM);z(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Ud(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,c)}}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Ud(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function ch(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Vd))&&
|
||||
(a=a.replace(Vd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Ec;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Ec;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Wd&&(d=d.splice(0,Wd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function dh(a,b,d,c){var e=a.d,f=e.length-a.i;b=z(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=
|
||||
1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Ud(a,b,d,c,e){if(!A(a)&&!W(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="\u221e";else{g=ch(k);dh(g,e,b.minFrac,b.maxFrac);h=g.d;k=g.i;e=g.e;f=[];for(g=h.reduce(function(a,b){return a&&!b},
|
||||
!0);0>k;)h.unshift(0),k++;0<k?f=h.splice(k,h.length):(f=h,h=[0]);k=[];for(h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join(""));h=k.join(d);f.length&&(h+=c+f.join(""));e&&(h+="e+"+e)}return 0>a&&!g?b.negPre+h+b.negSuf:b.posPre+h+b.posSuf}function Ob(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Ec+a;d&&(a=a.substr(a.length-b));return e+a}function ea(a,
|
||||
b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Ob(f,b,c,e)}}function kb(a,b,d){return function(c,e){var f=c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Xd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Yd(a){return function(b){var d=Xd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ob(b,a)}}function Fc(a,b){return 0>=
|
||||
a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Rd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=fa(b[9]+b[10]),g=fa(b[9]+b[11]));k.call(a,fa(b[1]),fa(b[2])-1,fa(b[3]));f=fa(b[4]||0)-f;g=fa(b[5]||0)-g;k=fa(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));h.call(a,f,g,k,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,
|
||||
d,f){var g="",k=[],h,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;A(c)&&(c=eh.test(c)?fa(c):b(c));W(c)&&(c=new Date(c));if(!ha(c)||!isFinite(c.getTime()))return c;for(;d;)(l=fh.exec(d))?(k=db(k,l,1),d=k.pop()):(k.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=ec(f,m),c=fc(c,f,!0));r(k,function(b){h=gh[b];g+=h?h(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Yg(){return function(a,b){z(b)&&(b=2);return eb(a,b)}}function Zg(){return function(a,
|
||||
b,d){b=Infinity===Math.abs(Number(b))?Number(b):fa(b);if(X(b))return a;W(a)&&(a=a.toString());if(!ya(a))return a;d=!d||isNaN(d)?0:fa(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Gc(a,d,d+b):0===d?Gc(a,b,a.length):Gc(a,Math.max(0,d+b),d)}}function Gc(a,b,d){return A(a)?a.slice(b,d):Ha.call(a,b,d)}function Td(a){function b(b){return b.map(function(b){var c=1,d=Ta;if(B(b))d=b;else if(A(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=
|
||||
d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,h=b.type;if(d===h){var h=a.value,l=b.value;"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(h)&&(h=a.index),D(l)&&(l=b.index));h!==l&&(c=h<l?-1:1)}else c="undefined"===d?1:"undefined"===h?-1:"null"===d?1:"null"===h?-1:d<h?-1:1;return c}return function(a,f,g,k){if(null==a)return a;if(!ya(a))throw F("orderBy")("notarray",
|
||||
a);H(f)||(f=[f]);0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=B(k)?k:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="null";else if("object"===c)a:{if(B(e.valueOf)&&(e=e.valueOf(),d(e)))break a;bc(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*
|
||||
h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Ra(a){B(a)&&(a={link:a});a.restrict=a.restrict||"AC";return ia(a)}function Pb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=lb;this.$$element=a;this.$$animate=c;Zd(this)}function Zd(a){a.$$classCache=
|
||||
{};a.$$classCache[$d]=!(a.$$classCache[mb]=a.$$element.hasClass(mb))}function ae(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Vc(c,"-"):"";b(a,mb+c,!0===d);b(a,$d+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){z(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,
|
||||
a,k),be(this.$pending)&&(this.$pending=void 0));Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=be(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a,
|
||||
g,this)}}function be(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Hc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Sa(a,b,d,c,e,f){var g=K(b[0].type);if(!e.android){var k=!1;b.on("compositionstart",function(){k=!0});b.on("compositionupdate",function(a){if(z(a.data)||""===a.data)k=!1});b.on("compositionend",function(){k=!1;l()})}var h,l=function(a){h&&(f.defer.cancel(h),h=null);if(!k){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&
|
||||
"false"===d.ngTrim||(e=U(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){h||(h=f.defer(function(){h=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ce[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!h){var b=this.validity,
|
||||
c=b.badInput,d=b.typeMismatch;h=f.defer(function(){h=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Qb(a,b){return function(d,c){var e,f;if(ha(d))return d;if(A(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(hh.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),
|
||||
ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0),100>f.yyyy&&e.setFullYear(f.yyyy),e}return NaN}}function nb(a,b,d,c){return function(e,f,g,k,h,l,m,p){function n(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function s(a){return w(a)&&!ha(a)?r(a)||void 0:a}function r(a,b){var c=k.$options.getOption("timezone");v&&v!==c&&(b=Sc(b,ec(v)));var e=d(a,
|
||||
b);!isNaN(e)&&c&&(e=fc(e,c));return e}Ic(e,f,g,k,a);Sa(e,f,g,k,h,l);var t="time"===a||"datetimelocal"===a,q,v;k.$parsers.push(function(c){if(k.$isEmpty(c))return null;if(b.test(c))return r(c,q);k.$$parserName=a});k.$formatters.push(function(a){if(a&&!ha(a))throw ob("datefmt",a);if(n(a)){q=a;var b=k.$options.getOption("timezone");b&&(v=b,q=fc(q,b,!0));var d=c;t&&A(k.$options.getOption("timeSecondsFormat"))&&(d=c.replace("ss.sss",k.$options.getOption("timeSecondsFormat")).replace(/:$/,""));a=m("date")(a,
|
||||
d,b);t&&k.$options.getOption("timeStripZeroSeconds")&&(a=a.replace(/(?::00)?(?:\.000)?$/,""));return a}v=q=null;return""});if(w(g.min)||g.ngMin){var x=g.min||p(g.ngMin)(e),B=s(x);k.$validators.min=function(a){return!n(a)||z(B)||d(a)>=B};g.$observe("min",function(a){a!==x&&(B=s(a),x=a,k.$validate())})}if(w(g.max)||g.ngMax){var y=g.max||p(g.ngMax)(e),J=s(y);k.$validators.max=function(a){return!n(a)||z(J)||d(a)<=J};g.$observe("max",function(a){a!==y&&(J=s(a),y=a,k.$validate())})}}}function Ic(a,b,d,
|
||||
c,e){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(d.badInput||d.typeMismatch)c.$$parserName=e;else return a})}function de(a){a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(ih.test(b))return parseFloat(b);a.$$parserName="number"});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!W(b))throw ob("numfmt",b);b=b.toString()}return b})}function na(a){w(a)&&!W(a)&&(a=parseFloat(a));return X(a)?void 0:a}function Jc(a){var b=a.toString(),
|
||||
d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ee(a,b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Jc(a):0,k=e?Jc(b):0,h=f?Jc(d):0,g=Math.max(g,k,h),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function fe(a,b,d,c,e){if(w(c)){a=a(c);if(!a.constant)throw ob("constexpr",d,c);return a(b)}return e}function Kc(a,b){function d(a,b){if(!a||!a.length)return[];
|
||||
if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){if(!a)return a;var b=a;H(a)?b=a.map(c).join(" "):D(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):A(a)||(b=a+"");return b}a="ngClass"+a;var e;return["$parse",function(f){return{restrict:"AC",link:function(g,k,h){function l(a,b){var c=[];r(a,function(a){if(0<b||p[a])p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a)});return c.join(" ")}function m(a){if(a===
|
||||
b){var c=s,c=l(c&&c.split(" "),1);h.$addClass(c)}else c=s,c=l(c&&c.split(" "),-1),h.$removeClass(c);n=a}var p=k.data("$classCounts"),n=!0,s;p||(p=T(),k.data("$classCounts",p));"ngClass"!==a&&(e||(e=f("$index",function(a){return a&1})),g.$watch(e,m));g.$watch(f(h[a],c),function(a){if(n===b){var c=s&&s.split(" "),e=a&&a.split(" "),f=d(c,e),c=d(e,c),f=l(f,-1),c=l(c,1);h.$addClass(c);h.$removeClass(f)}s=a})}}}]}function qd(a,b,d,c,e,f){return{restrict:"A",compile:function(g,k){var h=a(k[c]);return function(a,
|
||||
c){c.on(e,function(c){var e=function(){h(a,{$event:c})};if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(g){d(g)}else a.$apply(e)})}}}}function Rb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=
|
||||
void 0;this.$name=h(d.name||"",!1)(a);this.$$parentForm=lb;this.$options=Sb;this.$$updateEvents="";this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=null;this.$$parserValid=void 0;this.$$parserName="parse";this.$$currentValidationRunId=0;this.$$scope=a;this.$$rootScope=a.$root;this.$$attr=d;
|
||||
this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=k;this.$$exceptionHandler=b;Zd(this);jh(this)}function jh(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Lc(a){this.$$options=a}function ge(a,b){r(b,function(b,c){w(a[c])||(a[c]=b)})}function Oa(a,b){a.prop("selected",b);a.attr("selected",b)}function he(a,b,d){if(a){A(a)&&(a=new RegExp("^"+a+"$"));if(!a.test)throw F("ngPattern")("noregexp",
|
||||
b,a,za(d));return a}}function Tb(a){a=fa(a);return X(a)?-1:a}var Wb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ie=/^\/(.+)\/([a-z]*)$/,ta=Object.prototype.hasOwnProperty,K=function(a){return A(a)?a.toLowerCase():a},ub=function(a){return A(a)?a.toUpperCase():a},Ca,x,rb,Ha=[].slice,Fg=[].splice,kh=[].push,la=Object.prototype.toString,Pc=Object.getPrototypeOf,pa=F("ng"),ca=C.angular||(C.angular={}),kc,pb=0;Ca=C.document.documentMode;var X=Number.isNaN||function(a){return a!==a};E.$inject=[];Ta.$inject=
|
||||
[];var ve=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,U=function(a){return A(a)?a.trim():a},Md=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Aa=function(){if(!w(Aa.rules)){var a=C.document.querySelector("[ng-csp]")||C.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Aa.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==
|
||||
b.indexOf("no-inline-style")}}else{a=Aa;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Aa.rules},qb=function(){if(w(qb.name_))return qb.name_;var a,b,d=Qa.length,c,e;for(b=0;b<d;++b)if(c=Qa[b],a=C.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return qb.name_=e},xe=/:/g,Qa=["ng-","data-ng-","ng:","x-ng-"],Be=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof C.HTMLScriptElement||b instanceof C.SVGScriptElement))return!1;
|
||||
b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0;default:return!1}})}(C.document),Ee=/[A-Z]/g,Wc=!1,Pa=3,Ke={full:"1.7.7",major:1,minor:7,dot:7,codeName:"kingly-exiting"};Y.expando="ng339";var Ka=Y.cache={},pg=
|
||||
1;Y._data=function(a){return this.cache[a[this.expando]]||{}};var lg=/-([a-z])/g,lh=/^-ms-/,Ab={mouseleave:"mouseout",mouseenter:"mouseover"},nc=F("jqLite"),og=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,mc=/<|&#?\w+;/,mg=/<([\w:-]+)/,ng=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,oa={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>",
|
||||
"</tr></tbody></table>"],_default:[0,"",""]};oa.optgroup=oa.option;oa.tbody=oa.tfoot=oa.colgroup=oa.caption=oa.thead;oa.th=oa.td;var ug=C.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Wa=Y.prototype={ready:fd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?x(this[a]):x(this[this.length+a])},length:0,push:kh,sort:[].sort,splice:[].splice},Gb={};r("multiple selected checked disabled readOnly required open".split(" "),
|
||||
function(a){Gb[K(a)]=a});var md={};r("input select option textarea button form details".split(" "),function(a){md[a]=!0});var td={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:rc,removeData:qc,hasData:function(a){for(var b in Ka[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)qc(a[b]),id(a[b])}},function(a,b){Y[b]=a});r({data:rc,inheritedData:Eb,scope:function(a){return x.data(a,"$scope")||Eb(a.parentNode||
|
||||
a,["$isolateScope","$scope"])},isolateScope:function(a){return x.data(a,"$isolateScope")||x.data(a,"$isolateScopeNoTemplate")},controller:jd,injector:function(a){return Eb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Bb,css:function(a,b,d){b=xb(b.replace(lh,"ms-"));if(w(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Pa&&2!==c&&8!==c&&a.getAttribute){var c=K(b),e=Gb[c];if(w(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,
|
||||
e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(w(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(z(d)){var c=a.nodeType;return 1===c||c===Pa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(z(b)){if(a.multiple&&"select"===ua(a)){var d=[];r(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(z(b))return a.innerHTML;yb(a,!0);a.innerHTML=b},
|
||||
empty:kd},function(a,b){Y.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==kd&&z(2===a.length&&a!==Bb&&a!==jd?b:c)){if(D(b)){for(e=0;e<g;e++)if(a===rc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=z(e)?Math.min(g,1):g;for(f=0;f<g;f++){var k=a(this[f],b,c);e=e?e+k:k}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});r({removeData:qc,on:function(a,b,d,c){if(w(c))throw nc("onargs");if(lc(a)){c=zb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=rg(a,e));c=0<=b.indexOf(" ")?
|
||||
b.split(" "):[b];for(var g=c.length,k=function(b,c,g){var k=e[b];k||(k=e[b]=[],k.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));k.push(d)};g--;)b=c[g],Ab[b]?(k(Ab[b],tg),k(b,void 0,!0)):k(b)}},off:id,one:function(a,b,d){a=x(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;yb(a);r(new Y(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];r(a.childNodes,function(a){1===
|
||||
a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new Y(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;r(new Y(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){var d=x(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Fb,detach:function(a){Fb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;
|
||||
if(c){b=new Y(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Db,removeClass:Cb,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;z(e)&&(e=!Bb(a,b));(e?Db:Cb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:pc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=zb(a);if(g=(g=g&&g.events)&&
|
||||
g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:E,type:f,target:a},b.type&&(c=S(c,b)),b=ja(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){Y.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<
|
||||
k;g++)z(f)?(f=a(this[g],b,c,e),w(f)&&(f=x(f))):oc(f,a(this[g],b,c,e));return w(f)?f:this}});Y.prototype.bind=Y.prototype.on;Y.prototype.unbind=Y.prototype.off;var mh=Object.create(null);nd.prototype={_idx:function(a){a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a));return this._lastIndex},_transformKey:function(a){return X(a)?mh:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},has:function(a){a=this._transformKey(a);return-1!==this._idx(a)},
|
||||
set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};var Hb=nd,jg=[function(){this.$get=[function(){return Hb}]}],wg=/^([^(]+?)=>/,xg=/^[^(]*\(\s*([^)]*)\)/m,nh=/,/,oh=/^\s*(_?)(\S+?)\1\s*$/,vg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ba=F("$injector");
|
||||
fb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw A(d)&&d||(d=a.name||yg(a)),Ba("strictdi",d);b=od(a);r(b[1].split(nh),function(a){a.replace(oh,function(a,b,d){c.push(d)})})}a.$inject=c}}else H(a)?(b=a.length-1,sb(a[b],"fn"),c=a.slice(0,b)):sb(a,"fn",!0);return c};var je=F("$animate"),zf=function(){this.$get=E},Af=function(){var a=new Hb,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=A(b)?b.split(" "):
|
||||
H(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=zg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Db(a,e);f&&Cb(a,f)});a.delete(b)}});b.length=0}return{enabled:E,on:E,off:E,pin:E,push:function(g,k,h,l){l&&l();h=h||{};h.from&&g.css(h.from);h.to&&g.css(h.to);if(h.addClass||h.removeClass)if(k=h.addClass,l=h.removeClass,h=a.get(g)||{},k=e(h,k,!0),l=e(h,l,!1),
|
||||
k||l)a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},xf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw je("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=B(a)?a:null);return c};this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?
|
||||
a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,je("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,
|
||||
"enter",ra(l))},move:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,"move",ra(l))},leave:function(b,c){return a.push(b,"leave",ra(c),function(){b.remove()})},addClass:function(b,c,d){d=ra(d);d.addClass=hb(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=ra(d);d.removeClass=hb(d.removeClass,c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=ra(f);f.addClass=hb(f.addClass,c);f.removeClass=hb(f.removeClass,d);return a.push(b,"setClass",
|
||||
f)},animate:function(b,c,d,f,m){m=ra(m);m.from=m.from?S(m.from,c):c;m.to=m.to?S(m.to,d):d;m.tempClasses=hb(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],Cf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},Bf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,
|
||||
b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:E,getPromise:function(){if(!this.promise){var b=
|
||||
this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},
|
||||
complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},yf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);k||
|
||||
h.complete();k=!0});return h}var g=e||{};g.$$prepared||(g=Ia(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]},$=F("$compile"),tc=new function(){};Xc.$inject=["$provide","$$sanitizeUriProvider"];Jb.prototype.isFirstChange=function(){return this.previousValue===tc};var pd=/^((?:x|data)[:\-_])/i,Eg=/[:\-_]+(.)/g,vd=F("$controller"),ud=/^(\S+)(\s+as\s+([\w$]+))?$/,Jf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&
|
||||
b instanceof x&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},wd="application/json",wc={"Content-Type":wd+";charset=utf-8"},Hg=/^\[|^\{(?!\{)/,Ig={"[":/]$/,"{":/}$/},Gg=/^\)]\}',?\n/,Kb=F("$http"),Ma=ca.$interpolateMinErr=F("$interpolate");Ma.throwNoconcat=function(a){throw Ma("noconcat",a);};Ma.interr=function(a,b){return Ma("interr",a,b.toString())};var Lg=F("$interval"),Sf=function(){this.$get=function(){function a(a){var b=function(a){b.data=a;b.called=!0};b.id=a;return b}var b=ca.callbacks,
|
||||
d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},ph=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Mg={http:80,https:443,ftp:21},jb=F("$location"),Ng=/^\s*[\\/]{2,}/,qh={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){for(var a=this.$$path,b=this.$$hash,d=ye(this.$$search),b=b?
|
||||
"#"+hc(b):"",a=a.split("/"),c=a.length;c--;)a[c]=hc(a[c].replace(/%2F/g,"/"));this.$$url=a.join("/")+(d?"?"+d:"")+b;this.$$absUrl=this.$$normalizeUrl(this.$$url);this.$$urlUpdatedByLocation=!0},absUrl:Lb("$$absUrl"),url:function(a){if(z(a))return this.$$url;var b=ph.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Lb("$$protocol"),host:Lb("$$host"),port:Lb("$$port"),path:Dd("$$path",function(a){a=null!==
|
||||
a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(A(a)||W(a))a=a.toString(),this.$$search=gc(a);else if(D(a))a=Ia(a,{}),r(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw jb("isrcharg");break;default:z(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:Dd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};
|
||||
r([Cd,zc,yc],function(a){a.prototype=Object.create(qh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==yc||!this.$$html5)throw jb("nostate");this.$$state=z(b)?null:b;this.$$urlUpdatedByLocation=!0;return this}});var Ya=F("$parse"),Rg={}.constructor.prototype.valueOf,Ub=T();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Ub[a]=!0});var rh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Nb=function(a){this.options=a};Nb.prototype={constructor:Nb,
|
||||
lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Ub[b],e=Ub[d];Ub[a]||
|
||||
c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?
|
||||
this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):
|
||||
(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Ya("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<
|
||||
this.text.length;){var d=K(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<
|
||||
this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,
|
||||
16))):d+=rh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer=a;this.options=b};q.Program="Program";q.ExpressionStatement="ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression="ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";
|
||||
q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression";q.ThisExpression="ThisExpression";q.LocalsExpression="LocalsExpression";q.NGValueParameter="NGValueParameter";q.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},
|
||||
program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Hd(a))throw Ya("lval");
|
||||
a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a=
|
||||
{type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,
|
||||
operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?
|
||||
a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=Ia(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):
|
||||
"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))
|
||||
}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
|
||||
b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");
|
||||
return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Ya("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Ya("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Ya("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,
|
||||
e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}};var Fd=2;Jd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};Z(a,b.$filter);var d="",c;this.stage="assign";if(c=Id(a))this.state.computing=
|
||||
"assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Gd(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d;var k=b.nextId();b.recurse(a,k);b.return_(k);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+
|
||||
d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Og,Pg,Ed);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,
|
||||
b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,k,h=this,l,m,p;c=c||E;if(!f&&w(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,
|
||||
this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a});c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case q.Literal:m=this.escape(a.value);this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){k=a});m=a.operator+"("+this.ifDefined(k,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,
|
||||
void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){k=a});m="+"===a.operator?this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId();h.recurse(a.left,b);h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();h.recurse(a.test,b);h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,
|
||||
b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),h.lazyAssign(h.nonComputedMember("s",a.name),"{}"));h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",
|
||||
a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();h.recurse(a.object,g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,
|
||||
a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(k=h.filter(a.callee.name),l=[],r(a.arguments,function(a){var b=h.nextId();h.recurse(a,b);l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){r(a.arguments,function(b){h.recurse(b,a.constant?
|
||||
void 0:h.nextId(),void 0,function(a){l.push(a)})});m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+")";h.assign(b,m)},function(){h.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:k=this.nextId();g={};this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k);m=h.member(g.context,g.name,g.computed)+a.operator+k;h.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){h.recurse(b,
|
||||
a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;k=h.nextId();h.recurse(a.value,k);h.assign(h.member(b,g,a.computed),k)})):(r(a.properties,function(b){h.recurse(b.value,a.constant?void 0:
|
||||
h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break;case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,
|
||||
b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},
|
||||
not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=
|
||||
this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(A(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(W(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Ya("esc");},nextId:function(a,
|
||||
b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Kd.prototype={compile:function(a){var b=this;Z(a,b.$filter);var d,c;if(d=Id(a))c=this.recurse(d);d=Gd(a.body);var e;d&&(e=[],r(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?E:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=
|
||||
d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
|
||||
this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),
|
||||
a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n=[];for(var s=0;s<g.length;++s)n.push(g[s](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=
|
||||
c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,
|
||||
c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=w(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,
|
||||
e,f);d=w(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=Ed(k,c);return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=(w(k)?k:0)-(w(c)?c:0);return d?{value:k}:k}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,
|
||||
e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,
|
||||
e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=
|
||||
a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k)?b(e,f,g,k):d(e,f,g,k);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:
|
||||
e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var h=a(e,f,g,k),l,m;null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]);return d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0;return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Mb.prototype={constructor:Mb,parse:function(a){a=this.getAst(a);var b=
|
||||
this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var Ea=F("$sce"),V={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",
|
||||
JS:"js"},Cc=/_([a-z])/g,Ug=F("$templateRequest"),Vg=F("$timeout"),aa=C.document.createElement("a"),Od=ga(C.location.href),Na;aa.href="http://[::1]";var Wg="[::1]"===aa.hostname;Pd.$inject=["$document"];dd.$inject=["$provide"];var Wd=22,Vd=".",Ec="0";Qd.$inject=["$locale"];Sd.$inject=["$locale"];var gh={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:kb("Month"),MMM:kb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:kb("Month",!1,!0),dd:ea("Date",2),
|
||||
d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:kb("Day"),EEE:kb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ob(Math[0<a?"floor":"ceil"](a/60),2)+Ob(Math.abs(a%60),2))},ww:Yd(2),w:Yd(1),G:Fc,GG:Fc,GGG:Fc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},
|
||||
fh=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,eh=/^-?\d+$/;Rd.$inject=["$locale"];var $g=ia(K),ah=ia(ub);Td.$inject=["$parse"];var Me=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===la.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};r(Gb,function(a,b){function d(a,d,e){a.$watch(e[c],
|
||||
function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=wa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(td,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ie))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});r(["src","srcset","href"],function(a){var b=wa("ng-"+a);vb[b]=
|
||||
["$sce",function(d){return{priority:99,link:function(c,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===la.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$set(b,d.getTrustedMediaUrl(f[b]));f.$observe(b,function(b){b?(f.$set(k,b),Ca&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}]});var lb={$addControl:E,$getControls:ia([]),$$renameControl:function(a,b){a.$name=b},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E,$$setSubmitted:E};Pb.$inject=
|
||||
["$element","$attrs","$scope","$animate","$interpolate"];Pb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ja(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$getControls:function(){return ja(this.$$controls)},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&
|
||||
this[a.$name]===a&&delete this[a.$name];r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=lb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,
|
||||
Za,Vb+" ng-submitted");this.$dirty=!1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==lb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=!0;r(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}};ae({clazz:Pb,set:function(a,
|
||||
b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var ke=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||E}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Pb,compile:function(d,f){d.addClass(Za).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();
|
||||
p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var s=g?c(p.$name):E;g&&(s(a,p),e.$observe(g,function(b){p.$name!==b&&(s(a,void 0),p.$$parentForm.$$renameControl(p,b),s=c(p.$name),s(a,p))}));d.on("$destroy",function(){p.$$parentForm.$removeControl(p);s(a,void 0);S(p,lb)})}}}}}]},Ne=ke(),Ze=ke(!0),hh=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,
|
||||
sh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,th=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,ih=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,le=/^(\d{4,})-(\d{2})-(\d{2})$/,me=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Mc=/^(\d{4,})-W(\d\d)$/,ne=/^(\d{4,})-(\d\d)$/,
|
||||
oe=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ce=T();r(["date","datetime-local","month","time","week"],function(a){ce[a]=!0});var pe={text:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c)},date:nb("date",le,Qb(le,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":nb("datetimelocal",me,Qb(me,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:nb("time",oe,Qb(oe,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:nb("week",Mc,function(a,b){if(ha(a))return a;if(A(a)){Mc.lastIndex=0;var d=Mc.exec(a);
|
||||
if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Xd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds());return new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:nb("month",ne,Qb(ne,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f,g,k){Ic(a,b,d,c,"number");de(c);Sa(a,b,d,c,e,f);var h;if(w(d.min)||d.ngMin){var l=d.min||k(d.ngMin)(a);h=na(l);c.$validators.min=function(a,b){return c.$isEmpty(b)||z(h)||b>=h};d.$observe("min",function(a){a!==l&&(h=na(a),
|
||||
l=a,c.$validate())})}if(w(d.max)||d.ngMax){var m=d.max||k(d.ngMax)(a),p=na(m);c.$validators.max=function(a,b){return c.$isEmpty(b)||z(p)||b<=p};d.$observe("max",function(a){a!==m&&(p=na(a),m=a,c.$validate())})}if(w(d.step)||d.ngStep){var n=d.step||k(d.ngStep)(a),s=na(n);c.$validators.step=function(a,b){return c.$isEmpty(b)||z(s)||ee(b,h||0,s)};d.$observe("step",function(a){a!==n&&(s=na(a),n=a,c.$validate())})}},url:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.url=function(a,b){var d=
|
||||
a||b;return c.$isEmpty(d)||sh.test(d)}},email:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||th.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==U(d.ngTrim);z(d.name)&&b.attr("name",++pb);b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=U(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=U(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,
|
||||
c){b.attr(a,d[a]);var e=d[a];d.$observe(a,function(a){a!==e&&(e=a,c(a))})}function k(a){p=na(a);X(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function h(a){n=na(a);X(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())}function l(a){s=na(a);X(c.$modelValue)||(m?c.$viewValue!==b.val()&&c.$setViewValue(b.val()):c.$validate())}Ic(a,b,d,c,"range");de(c);Sa(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?
|
||||
0:void 0,n=m?100:void 0,s=m?1:void 0,r=b[0].validity;a=w(d.min);e=w(d.max);f=w(d.step);var q=c.$render;c.$render=m&&w(r.rangeUnderflow)&&w(r.rangeOverflow)?function(){q();c.$setViewValue(b.val())}:q;a&&(p=na(d.min),c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(p)||b>=p},g("min",k));e&&(n=na(d.max),c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(n)||b<=n},g("max",h));f&&(s=na(d.step),c.$validators.step=m?function(){return!r.stepMismatch}:
|
||||
function(a,b){return c.$isEmpty(b)||z(s)||ee(b,p||0,s)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,k){var h=fe(k,a,"ngTrueValue",d.ngTrueValue,!0),l=fe(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return va(a,h)});c.$parsers.push(function(a){return a?h:l})},hidden:E,button:E,submit:E,reset:E,file:E},Yc=["$browser","$sniffer",
|
||||
"$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,k){k[0]&&(pe[K(g.type)]||pe.text)(e,f,g,k[0],b,a,d,c)}}}}],vf=function(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};return{restrict:"E",priority:200,compile:function(b,d){if("hidden"===K(d.type))return{pre:function(b,d,f,g){b=d[0];b.parentNode&&b.parentNode.insertBefore(b,b.nextSibling);Object.defineProperty&&
|
||||
Object.defineProperty(b,"value",a)}}}}},uh=/^(true|false|\d+)$/,sf=function(){function a(a,d,c){var e=w(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return uh.test(d.ngValue)?function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Re=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];
|
||||
b.$watch(e.ngBind,function(a){c.textContent=ic(a)})}}}}],Te=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=z(a)?"":a})}}}}],Se=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);
|
||||
return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],rf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Ue=Kc("",!0),We=Kc("Odd",0),Ve=Kc("Even",1),Xe=Ra({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ye=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],cd={},vh={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),
|
||||
function(a){var b=wa("ng-"+a);cd[b]=["$parse","$rootScope","$exceptionHandler",function(d,c,e){return qd(d,c,e,b,a,vh[a])}]});var af=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);k={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=tb(k.clone),
|
||||
a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],bf=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){var r=0,q,t,x,v=function(){t&&(t.remove(),t=null);q&&(q.$destroy(),q=null);x&&(d.leave(x).done(function(a){!1!==a&&(t=null)}),t=x,x=null)};c.$watch(f,function(f){var m=function(a){!1===
|
||||
a||!w(k)||k&&!c.$eval(k)||b()},t=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&t===r){var b=c.$new();p.template=a;a=n(b,function(a){v();d.enter(a,null,e).done(m)});q=b;x=a;q.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||t!==r||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],uf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){la.call(d[0]).match(/SVG/)?
|
||||
(d.empty(),a(ed(e.template,C.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],cf=Ra({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),qf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?U(e):e;c.$parsers.push(function(a){if(!z(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?U(a):a)});return b}});c.$formatters.push(function(a){if(H(a))return a.join(e)});
|
||||
c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",$d="ng-invalid",Za="ng-pristine",Vb="ng-dirty",ob=F("ngModel");Rb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");Rb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);B(c)&&(c=a(b));return c};this.$$ngModelSet=
|
||||
function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw ob("nonassign",this.$$attr.ngModel,za(this.$$element));},$render:E,$isEmpty:function(a){return z(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,
|
||||
"ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,Za)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=
|
||||
!0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!X(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==
|
||||
c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(h.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(h.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(h.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!B(h.then))throw ob("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?h.$$q.all(c).then(function(){g(d)},E):g(!0)}function f(a,b){k===h.$$currentValidationRunId&&
|
||||
h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;if(z(h.$$parserValid))f(a,null);else return h.$$parserValid||(r(h.$validators,function(a,b){f(b,null)}),r(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce);if(this.$$lastCommittedViewValue!==
|
||||
a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;this.$$parserValid=z(a)?void 0:!0;this.$setValidity(this.$$parserName,null);this.$$parserName="parse";if(this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),z(a)){this.$$parserValid=!1;break}X(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));
|
||||
var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=
|
||||
a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");W(b[a])?b=b[a]:W(b["default"])&&-1===this.$options.getOption("updateOn").indexOf(a)?b=b["default"]:W(b["*"])&&(b=b["*"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},
|
||||
$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,E))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=
|
||||
void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};ae({clazz:Rb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var pf=["$rootScope",function(a){return{restrict:"A",require:["ngModel",
|
||||
"^?form","^?ngModelOptions"],controller:Rb,priority:1,compile:function(b){b.addClass(Za).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents();c.on("blur",
|
||||
function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Sb,wh=/(\s+|^)default(\s+|$)/;Lc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;a=S({},a);r(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=U(d.replace(wh,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],ge(a,this.$$options));ge(a,Sb.$$options);
|
||||
return new Lc(a)}};Sb=new Lc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var tf=function(){function a(a,d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Sb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},df=Ra({terminal:!0,
|
||||
priority:1E3}),xh=F("ngOptions"),yh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,nf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!r&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&
|
||||
"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(yh);if(!p)throw xh("iexp",a,za(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);var t=a&&d(a)||b,w=q&&d(q),v=q?function(a,b){return w(c,b)}:function(a){return La(a)},x=function(a,b){return v(a,A(a,b))},z=d(p[2]||p[1]),y=d(p[3]||""),J=d(p[4]||""),I=d(p[8]),B={},A=r?function(a,b){B[r]=b;B[n]=a;return B}:function(a){B[n]=a;return B};return{trackBy:q,getTrackByValue:x,getWatchables:d(I,function(a){var b=[];a=a||[];for(var d=
|
||||
f(a),e=d.length,g=0;g<e;g++){var k=a===d?g:d[g],l=a[k],k=A(l,k),l=v(l,k);b.push(l);if(p[2]||p[1])l=z(c,k),b.push(l);p[4]&&(k=J(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=I(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===g?n:g[n],r=A(d[p],p),s=t(c,r),p=v(s,r),w=z(c,r),B=y(c,r),r=J(c,r),s=new e(p,s,w,B,r);a.push(s);b[p]=s}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[x(a)]},getViewValueFromOption:function(a){return q?Ia(a.viewValue):a.viewValue}}}}}
|
||||
var e=C.document.createElement("option"),f=C.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=E},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],q=l[1],z=h.multiple;l=0;for(var t=k.children(),
|
||||
B=t.length;l<B;l++)if(""===t[l].value){n.hasEmptyOption=!0;n.emptyOption=t.eq(l);break}k.empty();l=!!n.emptyOption;x(e.cloneNode(!1)).val("?");var v,A=c(h.ngOptions,k,d),C=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};z?(n.writeValue=function(a){if(v){var b=a&&a.map(m)||[];v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=k.val()||[],b=[];r(a,function(a){(a=v.selectValueMap[a])&&
|
||||
!a.disabled&&b.push(v.getViewValueFromOption(a))});return b},A.trackBy&&d.$watchCollection(function(){if(H(q.$viewValue))return q.$viewValue.map(function(a){return A.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){if(v){var b=k[0].options[k[0].selectedIndex],c=v.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},
|
||||
n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},A.trackBy&&d.$watch(function(){return A.getTrackByValue(q.$viewValue)},function(){q.$render()}));l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",
|
||||
function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(A.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=v.items[b];w(c.group)?Fb(c.element.parentNode):Fb(c.element)}v=A.getOptions();var d={};v.items.forEach(function(a){var b;if(w(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),C.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);
|
||||
var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),C.appendChild(b),p(a,b)});k[0].appendChild(C);q.$render();q.$isEmpty(a)||(b=n.readValue(),(A.trackBy||z?va(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],ef=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},q={},w=b.startSymbol(),t=b.endSymbol(),x=w+l+"-"+
|
||||
p+t,v=ca.noop,A;r(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+K(c[2]),n[c]=g.attr(k.$attr[b]))});r(n,function(a,d){q[d]=b(a.replace(c,x))});f.$watch(l,function(b){var c=parseFloat(b),e=X(c);e||c in n||(c=a.pluralCat(c-p));c===A||e&&X(A)||(v(),e=q[c],z(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),v=E,h()):v=f.$watch(e,h),A=c)})}}}],qe=F("ngRef"),ff=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=wa(ua(b)),e=a(d.ngRef),f=e.assign||
|
||||
function(){throw qe("nonassign",d.ngRef);};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead"))if("$element"===h.ngRefRead)l=b;else{if(l=b.data("$"+h.ngRefRead+"Controller"),!l)throw qe("noctrl",h.ngRefRead,d.ngRef);}else l=b.data("$"+c+"Controller");l=l||b;f(a,l);b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],gf=["$parse","$animate","$compile",function(a,b,d){var c=F("ngRepeat"),e=function(a,b,c,d,e,f,g){a[c]=d;e&&(a[e]=f);a.$index=b;a.$first=0===b;a.$last=b===g-1;a.$middle=!(a.$first||
|
||||
a.$last);a.$odd=!(a.$even=0===(b&1))},f=function(a,b,c){return La(c)},g=function(a,b){return b};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(k,h){var l=h.ngRepeat,m=d.$$createComment("end ngRepeat",l),p=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw c("iexp",l);var n=p[1],q=p[2],w=p[3],t=p[4],p=n.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!p)throw c("iidexp",
|
||||
n);var x=p[3]||p[1],v=p[2];if(w&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(w)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(w)))throw c("badident",w);var z;if(t){var A={$id:La},y=a(t);z=function(a,b,c,d){v&&(A[v]=b);A[x]=c;A.$index=d;return y(a,A)}}return function(a,d,h,k,n){var p=T();a.$watchCollection(q,function(h){var k,q,t=d[0],s,y=T(),B,C,E,D,H,F,K;w&&(a[w]=h);if(ya(h))H=h,q=z||f;else for(K in q=z||g,H=[],h)ta.call(h,K)&&"$"!==K.charAt(0)&&H.push(K);
|
||||
B=H.length;K=Array(B);for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],D=q(a,C,E,k),p[D])F=p[D],delete p[D],y[D]=F,K[k]=F;else{if(y[D])throw r(K,function(a){a&&a.scope&&(p[a.id]=a)}),c("dupes",l,D,E);K[k]={id:D,scope:void 0,clone:void 0};y[D]=!0}A&&(A[x]=void 0);for(s in p){F=p[s];D=tb(F.clone);b.leave(D);if(D[0].parentNode)for(k=0,q=D.length;k<q;k++)D[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],F=K[k],F.scope){s=t;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);F.clone[0]!==
|
||||
s&&b.move(tb(F.clone),null,t);t=F.clone[F.clone.length-1];e(F.scope,k,x,E,v,C,B)}else n(function(a,c){F.scope=c;var d=m.cloneNode(!1);a[a.length++]=d;b.enter(a,null,t);t=d;F.clone=a;y[F.id]=F;e(F.scope,k,x,E,v,C,B)});p=y})}}}}],hf=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],$e=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,
|
||||
d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],jf=Ra(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&(a||(a={}),r(d,function(b,d){null==a[d]&&(a[d]="")}));a&&b.css(a)})}),kf=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],k=[],h=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||
|
||||
e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());d=0;for(e=l.length;d<e;++d){var q=tb(k[d].clone);l[d].$destroy();(h[d]=a.leave(q)).done(m(h,d))}k.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");k.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],lf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,
|
||||
b,c){return c[b-1]!==a});r(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),mf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),zh=F("ngTransclude"),of=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw zh("orphan",
|
||||
za(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Pa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},null,f);f&&!k.isSlotFilled(f)&&h()}}}}],Oe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],Ah={$setViewValue:E,$render:E},Bh=["$element",
|
||||
"$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Hb;e.selectValueMap={};e.ngModelCtrl=Ah;e.multiple=!1;e.unknownOption=x(C.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);
|
||||
a.prepend(e.unknownOption);Oa(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Oa(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+La(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Oa(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Oa(e.emptyOption,!1)};b.$on("$destroy",
|
||||
function(){e.renderUnknownOption=E});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Oa(x(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=La(b),a.val(c in e.selectValueMap?c:b),Oa(x(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Ja(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=
|
||||
b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]===e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==
|
||||
a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,k=!1;e.registerOption=function(a,b,f,g,k){if(f.$attr.ngValue){var q,r;f.$observe("value",function(a){var d,f=b.prop("selected");w(r)&&(e.removeOption(q),delete e.selectValueMap[r],d=!0);r=La(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");
|
||||
w(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())});b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Pe=function(){return{restrict:"E",
|
||||
require:["select","?ngModel"],controller:Bh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];r(b.find("option"),function(b){b.selected&&!b.disabled&&(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,
|
||||
b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Oa(x(b),c)})};var g,k=NaN;a.$watch(function(){k!==f.$viewValue||va(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());k=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=E},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Qe=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;w(d.ngValue)||
|
||||
(w(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],$c=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.required||a(c.ngRequired)(b);c.required=!0;e.$validators.required=function(a,b){return!f||!e.$isEmpty(b)};c.$observe("required",function(a){f!==a&&(f=a,e.$validate())})}}}}],Zc=["$parse",
|
||||
function(a){return{restrict:"A",require:"?ngModel",compile:function(b,d){var c,e;d.ngPattern&&(c=d.ngPattern,e="/"===d.ngPattern.charAt(0)&&ie.test(d.ngPattern)?function(){return d.ngPattern}:a(d.ngPattern));return function(a,b,d,h){if(h){var l=d.pattern;d.ngPattern?l=e(a):c=d.pattern;var m=he(l,c,b);d.$observe("pattern",function(a){var d=m;m=he(a,c,b);(d&&d.toString())!==(m&&m.toString())&&h.$validate()});h.$validators.pattern=function(a,b){return h.$isEmpty(b)||z(m)||m.test(b)}}}}}}],bd=["$parse",
|
||||
function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.maxlength||a(c.ngMaxlength)(b),g=Tb(f);c.$observe("maxlength",function(a){f!==a&&(g=Tb(a),f=a,e.$validate())});e.$validators.maxlength=function(a,b){return 0>g||e.$isEmpty(b)||b.length<=g}}}}}],ad=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.minlength||a(c.ngMinlength)(b),g=Tb(f)||-1;c.$observe("minlength",function(a){f!==a&&(g=Tb(a)||-1,f=a,e.$validate())});
|
||||
e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g}}}}}];C.angular.bootstrap?C.console&&console.log("WARNING: Tried to load AngularJS more than once."):(Fe(),Je(ca),ca.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,
|
||||
MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",
|
||||
shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),x(function(){Ae(C.document,Uc)}))})(window);
|
||||
!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
|
||||
//# sourceMappingURL=angular.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"angular.min.js",
|
||||
"lineCount":349,
|
||||
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAAS,CAwClBC,QAASA,GAAmB,CAACC,CAAD,CAAS,CACnC,GAAIC,CAAA,CAASD,CAAT,CAAJ,CACME,CAAA,CAAUF,CAAAG,eAAV,CAGJ,GAFEC,EAAAD,eAEF,CAFgCE,EAAA,CAAsBL,CAAAG,eAAtB,CAAA,CAA+CH,CAAAG,eAA/C,CAAuEG,GAEvG,EAAIJ,CAAA,CAAUF,CAAAO,sBAAV,CAAJ,EAA+CC,EAAA,CAAUR,CAAAO,sBAAV,CAA/C,GACEH,EAAAG,sBADF,CACuCP,CAAAO,sBADvC,CAJF,KAQE,OAAOH,GAT0B,CAkBrCC,QAASA,GAAqB,CAACI,CAAD,CAAW,CACvC,MAAOC,EAAA,CAASD,CAAT,CAAP,EAAwC,CAAxC,CAA6BA,CADU,CAmCzCE,QAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,KAAAA,OAAAA,SAAAA,EAAAA,CAAAA,IAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,CAAAA,sCAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,SAAAA,OAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,CAAAA,CAAAA,GAAAA,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,EAAAA,GAAAA,KAAAA,EAAAA,kBAAAA;AAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,UAAAA,EAAAA,MAAAA,EAAAA,CAAAA,CAAAA,SAAAA,EAAAA,QAAAA,CAAAA,aAAAA,CAAAA,EAAAA,CAAAA,CAAAA,WAAAA,EAAAA,MAAAA,EAAAA,CAAAA,WAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,CAAAA,IAAAA,UAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CA2NAC,QAASA,GAAW,CAACC,CAAD,CAAM,CAGxB,GAAW,IAAX,EAAIA,CAAJ,EAAmBC,EAAA,CAASD,CAAT,CAAnB,CAAkC,MAAO,CAAA,CAMzC,IAAIE,CAAA,CAAQF,CAAR,CAAJ,EAAoBG,CAAA,CAASH,CAAT,CAApB,EAAsCI,CAAtC,EAAgDJ,CAAhD,WAA+DI,EAA/D,CAAwE,MAAO,CAAA,CAI/E,KAAIC,EAAS,QAATA,EAAqBC,OAAA,CAAON,CAAP,CAArBK,EAAoCL,CAAAK,OAIxC,OAAOR,EAAA,CAASQ,CAAT,CAAP,GAAsC,CAAtC,EAA4BA,CAA5B,EAA4CA,CAA5C,CAAqD,CAArD,GAA2DL,EAA3D,EAAsF,UAAtF,GAAkE,MAAOA,EAAAO,KAAzE,CAjBwB,CAwD1BC,QAASA,EAAO,CAACR,CAAD,CAAMS,CAAN,CAAgBC,CAAhB,CAAyB,CAAA,IACnCC,CADmC,CAC9BN,CACT,IAAIL,CAAJ,CACE,GAAIY,CAAA,CAAWZ,CAAX,CAAJ,CACE,IAAKW,CAAL,GAAYX,EAAZ,CACc,WAAZ,GAAIW,CAAJ,EAAmC,QAAnC,GAA2BA,CAA3B,EAAuD,MAAvD,GAA+CA,CAA/C,EAAiEX,CAAAa,eAAA,CAAmBF,CAAnB,CAAjE,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAHN,KAMO,IAAIE,CAAA,CAAQF,CAAR,CAAJ;AAAoBD,EAAA,CAAYC,CAAZ,CAApB,CAAsC,CAC3C,IAAIe,EAA6B,QAA7BA,GAAc,MAAOf,EACpBW,EAAA,CAAM,CAAX,KAAcN,CAAd,CAAuBL,CAAAK,OAAvB,CAAmCM,CAAnC,CAAyCN,CAAzC,CAAiDM,CAAA,EAAjD,CACE,CAAII,CAAJ,EAAmBJ,CAAnB,GAA0BX,EAA1B,GACES,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAJuC,CAAtC,IAOA,IAAIA,CAAAQ,QAAJ,EAAmBR,CAAAQ,QAAnB,GAAmCA,CAAnC,CACHR,CAAAQ,QAAA,CAAYC,CAAZ,CAAsBC,CAAtB,CAA+BV,CAA/B,CADG,KAEA,IAAIgB,EAAA,CAAchB,CAAd,CAAJ,CAEL,IAAKW,CAAL,GAAYX,EAAZ,CACES,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAHG,KAKA,IAAkC,UAAlC,GAAI,MAAOA,EAAAa,eAAX,CAEL,IAAKF,CAAL,GAAYX,EAAZ,CACMA,CAAAa,eAAA,CAAmBF,CAAnB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAJC,KASL,KAAKW,CAAL,GAAYX,EAAZ,CACMa,EAAAC,KAAA,CAAoBd,CAApB,CAAyBW,CAAzB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAKR,OAAOA,EAvCgC,CA0CzCiB,QAASA,GAAa,CAACjB,CAAD,CAAMS,CAAN,CAAgBC,CAAhB,CAAyB,CAE7C,IADA,IAAIQ,EAAOZ,MAAAY,KAAA,CAAYlB,CAAZ,CAAAmB,KAAA,EAAX,CACSC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBF,CAAAb,OAApB,CAAiCe,CAAA,EAAjC,CACEX,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIkB,CAAA,CAAKE,CAAL,CAAJ,CAAvB,CAAqCF,CAAA,CAAKE,CAAL,CAArC,CAEF,OAAOF,EALsC,CAc/CG,QAASA,GAAa,CAACC,CAAD,CAAa,CACjC,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAa,CAACW,CAAA,CAAWX,CAAX,CAAgBY,CAAhB,CAAD,CADK,CAcnCC,QAASA,GAAO,EAAG,CACjB,MAAO,EAAEC,EADQ,CAtbD;AAyclBC,QAASA,GAAU,CAACC,CAAD,CAAMC,CAAN,CAAYC,CAAZ,CAAkB,CAGnC,IAFA,IAAIC,EAAIH,CAAAI,UAAR,CAESX,EAAI,CAFb,CAEgBY,EAAKJ,CAAAvB,OAArB,CAAkCe,CAAlC,CAAsCY,CAAtC,CAA0C,EAAEZ,CAA5C,CAA+C,CAC7C,IAAIpB,EAAM4B,CAAA,CAAKR,CAAL,CACV,IAAKhC,CAAA,CAASY,CAAT,CAAL,EAAuBY,CAAA,CAAWZ,CAAX,CAAvB,CAEA,IADA,IAAIkB,EAAOZ,MAAAY,KAAA,CAAYlB,CAAZ,CAAX,CACSiC,EAAI,CADb,CACgBC,EAAKhB,CAAAb,OAArB,CAAkC4B,CAAlC,CAAsCC,CAAtC,CAA0CD,CAAA,EAA1C,CAA+C,CAC7C,IAAItB,EAAMO,CAAA,CAAKe,CAAL,CAAV,CACIE,EAAMnC,CAAA,CAAIW,CAAJ,CAENkB,EAAJ,EAAYzC,CAAA,CAAS+C,CAAT,CAAZ,CACMC,EAAA,CAAOD,CAAP,CAAJ,CACER,CAAA,CAAIhB,CAAJ,CADF,CACa,IAAI0B,IAAJ,CAASF,CAAAG,QAAA,EAAT,CADb,CAEWC,EAAA,CAASJ,CAAT,CAAJ,CACLR,CAAA,CAAIhB,CAAJ,CADK,CACM,IAAI6B,MAAJ,CAAWL,CAAX,CADN,CAEIA,CAAAM,SAAJ,CACLd,CAAA,CAAIhB,CAAJ,CADK,CACMwB,CAAAO,UAAA,CAAc,CAAA,CAAd,CADN,CAEIC,EAAA,CAAUR,CAAV,CAAJ,CACLR,CAAA,CAAIhB,CAAJ,CADK,CACMwB,CAAAS,MAAA,EADN,EAGAxD,CAAA,CAASuC,CAAA,CAAIhB,CAAJ,CAAT,CACL,GADyBgB,CAAA,CAAIhB,CAAJ,CACzB,CADoCT,CAAA,CAAQiC,CAAR,CAAA,CAAe,EAAf,CAAoB,EACxD,EAAAT,EAAA,CAAWC,CAAA,CAAIhB,CAAJ,CAAX,CAAqB,CAACwB,CAAD,CAArB,CAA4B,CAAA,CAA5B,CAJK,CAPT,CAcER,CAAA,CAAIhB,CAAJ,CAdF,CAcawB,CAlBgC,CAJF,CA2B/BL,CAtChB,CAsCWH,CArCTI,UADF,CAsCgBD,CAtChB,CAGE,OAmCSH,CAnCFI,UAoCT,OAAOJ,EA/B4B,CAoDrCkB,QAASA,EAAM,CAAClB,CAAD,CAAM,CACnB,MAAOD,GAAA,CAAWC,CAAX,CAAgBmB,EAAAhC,KAAA,CAAWiC,SAAX,CAAsB,CAAtB,CAAhB,CAA0C,CAAA,CAA1C,CADY,CAuCrBC,QAASA,GAAK,CAACrB,CAAD,CAAM,CAClB,MAAOD,GAAA,CAAWC,CAAX,CALine truncated
|
||||
"sources":["angular.js"],
|
||||
"names":["window","errorHandlingConfig","config","isObject","isDefined","objectMaxDepth","minErrConfig","isValidObjectMaxDepth","NaN","urlErrorParamsEnabled","isBoolean","maxDepth","isNumber","minErr","isArrayLike","obj","isWindow","isArray","isString","jqLite","length","Object","item","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","i","reverseParams","iteratorFn","value","nextUid","uid","baseExtend","dst","objs","deep","h","$$hashKey","ii","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","nodeName","cloneNode","isElement","clone","extend","slice","arguments","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","valueRef","hasCustomToString","toString","isUndefined","getPrototypeOf","arr","Array","isError","tag","Error","isScope","$evalAsync","$watch","isTypedArray","TYPED_ARRAY_REGEXP","test","node","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","copyRecurse","push","copyElement","stackSource","stackDest","ngMinErr","needsRecurse","copyType","undefined","constructor","buffer","byteOffset","copied","ArrayBuffer","byteLength","set","Uint8Array","re","match","lastIndex","type","simpleCompare","a","b","equals","o1","o2","t1","t2","getTime","keySet","createMap","charAt","concat","array1","array2","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","document","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","replace","ALL_COLONS","requestedTimezoneOffset","isNumberNaN","addDateMinutes","date","minutes","setMinutes","getMinutes","convertTimezoneToLocal","reverse","dateTimezoneOffset","getTimezoneOffset","timezoneOffset","startingTag","empty","elemHtml","append","html","nodeType","NODE_TYPE_TEXT","e","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","module","prefix","name","hasAttribute","candidate","querySelector","isAutoBootstrapAllowed","strictDi","console","error","modules","defaultConfig","doBootstrap","injector","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","JQLite","cleanData","jqLite.cleanData","elems","events","elem","_data","$destroy","triggerHandler","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","info","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","component","run","block","shallowCopy","serializeObject","seen","publishExternalAPI","version","$$counter","csp","uppercase","angularModule","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRef","ngRefDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattLine truncated
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "angular",
|
||||
"version": "1.7.7",
|
||||
"license": "MIT",
|
||||
"main": "./angular.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
require('./angular');
|
||||
module.exports = angular;
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"angular@1.7.7",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "angular@1.7.7",
|
||||
"_id": "angular@1.7.7",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-MH3JEGd8y/EkNCKJ8EV6Ch0j9X0rZTta/QVIDpBWaIdfh85/e5KO8+ZKgvWIb02MQuiS20pDFmMFlv4ZaLcLWg==",
|
||||
"_location": "/angular",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "angular@1.7.7",
|
||||
"name": "angular",
|
||||
"escapedName": "angular",
|
||||
"rawSpec": "1.7.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.7.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular/-/angular-1.7.7.tgz",
|
||||
"_spec": "1.7.7",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"author": {
|
||||
"name": "Angular Core Team",
|
||||
"email": "angular-core+npm@google.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/angular/angular.js/issues"
|
||||
},
|
||||
"description": "HTML enhanced for web apps",
|
||||
"homepage": "http://angularjs.org",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"framework",
|
||||
"browser",
|
||||
"client-side"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/angular/angular.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.7.7"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
Copyright (c) 2010-2018, Vladimir Agafonkin
|
||||
Copyright (c) 2010-2011, CloudMade
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
of conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,32 @@
|
||||
<img width="600" src="https://rawgit.com/Leaflet/Leaflet/master/src/images/logo.svg" alt="Leaflet" />
|
||||
|
||||
Leaflet is the leading open-source JavaScript library for **mobile-friendly interactive maps**.
|
||||
Weighing just about 37 KB of gzipped JS code, it has all the mapping [features][] most developers ever need.
|
||||
|
||||
Leaflet is designed with *simplicity*, *performance* and *usability* in mind.
|
||||
It works efficiently across all major desktop and mobile platforms out of the box,
|
||||
taking advantage of HTML5 and CSS3 on modern browsers while being accessible on older ones too.
|
||||
It can be extended with a huge amount of [plugins][],
|
||||
has a beautiful, easy to use and [well-documented][] API
|
||||
and a simple, readable [source code][] that is a joy to [contribute][] to.
|
||||
|
||||
For more info, docs and tutorials, check out the [official website][].<br>
|
||||
For **Leaflet downloads** (including the built master version), check out the [download page][].
|
||||
|
||||
We're happy to meet new contributors.
|
||||
If you want to **get involved** with Leaflet development, check out the [contribution guide][contribute].
|
||||
Let's make the best mapping library that will ever exist,
|
||||
and push the limits of what's possible with online maps!
|
||||
|
||||
[](https://travis-ci.org/Leaflet/Leaflet)
|
||||
|
||||
[contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors
|
||||
[features]: http://leafletjs.com/#features
|
||||
[plugins]: http://leafletjs.com/plugins.html
|
||||
[well-documented]: http://leafletjs.com/reference.html "Leaflet API reference"
|
||||
[source code]: https://github.com/Leaflet/Leaflet "Leaflet GitHub repository"
|
||||
[hosted on GitHub]: http://github.com/Leaflet/Leaflet
|
||||
[contribute]: https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md "A guide to contributing to Leaflet"
|
||||
[official website]: http://leafletjs.com
|
||||
[download page]: http://leafletjs.com/download.html
|
||||
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 696 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 618 B |
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"leaflet-src.esm.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/geometry/Point.js","../src/geometry/Bounds.js","../src/geo/LatLngBounds.js","../src/geo/LatLng.js","../src/geo/crs/CRS.js","../src/geo/crs/CRS.Earth.js","../src/geo/projection/Projection.SphericalMercator.js","../src/geometry/Transformation.js","../src/geo/crs/CRS.EPSG3857.js","../src/layer/vector/SVG.Util.js","../src/core/Browser.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomUtil.js","../src/dom/DomEvent.js","../src/dom/PosAnimation.js","../src/map/Map.js","../src/control/Control.js","../src/control/Control.Layers.js","../src/control/Control.Zoom.js","../src/control/Control.Scale.js","../src/control/Control.Attribution.js","../src/control/index.js","../src/core/Handler.js","../src/core/index.js","../src/dom/Draggable.js","../src/geometry/LineUtil.js","../src/geometry/PolyUtil.js","../src/geo/projection/Projection.LonLat.js","../src/geo/projection/Projection.Mercator.js","../src/geo/projection/index.js","../src/geo/crs/CRS.EPSG3395.js","../src/geo/crs/CRS.EPSG4326.js","../src/geo/crs/CRS.Simple.js","../src/geo/crs/index.js","../src/layer/Layer.js","../src/layer/LayerGroup.js","../src/layer/FeatureGroup.js","../src/layer/marker/Icon.js","../src/layer/marker/Icon.Default.js","../src/layer/marker/Marker.Drag.js","../src/layer/marker/Marker.js","../src/layer/vector/Path.js","../src/layer/vector/CircleMarker.js","../src/layer/vector/Circle.js","../src/layer/vector/Polyline.js","../src/layer/vector/Polygon.js","../src/layer/GeoJSON.js","../src/layer/ImageOverlay.js","../src/layer/VideoOverlay.js","../src/layer/DivOverlay.js","../src/layer/Popup.js","../src/layer/Tooltip.js","../src/layer/marker/DivIcon.js","../src/layer/marker/index.js","../src/layer/tile/GridLayer.js","../src/layer/tile/TileLayer.js","../src/layer/tile/TileLayer.WMS.js","../src/layer/tile/index.js","../src/layer/vector/Renderer.js","../src/layer/vector/Canvas.js","../src/layer/vector/SVG.VML.js","../src/layer/vector/SVG.js","../src/layer/vector/Renderer.getRenderer.js","../src/layer/vector/Rectangle.js","../src/layer/vector/index.js","../src/layer/index.js","../src/map/handler/Map.BoxZoom.js","../src/map/handler/Map.DoubleClickZoom.js","../src/map/handler/Map.Drag.js","../src/map/handler/Map.Keyboard.js","../src/map/handler/Map.ScrollWheelZoom.js","../src/map/handler/Map.Tap.js","../src/map/handler/Map.TouchZoom.js","../src/map/index.js","../src/Leaflet.js"],"sourcesContent":["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\nexport var freeze = Object.freeze;\r\nObject.freeze = function (obj) { return obj; };\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\t/*eslint-disable */\r\n\tobj._leaflet_id = obj._leaflet_id || ++lastId;\r\n\treturn obj._leaflet_id;\r\n\t/* eslint-enable */\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any argumentLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"leaflet-src.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/geometry/Point.js","../src/geometry/Bounds.js","../src/geo/LatLngBounds.js","../src/geo/LatLng.js","../src/geo/crs/CRS.js","../src/geo/crs/CRS.Earth.js","../src/geo/projection/Projection.SphericalMercator.js","../src/geometry/Transformation.js","../src/geo/crs/CRS.EPSG3857.js","../src/layer/vector/SVG.Util.js","../src/core/Browser.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomUtil.js","../src/dom/DomEvent.js","../src/dom/PosAnimation.js","../src/map/Map.js","../src/control/Control.js","../src/control/Control.Layers.js","../src/control/Control.Zoom.js","../src/control/Control.Scale.js","../src/control/Control.Attribution.js","../src/control/index.js","../src/core/Handler.js","../src/core/index.js","../src/dom/Draggable.js","../src/geometry/LineUtil.js","../src/geometry/PolyUtil.js","../src/geo/projection/Projection.LonLat.js","../src/geo/projection/Projection.Mercator.js","../src/geo/projection/index.js","../src/geo/crs/CRS.EPSG3395.js","../src/geo/crs/CRS.EPSG4326.js","../src/geo/crs/CRS.Simple.js","../src/geo/crs/index.js","../src/layer/Layer.js","../src/layer/LayerGroup.js","../src/layer/FeatureGroup.js","../src/layer/marker/Icon.js","../src/layer/marker/Icon.Default.js","../src/layer/marker/Marker.Drag.js","../src/layer/marker/Marker.js","../src/layer/vector/Path.js","../src/layer/vector/CircleMarker.js","../src/layer/vector/Circle.js","../src/layer/vector/Polyline.js","../src/layer/vector/Polygon.js","../src/layer/GeoJSON.js","../src/layer/ImageOverlay.js","../src/layer/VideoOverlay.js","../src/layer/DivOverlay.js","../src/layer/Popup.js","../src/layer/Tooltip.js","../src/layer/marker/DivIcon.js","../src/layer/marker/index.js","../src/layer/tile/GridLayer.js","../src/layer/tile/TileLayer.js","../src/layer/tile/TileLayer.WMS.js","../src/layer/tile/index.js","../src/layer/vector/Renderer.js","../src/layer/vector/Canvas.js","../src/layer/vector/SVG.VML.js","../src/layer/vector/SVG.js","../src/layer/vector/Renderer.getRenderer.js","../src/layer/vector/Rectangle.js","../src/layer/vector/index.js","../src/layer/index.js","../src/map/handler/Map.BoxZoom.js","../src/map/handler/Map.DoubleClickZoom.js","../src/map/handler/Map.Drag.js","../src/map/handler/Map.Keyboard.js","../src/map/handler/Map.ScrollWheelZoom.js","../src/map/handler/Map.Tap.js","../src/map/handler/Map.TouchZoom.js","../src/map/index.js","../src/Leaflet.js"],"sourcesContent":["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\nexport var freeze = Object.freeze;\r\nObject.freeze = function (obj) { return obj; };\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\t/*eslint-disable */\r\n\tobj._leaflet_id = obj._leaflet_id || ++lastId;\r\n\treturn obj._leaflet_id;\r\n\t/* eslint-enable */\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any arguments paLine truncated
|
||||
@@ -0,0 +1,635 @@
|
||||
/* 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,
|
||||
.leaflet-container .leaflet-tile {
|
||||
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;
|
||||
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);
|
||||
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;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* cursors */
|
||||
|
||||
.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
}
|
||||
.leaflet-grab {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: 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;
|
||||
cursor: 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);
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/* @preserve
|
||||
* Leaflet 1.4.0, a JS library for interactive maps. http://leafletjs.com
|
||||
* (c) 2010-2018 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<n;e++){o=arguments[e];for(i in o)t[i]=o[i]}return t}function e(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}function n(t){return t._leaflet_id=t._leaflet_id||++ei,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function s(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function r(){return!1}function a(t,i){var e=Math.pow(10,void 0===i?6:i);return Math.round(t*e)/e}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return h(t).split(/\s+/)}function l(t,i){t.hasOwnProperty("options")||(t.options=t.options?ii(t.options):{});for(var e in i)t.options[e]=i[e];return t.options}function c(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}function _(t,i){return t.replace(ni,function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n})}function d(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}function p(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var i=+new Date,e=Math.max(0,16-(i-ri));return ri=i+e,window.setTimeout(t,e)}function f(t,i,n){if(!n||ai!==m)return ai.call(window,e(t,i));t.call(i)}function g(t){t&&hi.call(window,t)}function v(){}function y(t){if("undefined"!=typeof L&&L&&L.Mixin){t=oi(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function x(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}function w(t,i,e){return t instanceof x?t:oi(t)?new x(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new x(t.x,t.y):new x(t,i,e)}function P(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function b(t,i){return!t||t instanceof P?t:new P(t,i)}function T(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function z(t,i){return t instanceof T?t:new T(t,i)}function M(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function C(t,i,e){return t instanceof M?t:oi(t)&&"object"!=typeof t[0]?3===t.length?new M(t[0],t[1],t[2]):2===t.length?new M(t[0],t[1]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new M(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new M(t,i,e)}function S(t,i,e,n){if(oi(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=i,this._c=e,this._d=n}function Z(t,i,e,n){return new S(t,i,e,n)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=i?Ji?"z":"x":""}return h||"M0 0"}function B(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}function A(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 I(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(te,n,!1):"touchmove"===i?t.removeEventListener(ie,n,!1):"touchend"===i&&(t.removeEventListener(ee,n,!1),t.removeEventListener(ne,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(!(oe.indexOf(t.target.tagName)<0))return;Pt(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(te,o,!1),re||(document.documentElement.addEventListener(te,R,!0),document.documentElement.addEventListener(ie,N,!0),document.documentElement.addEventListener(ee,D,!0),document.documentElement.addEventListener(ne,D,!0),re=!0)}function R(t){se[t.pointerId]=t,ae++}function N(t){se[t.pointerId]&&(se[t.pointerId]=t)}function D(t){delete se[t.pointerId],ae--}function j(t,i){t.touches=[];for(var e in se)t.touches.push(se[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(ie,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(ee,n,!1),t.addEventListener(ne,n,!1)}function F(t,i,e){function n(t){var i;if(Vi){if(!bi||"mouse"===t.pointerType)return;i=ae}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["dist/leaflet-src.js"],"names":["global","factory","exports","module","define","amd","L","this","extend","dest","i","j","len","src","arguments","length","bind","fn","obj","slice","Array","prototype","apply","call","args","concat","stamp","_leaflet_id","lastId","throttle","time","context","lock","wrapperFn","later","setTimeout","wrapNum","x","range","includeMax","max","min","d","falseFn","formatNum","num","digits","pow","Math","undefined","round","trim","str","replace","splitWords","split","setOptions","options","hasOwnProperty","create","getParamString","existingUrl","uppercase","params","push","encodeURIComponent","toUpperCase","indexOf","join","template","data","templateRe","key","value","Error","array","el","getPrefixed","name","window","timeoutDefer","Date","timeToCall","lastTime","requestAnimFrame","immediate","requestFn","cancelAnimFrame","id","cancelFn","Class","checkDeprecatedMixinEvents","includes","Mixin","isArray","Events","console","warn","stack","Point","y","toPoint","Bounds","a","b","points","toBounds","LatLngBounds","corner1","corner2","latlngs","toLatLngBounds","LatLng","lat","lng","alt","isNaN","toLatLng","c","lon","Transformation","_a","_b","_c","_d","toTransformation","svgCreate","document","createElementNS","pointsToPath","rings","closed","len2","p","svg","userAgentContains","navigator","userAgent","toLowerCase","addPointerListener","type","handler","_addPointerStart","_addPointerMove","_addPointerEnd","removePointerListener","removeEventListener","POINTER_DOWN","POINTER_MOVE","POINTER_UP","POINTER_CANCEL","onDown","e","pointerType","MSPOINTER_TYPE_MOUSE","TAG_WHITE_LIST","target","tagName","preventDefault","_handlePointer","addEventListener","_pointerDocListener","documentElement","_globalPointerDown","_globalPointerMove","_globalPointerUp","_pointers","pointerId","_pointersCount","touches","changedTouches","onMove","buttons","onUp","addDoubleTapListener","onTouchStart","count","pointer","edge","now","delta","last","touch$$1","doubleTap","delay","onTouchEnd","cancelBubble","prop","newTouch","_pre","_touchstart","_touchend","removeDoubleTapListener","touchstart","touchend","dblclick","get","getElementById","getStyle","style","currentStyle","defaultView","css","getComputedStyle","create$1","className","container","createElement","appendChild","remove","parent","parentNode","removeChild","empty","firstChild","toFront","lastChild","toBack","insertBefore","hasClass","classList","contains","getClass","RegExp","test","addClass","classes","add","setClass","removeClass","baseVal","correspondingElement","setOpacity","opacity","_setOpacityIE","filter","filterName","filters","item","Enabled","Opacity","testProp","props","setTransform","offset","scale","pos","TRANSFORM","ie3d","setPosition","point","_leaflet_pos","any3d","left","top","getPosition","disableImageDrag","on","enableImageDrag","off","preventOutline","element","tabIndex","restoreOutline","_outlineElement","_outlineStyle","outline","getSizedParentNode","offsetWidth","offsetHeight","body","getScale","rect","getBoundingClientRect","width","height","boundingClientRect","types","addOne","removeOne","eventsKey","event","originalHandler","touch","chrome","isExternalTarget","android","filterClick","attachEvent","detachEvent","stopPropagation","originalEvent","_stopped","skipped","disableScrollPropagation","disableClickPropagation","fakeStop","returnValue","stop","getMousePosition","clientX","clientY","clientLeft","clientTop","getWheelDelta","wheelDeltaY","deltaY","deltaMode","wheelPxFactor","deltaX","deltaZ","wheelDelta","detail","abs","skipEvents","events","related","relatedTarget","err","timeStamp","elapsed","lastClick","_simulatedClick","_simulated","simplify","tolerance","sqTolerance","_reducePoints","_simplifyDP","pointToSegmentDistance","p1","p2","sqrt","_sqClosestPointOnSegment","markers","Uint8Array","_simplifyDPStep","newPoints","first","index","sqDist","maxSqDist","reducedPoints","prev","_sqDist","clipSegment","bounds","useLastCode","codeOut","newCode","codeA","_lastCode","_getBitCode","codeB","_getEdgeIntersection","code","dx","dy","t","dot","isFlat","_flat","clipPolygon","clippedPoints","k","edges","_code","geometryToLayer","geojson","latlng","geometry","coords","coordinates","layers","pointToLayer","_coordsToLatLng","coordsToLatLng","Marker","FeatureGroup","coordsToLatLngs","Polyline","Polygon","geometries","layer","properties","levelsDeep","latLngToCoords","precision","latLngsToCoords","getFeature","newGeometry","feature","asFeature","geoJSON","GeoJSON","tileLayer","url","TileLayer","canvas$1","canvas","Canvas","svg$1","vml","SVG","freeze","Object","F","proto","toString","emptyImageUrl","requestAnimationFrame","cancelAnimationFrame","clearTimeout","Util","NewClass","initialize","callInitHooks","parentProto","__super__","constructor","statics","_initHooks","_initHooksCalled","include","mergeOptions","addInitHook","init","_on","_off","_events","typeListeners","newListener","ctx","listeners","l","_firingCount",Line truncated
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"leaflet@1.4.0",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "leaflet@1.4.0",
|
||||
"_id": "leaflet@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-x9j9tGY1+PDLN9pcWTx9/y6C5nezoTMB8BLK5jTakx+H7bPlnbCHfi9Hjg+Qt36sgDz/cb9lrSpNQXmk45Tvhw==",
|
||||
"_location": "/leaflet",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "leaflet@1.4.0",
|
||||
"name": "leaflet",
|
||||
"escapedName": "leaflet",
|
||||
"rawSpec": "1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.4.0.tgz",
|
||||
"_spec": "1.4.0",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Leaflet/Leaflet/issues"
|
||||
},
|
||||
"description": "JavaScript library for mobile-friendly interactive maps",
|
||||
"devDependencies": {
|
||||
"eslint": "^4.5.0",
|
||||
"eslint-config-mourner": "^2.0.1",
|
||||
"git-rev-sync": "^1.8.0",
|
||||
"happen": "~0.3.2",
|
||||
"karma": "^1.3.0",
|
||||
"karma-chrome-launcher": "^2.0.0",
|
||||
"karma-coverage": "~1.1.1",
|
||||
"karma-expect": "^1.1.3",
|
||||
"karma-firefox-launcher": "~1.0.0",
|
||||
"karma-mocha": "^1.2.0",
|
||||
"karma-phantomjs-launcher": "^1.0.2",
|
||||
"karma-rollup-preprocessor": "^5.0.1",
|
||||
"karma-safari-launcher": "~1.0.0",
|
||||
"karma-sinon": "^1.0.5",
|
||||
"leafdoc": "^1.4.1",
|
||||
"mocha": "^3.1.0",
|
||||
"phantomjs-prebuilt": "^2.1.12",
|
||||
"prosthetic-hand": "^1.3.1",
|
||||
"rollup": "^0.51.8",
|
||||
"rollup-plugin-git-version": "0.2.1",
|
||||
"rollup-plugin-json": "^2.1.0",
|
||||
"rollup-watch": "^4.3.1",
|
||||
"sinon": "^1.6.0",
|
||||
"source-map": "^0.5.6",
|
||||
"ssri": "^5.2.2",
|
||||
"uglify-js": "~3.0.26"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"globals": {
|
||||
"L": true
|
||||
},
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"amd": true,
|
||||
"node": false
|
||||
},
|
||||
"extends": "mourner",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"linebreak-style": [
|
||||
0,
|
||||
"unix"
|
||||
],
|
||||
"no-mixed-spaces-and-tabs": [
|
||||
2,
|
||||
"smart-tabs"
|
||||
],
|
||||
"indent": [
|
||||
2,
|
||||
"tab",
|
||||
{
|
||||
"VariableDeclarator": 0,
|
||||
"flatTernaryExpressions": true
|
||||
}
|
||||
],
|
||||
"curly": 2,
|
||||
"spaced-comment": 2,
|
||||
"strict": 0,
|
||||
"wrap-iife": 0,
|
||||
"key-spacing": 0,
|
||||
"consistent-return": 0
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"!dist/leaflet.zip"
|
||||
],
|
||||
"homepage": "https://github.com/Leaflet/Leaflet#readme",
|
||||
"keywords": [
|
||||
"gis",
|
||||
"map"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "dist/leaflet-src.js",
|
||||
"name": "leaflet",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Leaflet/Leaflet.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run rollup && npm run uglify",
|
||||
"docs": "node ./build/docs.js",
|
||||
"integrity": "node ./build/integrity.js",
|
||||
"lint": "eslint src",
|
||||
"lint-spec": "eslint spec/suites",
|
||||
"lintfix": "eslint src --fix; eslint spec/suites --fix;",
|
||||
"pretest": "npm run lint && npm run lint-spec",
|
||||
"release": "./build/publish.sh",
|
||||
"rollup": "rollup -c build/rollup-config.js",
|
||||
"test": "npm run test-nolint",
|
||||
"test-nolint": "karma start ./spec/karma.conf.js",
|
||||
"uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --in-source-map dist/leaflet-src.js.map --source-map-url leaflet.js.map --comments",
|
||||
"watch": "rollup -w -c build/rollup-watch-config.js"
|
||||
},
|
||||
"style": "dist/leaflet.css",
|
||||
"version": "1.4.0"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
import {version} from '../package.json';
|
||||
export {version};
|
||||
|
||||
// control
|
||||
export * from './control/index';
|
||||
|
||||
// core
|
||||
export * from './core/index';
|
||||
|
||||
// dom
|
||||
export * from './dom/index';
|
||||
|
||||
// geometry
|
||||
export * from './geometry/index';
|
||||
|
||||
// geo
|
||||
export * from './geo/index';
|
||||
|
||||
// layer
|
||||
export * from './layer/index';
|
||||
|
||||
// map
|
||||
export * from './map/index';
|
||||
|
||||
import {freeze} from './core/Util';
|
||||
Object.freeze = freeze;
|
||||
@@ -0,0 +1,129 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import {Map} from '../map/Map';
|
||||
import * as Util from '../core/Util';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Attribution
|
||||
* @aka L.Control.Attribution
|
||||
* @inherits Control
|
||||
*
|
||||
* The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.
|
||||
*/
|
||||
|
||||
export var Attribution = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Attribution options
|
||||
options: {
|
||||
position: 'bottomright',
|
||||
|
||||
// @option prefix: String = 'Leaflet'
|
||||
// The HTML text shown before the attributions. Pass `false` to disable.
|
||||
prefix: '<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._attributions = {};
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
map.attributionControl = this;
|
||||
this._container = DomUtil.create('div', 'leaflet-control-attribution');
|
||||
DomEvent.disableClickPropagation(this._container);
|
||||
|
||||
// TODO ugly, refactor
|
||||
for (var i in map._layers) {
|
||||
if (map._layers[i].getAttribution) {
|
||||
this.addAttribution(map._layers[i].getAttribution());
|
||||
}
|
||||
}
|
||||
|
||||
this._update();
|
||||
|
||||
return this._container;
|
||||
},
|
||||
|
||||
// @method setPrefix(prefix: String): this
|
||||
// Sets the text before the attributions.
|
||||
setPrefix: function (prefix) {
|
||||
this.options.prefix = prefix;
|
||||
this._update();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method addAttribution(text: String): this
|
||||
// Adds an attribution text (e.g. `'Vector data © Mapbox'`).
|
||||
addAttribution: function (text) {
|
||||
if (!text) { return this; }
|
||||
|
||||
if (!this._attributions[text]) {
|
||||
this._attributions[text] = 0;
|
||||
}
|
||||
this._attributions[text]++;
|
||||
|
||||
this._update();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeAttribution(text: String): this
|
||||
// Removes an attribution text.
|
||||
removeAttribution: function (text) {
|
||||
if (!text) { return this; }
|
||||
|
||||
if (this._attributions[text]) {
|
||||
this._attributions[text]--;
|
||||
this._update();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
if (!this._map) { return; }
|
||||
|
||||
var attribs = [];
|
||||
|
||||
for (var i in this._attributions) {
|
||||
if (this._attributions[i]) {
|
||||
attribs.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
var prefixAndAttribs = [];
|
||||
|
||||
if (this.options.prefix) {
|
||||
prefixAndAttribs.push(this.options.prefix);
|
||||
}
|
||||
if (attribs.length) {
|
||||
prefixAndAttribs.push(attribs.join(', '));
|
||||
}
|
||||
|
||||
this._container.innerHTML = prefixAndAttribs.join(' | ');
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Map
|
||||
// @section Control options
|
||||
// @option attributionControl: Boolean = true
|
||||
// Whether a [attribution control](#control-attribution) is added to the map by default.
|
||||
Map.mergeOptions({
|
||||
attributionControl: true
|
||||
});
|
||||
|
||||
Map.addInitHook(function () {
|
||||
if (this.options.attributionControl) {
|
||||
new Attribution().addTo(this);
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Control.Attribution
|
||||
// @factory L.control.attribution(options: Control.Attribution options)
|
||||
// Creates an attribution control.
|
||||
export var attribution = function (options) {
|
||||
return new Attribution(options);
|
||||
};
|
||||
@@ -0,0 +1,431 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Layers
|
||||
* @aka L.Control.Layers
|
||||
* @inherits Control
|
||||
*
|
||||
* The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](http://leafletjs.com/examples/layers-control/)). Extends `Control`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var baseLayers = {
|
||||
* "Mapbox": mapbox,
|
||||
* "OpenStreetMap": osm
|
||||
* };
|
||||
*
|
||||
* var overlays = {
|
||||
* "Marker": marker,
|
||||
* "Roads": roadsLayer
|
||||
* };
|
||||
*
|
||||
* L.control.layers(baseLayers, overlays).addTo(map);
|
||||
* ```
|
||||
*
|
||||
* The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
* "<someName1>": layer1,
|
||||
* "<someName2>": layer2
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The layer names can contain HTML, which allows you to add additional styling to the items:
|
||||
*
|
||||
* ```js
|
||||
* {"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Layers = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Layers options
|
||||
options: {
|
||||
// @option collapsed: Boolean = true
|
||||
// If `true`, the control will be collapsed into an icon and expanded on mouse hover or touch.
|
||||
collapsed: true,
|
||||
position: 'topright',
|
||||
|
||||
// @option autoZIndex: Boolean = true
|
||||
// If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
|
||||
autoZIndex: true,
|
||||
|
||||
// @option hideSingleBase: Boolean = false
|
||||
// If `true`, the base layers in the control will be hidden when there is only one.
|
||||
hideSingleBase: false,
|
||||
|
||||
// @option sortLayers: Boolean = false
|
||||
// Whether to sort the layers. When `false`, layers will keep the order
|
||||
// in which they were added to the control.
|
||||
sortLayers: false,
|
||||
|
||||
// @option sortFunction: Function = *
|
||||
// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
||||
// that will be used for sorting the layers, when `sortLayers` is `true`.
|
||||
// The function receives both the `L.Layer` instances and their names, as in
|
||||
// `sortFunction(layerA, layerB, nameA, nameB)`.
|
||||
// By default, it sorts layers alphabetically by their name.
|
||||
sortFunction: function (layerA, layerB, nameA, nameB) {
|
||||
return nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function (baseLayers, overlays, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._layerControlInputs = [];
|
||||
this._layers = [];
|
||||
this._lastZIndex = 0;
|
||||
this._handlingClick = false;
|
||||
|
||||
for (var i in baseLayers) {
|
||||
this._addLayer(baseLayers[i], i);
|
||||
}
|
||||
|
||||
for (i in overlays) {
|
||||
this._addLayer(overlays[i], i, true);
|
||||
}
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._initLayout();
|
||||
this._update();
|
||||
|
||||
this._map = map;
|
||||
map.on('zoomend', this._checkDisabledLayers, this);
|
||||
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
this._layers[i].layer.on('add remove', this._onLayerChange, this);
|
||||
}
|
||||
|
||||
return this._container;
|
||||
},
|
||||
|
||||
addTo: function (map) {
|
||||
Control.prototype.addTo.call(this, map);
|
||||
// Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.
|
||||
return this._expandIfNotCollapsed();
|
||||
},
|
||||
|
||||
onRemove: function () {
|
||||
this._map.off('zoomend', this._checkDisabledLayers, this);
|
||||
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
this._layers[i].layer.off('add remove', this._onLayerChange, this);
|
||||
}
|
||||
},
|
||||
|
||||
// @method addBaseLayer(layer: Layer, name: String): this
|
||||
// Adds a base layer (radio button entry) with the given name to the control.
|
||||
addBaseLayer: function (layer, name) {
|
||||
this._addLayer(layer, name);
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method addOverlay(layer: Layer, name: String): this
|
||||
// Adds an overlay (checkbox entry) with the given name to the control.
|
||||
addOverlay: function (layer, name) {
|
||||
this._addLayer(layer, name, true);
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method removeLayer(layer: Layer): this
|
||||
// Remove the given layer from the control.
|
||||
removeLayer: function (layer) {
|
||||
layer.off('add remove', this._onLayerChange, this);
|
||||
|
||||
var obj = this._getLayer(Util.stamp(layer));
|
||||
if (obj) {
|
||||
this._layers.splice(this._layers.indexOf(obj), 1);
|
||||
}
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method expand(): this
|
||||
// Expand the control container if collapsed.
|
||||
expand: function () {
|
||||
DomUtil.addClass(this._container, 'leaflet-control-layers-expanded');
|
||||
this._section.style.height = null;
|
||||
var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);
|
||||
if (acceptableHeight < this._section.clientHeight) {
|
||||
DomUtil.addClass(this._section, 'leaflet-control-layers-scrollbar');
|
||||
this._section.style.height = acceptableHeight + 'px';
|
||||
} else {
|
||||
DomUtil.removeClass(this._section, 'leaflet-control-layers-scrollbar');
|
||||
}
|
||||
this._checkDisabledLayers();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method collapse(): this
|
||||
// Collapse the control container if expanded.
|
||||
collapse: function () {
|
||||
DomUtil.removeClass(this._container, 'leaflet-control-layers-expanded');
|
||||
return this;
|
||||
},
|
||||
|
||||
_initLayout: function () {
|
||||
var className = 'leaflet-control-layers',
|
||||
container = this._container = DomUtil.create('div', className),
|
||||
collapsed = this.options.collapsed;
|
||||
|
||||
// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released
|
||||
container.setAttribute('aria-haspopup', true);
|
||||
|
||||
DomEvent.disableClickPropagation(container);
|
||||
DomEvent.disableScrollPropagation(container);
|
||||
|
||||
var section = this._section = DomUtil.create('section', className + '-list');
|
||||
|
||||
if (collapsed) {
|
||||
this._map.on('click', this.collapse, this);
|
||||
|
||||
if (!Browser.android) {
|
||||
DomEvent.on(container, {
|
||||
mouseenter: this.expand,
|
||||
mouseleave: this.collapse
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
var link = this._layersLink = DomUtil.create('a', className + '-toggle', container);
|
||||
link.href = '#';
|
||||
link.title = 'Layers';
|
||||
|
||||
if (Browser.touch) {
|
||||
DomEvent.on(link, 'click', DomEvent.stop);
|
||||
DomEvent.on(link, 'click', this.expand, this);
|
||||
} else {
|
||||
DomEvent.on(link, 'focus', this.expand, this);
|
||||
}
|
||||
|
||||
if (!collapsed) {
|
||||
this.expand();
|
||||
}
|
||||
|
||||
this._baseLayersList = DomUtil.create('div', className + '-base', section);
|
||||
this._separator = DomUtil.create('div', className + '-separator', section);
|
||||
this._overlaysList = DomUtil.create('div', className + '-overlays', section);
|
||||
|
||||
container.appendChild(section);
|
||||
},
|
||||
|
||||
_getLayer: function (id) {
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
|
||||
if (this._layers[i] && Util.stamp(this._layers[i].layer) === id) {
|
||||
return this._layers[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_addLayer: function (layer, name, overlay) {
|
||||
if (this._map) {
|
||||
layer.on('add remove', this._onLayerChange, this);
|
||||
}
|
||||
|
||||
this._layers.push({
|
||||
layer: layer,
|
||||
name: name,
|
||||
overlay: overlay
|
||||
});
|
||||
|
||||
if (this.options.sortLayers) {
|
||||
this._layers.sort(Util.bind(function (a, b) {
|
||||
return this.options.sortFunction(a.layer, b.layer, a.name, b.name);
|
||||
}, this));
|
||||
}
|
||||
|
||||
if (this.options.autoZIndex && layer.setZIndex) {
|
||||
this._lastZIndex++;
|
||||
layer.setZIndex(this._lastZIndex);
|
||||
}
|
||||
|
||||
this._expandIfNotCollapsed();
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
if (!this._container) { return this; }
|
||||
|
||||
DomUtil.empty(this._baseLayersList);
|
||||
DomUtil.empty(this._overlaysList);
|
||||
|
||||
this._layerControlInputs = [];
|
||||
var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;
|
||||
|
||||
for (i = 0; i < this._layers.length; i++) {
|
||||
obj = this._layers[i];
|
||||
this._addItem(obj);
|
||||
overlaysPresent = overlaysPresent || obj.overlay;
|
||||
baseLayersPresent = baseLayersPresent || !obj.overlay;
|
||||
baseLayersCount += !obj.overlay ? 1 : 0;
|
||||
}
|
||||
|
||||
// Hide base layers section if there's only one layer.
|
||||
if (this.options.hideSingleBase) {
|
||||
baseLayersPresent = baseLayersPresent && baseLayersCount > 1;
|
||||
this._baseLayersList.style.display = baseLayersPresent ? '' : 'none';
|
||||
}
|
||||
|
||||
this._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_onLayerChange: function (e) {
|
||||
if (!this._handlingClick) {
|
||||
this._update();
|
||||
}
|
||||
|
||||
var obj = this._getLayer(Util.stamp(e.target));
|
||||
|
||||
// @namespace Map
|
||||
// @section Layer events
|
||||
// @event baselayerchange: LayersControlEvent
|
||||
// Fired when the base layer is changed through the [layer control](#control-layers).
|
||||
// @event overlayadd: LayersControlEvent
|
||||
// Fired when an overlay is selected through the [layer control](#control-layers).
|
||||
// @event overlayremove: LayersControlEvent
|
||||
// Fired when an overlay is deselected through the [layer control](#control-layers).
|
||||
// @namespace Control.Layers
|
||||
var type = obj.overlay ?
|
||||
(e.type === 'add' ? 'overlayadd' : 'overlayremove') :
|
||||
(e.type === 'add' ? 'baselayerchange' : null);
|
||||
|
||||
if (type) {
|
||||
this._map.fire(type, obj);
|
||||
}
|
||||
},
|
||||
|
||||
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
|
||||
_createRadioElement: function (name, checked) {
|
||||
|
||||
var radioHtml = '<input type="radio" class="leaflet-control-layers-selector" name="' +
|
||||
name + '"' + (checked ? ' checked="checked"' : '') + '/>';
|
||||
|
||||
var radioFragment = document.createElement('div');
|
||||
radioFragment.innerHTML = radioHtml;
|
||||
|
||||
return radioFragment.firstChild;
|
||||
},
|
||||
|
||||
_addItem: function (obj) {
|
||||
var label = document.createElement('label'),
|
||||
checked = this._map.hasLayer(obj.layer),
|
||||
input;
|
||||
|
||||
if (obj.overlay) {
|
||||
input = document.createElement('input');
|
||||
input.type = 'checkbox';
|
||||
input.className = 'leaflet-control-layers-selector';
|
||||
input.defaultChecked = checked;
|
||||
} else {
|
||||
input = this._createRadioElement('leaflet-base-layers', checked);
|
||||
}
|
||||
|
||||
this._layerControlInputs.push(input);
|
||||
input.layerId = Util.stamp(obj.layer);
|
||||
|
||||
DomEvent.on(input, 'click', this._onInputClick, this);
|
||||
|
||||
var name = document.createElement('span');
|
||||
name.innerHTML = ' ' + obj.name;
|
||||
|
||||
// Helps from preventing layer control flicker when checkboxes are disabled
|
||||
// https://github.com/Leaflet/Leaflet/issues/2771
|
||||
var holder = document.createElement('div');
|
||||
|
||||
label.appendChild(holder);
|
||||
holder.appendChild(input);
|
||||
holder.appendChild(name);
|
||||
|
||||
var container = obj.overlay ? this._overlaysList : this._baseLayersList;
|
||||
container.appendChild(label);
|
||||
|
||||
this._checkDisabledLayers();
|
||||
return label;
|
||||
},
|
||||
|
||||
_onInputClick: function () {
|
||||
var inputs = this._layerControlInputs,
|
||||
input, layer;
|
||||
var addedLayers = [],
|
||||
removedLayers = [];
|
||||
|
||||
this._handlingClick = true;
|
||||
|
||||
for (var i = inputs.length - 1; i >= 0; i--) {
|
||||
input = inputs[i];
|
||||
layer = this._getLayer(input.layerId).layer;
|
||||
|
||||
if (input.checked) {
|
||||
addedLayers.push(layer);
|
||||
} else if (!input.checked) {
|
||||
removedLayers.push(layer);
|
||||
}
|
||||
}
|
||||
|
||||
// Bugfix issue 2318: Should remove all old layers before readding new ones
|
||||
for (i = 0; i < removedLayers.length; i++) {
|
||||
if (this._map.hasLayer(removedLayers[i])) {
|
||||
this._map.removeLayer(removedLayers[i]);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < addedLayers.length; i++) {
|
||||
if (!this._map.hasLayer(addedLayers[i])) {
|
||||
this._map.addLayer(addedLayers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this._handlingClick = false;
|
||||
|
||||
this._refocusOnMap();
|
||||
},
|
||||
|
||||
_checkDisabledLayers: function () {
|
||||
var inputs = this._layerControlInputs,
|
||||
input,
|
||||
layer,
|
||||
zoom = this._map.getZoom();
|
||||
|
||||
for (var i = inputs.length - 1; i >= 0; i--) {
|
||||
input = inputs[i];
|
||||
layer = this._getLayer(input.layerId).layer;
|
||||
input.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||
|
||||
(layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
_expandIfNotCollapsed: function () {
|
||||
if (this._map && !this.options.collapsed) {
|
||||
this.expand();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_expand: function () {
|
||||
// Backward compatibility, remove me in 1.1.
|
||||
return this.expand();
|
||||
},
|
||||
|
||||
_collapse: function () {
|
||||
// Backward compatibility, remove me in 1.1.
|
||||
return this.collapse();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)
|
||||
// Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
|
||||
export var layers = function (baseLayers, overlays, options) {
|
||||
return new Layers(baseLayers, overlays, options);
|
||||
};
|
||||
@@ -0,0 +1,132 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Scale
|
||||
* @aka L.Control.Scale
|
||||
* @inherits Control
|
||||
*
|
||||
* A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.control.scale().addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Scale = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Scale options
|
||||
options: {
|
||||
position: 'bottomleft',
|
||||
|
||||
// @option maxWidth: Number = 100
|
||||
// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
|
||||
maxWidth: 100,
|
||||
|
||||
// @option metric: Boolean = True
|
||||
// Whether to show the metric scale line (m/km).
|
||||
metric: true,
|
||||
|
||||
// @option imperial: Boolean = True
|
||||
// Whether to show the imperial scale line (mi/ft).
|
||||
imperial: true
|
||||
|
||||
// @option updateWhenIdle: Boolean = false
|
||||
// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
var className = 'leaflet-control-scale',
|
||||
container = DomUtil.create('div', className),
|
||||
options = this.options;
|
||||
|
||||
this._addScales(options, className + '-line', container);
|
||||
|
||||
map.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
|
||||
map.whenReady(this._update, this);
|
||||
|
||||
return container;
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
map.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
|
||||
},
|
||||
|
||||
_addScales: function (options, className, container) {
|
||||
if (options.metric) {
|
||||
this._mScale = DomUtil.create('div', className, container);
|
||||
}
|
||||
if (options.imperial) {
|
||||
this._iScale = DomUtil.create('div', className, container);
|
||||
}
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
var map = this._map,
|
||||
y = map.getSize().y / 2;
|
||||
|
||||
var maxMeters = map.distance(
|
||||
map.containerPointToLatLng([0, y]),
|
||||
map.containerPointToLatLng([this.options.maxWidth, y]));
|
||||
|
||||
this._updateScales(maxMeters);
|
||||
},
|
||||
|
||||
_updateScales: function (maxMeters) {
|
||||
if (this.options.metric && maxMeters) {
|
||||
this._updateMetric(maxMeters);
|
||||
}
|
||||
if (this.options.imperial && maxMeters) {
|
||||
this._updateImperial(maxMeters);
|
||||
}
|
||||
},
|
||||
|
||||
_updateMetric: function (maxMeters) {
|
||||
var meters = this._getRoundNum(maxMeters),
|
||||
label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';
|
||||
|
||||
this._updateScale(this._mScale, label, meters / maxMeters);
|
||||
},
|
||||
|
||||
_updateImperial: function (maxMeters) {
|
||||
var maxFeet = maxMeters * 3.2808399,
|
||||
maxMiles, miles, feet;
|
||||
|
||||
if (maxFeet > 5280) {
|
||||
maxMiles = maxFeet / 5280;
|
||||
miles = this._getRoundNum(maxMiles);
|
||||
this._updateScale(this._iScale, miles + ' mi', miles / maxMiles);
|
||||
|
||||
} else {
|
||||
feet = this._getRoundNum(maxFeet);
|
||||
this._updateScale(this._iScale, feet + ' ft', feet / maxFeet);
|
||||
}
|
||||
},
|
||||
|
||||
_updateScale: function (scale, text, ratio) {
|
||||
scale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';
|
||||
scale.innerHTML = text;
|
||||
},
|
||||
|
||||
_getRoundNum: function (num) {
|
||||
var pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),
|
||||
d = num / pow10;
|
||||
|
||||
d = d >= 10 ? 10 :
|
||||
d >= 5 ? 5 :
|
||||
d >= 3 ? 3 :
|
||||
d >= 2 ? 2 : 1;
|
||||
|
||||
return pow10 * d;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// @factory L.control.scale(options?: Control.Scale options)
|
||||
// Creates an scale control with the given options.
|
||||
export var scale = function (options) {
|
||||
return new Scale(options);
|
||||
};
|
||||
@@ -0,0 +1,142 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import {Map} from '../map/Map';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
|
||||
/*
|
||||
* @class Control.Zoom
|
||||
* @aka L.Control.Zoom
|
||||
* @inherits Control
|
||||
*
|
||||
* A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`.
|
||||
*/
|
||||
|
||||
export var Zoom = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Zoom options
|
||||
options: {
|
||||
position: 'topleft',
|
||||
|
||||
// @option zoomInText: String = '+'
|
||||
// The text set on the 'zoom in' button.
|
||||
zoomInText: '+',
|
||||
|
||||
// @option zoomInTitle: String = 'Zoom in'
|
||||
// The title set on the 'zoom in' button.
|
||||
zoomInTitle: 'Zoom in',
|
||||
|
||||
// @option zoomOutText: String = '−'
|
||||
// The text set on the 'zoom out' button.
|
||||
zoomOutText: '−',
|
||||
|
||||
// @option zoomOutTitle: String = 'Zoom out'
|
||||
// The title set on the 'zoom out' button.
|
||||
zoomOutTitle: 'Zoom out'
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
var zoomName = 'leaflet-control-zoom',
|
||||
container = DomUtil.create('div', zoomName + ' leaflet-bar'),
|
||||
options = this.options;
|
||||
|
||||
this._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle,
|
||||
zoomName + '-in', container, this._zoomIn);
|
||||
this._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,
|
||||
zoomName + '-out', container, this._zoomOut);
|
||||
|
||||
this._updateDisabled();
|
||||
map.on('zoomend zoomlevelschange', this._updateDisabled, this);
|
||||
|
||||
return container;
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
map.off('zoomend zoomlevelschange', this._updateDisabled, this);
|
||||
},
|
||||
|
||||
disable: function () {
|
||||
this._disabled = true;
|
||||
this._updateDisabled();
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function () {
|
||||
this._disabled = false;
|
||||
this._updateDisabled();
|
||||
return this;
|
||||
},
|
||||
|
||||
_zoomIn: function (e) {
|
||||
if (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {
|
||||
this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));
|
||||
}
|
||||
},
|
||||
|
||||
_zoomOut: function (e) {
|
||||
if (!this._disabled && this._map._zoom > this._map.getMinZoom()) {
|
||||
this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));
|
||||
}
|
||||
},
|
||||
|
||||
_createButton: function (html, title, className, container, fn) {
|
||||
var link = DomUtil.create('a', className, container);
|
||||
link.innerHTML = html;
|
||||
link.href = '#';
|
||||
link.title = title;
|
||||
|
||||
/*
|
||||
* Will force screen readers like VoiceOver to read this as "Zoom in - button"
|
||||
*/
|
||||
link.setAttribute('role', 'button');
|
||||
link.setAttribute('aria-label', title);
|
||||
|
||||
DomEvent.disableClickPropagation(link);
|
||||
DomEvent.on(link, 'click', DomEvent.stop);
|
||||
DomEvent.on(link, 'click', fn, this);
|
||||
DomEvent.on(link, 'click', this._refocusOnMap, this);
|
||||
|
||||
return link;
|
||||
},
|
||||
|
||||
_updateDisabled: function () {
|
||||
var map = this._map,
|
||||
className = 'leaflet-disabled';
|
||||
|
||||
DomUtil.removeClass(this._zoomInButton, className);
|
||||
DomUtil.removeClass(this._zoomOutButton, className);
|
||||
|
||||
if (this._disabled || map._zoom === map.getMinZoom()) {
|
||||
DomUtil.addClass(this._zoomOutButton, className);
|
||||
}
|
||||
if (this._disabled || map._zoom === map.getMaxZoom()) {
|
||||
DomUtil.addClass(this._zoomInButton, className);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Map
|
||||
// @section Control options
|
||||
// @option zoomControl: Boolean = true
|
||||
// Whether a [zoom control](#control-zoom) is added to the map by default.
|
||||
Map.mergeOptions({
|
||||
zoomControl: true
|
||||
});
|
||||
|
||||
Map.addInitHook(function () {
|
||||
if (this.options.zoomControl) {
|
||||
// @section Controls
|
||||
// @property zoomControl: Control.Zoom
|
||||
// The default zoom control (only available if the
|
||||
// [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).
|
||||
this.zoomControl = new Zoom();
|
||||
this.addControl(this.zoomControl);
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Control.Zoom
|
||||
// @factory L.control.zoom(options: Control.Zoom options)
|
||||
// Creates a zoom control
|
||||
export var zoom = function (options) {
|
||||
return new Zoom(options);
|
||||
};
|
||||
@@ -0,0 +1,171 @@
|
||||
|
||||
import {Class} from '../core/Class';
|
||||
import {Map} from '../map/Map';
|
||||
import * as Util from '../core/Util';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control
|
||||
* @aka L.Control
|
||||
* @inherits Class
|
||||
*
|
||||
* L.Control is a base class for implementing map controls. Handles positioning.
|
||||
* All other controls extend from this class.
|
||||
*/
|
||||
|
||||
export var Control = Class.extend({
|
||||
// @section
|
||||
// @aka Control options
|
||||
options: {
|
||||
// @option position: String = 'topright'
|
||||
// The position of the control (one of the map corners). Possible values are `'topleft'`,
|
||||
// `'topright'`, `'bottomleft'` or `'bottomright'`
|
||||
position: 'topright'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
Util.setOptions(this, options);
|
||||
},
|
||||
|
||||
/* @section
|
||||
* Classes extending L.Control will inherit the following methods:
|
||||
*
|
||||
* @method getPosition: string
|
||||
* Returns the position of the control.
|
||||
*/
|
||||
getPosition: function () {
|
||||
return this.options.position;
|
||||
},
|
||||
|
||||
// @method setPosition(position: string): this
|
||||
// Sets the position of the control.
|
||||
setPosition: function (position) {
|
||||
var map = this._map;
|
||||
|
||||
if (map) {
|
||||
map.removeControl(this);
|
||||
}
|
||||
|
||||
this.options.position = position;
|
||||
|
||||
if (map) {
|
||||
map.addControl(this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getContainer: HTMLElement
|
||||
// Returns the HTMLElement that contains the control.
|
||||
getContainer: function () {
|
||||
return this._container;
|
||||
},
|
||||
|
||||
// @method addTo(map: Map): this
|
||||
// Adds the control to the given map.
|
||||
addTo: function (map) {
|
||||
this.remove();
|
||||
this._map = map;
|
||||
|
||||
var container = this._container = this.onAdd(map),
|
||||
pos = this.getPosition(),
|
||||
corner = map._controlCorners[pos];
|
||||
|
||||
DomUtil.addClass(container, 'leaflet-control');
|
||||
|
||||
if (pos.indexOf('bottom') !== -1) {
|
||||
corner.insertBefore(container, corner.firstChild);
|
||||
} else {
|
||||
corner.appendChild(container);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method remove: this
|
||||
// Removes the control from the map it is currently active on.
|
||||
remove: function () {
|
||||
if (!this._map) {
|
||||
return this;
|
||||
}
|
||||
|
||||
DomUtil.remove(this._container);
|
||||
|
||||
if (this.onRemove) {
|
||||
this.onRemove(this._map);
|
||||
}
|
||||
|
||||
this._map = null;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_refocusOnMap: function (e) {
|
||||
// if map exists and event is not a keyboard event
|
||||
if (this._map && e && e.screenX > 0 && e.screenY > 0) {
|
||||
this._map.getContainer().focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export var control = function (options) {
|
||||
return new Control(options);
|
||||
};
|
||||
|
||||
/* @section Extension methods
|
||||
* @uninheritable
|
||||
*
|
||||
* Every control should extend from `L.Control` and (re-)implement the following methods.
|
||||
*
|
||||
* @method onAdd(map: Map): HTMLElement
|
||||
* Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).
|
||||
*
|
||||
* @method onRemove(map: Map)
|
||||
* Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).
|
||||
*/
|
||||
|
||||
/* @namespace Map
|
||||
* @section Methods for Layers and Controls
|
||||
*/
|
||||
Map.include({
|
||||
// @method addControl(control: Control): this
|
||||
// Adds the given control to the map
|
||||
addControl: function (control) {
|
||||
control.addTo(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeControl(control: Control): this
|
||||
// Removes the given control from the map
|
||||
removeControl: function (control) {
|
||||
control.remove();
|
||||
return this;
|
||||
},
|
||||
|
||||
_initControlPos: function () {
|
||||
var corners = this._controlCorners = {},
|
||||
l = 'leaflet-',
|
||||
container = this._controlContainer =
|
||||
DomUtil.create('div', l + 'control-container', this._container);
|
||||
|
||||
function createCorner(vSide, hSide) {
|
||||
var className = l + vSide + ' ' + l + hSide;
|
||||
|
||||
corners[vSide + hSide] = DomUtil.create('div', className, container);
|
||||
}
|
||||
|
||||
createCorner('top', 'left');
|
||||
createCorner('top', 'right');
|
||||
createCorner('bottom', 'left');
|
||||
createCorner('bottom', 'right');
|
||||
},
|
||||
|
||||
_clearControlPos: function () {
|
||||
for (var i in this._controlCorners) {
|
||||
DomUtil.remove(this._controlCorners[i]);
|
||||
}
|
||||
DomUtil.remove(this._controlContainer);
|
||||
delete this._controlCorners;
|
||||
delete this._controlContainer;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import {Control, control} from './Control';
|
||||
import {Layers, layers} from './Control.Layers';
|
||||
import {Zoom, zoom} from './Control.Zoom';
|
||||
import {Scale, scale} from './Control.Scale';
|
||||
import {Attribution, attribution} from './Control.Attribution';
|
||||
|
||||
Control.Layers = Layers;
|
||||
Control.Zoom = Zoom;
|
||||
Control.Scale = Scale;
|
||||
Control.Attribution = Attribution;
|
||||
|
||||
control.layers = layers;
|
||||
control.zoom = zoom;
|
||||
control.scale = scale;
|
||||
control.attribution = attribution;
|
||||
|
||||
export {Control, control};
|
||||
@@ -0,0 +1,147 @@
|
||||
import {svgCreate} from '../layer/vector/SVG.Util';
|
||||
|
||||
/*
|
||||
* @namespace Browser
|
||||
* @aka L.Browser
|
||||
*
|
||||
* A namespace with static properties for browser/feature detection used by Leaflet internally.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* if (L.Browser.ielt9) {
|
||||
* alert('Upgrade your browser, dude!');
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
var style = document.documentElement.style;
|
||||
|
||||
// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).
|
||||
export var ie = 'ActiveXObject' in window;
|
||||
|
||||
// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.
|
||||
export var ielt9 = ie && !document.addEventListener;
|
||||
|
||||
// @property edge: Boolean; `true` for the Edge web browser.
|
||||
export var edge = 'msLaunchUri' in navigator && !('documentMode' in document);
|
||||
|
||||
// @property webkit: Boolean;
|
||||
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
|
||||
export var webkit = userAgentContains('webkit');
|
||||
|
||||
// @property android: Boolean
|
||||
// `true` for any browser running on an Android platform.
|
||||
export var android = userAgentContains('android');
|
||||
|
||||
// @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.
|
||||
export var android23 = userAgentContains('android 2') || userAgentContains('android 3');
|
||||
|
||||
/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */
|
||||
var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit
|
||||
// @property androidStock: Boolean; `true` for the Android stock browser (i.e. not Chrome)
|
||||
export var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);
|
||||
|
||||
// @property opera: Boolean; `true` for the Opera browser
|
||||
export var opera = !!window.opera;
|
||||
|
||||
// @property chrome: Boolean; `true` for the Chrome browser.
|
||||
export var chrome = userAgentContains('chrome');
|
||||
|
||||
// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.
|
||||
export var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;
|
||||
|
||||
// @property safari: Boolean; `true` for the Safari browser.
|
||||
export var safari = !chrome && userAgentContains('safari');
|
||||
|
||||
export var phantom = userAgentContains('phantom');
|
||||
|
||||
// @property opera12: Boolean
|
||||
// `true` for the Opera browser supporting CSS transforms (version 12 or later).
|
||||
export var opera12 = 'OTransition' in style;
|
||||
|
||||
// @property win: Boolean; `true` when the browser is running in a Windows platform
|
||||
export var win = navigator.platform.indexOf('Win') === 0;
|
||||
|
||||
// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.
|
||||
export var ie3d = ie && ('transition' in style);
|
||||
|
||||
// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.
|
||||
export var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;
|
||||
|
||||
// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.
|
||||
export var gecko3d = 'MozPerspective' in style;
|
||||
|
||||
// @property any3d: Boolean
|
||||
// `true` for all browsers supporting CSS transforms.
|
||||
export var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;
|
||||
|
||||
// @property mobile: Boolean; `true` for all browsers running in a mobile device.
|
||||
export var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
|
||||
|
||||
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
|
||||
export var mobileWebkit = mobile && webkit;
|
||||
|
||||
// @property mobileWebkit3d: Boolean
|
||||
// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.
|
||||
export var mobileWebkit3d = mobile && webkit3d;
|
||||
|
||||
// @property msPointer: Boolean
|
||||
// `true` for browsers implementing the Microsoft touch events model (notably IE10).
|
||||
export var msPointer = !window.PointerEvent && window.MSPointerEvent;
|
||||
|
||||
// @property pointer: Boolean
|
||||
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
||||
export var pointer = !!(window.PointerEvent || msPointer);
|
||||
|
||||
// @property touch: Boolean
|
||||
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
||||
// This does not necessarily mean that the browser is running in a computer with
|
||||
// a touchscreen, it only means that the browser is capable of understanding
|
||||
// touch events.
|
||||
export var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||
|
||||
(window.DocumentTouch && document instanceof window.DocumentTouch));
|
||||
|
||||
// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.
|
||||
export var mobileOpera = mobile && opera;
|
||||
|
||||
// @property mobileGecko: Boolean
|
||||
// `true` for gecko-based browsers running in a mobile device.
|
||||
export var mobileGecko = mobile && gecko;
|
||||
|
||||
// @property retina: Boolean
|
||||
// `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
|
||||
export var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
|
||||
|
||||
|
||||
// @property canvas: Boolean
|
||||
// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
|
||||
export var canvas = (function () {
|
||||
return !!document.createElement('canvas').getContext;
|
||||
}());
|
||||
|
||||
// @property svg: Boolean
|
||||
// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).
|
||||
export var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);
|
||||
|
||||
// @property vml: Boolean
|
||||
// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).
|
||||
export var vml = !svg && (function () {
|
||||
try {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<v:shape adj="1"/>';
|
||||
|
||||
var shape = div.firstChild;
|
||||
shape.style.behavior = 'url(#default#VML)';
|
||||
|
||||
return shape && (typeof shape.adj === 'object');
|
||||
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}());
|
||||
|
||||
|
||||
function userAgentContains(str) {
|
||||
return navigator.userAgent.toLowerCase().indexOf(str) >= 0;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import * as Util from './Util';
|
||||
|
||||
// @class Class
|
||||
// @aka L.Class
|
||||
|
||||
// @section
|
||||
// @uninheritable
|
||||
|
||||
// Thanks to John Resig and Dean Edwards for inspiration!
|
||||
|
||||
export function Class() {}
|
||||
|
||||
Class.extend = function (props) {
|
||||
|
||||
// @function extend(props: Object): Function
|
||||
// [Extends the current class](#class-inheritance) given the properties to be included.
|
||||
// Returns a Javascript function that is a class constructor (to be called with `new`).
|
||||
var NewClass = function () {
|
||||
|
||||
// call the constructor
|
||||
if (this.initialize) {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
// call all constructor hooks
|
||||
this.callInitHooks();
|
||||
};
|
||||
|
||||
var parentProto = NewClass.__super__ = this.prototype;
|
||||
|
||||
var proto = Util.create(parentProto);
|
||||
proto.constructor = NewClass;
|
||||
|
||||
NewClass.prototype = proto;
|
||||
|
||||
// inherit parent's statics
|
||||
for (var i in this) {
|
||||
if (this.hasOwnProperty(i) && i !== 'prototype' && i !== '__super__') {
|
||||
NewClass[i] = this[i];
|
||||
}
|
||||
}
|
||||
|
||||
// mix static properties into the class
|
||||
if (props.statics) {
|
||||
Util.extend(NewClass, props.statics);
|
||||
delete props.statics;
|
||||
}
|
||||
|
||||
// mix includes into the prototype
|
||||
if (props.includes) {
|
||||
checkDeprecatedMixinEvents(props.includes);
|
||||
Util.extend.apply(null, [proto].concat(props.includes));
|
||||
delete props.includes;
|
||||
}
|
||||
|
||||
// merge options
|
||||
if (proto.options) {
|
||||
props.options = Util.extend(Util.create(proto.options), props.options);
|
||||
}
|
||||
|
||||
// mix given properties into the prototype
|
||||
Util.extend(proto, props);
|
||||
|
||||
proto._initHooks = [];
|
||||
|
||||
// add method for calling all hooks
|
||||
proto.callInitHooks = function () {
|
||||
|
||||
if (this._initHooksCalled) { return; }
|
||||
|
||||
if (parentProto.callInitHooks) {
|
||||
parentProto.callInitHooks.call(this);
|
||||
}
|
||||
|
||||
this._initHooksCalled = true;
|
||||
|
||||
for (var i = 0, len = proto._initHooks.length; i < len; i++) {
|
||||
proto._initHooks[i].call(this);
|
||||
}
|
||||
};
|
||||
|
||||
return NewClass;
|
||||
};
|
||||
|
||||
|
||||
// @function include(properties: Object): this
|
||||
// [Includes a mixin](#class-includes) into the current class.
|
||||
Class.include = function (props) {
|
||||
Util.extend(this.prototype, props);
|
||||
return this;
|
||||
};
|
||||
|
||||
// @function mergeOptions(options: Object): this
|
||||
// [Merges `options`](#class-options) into the defaults of the class.
|
||||
Class.mergeOptions = function (options) {
|
||||
Util.extend(this.prototype.options, options);
|
||||
return this;
|
||||
};
|
||||
|
||||
// @function addInitHook(fn: Function): this
|
||||
// Adds a [constructor hook](#class-constructor-hooks) to the class.
|
||||
Class.addInitHook = function (fn) { // (Function) || (String, args...)
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
var init = typeof fn === 'function' ? fn : function () {
|
||||
this[fn].apply(this, args);
|
||||
};
|
||||
|
||||
this.prototype._initHooks = this.prototype._initHooks || [];
|
||||
this.prototype._initHooks.push(init);
|
||||
return this;
|
||||
};
|
||||
|
||||
function checkDeprecatedMixinEvents(includes) {
|
||||
if (typeof L === 'undefined' || !L || !L.Mixin) { return; }
|
||||
|
||||
includes = Util.isArray(includes) ? includes : [includes];
|
||||
|
||||
for (var i = 0; i < includes.length; i++) {
|
||||
if (includes[i] === L.Mixin.Events) {
|
||||
console.warn('Deprecated include of L.Mixin.Events: ' +
|
||||
'this property will be removed in future releases, ' +
|
||||
'please inherit from L.Evented instead.', new Error().stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
|
||||
@class Class
|
||||
@aka L.Class
|
||||
|
||||
L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
|
||||
|
||||
In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
|
||||
|
||||
|
||||
@example
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
initialize: function (greeter) {
|
||||
this.greeter = greeter;
|
||||
// class constructor
|
||||
},
|
||||
|
||||
greet: function (name) {
|
||||
alert(this.greeter + ', ' + name)
|
||||
}
|
||||
});
|
||||
|
||||
// create instance of MyClass, passing "Hello" to the constructor
|
||||
var a = new MyClass("Hello");
|
||||
|
||||
// call greet method, alerting "Hello, World"
|
||||
a.greet("World");
|
||||
```
|
||||
|
||||
@section Class Factories
|
||||
@example
|
||||
|
||||
You may have noticed that Leaflet objects are created without using
|
||||
the `new` keyword. This is achieved by complementing each class with a
|
||||
lowercase factory method:
|
||||
|
||||
```js
|
||||
new L.Map('map'); // becomes:
|
||||
L.map('map');
|
||||
```
|
||||
|
||||
The factories are implemented very easily, and you can do this for your own classes:
|
||||
|
||||
```js
|
||||
L.map = function (id, options) {
|
||||
return new L.Map(id, options);
|
||||
};
|
||||
```
|
||||
@section Inheritance
|
||||
@example
|
||||
|
||||
You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
|
||||
|
||||
```js
|
||||
var MyChildClass = MyClass.extend({
|
||||
// ... new properties and methods
|
||||
});
|
||||
```
|
||||
|
||||
This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
|
||||
|
||||
```js
|
||||
var a = new MyChildClass();
|
||||
a instanceof MyChildClass; // true
|
||||
a instanceof MyClass; // true
|
||||
```
|
||||
|
||||
You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
|
||||
|
||||
```
|
||||
var MyChildClass = MyClass.extend({
|
||||
initialize: function () {
|
||||
MyClass.prototype.initialize.call(this, "Yo");
|
||||
},
|
||||
|
||||
greet: function (name) {
|
||||
MyClass.prototype.greet.call(this, 'bro ' + name + '!');
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyChildClass();
|
||||
a.greet('Jason'); // alerts "Yo, bro Jason!"
|
||||
```
|
||||
|
||||
@section Options
|
||||
@example
|
||||
|
||||
`options` is a special property that unlike other objects that you pass
|
||||
to `extend` will be merged with the parent one instead of overriding it
|
||||
completely, which makes managing configuration of objects and default
|
||||
values convenient:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
options: {
|
||||
myOption1: 'foo',
|
||||
myOption2: 'bar'
|
||||
}
|
||||
});
|
||||
|
||||
var MyChildClass = MyClass.extend({
|
||||
options: {
|
||||
myOption1: 'baz',
|
||||
myOption3: 5
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyChildClass();
|
||||
a.options.myOption1; // 'baz'
|
||||
a.options.myOption2; // 'bar'
|
||||
a.options.myOption3; // 5
|
||||
```
|
||||
|
||||
There's also [`L.Util.setOptions`](#util-setoptions), a method for
|
||||
conveniently merging options passed to constructor with the defaults
|
||||
defines in the class:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
options: {
|
||||
foo: 'bar',
|
||||
bla: 5
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
L.Util.setOptions(this, options);
|
||||
...
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyClass({bla: 10});
|
||||
a.options; // {foo: 'bar', bla: 10}
|
||||
```
|
||||
|
||||
Note that the options object allows any keys, not just
|
||||
the options defined by the class and its base classes.
|
||||
This means you can use the options object to store
|
||||
application specific information, as long as you avoid
|
||||
keys that are already used by the class in question.
|
||||
|
||||
@section Includes
|
||||
@example
|
||||
|
||||
`includes` is a special class property that merges all specified objects into the class (such objects are called mixins).
|
||||
|
||||
```js
|
||||
var MyMixin = {
|
||||
foo: function () { ... },
|
||||
bar: 5
|
||||
};
|
||||
|
||||
var MyClass = L.Class.extend({
|
||||
includes: MyMixin
|
||||
});
|
||||
|
||||
var a = new MyClass();
|
||||
a.foo();
|
||||
```
|
||||
|
||||
You can also do such includes in runtime with the `include` method:
|
||||
|
||||
```js
|
||||
MyClass.include(MyMixin);
|
||||
```
|
||||
|
||||
`statics` is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
statics: {
|
||||
FOO: 'bar',
|
||||
BLA: 5
|
||||
}
|
||||
});
|
||||
|
||||
MyClass.FOO; // 'bar'
|
||||
```
|
||||
|
||||
|
||||
@section Constructor hooks
|
||||
@example
|
||||
|
||||
If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for `L.Polyline`). Leaflet comes with a way to do it easily using the `addInitHook` method:
|
||||
|
||||
```js
|
||||
MyClass.addInitHook(function () {
|
||||
// ... do something in constructor additionally
|
||||
// e.g. add event listeners, set custom properties etc.
|
||||
});
|
||||
```
|
||||
|
||||
You can also use the following shortcut when you just need to make one additional method call:
|
||||
|
||||
```js
|
||||
MyClass.addInitHook('methodName', arg1, arg2, …);
|
||||
```
|
||||
@@ -0,0 +1,295 @@
|
||||
import {Class} from './Class';
|
||||
import * as Util from './Util';
|
||||
|
||||
/*
|
||||
* @class Evented
|
||||
* @aka L.Evented
|
||||
* @inherits Class
|
||||
*
|
||||
* A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* map.on('click', function(e) {
|
||||
* alert(e.latlng);
|
||||
* } );
|
||||
* ```
|
||||
*
|
||||
* Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
|
||||
*
|
||||
* ```js
|
||||
* function onClick(e) { ... }
|
||||
*
|
||||
* map.on('click', onClick);
|
||||
* map.off('click', onClick);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Events = {
|
||||
/* @method on(type: String, fn: Function, context?: Object): this
|
||||
* Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).
|
||||
*
|
||||
* @alternative
|
||||
* @method on(eventMap: Object): this
|
||||
* Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
*/
|
||||
on: function (types, fn, context) {
|
||||
|
||||
// types can be a map of types/handlers
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
// we don't process space-separated events here for performance;
|
||||
// it's a hot path since Layer uses the on(obj) syntax
|
||||
this._on(type, types[type], fn);
|
||||
}
|
||||
|
||||
} else {
|
||||
// types can be a string of space-separated words
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
this._on(types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/* @method off(type: String, fn?: Function, context?: Object): this
|
||||
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.
|
||||
*
|
||||
* @alternative
|
||||
* @method off(eventMap: Object): this
|
||||
* Removes a set of type/listener pairs.
|
||||
*
|
||||
* @alternative
|
||||
* @method off: this
|
||||
* Removes all listeners to all events on the object.
|
||||
*/
|
||||
off: function (types, fn, context) {
|
||||
|
||||
if (!types) {
|
||||
// clear all listeners if called without arguments
|
||||
delete this._events;
|
||||
|
||||
} else if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
this._off(type, types[type], fn);
|
||||
}
|
||||
|
||||
} else {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
this._off(types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// attach listener (without syntactic sugar now)
|
||||
_on: function (type, fn, context) {
|
||||
this._events = this._events || {};
|
||||
|
||||
/* get/init listeners for type */
|
||||
var typeListeners = this._events[type];
|
||||
if (!typeListeners) {
|
||||
typeListeners = [];
|
||||
this._events[type] = typeListeners;
|
||||
}
|
||||
|
||||
if (context === this) {
|
||||
// Less memory footprint.
|
||||
context = undefined;
|
||||
}
|
||||
var newListener = {fn: fn, ctx: context},
|
||||
listeners = typeListeners;
|
||||
|
||||
// check if fn already there
|
||||
for (var i = 0, len = listeners.length; i < len; i++) {
|
||||
if (listeners[i].fn === fn && listeners[i].ctx === context) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
listeners.push(newListener);
|
||||
},
|
||||
|
||||
_off: function (type, fn, context) {
|
||||
var listeners,
|
||||
i,
|
||||
len;
|
||||
|
||||
if (!this._events) { return; }
|
||||
|
||||
listeners = this._events[type];
|
||||
|
||||
if (!listeners) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fn) {
|
||||
// Set all removed listeners to noop so they are not called if remove happens in fire
|
||||
for (i = 0, len = listeners.length; i < len; i++) {
|
||||
listeners[i].fn = Util.falseFn;
|
||||
}
|
||||
// clear all listeners for a type if function isn't specified
|
||||
delete this._events[type];
|
||||
return;
|
||||
}
|
||||
|
||||
if (context === this) {
|
||||
context = undefined;
|
||||
}
|
||||
|
||||
if (listeners) {
|
||||
|
||||
// find fn and remove it
|
||||
for (i = 0, len = listeners.length; i < len; i++) {
|
||||
var l = listeners[i];
|
||||
if (l.ctx !== context) { continue; }
|
||||
if (l.fn === fn) {
|
||||
|
||||
// set the removed listener to noop so that's not called if remove happens in fire
|
||||
l.fn = Util.falseFn;
|
||||
|
||||
if (this._firingCount) {
|
||||
/* copy array in case events are being fired */
|
||||
this._events[type] = listeners = listeners.slice();
|
||||
}
|
||||
listeners.splice(i, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// @method fire(type: String, data?: Object, propagate?: Boolean): this
|
||||
// Fires an event of the specified type. You can optionally provide an data
|
||||
// object — the first argument of the listener function will contain its
|
||||
// properties. The event can optionally be propagated to event parents.
|
||||
fire: function (type, data, propagate) {
|
||||
if (!this.listens(type, propagate)) { return this; }
|
||||
|
||||
var event = Util.extend({}, data, {
|
||||
type: type,
|
||||
target: this,
|
||||
sourceTarget: data && data.sourceTarget || this
|
||||
});
|
||||
|
||||
if (this._events) {
|
||||
var listeners = this._events[type];
|
||||
|
||||
if (listeners) {
|
||||
this._firingCount = (this._firingCount + 1) || 1;
|
||||
for (var i = 0, len = listeners.length; i < len; i++) {
|
||||
var l = listeners[i];
|
||||
l.fn.call(l.ctx || this, event);
|
||||
}
|
||||
|
||||
this._firingCount--;
|
||||
}
|
||||
}
|
||||
|
||||
if (propagate) {
|
||||
// propagate the event to parents (set with addEventParent)
|
||||
this._propagateEvent(event);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method listens(type: String): Boolean
|
||||
// Returns `true` if a particular event type has any listeners attached to it.
|
||||
listens: function (type, propagate) {
|
||||
var listeners = this._events && this._events[type];
|
||||
if (listeners && listeners.length) { return true; }
|
||||
|
||||
if (propagate) {
|
||||
// also check parents for listeners if event propagates
|
||||
for (var id in this._eventParents) {
|
||||
if (this._eventParents[id].listens(type, propagate)) { return true; }
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// @method once(…): this
|
||||
// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
|
||||
once: function (types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
this.once(type, types[type], fn);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
var handler = Util.bind(function () {
|
||||
this
|
||||
.off(types, fn, context)
|
||||
.off(types, handler, context);
|
||||
}, this);
|
||||
|
||||
// add a listener that's executed once and removed after that
|
||||
return this
|
||||
.on(types, fn, context)
|
||||
.on(types, handler, context);
|
||||
},
|
||||
|
||||
// @method addEventParent(obj: Evented): this
|
||||
// Adds an event parent - an `Evented` that will receive propagated events
|
||||
addEventParent: function (obj) {
|
||||
this._eventParents = this._eventParents || {};
|
||||
this._eventParents[Util.stamp(obj)] = obj;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeEventParent(obj: Evented): this
|
||||
// Removes an event parent, so it will stop receiving propagated events
|
||||
removeEventParent: function (obj) {
|
||||
if (this._eventParents) {
|
||||
delete this._eventParents[Util.stamp(obj)];
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_propagateEvent: function (e) {
|
||||
for (var id in this._eventParents) {
|
||||
this._eventParents[id].fire(e.type, Util.extend({
|
||||
layer: e.target,
|
||||
propagatedFrom: e.target
|
||||
}, e), true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// aliases; we should ditch those eventually
|
||||
|
||||
// @method addEventListener(…): this
|
||||
// Alias to [`on(…)`](#evented-on)
|
||||
Events.addEventListener = Events.on;
|
||||
|
||||
// @method removeEventListener(…): this
|
||||
// Alias to [`off(…)`](#evented-off)
|
||||
|
||||
// @method clearAllEventListeners(…): this
|
||||
// Alias to [`off()`](#evented-off)
|
||||
Events.removeEventListener = Events.clearAllEventListeners = Events.off;
|
||||
|
||||
// @method addOneTimeEventListener(…): this
|
||||
// Alias to [`once(…)`](#evented-once)
|
||||
Events.addOneTimeEventListener = Events.once;
|
||||
|
||||
// @method fireEvent(…): this
|
||||
// Alias to [`fire(…)`](#evented-fire)
|
||||
Events.fireEvent = Events.fire;
|
||||
|
||||
// @method hasEventListeners(…): Boolean
|
||||
// Alias to [`listens(…)`](#evented-listens)
|
||||
Events.hasEventListeners = Events.listens;
|
||||
|
||||
export var Evented = Class.extend(Events);
|
||||
@@ -0,0 +1,143 @@
|
||||
|
||||
@namespace Event objects
|
||||
|
||||
|
||||
Whenever a class inheriting from `Evented` fires an event, a listener function
|
||||
will be called with an event argument, which is a plain object containing
|
||||
information about the event. For example:
|
||||
|
||||
```js
|
||||
map.on('click', function(ev) {
|
||||
alert(ev.latlng); // ev is an event object (MouseEvent in this case)
|
||||
});
|
||||
```
|
||||
|
||||
The information available depends on the event type:
|
||||
|
||||
|
||||
@miniclass Event (Event objects)
|
||||
@section
|
||||
The base event object. All other event objects contain these properties too.
|
||||
@property type: String
|
||||
The event type (e.g. `'click'`).
|
||||
@property target: Object
|
||||
The object that fired the event. For propagated events, the last object in
|
||||
the propagation chain that fired the event.
|
||||
@property sourceTarget: Object
|
||||
The object that originally fired the event. For non-propagated events, this will
|
||||
be the same as the `target`.
|
||||
@property propagatedFrom: Object
|
||||
For propagated events, the last object that propagated the event to its
|
||||
event parent.
|
||||
@property layer: Object
|
||||
**Deprecated.** The same as `propagatedFrom`.
|
||||
|
||||
|
||||
@miniclass KeyboardEvent (Event objects)
|
||||
@inherits Event
|
||||
@property originalEvent: DOMEvent
|
||||
The original [DOM `KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) that triggered this Leaflet event.
|
||||
|
||||
@miniclass MouseEvent (Event objects)
|
||||
@inherits Event
|
||||
@property latlng: LatLng
|
||||
The geographical point where the mouse event occured.
|
||||
@property layerPoint: Point
|
||||
Pixel coordinates of the point where the mouse event occured relative to the map layer.
|
||||
@property containerPoint: Point
|
||||
Pixel coordinates of the point where the mouse event occured relative to the map сontainer.
|
||||
@property originalEvent: DOMEvent
|
||||
The original [DOM `MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) or [DOM `TouchEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent) that triggered this Leaflet event.
|
||||
|
||||
@miniclass LocationEvent (Event objects)
|
||||
@inherits Event
|
||||
@property latlng: LatLng
|
||||
Detected geographical location of the user.
|
||||
@property bounds: LatLngBounds
|
||||
Geographical bounds of the area user is located in (with respect to the accuracy of location).
|
||||
@property accuracy: Number
|
||||
Accuracy of location in meters.
|
||||
@property altitude: Number
|
||||
Height of the position above the WGS84 ellipsoid in meters.
|
||||
@property altitudeAccuracy: Number
|
||||
Accuracy of altitude in meters.
|
||||
@property heading: Number
|
||||
The direction of travel in degrees counting clockwise from true North.
|
||||
@property speed: Number
|
||||
Current velocity in meters per second.
|
||||
@property timestamp: Number
|
||||
The time when the position was acquired.
|
||||
|
||||
@miniclass ErrorEvent (Event objects)
|
||||
@inherits Event
|
||||
@property message: String
|
||||
Error message.
|
||||
@property code: Number
|
||||
Error code (if applicable).
|
||||
|
||||
@miniclass LayerEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer that was added or removed.
|
||||
|
||||
@miniclass LayersControlEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer that was added or removed.
|
||||
@property name: String
|
||||
The name of the layer that was added or removed.
|
||||
|
||||
@miniclass TileEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tile: HTMLElement
|
||||
The tile element (image).
|
||||
@property coords: Point
|
||||
Point object with the tile's `x`, `y`, and `z` (zoom level) coordinates.
|
||||
|
||||
@miniclass TileErrorEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tile: HTMLElement
|
||||
The tile element (image).
|
||||
@property coords: Point
|
||||
Point object with the tile's `x`, `y`, and `z` (zoom level) coordinates.
|
||||
@property error: *
|
||||
Error passed to the tile's `done()` callback.
|
||||
|
||||
@miniclass ResizeEvent (Event objects)
|
||||
@inherits Event
|
||||
@property oldSize: Point
|
||||
The old size before resize event.
|
||||
@property newSize: Point
|
||||
The new size after the resize event.
|
||||
|
||||
@miniclass GeoJSONEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer for the GeoJSON feature that is being added to the map.
|
||||
@property properties: Object
|
||||
GeoJSON properties of the feature.
|
||||
@property geometryType: String
|
||||
GeoJSON geometry type of the feature.
|
||||
@property id: String
|
||||
GeoJSON ID of the feature (if present).
|
||||
|
||||
@miniclass PopupEvent (Event objects)
|
||||
@inherits Event
|
||||
@property popup: Popup
|
||||
The popup that was opened or closed.
|
||||
|
||||
@miniclass TooltipEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tooltip: Tooltip
|
||||
The tooltip that was opened or closed.
|
||||
|
||||
@miniclass DragEndEvent (Event objects)
|
||||
@inherits Event
|
||||
@property distance: Number
|
||||
The distance in pixels the draggable element was moved by.
|
||||
|
||||
@miniclass ZoomAnimEvent (Event objects)
|
||||
@inherits Event
|
||||
@property center: LatLng; The current center of the map
|
||||
@property zoom: Number; The current zoom level of the map
|
||||
@property noUpdate: Boolean; Whether layers should update their contents due to this event
|
||||
@@ -0,0 +1,57 @@
|
||||
import {Class} from './Class';
|
||||
|
||||
/*
|
||||
L.Handler is a base class for handler classes that are used internally to inject
|
||||
interaction features like dragging to classes like Map and Marker.
|
||||
*/
|
||||
|
||||
// @class Handler
|
||||
// @aka L.Handler
|
||||
// Abstract class for map interaction handlers
|
||||
|
||||
export var Handler = Class.extend({
|
||||
initialize: function (map) {
|
||||
this._map = map;
|
||||
},
|
||||
|
||||
// @method enable(): this
|
||||
// Enables the handler
|
||||
enable: function () {
|
||||
if (this._enabled) { return this; }
|
||||
|
||||
this._enabled = true;
|
||||
this.addHooks();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method disable(): this
|
||||
// Disables the handler
|
||||
disable: function () {
|
||||
if (!this._enabled) { return this; }
|
||||
|
||||
this._enabled = false;
|
||||
this.removeHooks();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method enabled(): Boolean
|
||||
// Returns `true` if the handler is enabled
|
||||
enabled: function () {
|
||||
return !!this._enabled;
|
||||
}
|
||||
|
||||
// @section Extension methods
|
||||
// Classes inheriting from `Handler` must implement the two following methods:
|
||||
// @method addHooks()
|
||||
// Called when the handler is enabled, should add event hooks.
|
||||
// @method removeHooks()
|
||||
// Called when the handler is disabled, should remove the event hooks added previously.
|
||||
});
|
||||
|
||||
// @section There is static function which can be called without instantiating L.Handler:
|
||||
// @function addTo(map: Map, name: String): this
|
||||
// Adds a new Handler to the given map with the given name.
|
||||
Handler.addTo = function (map, name) {
|
||||
map.addHandler(name, this);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* @namespace Util
|
||||
*
|
||||
* Various utility functions, used by Leaflet internally.
|
||||
*/
|
||||
|
||||
export var freeze = Object.freeze;
|
||||
Object.freeze = function (obj) { return obj; };
|
||||
|
||||
// @function extend(dest: Object, src?: Object): Object
|
||||
// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.
|
||||
export function extend(dest) {
|
||||
var i, j, len, src;
|
||||
|
||||
for (j = 1, len = arguments.length; j < len; j++) {
|
||||
src = arguments[j];
|
||||
for (i in src) {
|
||||
dest[i] = src[i];
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
// @function create(proto: Object, properties?: Object): Object
|
||||
// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)
|
||||
export var create = Object.create || (function () {
|
||||
function F() {}
|
||||
return function (proto) {
|
||||
F.prototype = proto;
|
||||
return new F();
|
||||
};
|
||||
})();
|
||||
|
||||
// @function bind(fn: Function, …): Function
|
||||
// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
// Has a `L.bind()` shortcut.
|
||||
export function bind(fn, obj) {
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
if (fn.bind) {
|
||||
return fn.bind.apply(fn, slice.call(arguments, 1));
|
||||
}
|
||||
|
||||
var args = slice.call(arguments, 2);
|
||||
|
||||
return function () {
|
||||
return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);
|
||||
};
|
||||
}
|
||||
|
||||
// @property lastId: Number
|
||||
// Last unique ID used by [`stamp()`](#util-stamp)
|
||||
export var lastId = 0;
|
||||
|
||||
// @function stamp(obj: Object): Number
|
||||
// Returns the unique ID of an object, assigning it one if it doesn't have it.
|
||||
export function stamp(obj) {
|
||||
/*eslint-disable */
|
||||
obj._leaflet_id = obj._leaflet_id || ++lastId;
|
||||
return obj._leaflet_id;
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
// @function throttle(fn: Function, time: Number, context: Object): Function
|
||||
// Returns a function which executes function `fn` with the given scope `context`
|
||||
// (so that the `this` keyword refers to `context` inside `fn`'s code). The function
|
||||
// `fn` will be called no more than one time per given amount of `time`. The arguments
|
||||
// received by the bound function will be any arguments passed when binding the
|
||||
// function, followed by any arguments passed when invoking the bound function.
|
||||
// Has an `L.throttle` shortcut.
|
||||
export function throttle(fn, time, context) {
|
||||
var lock, args, wrapperFn, later;
|
||||
|
||||
later = function () {
|
||||
// reset lock and call if queued
|
||||
lock = false;
|
||||
if (args) {
|
||||
wrapperFn.apply(context, args);
|
||||
args = false;
|
||||
}
|
||||
};
|
||||
|
||||
wrapperFn = function () {
|
||||
if (lock) {
|
||||
// called too soon, queue to call later
|
||||
args = arguments;
|
||||
|
||||
} else {
|
||||
// call and lock until later
|
||||
fn.apply(context, arguments);
|
||||
setTimeout(later, time);
|
||||
lock = true;
|
||||
}
|
||||
};
|
||||
|
||||
return wrapperFn;
|
||||
}
|
||||
|
||||
// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number
|
||||
// Returns the number `num` modulo `range` in such a way so it lies within
|
||||
// `range[0]` and `range[1]`. The returned value will be always smaller than
|
||||
// `range[1]` unless `includeMax` is set to `true`.
|
||||
export function wrapNum(x, range, includeMax) {
|
||||
var max = range[1],
|
||||
min = range[0],
|
||||
d = max - min;
|
||||
return x === max && includeMax ? x : ((x - min) % d + d) % d + min;
|
||||
}
|
||||
|
||||
// @function falseFn(): Function
|
||||
// Returns a function which always returns `false`.
|
||||
export function falseFn() { return false; }
|
||||
|
||||
// @function formatNum(num: Number, digits?: Number): Number
|
||||
// Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.
|
||||
export function formatNum(num, digits) {
|
||||
var pow = Math.pow(10, (digits === undefined ? 6 : digits));
|
||||
return Math.round(num * pow) / pow;
|
||||
}
|
||||
|
||||
// @function trim(str: String): String
|
||||
// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)
|
||||
export function trim(str) {
|
||||
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
|
||||
// @function splitWords(str: String): String[]
|
||||
// Trims and splits the string on whitespace and returns the array of parts.
|
||||
export function splitWords(str) {
|
||||
return trim(str).split(/\s+/);
|
||||
}
|
||||
|
||||
// @function setOptions(obj: Object, options: Object): Object
|
||||
// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.
|
||||
export function setOptions(obj, options) {
|
||||
if (!obj.hasOwnProperty('options')) {
|
||||
obj.options = obj.options ? create(obj.options) : {};
|
||||
}
|
||||
for (var i in options) {
|
||||
obj.options[i] = options[i];
|
||||
}
|
||||
return obj.options;
|
||||
}
|
||||
|
||||
// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String
|
||||
// Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}`
|
||||
// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will
|
||||
// be appended at the end. If `uppercase` is `true`, the parameter names will
|
||||
// be uppercased (e.g. `'?A=foo&B=bar'`)
|
||||
export function getParamString(obj, existingUrl, uppercase) {
|
||||
var params = [];
|
||||
for (var i in obj) {
|
||||
params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));
|
||||
}
|
||||
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
|
||||
}
|
||||
|
||||
var templateRe = /\{ *([\w_-]+) *\}/g;
|
||||
|
||||
// @function template(str: String, data: Object): String
|
||||
// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`
|
||||
// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string
|
||||
// `('Hello foo, bar')`. You can also specify functions instead of strings for
|
||||
// data values — they will be evaluated passing `data` as an argument.
|
||||
export function template(str, data) {
|
||||
return str.replace(templateRe, function (str, key) {
|
||||
var value = data[key];
|
||||
|
||||
if (value === undefined) {
|
||||
throw new Error('No value provided for variable ' + str);
|
||||
|
||||
} else if (typeof value === 'function') {
|
||||
value = value(data);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
// @function isArray(obj): Boolean
|
||||
// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)
|
||||
export var isArray = Array.isArray || function (obj) {
|
||||
return (Object.prototype.toString.call(obj) === '[object Array]');
|
||||
};
|
||||
|
||||
// @function indexOf(array: Array, el: Object): Number
|
||||
// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
|
||||
export function indexOf(array, el) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i] === el) { return i; }
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// @property emptyImageUrl: String
|
||||
// Data URI string containing a base64-encoded empty GIF image.
|
||||
// Used as a hack to free memory from unused images on WebKit-powered
|
||||
// mobile devices (by setting image `src` to this string).
|
||||
export var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
|
||||
|
||||
// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
|
||||
function getPrefixed(name) {
|
||||
return window['webkit' + name] || window['moz' + name] || window['ms' + name];
|
||||
}
|
||||
|
||||
var lastTime = 0;
|
||||
|
||||
// fallback for IE 7-8
|
||||
function timeoutDefer(fn) {
|
||||
var time = +new Date(),
|
||||
timeToCall = Math.max(0, 16 - (time - lastTime));
|
||||
|
||||
lastTime = time + timeToCall;
|
||||
return window.setTimeout(fn, timeToCall);
|
||||
}
|
||||
|
||||
export var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;
|
||||
export var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||
|
||||
getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };
|
||||
|
||||
// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number
|
||||
// Schedules `fn` to be executed when the browser repaints. `fn` is bound to
|
||||
// `context` if given. When `immediate` is set, `fn` is called immediately if
|
||||
// the browser doesn't have native support for
|
||||
// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),
|
||||
// otherwise it's delayed. Returns a request ID that can be used to cancel the request.
|
||||
export function requestAnimFrame(fn, context, immediate) {
|
||||
if (immediate && requestFn === timeoutDefer) {
|
||||
fn.call(context);
|
||||
} else {
|
||||
return requestFn.call(window, bind(fn, context));
|
||||
}
|
||||
}
|
||||
|
||||
// @function cancelAnimFrame(id: Number): undefined
|
||||
// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).
|
||||
export function cancelAnimFrame(id) {
|
||||
if (id) {
|
||||
cancelFn.call(window, id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as Browser from './Browser';
|
||||
export {Browser};
|
||||
|
||||
export {Class} from './Class';
|
||||
|
||||
import {Evented} from './Events';
|
||||
import {Events} from './Events';
|
||||
export {Evented};
|
||||
export var Mixin = {Events: Events};
|
||||
|
||||
export {Handler} from './Handler';
|
||||
|
||||
import * as Util from './Util';
|
||||
export {Util};
|
||||
export {extend, bind, stamp, setOptions} from './Util';
|
||||
@@ -0,0 +1,86 @@
|
||||
import * as Browser from '../core/Browser';
|
||||
import {_pointersCount} from './DomEvent.Pointer';
|
||||
|
||||
/*
|
||||
* Extends the event handling code with double tap support for mobile browsers.
|
||||
*/
|
||||
|
||||
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart';
|
||||
var _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend';
|
||||
var _pre = '_leaflet_';
|
||||
|
||||
// inspired by Zepto touch code by Thomas Fuchs
|
||||
export function addDoubleTapListener(obj, handler, id) {
|
||||
var last, touch,
|
||||
doubleTap = false,
|
||||
delay = 250;
|
||||
|
||||
function onTouchStart(e) {
|
||||
var count;
|
||||
|
||||
if (Browser.pointer) {
|
||||
if ((!Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||
count = _pointersCount;
|
||||
} else {
|
||||
count = e.touches.length;
|
||||
}
|
||||
|
||||
if (count > 1) { return; }
|
||||
|
||||
var now = Date.now(),
|
||||
delta = now - (last || now);
|
||||
|
||||
touch = e.touches ? e.touches[0] : e;
|
||||
doubleTap = (delta > 0 && delta <= delay);
|
||||
last = now;
|
||||
}
|
||||
|
||||
function onTouchEnd(e) {
|
||||
if (doubleTap && !touch.cancelBubble) {
|
||||
if (Browser.pointer) {
|
||||
if ((!Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||
// work around .type being readonly with MSPointer* events
|
||||
var newTouch = {},
|
||||
prop, i;
|
||||
|
||||
for (i in touch) {
|
||||
prop = touch[i];
|
||||
newTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;
|
||||
}
|
||||
touch = newTouch;
|
||||
}
|
||||
touch.type = 'dblclick';
|
||||
handler(touch);
|
||||
last = null;
|
||||
}
|
||||
}
|
||||
|
||||
obj[_pre + _touchstart + id] = onTouchStart;
|
||||
obj[_pre + _touchend + id] = onTouchEnd;
|
||||
obj[_pre + 'dblclick' + id] = handler;
|
||||
|
||||
obj.addEventListener(_touchstart, onTouchStart, false);
|
||||
obj.addEventListener(_touchend, onTouchEnd, false);
|
||||
|
||||
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
|
||||
// the browser doesn't fire touchend/pointerup events but does fire
|
||||
// native dblclicks. See #4127.
|
||||
// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.
|
||||
obj.addEventListener('dblclick', handler, false);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
export function removeDoubleTapListener(obj, id) {
|
||||
var touchstart = obj[_pre + _touchstart + id],
|
||||
touchend = obj[_pre + _touchend + id],
|
||||
dblclick = obj[_pre + 'dblclick' + id];
|
||||
|
||||
obj.removeEventListener(_touchstart, touchstart, false);
|
||||
obj.removeEventListener(_touchend, touchend, false);
|
||||
if (!Browser.edge) {
|
||||
obj.removeEventListener('dblclick', dblclick, false);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
|
||||
/*
|
||||
* Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.
|
||||
*/
|
||||
|
||||
|
||||
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';
|
||||
var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';
|
||||
var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';
|
||||
var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';
|
||||
var TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'];
|
||||
|
||||
var _pointers = {};
|
||||
var _pointerDocListener = false;
|
||||
|
||||
// DomEvent.DoubleTap needs to know about this
|
||||
export var _pointersCount = 0;
|
||||
|
||||
// Provides a touch events wrapper for (ms)pointer events.
|
||||
// ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
|
||||
|
||||
export function addPointerListener(obj, type, handler, id) {
|
||||
if (type === 'touchstart') {
|
||||
_addPointerStart(obj, handler, id);
|
||||
|
||||
} else if (type === 'touchmove') {
|
||||
_addPointerMove(obj, handler, id);
|
||||
|
||||
} else if (type === 'touchend') {
|
||||
_addPointerEnd(obj, handler, id);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
export function removePointerListener(obj, type, id) {
|
||||
var handler = obj['_leaflet_' + type + id];
|
||||
|
||||
if (type === 'touchstart') {
|
||||
obj.removeEventListener(POINTER_DOWN, handler, false);
|
||||
|
||||
} else if (type === 'touchmove') {
|
||||
obj.removeEventListener(POINTER_MOVE, handler, false);
|
||||
|
||||
} else if (type === 'touchend') {
|
||||
obj.removeEventListener(POINTER_UP, handler, false);
|
||||
obj.removeEventListener(POINTER_CANCEL, handler, false);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function _addPointerStart(obj, handler, id) {
|
||||
var onDown = Util.bind(function (e) {
|
||||
if (e.pointerType !== 'mouse' && e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
|
||||
// In IE11, some touch events needs to fire for form controls, or
|
||||
// the controls will stop working. We keep a whitelist of tag names that
|
||||
// need these events. For other target tags, we prevent default on the event.
|
||||
if (TAG_WHITE_LIST.indexOf(e.target.tagName) < 0) {
|
||||
DomEvent.preventDefault(e);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_handlePointer(e, handler);
|
||||
});
|
||||
|
||||
obj['_leaflet_touchstart' + id] = onDown;
|
||||
obj.addEventListener(POINTER_DOWN, onDown, false);
|
||||
|
||||
// need to keep track of what pointers and how many are active to provide e.touches emulation
|
||||
if (!_pointerDocListener) {
|
||||
// we listen documentElement as any drags that end by moving the touch off the screen get fired there
|
||||
document.documentElement.addEventListener(POINTER_DOWN, _globalPointerDown, true);
|
||||
document.documentElement.addEventListener(POINTER_MOVE, _globalPointerMove, true);
|
||||
document.documentElement.addEventListener(POINTER_UP, _globalPointerUp, true);
|
||||
document.documentElement.addEventListener(POINTER_CANCEL, _globalPointerUp, true);
|
||||
|
||||
_pointerDocListener = true;
|
||||
}
|
||||
}
|
||||
|
||||
function _globalPointerDown(e) {
|
||||
_pointers[e.pointerId] = e;
|
||||
_pointersCount++;
|
||||
}
|
||||
|
||||
function _globalPointerMove(e) {
|
||||
if (_pointers[e.pointerId]) {
|
||||
_pointers[e.pointerId] = e;
|
||||
}
|
||||
}
|
||||
|
||||
function _globalPointerUp(e) {
|
||||
delete _pointers[e.pointerId];
|
||||
_pointersCount--;
|
||||
}
|
||||
|
||||
function _handlePointer(e, handler) {
|
||||
e.touches = [];
|
||||
for (var i in _pointers) {
|
||||
e.touches.push(_pointers[i]);
|
||||
}
|
||||
e.changedTouches = [e];
|
||||
|
||||
handler(e);
|
||||
}
|
||||
|
||||
function _addPointerMove(obj, handler, id) {
|
||||
var onMove = function (e) {
|
||||
// don't fire touch moves when mouse isn't down
|
||||
if ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; }
|
||||
|
||||
_handlePointer(e, handler);
|
||||
};
|
||||
|
||||
obj['_leaflet_touchmove' + id] = onMove;
|
||||
obj.addEventListener(POINTER_MOVE, onMove, false);
|
||||
}
|
||||
|
||||
function _addPointerEnd(obj, handler, id) {
|
||||
var onUp = function (e) {
|
||||
_handlePointer(e, handler);
|
||||
};
|
||||
|
||||
obj['_leaflet_touchend' + id] = onUp;
|
||||
obj.addEventListener(POINTER_UP, onUp, false);
|
||||
obj.addEventListener(POINTER_CANCEL, onUp, false);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,316 @@
|
||||
import {Point} from '../geometry/Point';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
import {addPointerListener, removePointerListener} from './DomEvent.Pointer';
|
||||
import {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';
|
||||
import {getScale} from './DomUtil';
|
||||
|
||||
/*
|
||||
* @namespace DomEvent
|
||||
* Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.
|
||||
*/
|
||||
|
||||
// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.
|
||||
|
||||
// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this
|
||||
// Adds a listener function (`fn`) to a particular DOM event type of the
|
||||
// element `el`. You can optionally specify the context of the listener
|
||||
// (object the `this` keyword will point to). You can also pass several
|
||||
// space-separated types (e.g. `'click dblclick'`).
|
||||
|
||||
// @alternative
|
||||
// @function on(el: HTMLElement, eventMap: Object, context?: Object): this
|
||||
// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
export function on(obj, types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
addOne(obj, type, types[type], fn);
|
||||
}
|
||||
} else {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
addOne(obj, types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
var eventsKey = '_leaflet_events';
|
||||
|
||||
// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this
|
||||
// Removes a previously added listener function.
|
||||
// Note that if you passed a custom context to on, you must pass the same
|
||||
// context to `off` in order to remove the listener.
|
||||
|
||||
// @alternative
|
||||
// @function off(el: HTMLElement, eventMap: Object, context?: Object): this
|
||||
// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
export function off(obj, types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
removeOne(obj, type, types[type], fn);
|
||||
}
|
||||
} else if (types) {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
removeOne(obj, types[i], fn, context);
|
||||
}
|
||||
} else {
|
||||
for (var j in obj[eventsKey]) {
|
||||
removeOne(obj, j, obj[eventsKey][j]);
|
||||
}
|
||||
delete obj[eventsKey];
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function addOne(obj, type, fn, context) {
|
||||
var id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');
|
||||
|
||||
if (obj[eventsKey] && obj[eventsKey][id]) { return this; }
|
||||
|
||||
var handler = function (e) {
|
||||
return fn.call(context || obj, e || window.event);
|
||||
};
|
||||
|
||||
var originalHandler = handler;
|
||||
|
||||
if (Browser.pointer && type.indexOf('touch') === 0) {
|
||||
// Needs DomEvent.Pointer.js
|
||||
addPointerListener(obj, type, handler, id);
|
||||
|
||||
} else if (Browser.touch && (type === 'dblclick') && addDoubleTapListener &&
|
||||
!(Browser.pointer && Browser.chrome)) {
|
||||
// Chrome >55 does not need the synthetic dblclicks from addDoubleTapListener
|
||||
// See #5180
|
||||
addDoubleTapListener(obj, handler, id);
|
||||
|
||||
} else if ('addEventListener' in obj) {
|
||||
|
||||
if (type === 'mousewheel') {
|
||||
obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
||||
|
||||
} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
|
||||
handler = function (e) {
|
||||
e = e || window.event;
|
||||
if (isExternalTarget(obj, e)) {
|
||||
originalHandler(e);
|
||||
}
|
||||
};
|
||||
obj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);
|
||||
|
||||
} else {
|
||||
if (type === 'click' && Browser.android) {
|
||||
handler = function (e) {
|
||||
filterClick(e, originalHandler);
|
||||
};
|
||||
}
|
||||
obj.addEventListener(type, handler, false);
|
||||
}
|
||||
|
||||
} else if ('attachEvent' in obj) {
|
||||
obj.attachEvent('on' + type, handler);
|
||||
}
|
||||
|
||||
obj[eventsKey] = obj[eventsKey] || {};
|
||||
obj[eventsKey][id] = handler;
|
||||
}
|
||||
|
||||
function removeOne(obj, type, fn, context) {
|
||||
|
||||
var id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : ''),
|
||||
handler = obj[eventsKey] && obj[eventsKey][id];
|
||||
|
||||
if (!handler) { return this; }
|
||||
|
||||
if (Browser.pointer && type.indexOf('touch') === 0) {
|
||||
removePointerListener(obj, type, id);
|
||||
|
||||
} else if (Browser.touch && (type === 'dblclick') && removeDoubleTapListener &&
|
||||
!(Browser.pointer && Browser.chrome)) {
|
||||
removeDoubleTapListener(obj, id);
|
||||
|
||||
} else if ('removeEventListener' in obj) {
|
||||
|
||||
if (type === 'mousewheel') {
|
||||
obj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
||||
|
||||
} else {
|
||||
obj.removeEventListener(
|
||||
type === 'mouseenter' ? 'mouseover' :
|
||||
type === 'mouseleave' ? 'mouseout' : type, handler, false);
|
||||
}
|
||||
|
||||
} else if ('detachEvent' in obj) {
|
||||
obj.detachEvent('on' + type, handler);
|
||||
}
|
||||
|
||||
obj[eventsKey][id] = null;
|
||||
}
|
||||
|
||||
// @function stopPropagation(ev: DOMEvent): this
|
||||
// Stop the given event from propagation to parent elements. Used inside the listener functions:
|
||||
// ```js
|
||||
// L.DomEvent.on(div, 'click', function (ev) {
|
||||
// L.DomEvent.stopPropagation(ev);
|
||||
// });
|
||||
// ```
|
||||
export function stopPropagation(e) {
|
||||
|
||||
if (e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
} else if (e.originalEvent) { // In case of Leaflet event.
|
||||
e.originalEvent._stopped = true;
|
||||
} else {
|
||||
e.cancelBubble = true;
|
||||
}
|
||||
skipped(e);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function disableScrollPropagation(el: HTMLElement): this
|
||||
// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).
|
||||
export function disableScrollPropagation(el) {
|
||||
addOne(el, 'mousewheel', stopPropagation);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function disableClickPropagation(el: HTMLElement): this
|
||||
// Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,
|
||||
// `'mousedown'` and `'touchstart'` events (plus browser variants).
|
||||
export function disableClickPropagation(el) {
|
||||
on(el, 'mousedown touchstart dblclick', stopPropagation);
|
||||
addOne(el, 'click', fakeStop);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function preventDefault(ev: DOMEvent): this
|
||||
// Prevents the default action of the DOM Event `ev` from happening (such as
|
||||
// following a link in the href of the a element, or doing a POST request
|
||||
// with page reload when a `<form>` is submitted).
|
||||
// Use it inside listener functions.
|
||||
export function preventDefault(e) {
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
} else {
|
||||
e.returnValue = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function stop(ev: DOMEvent): this
|
||||
// Does `stopPropagation` and `preventDefault` at the same time.
|
||||
export function stop(e) {
|
||||
preventDefault(e);
|
||||
stopPropagation(e);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point
|
||||
// Gets normalized mouse position from a DOM event relative to the
|
||||
// `container` (border excluded) or to the whole page if not specified.
|
||||
export function getMousePosition(e, container) {
|
||||
if (!container) {
|
||||
return new Point(e.clientX, e.clientY);
|
||||
}
|
||||
|
||||
var scale = getScale(container),
|
||||
offset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)
|
||||
|
||||
return new Point(
|
||||
// offset.left/top values are in page scale (like clientX/Y),
|
||||
// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).
|
||||
(e.clientX - offset.left) / scale.x - container.clientLeft,
|
||||
(e.clientY - offset.top) / scale.y - container.clientTop
|
||||
);
|
||||
}
|
||||
|
||||
// Chrome on Win scrolls double the pixels as in other platforms (see #4538),
|
||||
// and Firefox scrolls device pixels, not CSS pixels
|
||||
var wheelPxFactor =
|
||||
(Browser.win && Browser.chrome) ? 2 * window.devicePixelRatio :
|
||||
Browser.gecko ? window.devicePixelRatio : 1;
|
||||
|
||||
// @function getWheelDelta(ev: DOMEvent): Number
|
||||
// Gets normalized wheel delta from a mousewheel DOM event, in vertical
|
||||
// pixels scrolled (negative if scrolling down).
|
||||
// Events from pointing devices without precise scrolling are mapped to
|
||||
// a best guess of 60 pixels.
|
||||
export function getWheelDelta(e) {
|
||||
return (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta
|
||||
(e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels
|
||||
(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines
|
||||
(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages
|
||||
(e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events
|
||||
e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels
|
||||
(e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines
|
||||
e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages
|
||||
0;
|
||||
}
|
||||
|
||||
var skipEvents = {};
|
||||
|
||||
export function fakeStop(e) {
|
||||
// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)
|
||||
skipEvents[e.type] = true;
|
||||
}
|
||||
|
||||
export function skipped(e) {
|
||||
var events = skipEvents[e.type];
|
||||
// reset when checking, as it's only used in map container and propagates outside of the map
|
||||
skipEvents[e.type] = false;
|
||||
return events;
|
||||
}
|
||||
|
||||
// check if element really left/entered the event target (for mouseenter/mouseleave)
|
||||
export function isExternalTarget(el, e) {
|
||||
|
||||
var related = e.relatedTarget;
|
||||
|
||||
if (!related) { return true; }
|
||||
|
||||
try {
|
||||
while (related && (related !== el)) {
|
||||
related = related.parentNode;
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return (related !== el);
|
||||
}
|
||||
|
||||
var lastClick;
|
||||
|
||||
// this is a horrible workaround for a bug in Android where a single touch triggers two click events
|
||||
function filterClick(e, handler) {
|
||||
var timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),
|
||||
elapsed = lastClick && (timeStamp - lastClick);
|
||||
|
||||
// are they closer together than 500ms yet more than 100ms?
|
||||
// Android typically triggers them ~300ms apart while multiple listeners
|
||||
// on the same event should be triggered far faster;
|
||||
// or check if click is simulated on the element, and if it is, reject any non-simulated events
|
||||
|
||||
if ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) {
|
||||
stop(e);
|
||||
return;
|
||||
}
|
||||
lastClick = timeStamp;
|
||||
|
||||
handler(e);
|
||||
}
|
||||
|
||||
// @function addListener(…): this
|
||||
// Alias to [`L.DomEvent.on`](#domevent-on)
|
||||
export {on as addListener};
|
||||
|
||||
// @function removeListener(…): this
|
||||
// Alias to [`L.DomEvent.off`](#domevent-off)
|
||||
export {off as removeListener};
|
||||
@@ -0,0 +1,349 @@
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as Util from '../core/Util';
|
||||
import {Point} from '../geometry/Point';
|
||||
import * as Browser from '../core/Browser';
|
||||
|
||||
/*
|
||||
* @namespace DomUtil
|
||||
*
|
||||
* Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)
|
||||
* tree, used by Leaflet internally.
|
||||
*
|
||||
* Most functions expecting or returning a `HTMLElement` also work for
|
||||
* SVG elements. The only difference is that classes refer to CSS classes
|
||||
* in HTML and SVG classes in SVG.
|
||||
*/
|
||||
|
||||
|
||||
// @property TRANSFORM: String
|
||||
// Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).
|
||||
export var TRANSFORM = testProp(
|
||||
['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);
|
||||
|
||||
// webkitTransition comes first because some browser versions that drop vendor prefix don't do
|
||||
// the same for the transitionend event, in particular the Android 4.1 stock browser
|
||||
|
||||
// @property TRANSITION: String
|
||||
// Vendor-prefixed transition style name.
|
||||
export var TRANSITION = testProp(
|
||||
['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);
|
||||
|
||||
// @property TRANSITION_END: String
|
||||
// Vendor-prefixed transitionend event name.
|
||||
export var TRANSITION_END =
|
||||
TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';
|
||||
|
||||
|
||||
// @function get(id: String|HTMLElement): HTMLElement
|
||||
// Returns an element given its DOM id, or returns the element itself
|
||||
// if it was passed directly.
|
||||
export function get(id) {
|
||||
return typeof id === 'string' ? document.getElementById(id) : id;
|
||||
}
|
||||
|
||||
// @function getStyle(el: HTMLElement, styleAttrib: String): String
|
||||
// Returns the value for a certain style attribute on an element,
|
||||
// including computed values or values set through CSS.
|
||||
export function getStyle(el, style) {
|
||||
var value = el.style[style] || (el.currentStyle && el.currentStyle[style]);
|
||||
|
||||
if ((!value || value === 'auto') && document.defaultView) {
|
||||
var css = document.defaultView.getComputedStyle(el, null);
|
||||
value = css ? css[style] : null;
|
||||
}
|
||||
return value === 'auto' ? null : value;
|
||||
}
|
||||
|
||||
// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement
|
||||
// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.
|
||||
export function create(tagName, className, container) {
|
||||
var el = document.createElement(tagName);
|
||||
el.className = className || '';
|
||||
|
||||
if (container) {
|
||||
container.appendChild(el);
|
||||
}
|
||||
return el;
|
||||
}
|
||||
|
||||
// @function remove(el: HTMLElement)
|
||||
// Removes `el` from its parent element
|
||||
export function remove(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent) {
|
||||
parent.removeChild(el);
|
||||
}
|
||||
}
|
||||
|
||||
// @function empty(el: HTMLElement)
|
||||
// Removes all of `el`'s children elements from `el`
|
||||
export function empty(el) {
|
||||
while (el.firstChild) {
|
||||
el.removeChild(el.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// @function toFront(el: HTMLElement)
|
||||
// Makes `el` the last child of its parent, so it renders in front of the other children.
|
||||
export function toFront(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent && parent.lastChild !== el) {
|
||||
parent.appendChild(el);
|
||||
}
|
||||
}
|
||||
|
||||
// @function toBack(el: HTMLElement)
|
||||
// Makes `el` the first child of its parent, so it renders behind the other children.
|
||||
export function toBack(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent && parent.firstChild !== el) {
|
||||
parent.insertBefore(el, parent.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// @function hasClass(el: HTMLElement, name: String): Boolean
|
||||
// Returns `true` if the element's class attribute contains `name`.
|
||||
export function hasClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
return el.classList.contains(name);
|
||||
}
|
||||
var className = getClass(el);
|
||||
return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
|
||||
}
|
||||
|
||||
// @function addClass(el: HTMLElement, name: String)
|
||||
// Adds `name` to the element's class attribute.
|
||||
export function addClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
var classes = Util.splitWords(name);
|
||||
for (var i = 0, len = classes.length; i < len; i++) {
|
||||
el.classList.add(classes[i]);
|
||||
}
|
||||
} else if (!hasClass(el, name)) {
|
||||
var className = getClass(el);
|
||||
setClass(el, (className ? className + ' ' : '') + name);
|
||||
}
|
||||
}
|
||||
|
||||
// @function removeClass(el: HTMLElement, name: String)
|
||||
// Removes `name` from the element's class attribute.
|
||||
export function removeClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
el.classList.remove(name);
|
||||
} else {
|
||||
setClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));
|
||||
}
|
||||
}
|
||||
|
||||
// @function setClass(el: HTMLElement, name: String)
|
||||
// Sets the element's class.
|
||||
export function setClass(el, name) {
|
||||
if (el.className.baseVal === undefined) {
|
||||
el.className = name;
|
||||
} else {
|
||||
// in case of SVG element
|
||||
el.className.baseVal = name;
|
||||
}
|
||||
}
|
||||
|
||||
// @function getClass(el: HTMLElement): String
|
||||
// Returns the element's class.
|
||||
export function getClass(el) {
|
||||
// Check if the element is an SVGElementInstance and use the correspondingElement instead
|
||||
// (Required for linked SVG elements in IE11.)
|
||||
if (el.correspondingElement) {
|
||||
el = el.correspondingElement;
|
||||
}
|
||||
return el.className.baseVal === undefined ? el.className : el.className.baseVal;
|
||||
}
|
||||
|
||||
// @function setOpacity(el: HTMLElement, opacity: Number)
|
||||
// Set the opacity of an element (including old IE support).
|
||||
// `opacity` must be a number from `0` to `1`.
|
||||
export function setOpacity(el, value) {
|
||||
if ('opacity' in el.style) {
|
||||
el.style.opacity = value;
|
||||
} else if ('filter' in el.style) {
|
||||
_setOpacityIE(el, value);
|
||||
}
|
||||
}
|
||||
|
||||
function _setOpacityIE(el, value) {
|
||||
var filter = false,
|
||||
filterName = 'DXImageTransform.Microsoft.Alpha';
|
||||
|
||||
// filters collection throws an error if we try to retrieve a filter that doesn't exist
|
||||
try {
|
||||
filter = el.filters.item(filterName);
|
||||
} catch (e) {
|
||||
// don't set opacity to 1 if we haven't already set an opacity,
|
||||
// it isn't needed and breaks transparent pngs.
|
||||
if (value === 1) { return; }
|
||||
}
|
||||
|
||||
value = Math.round(value * 100);
|
||||
|
||||
if (filter) {
|
||||
filter.Enabled = (value !== 100);
|
||||
filter.Opacity = value;
|
||||
} else {
|
||||
el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';
|
||||
}
|
||||
}
|
||||
|
||||
// @function testProp(props: String[]): String|false
|
||||
// Goes through the array of style names and returns the first name
|
||||
// that is a valid style name for an element. If no such name is found,
|
||||
// it returns false. Useful for vendor-prefixed styles like `transform`.
|
||||
export function testProp(props) {
|
||||
var style = document.documentElement.style;
|
||||
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
if (props[i] in style) {
|
||||
return props[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)
|
||||
// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels
|
||||
// and optionally scaled by `scale`. Does not have an effect if the
|
||||
// browser doesn't support 3D CSS transforms.
|
||||
export function setTransform(el, offset, scale) {
|
||||
var pos = offset || new Point(0, 0);
|
||||
|
||||
el.style[TRANSFORM] =
|
||||
(Browser.ie3d ?
|
||||
'translate(' + pos.x + 'px,' + pos.y + 'px)' :
|
||||
'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +
|
||||
(scale ? ' scale(' + scale + ')' : '');
|
||||
}
|
||||
|
||||
// @function setPosition(el: HTMLElement, position: Point)
|
||||
// Sets the position of `el` to coordinates specified by `position`,
|
||||
// using CSS translate or top/left positioning depending on the browser
|
||||
// (used by Leaflet internally to position its layers).
|
||||
export function setPosition(el, point) {
|
||||
|
||||
/*eslint-disable */
|
||||
el._leaflet_pos = point;
|
||||
/* eslint-enable */
|
||||
|
||||
if (Browser.any3d) {
|
||||
setTransform(el, point);
|
||||
} else {
|
||||
el.style.left = point.x + 'px';
|
||||
el.style.top = point.y + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
// @function getPosition(el: HTMLElement): Point
|
||||
// Returns the coordinates of an element previously positioned with setPosition.
|
||||
export function getPosition(el) {
|
||||
// this method is only used for elements previously positioned using setPosition,
|
||||
// so it's safe to cache the position for performance
|
||||
|
||||
return el._leaflet_pos || new Point(0, 0);
|
||||
}
|
||||
|
||||
// @function disableTextSelection()
|
||||
// Prevents the user from generating `selectstart` DOM events, usually generated
|
||||
// when the user drags the mouse through a page with text. Used internally
|
||||
// by Leaflet to override the behaviour of any click-and-drag interaction on
|
||||
// the map. Affects drag interactions on the whole document.
|
||||
|
||||
// @function enableTextSelection()
|
||||
// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).
|
||||
export var disableTextSelection;
|
||||
export var enableTextSelection;
|
||||
var _userSelect;
|
||||
if ('onselectstart' in document) {
|
||||
disableTextSelection = function () {
|
||||
DomEvent.on(window, 'selectstart', DomEvent.preventDefault);
|
||||
};
|
||||
enableTextSelection = function () {
|
||||
DomEvent.off(window, 'selectstart', DomEvent.preventDefault);
|
||||
};
|
||||
} else {
|
||||
var userSelectProperty = testProp(
|
||||
['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);
|
||||
|
||||
disableTextSelection = function () {
|
||||
if (userSelectProperty) {
|
||||
var style = document.documentElement.style;
|
||||
_userSelect = style[userSelectProperty];
|
||||
style[userSelectProperty] = 'none';
|
||||
}
|
||||
};
|
||||
enableTextSelection = function () {
|
||||
if (userSelectProperty) {
|
||||
document.documentElement.style[userSelectProperty] = _userSelect;
|
||||
_userSelect = undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// @function disableImageDrag()
|
||||
// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but
|
||||
// for `dragstart` DOM events, usually generated when the user drags an image.
|
||||
export function disableImageDrag() {
|
||||
DomEvent.on(window, 'dragstart', DomEvent.preventDefault);
|
||||
}
|
||||
|
||||
// @function enableImageDrag()
|
||||
// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).
|
||||
export function enableImageDrag() {
|
||||
DomEvent.off(window, 'dragstart', DomEvent.preventDefault);
|
||||
}
|
||||
|
||||
var _outlineElement, _outlineStyle;
|
||||
// @function preventOutline(el: HTMLElement)
|
||||
// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)
|
||||
// of the element `el` invisible. Used internally by Leaflet to prevent
|
||||
// focusable elements from displaying an outline when the user performs a
|
||||
// drag interaction on them.
|
||||
export function preventOutline(element) {
|
||||
while (element.tabIndex === -1) {
|
||||
element = element.parentNode;
|
||||
}
|
||||
if (!element.style) { return; }
|
||||
restoreOutline();
|
||||
_outlineElement = element;
|
||||
_outlineStyle = element.style.outline;
|
||||
element.style.outline = 'none';
|
||||
DomEvent.on(window, 'keydown', restoreOutline);
|
||||
}
|
||||
|
||||
// @function restoreOutline()
|
||||
// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().
|
||||
export function restoreOutline() {
|
||||
if (!_outlineElement) { return; }
|
||||
_outlineElement.style.outline = _outlineStyle;
|
||||
_outlineElement = undefined;
|
||||
_outlineStyle = undefined;
|
||||
DomEvent.off(window, 'keydown', restoreOutline);
|
||||
}
|
||||
|
||||
// @function getSizedParentNode(el: HTMLElement): HTMLElement
|
||||
// Finds the closest parent node which size (width and height) is not null.
|
||||
export function getSizedParentNode(element) {
|
||||
do {
|
||||
element = element.parentNode;
|
||||
} while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);
|
||||
return element;
|
||||
}
|
||||
|
||||
// @function getScale(el: HTMLElement): Object
|
||||
// Computes the CSS scale currently applied on the element.
|
||||
// Returns an object with `x` and `y` members as horizontal and vertical scales respectively,
|
||||
// and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
|
||||
export function getScale(element) {
|
||||
var rect = element.getBoundingClientRect(); // Read-only in old browsers.
|
||||
|
||||
return {
|
||||
x: rect.width / element.offsetWidth || 1,
|
||||
y: rect.height / element.offsetHeight || 1,
|
||||
boundingClientRect: rect
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
import {Evented} from '../core/Events';
|
||||
import * as Browser from '../core/Browser';
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as DomUtil from './DomUtil';
|
||||
import * as Util from '../core/Util';
|
||||
import {Point} from '../geometry/Point';
|
||||
|
||||
/*
|
||||
* @class Draggable
|
||||
* @aka L.Draggable
|
||||
* @inherits Evented
|
||||
*
|
||||
* A class for making DOM elements draggable (including touch support).
|
||||
* Used internally for map and marker dragging. Only works for elements
|
||||
* that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var draggable = new L.Draggable(elementToDrag);
|
||||
* draggable.enable();
|
||||
* ```
|
||||
*/
|
||||
|
||||
var START = Browser.touch ? 'touchstart mousedown' : 'mousedown';
|
||||
var END = {
|
||||
mousedown: 'mouseup',
|
||||
touchstart: 'touchend',
|
||||
pointerdown: 'touchend',
|
||||
MSPointerDown: 'touchend'
|
||||
};
|
||||
var MOVE = {
|
||||
mousedown: 'mousemove',
|
||||
touchstart: 'touchmove',
|
||||
pointerdown: 'touchmove',
|
||||
MSPointerDown: 'touchmove'
|
||||
};
|
||||
|
||||
|
||||
export var Draggable = Evented.extend({
|
||||
|
||||
options: {
|
||||
// @section
|
||||
// @aka Draggable options
|
||||
// @option clickTolerance: Number = 3
|
||||
// The max number of pixels a user can shift the mouse pointer during a click
|
||||
// for it to be considered a valid click (as opposed to a mouse drag).
|
||||
clickTolerance: 3
|
||||
},
|
||||
|
||||
// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
|
||||
// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
|
||||
initialize: function (element, dragStartTarget, preventOutline, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._element = element;
|
||||
this._dragStartTarget = dragStartTarget || element;
|
||||
this._preventOutline = preventOutline;
|
||||
},
|
||||
|
||||
// @method enable()
|
||||
// Enables the dragging ability
|
||||
enable: function () {
|
||||
if (this._enabled) { return; }
|
||||
|
||||
DomEvent.on(this._dragStartTarget, START, this._onDown, this);
|
||||
|
||||
this._enabled = true;
|
||||
},
|
||||
|
||||
// @method disable()
|
||||
// Disables the dragging ability
|
||||
disable: function () {
|
||||
if (!this._enabled) { return; }
|
||||
|
||||
// If we're currently dragging this draggable,
|
||||
// disabling it counts as first ending the drag.
|
||||
if (Draggable._dragging === this) {
|
||||
this.finishDrag();
|
||||
}
|
||||
|
||||
DomEvent.off(this._dragStartTarget, START, this._onDown, this);
|
||||
|
||||
this._enabled = false;
|
||||
this._moved = false;
|
||||
},
|
||||
|
||||
_onDown: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
|
||||
this._moved = false;
|
||||
|
||||
if (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }
|
||||
|
||||
if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
|
||||
Draggable._dragging = this; // Prevent dragging multiple objects at once.
|
||||
|
||||
if (this._preventOutline) {
|
||||
DomUtil.preventOutline(this._element);
|
||||
}
|
||||
|
||||
DomUtil.disableImageDrag();
|
||||
DomUtil.disableTextSelection();
|
||||
|
||||
if (this._moving) { return; }
|
||||
|
||||
// @event down: Event
|
||||
// Fired when a drag is about to start.
|
||||
this.fire('down');
|
||||
|
||||
var first = e.touches ? e.touches[0] : e,
|
||||
sizedParent = DomUtil.getSizedParentNode(this._element);
|
||||
|
||||
this._startPoint = new Point(first.clientX, first.clientY);
|
||||
|
||||
// Cache the scale, so that we can continuously compensate for it during drag (_onMove).
|
||||
this._parentScale = DomUtil.getScale(sizedParent);
|
||||
|
||||
DomEvent.on(document, MOVE[e.type], this._onMove, this);
|
||||
DomEvent.on(document, END[e.type], this._onUp, this);
|
||||
},
|
||||
|
||||
_onMove: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
|
||||
if (e.touches && e.touches.length > 1) {
|
||||
this._moved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),
|
||||
offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);
|
||||
|
||||
if (!offset.x && !offset.y) { return; }
|
||||
if (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }
|
||||
|
||||
// We assume that the parent container's position, border and scale do not change for the duration of the drag.
|
||||
// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)
|
||||
// and we can use the cached value for the scale.
|
||||
offset.x /= this._parentScale.x;
|
||||
offset.y /= this._parentScale.y;
|
||||
|
||||
DomEvent.preventDefault(e);
|
||||
|
||||
if (!this._moved) {
|
||||
// @event dragstart: Event
|
||||
// Fired when a drag starts
|
||||
this.fire('dragstart');
|
||||
|
||||
this._moved = true;
|
||||
this._startPos = DomUtil.getPosition(this._element).subtract(offset);
|
||||
|
||||
DomUtil.addClass(document.body, 'leaflet-dragging');
|
||||
|
||||
this._lastTarget = e.target || e.srcElement;
|
||||
// IE and Edge do not give the <use> element, so fetch it
|
||||
// if necessary
|
||||
if ((window.SVGElementInstance) && (this._lastTarget instanceof SVGElementInstance)) {
|
||||
this._lastTarget = this._lastTarget.correspondingUseElement;
|
||||
}
|
||||
DomUtil.addClass(this._lastTarget, 'leaflet-drag-target');
|
||||
}
|
||||
|
||||
this._newPos = this._startPos.add(offset);
|
||||
this._moving = true;
|
||||
|
||||
Util.cancelAnimFrame(this._animRequest);
|
||||
this._lastEvent = e;
|
||||
this._animRequest = Util.requestAnimFrame(this._updatePosition, this, true);
|
||||
},
|
||||
|
||||
_updatePosition: function () {
|
||||
var e = {originalEvent: this._lastEvent};
|
||||
|
||||
// @event predrag: Event
|
||||
// Fired continuously during dragging *before* each corresponding
|
||||
// update of the element's position.
|
||||
this.fire('predrag', e);
|
||||
DomUtil.setPosition(this._element, this._newPos);
|
||||
|
||||
// @event drag: Event
|
||||
// Fired continuously during dragging.
|
||||
this.fire('drag', e);
|
||||
},
|
||||
|
||||
_onUp: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
this.finishDrag();
|
||||
},
|
||||
|
||||
finishDrag: function () {
|
||||
DomUtil.removeClass(document.body, 'leaflet-dragging');
|
||||
|
||||
if (this._lastTarget) {
|
||||
DomUtil.removeClass(this._lastTarget, 'leaflet-drag-target');
|
||||
this._lastTarget = null;
|
||||
}
|
||||
|
||||
for (var i in MOVE) {
|
||||
DomEvent.off(document, MOVE[i], this._onMove, this);
|
||||
DomEvent.off(document, END[i], this._onUp, this);
|
||||
}
|
||||
|
||||
DomUtil.enableImageDrag();
|
||||
DomUtil.enableTextSelection();
|
||||
|
||||
if (this._moved && this._moving) {
|
||||
// ensure drag is not fired after dragend
|
||||
Util.cancelAnimFrame(this._animRequest);
|
||||
|
||||
// @event dragend: DragEndEvent
|
||||
// Fired when the drag ends.
|
||||
this.fire('dragend', {
|
||||
distance: this._newPos.distanceTo(this._startPos)
|
||||
});
|
||||
}
|
||||
|
||||
this._moving = false;
|
||||
Draggable._dragging = false;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,100 @@
|
||||
import * as Util from '../core/Util';
|
||||
import {Evented} from '../core/Events';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
|
||||
/*
|
||||
* @class PosAnimation
|
||||
* @aka L.PosAnimation
|
||||
* @inherits Evented
|
||||
* Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var fx = new L.PosAnimation();
|
||||
* fx.run(el, [300, 500], 0.5);
|
||||
* ```
|
||||
*
|
||||
* @constructor L.PosAnimation()
|
||||
* Creates a `PosAnimation` object.
|
||||
*
|
||||
*/
|
||||
|
||||
export var PosAnimation = Evented.extend({
|
||||
|
||||
// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
|
||||
// Run an animation of a given element to a new position, optionally setting
|
||||
// duration in seconds (`0.25` by default) and easing linearity factor (3rd
|
||||
// argument of the [cubic bezier curve](http://cubic-bezier.com/#0,0,.5,1),
|
||||
// `0.5` by default).
|
||||
run: function (el, newPos, duration, easeLinearity) {
|
||||
this.stop();
|
||||
|
||||
this._el = el;
|
||||
this._inProgress = true;
|
||||
this._duration = duration || 0.25;
|
||||
this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);
|
||||
|
||||
this._startPos = DomUtil.getPosition(el);
|
||||
this._offset = newPos.subtract(this._startPos);
|
||||
this._startTime = +new Date();
|
||||
|
||||
// @event start: Event
|
||||
// Fired when the animation starts
|
||||
this.fire('start');
|
||||
|
||||
this._animate();
|
||||
},
|
||||
|
||||
// @method stop()
|
||||
// Stops the animation (if currently running).
|
||||
stop: function () {
|
||||
if (!this._inProgress) { return; }
|
||||
|
||||
this._step(true);
|
||||
this._complete();
|
||||
},
|
||||
|
||||
_animate: function () {
|
||||
// animation loop
|
||||
this._animId = Util.requestAnimFrame(this._animate, this);
|
||||
this._step();
|
||||
},
|
||||
|
||||
_step: function (round) {
|
||||
var elapsed = (+new Date()) - this._startTime,
|
||||
duration = this._duration * 1000;
|
||||
|
||||
if (elapsed < duration) {
|
||||
this._runFrame(this._easeOut(elapsed / duration), round);
|
||||
} else {
|
||||
this._runFrame(1);
|
||||
this._complete();
|
||||
}
|
||||
},
|
||||
|
||||
_runFrame: function (progress, round) {
|
||||
var pos = this._startPos.add(this._offset.multiplyBy(progress));
|
||||
if (round) {
|
||||
pos._round();
|
||||
}
|
||||
DomUtil.setPosition(this._el, pos);
|
||||
|
||||
// @event step: Event
|
||||
// Fired continuously during the animation.
|
||||
this.fire('step');
|
||||
},
|
||||
|
||||
_complete: function () {
|
||||
Util.cancelAnimFrame(this._animId);
|
||||
|
||||
this._inProgress = false;
|
||||
// @event end: Event
|
||||
// Fired when the animation ends.
|
||||
this.fire('end');
|
||||
},
|
||||
|
||||
_easeOut: function (t) {
|
||||
return 1 - Math.pow(1 - t, this._easeOutPower);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
export {PosAnimation} from './PosAnimation';
|
||||
|
||||
import * as DomEvent from './DomEvent';
|
||||
export {DomEvent};
|
||||
|
||||
import * as DomUtil from './DomUtil';
|
||||
export {DomUtil};
|
||||
|
||||
export {Draggable} from './Draggable';
|
||||
@@ -0,0 +1,137 @@
|
||||
import * as Util from '../core/Util';
|
||||
import {Earth} from './crs/CRS.Earth';
|
||||
import {toLatLngBounds} from './LatLngBounds';
|
||||
|
||||
/* @class LatLng
|
||||
* @aka L.LatLng
|
||||
*
|
||||
* Represents a geographical point with a certain latitude and longitude.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```
|
||||
* var latlng = L.latLng(50.5, 30.5);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
|
||||
*
|
||||
* ```
|
||||
* map.panTo([50, 30]);
|
||||
* map.panTo({lon: 30, lat: 50});
|
||||
* map.panTo({lat: 50, lng: 30});
|
||||
* map.panTo(L.latLng(50, 30));
|
||||
* ```
|
||||
*
|
||||
* Note that `LatLng` does not inherit from Leaflet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function LatLng(lat, lng, alt) {
|
||||
if (isNaN(lat) || isNaN(lng)) {
|
||||
throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');
|
||||
}
|
||||
|
||||
// @property lat: Number
|
||||
// Latitude in degrees
|
||||
this.lat = +lat;
|
||||
|
||||
// @property lng: Number
|
||||
// Longitude in degrees
|
||||
this.lng = +lng;
|
||||
|
||||
// @property alt: Number
|
||||
// Altitude in meters (optional)
|
||||
if (alt !== undefined) {
|
||||
this.alt = +alt;
|
||||
}
|
||||
}
|
||||
|
||||
LatLng.prototype = {
|
||||
// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean
|
||||
// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.
|
||||
equals: function (obj, maxMargin) {
|
||||
if (!obj) { return false; }
|
||||
|
||||
obj = toLatLng(obj);
|
||||
|
||||
var margin = Math.max(
|
||||
Math.abs(this.lat - obj.lat),
|
||||
Math.abs(this.lng - obj.lng));
|
||||
|
||||
return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);
|
||||
},
|
||||
|
||||
// @method toString(): String
|
||||
// Returns a string representation of the point (for debugging purposes).
|
||||
toString: function (precision) {
|
||||
return 'LatLng(' +
|
||||
Util.formatNum(this.lat, precision) + ', ' +
|
||||
Util.formatNum(this.lng, precision) + ')';
|
||||
},
|
||||
|
||||
// @method distanceTo(otherLatLng: LatLng): Number
|
||||
// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).
|
||||
distanceTo: function (other) {
|
||||
return Earth.distance(this, toLatLng(other));
|
||||
},
|
||||
|
||||
// @method wrap(): LatLng
|
||||
// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.
|
||||
wrap: function () {
|
||||
return Earth.wrapLatLng(this);
|
||||
},
|
||||
|
||||
// @method toBounds(sizeInMeters: Number): LatLngBounds
|
||||
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
|
||||
toBounds: function (sizeInMeters) {
|
||||
var latAccuracy = 180 * sizeInMeters / 40075017,
|
||||
lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);
|
||||
|
||||
return toLatLngBounds(
|
||||
[this.lat - latAccuracy, this.lng - lngAccuracy],
|
||||
[this.lat + latAccuracy, this.lng + lngAccuracy]);
|
||||
},
|
||||
|
||||
clone: function () {
|
||||
return new LatLng(this.lat, this.lng, this.alt);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng
|
||||
// Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLng(coords: Array): LatLng
|
||||
// Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLng(coords: Object): LatLng
|
||||
// Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.
|
||||
|
||||
export function toLatLng(a, b, c) {
|
||||
if (a instanceof LatLng) {
|
||||
return a;
|
||||
}
|
||||
if (Util.isArray(a) && typeof a[0] !== 'object') {
|
||||
if (a.length === 3) {
|
||||
return new LatLng(a[0], a[1], a[2]);
|
||||
}
|
||||
if (a.length === 2) {
|
||||
return new LatLng(a[0], a[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (a === undefined || a === null) {
|
||||
return a;
|
||||
}
|
||||
if (typeof a === 'object' && 'lat' in a) {
|
||||
return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);
|
||||
}
|
||||
if (b === undefined) {
|
||||
return null;
|
||||
}
|
||||
return new LatLng(a, b, c);
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
import {LatLng, toLatLng} from './LatLng';
|
||||
|
||||
/*
|
||||
* @class LatLngBounds
|
||||
* @aka L.LatLngBounds
|
||||
*
|
||||
* Represents a rectangular geographical area on a map.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var corner1 = L.latLng(40.712, -74.227),
|
||||
* corner2 = L.latLng(40.774, -74.125),
|
||||
* bounds = L.latLngBounds(corner1, corner2);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
|
||||
*
|
||||
* ```js
|
||||
* map.fitBounds([
|
||||
* [40.712, -74.227],
|
||||
* [40.774, -74.125]
|
||||
* ]);
|
||||
* ```
|
||||
*
|
||||
* Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.
|
||||
*
|
||||
* Note that `LatLngBounds` does not inherit from Leafet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])
|
||||
if (!corner1) { return; }
|
||||
|
||||
var latlngs = corner2 ? [corner1, corner2] : corner1;
|
||||
|
||||
for (var i = 0, len = latlngs.length; i < len; i++) {
|
||||
this.extend(latlngs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
LatLngBounds.prototype = {
|
||||
|
||||
// @method extend(latlng: LatLng): this
|
||||
// Extend the bounds to contain the given point
|
||||
|
||||
// @alternative
|
||||
// @method extend(otherBounds: LatLngBounds): this
|
||||
// Extend the bounds to contain the given bounds
|
||||
extend: function (obj) {
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2, ne2;
|
||||
|
||||
if (obj instanceof LatLng) {
|
||||
sw2 = obj;
|
||||
ne2 = obj;
|
||||
|
||||
} else if (obj instanceof LatLngBounds) {
|
||||
sw2 = obj._southWest;
|
||||
ne2 = obj._northEast;
|
||||
|
||||
if (!sw2 || !ne2) { return this; }
|
||||
|
||||
} else {
|
||||
return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;
|
||||
}
|
||||
|
||||
if (!sw && !ne) {
|
||||
this._southWest = new LatLng(sw2.lat, sw2.lng);
|
||||
this._northEast = new LatLng(ne2.lat, ne2.lng);
|
||||
} else {
|
||||
sw.lat = Math.min(sw2.lat, sw.lat);
|
||||
sw.lng = Math.min(sw2.lng, sw.lng);
|
||||
ne.lat = Math.max(ne2.lat, ne.lat);
|
||||
ne.lng = Math.max(ne2.lng, ne.lng);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method pad(bufferRatio: Number): LatLngBounds
|
||||
// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
|
||||
// For example, a ratio of 0.5 extends the bounds by 50% in each direction.
|
||||
// Negative values will retract the bounds.
|
||||
pad: function (bufferRatio) {
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,
|
||||
widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;
|
||||
|
||||
return new LatLngBounds(
|
||||
new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),
|
||||
new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));
|
||||
},
|
||||
|
||||
// @method getCenter(): LatLng
|
||||
// Returns the center point of the bounds.
|
||||
getCenter: function () {
|
||||
return new LatLng(
|
||||
(this._southWest.lat + this._northEast.lat) / 2,
|
||||
(this._southWest.lng + this._northEast.lng) / 2);
|
||||
},
|
||||
|
||||
// @method getSouthWest(): LatLng
|
||||
// Returns the south-west point of the bounds.
|
||||
getSouthWest: function () {
|
||||
return this._southWest;
|
||||
},
|
||||
|
||||
// @method getNorthEast(): LatLng
|
||||
// Returns the north-east point of the bounds.
|
||||
getNorthEast: function () {
|
||||
return this._northEast;
|
||||
},
|
||||
|
||||
// @method getNorthWest(): LatLng
|
||||
// Returns the north-west point of the bounds.
|
||||
getNorthWest: function () {
|
||||
return new LatLng(this.getNorth(), this.getWest());
|
||||
},
|
||||
|
||||
// @method getSouthEast(): LatLng
|
||||
// Returns the south-east point of the bounds.
|
||||
getSouthEast: function () {
|
||||
return new LatLng(this.getSouth(), this.getEast());
|
||||
},
|
||||
|
||||
// @method getWest(): Number
|
||||
// Returns the west longitude of the bounds
|
||||
getWest: function () {
|
||||
return this._southWest.lng;
|
||||
},
|
||||
|
||||
// @method getSouth(): Number
|
||||
// Returns the south latitude of the bounds
|
||||
getSouth: function () {
|
||||
return this._southWest.lat;
|
||||
},
|
||||
|
||||
// @method getEast(): Number
|
||||
// Returns the east longitude of the bounds
|
||||
getEast: function () {
|
||||
return this._northEast.lng;
|
||||
},
|
||||
|
||||
// @method getNorth(): Number
|
||||
// Returns the north latitude of the bounds
|
||||
getNorth: function () {
|
||||
return this._northEast.lat;
|
||||
},
|
||||
|
||||
// @method contains(otherBounds: LatLngBounds): Boolean
|
||||
// Returns `true` if the rectangle contains the given one.
|
||||
|
||||
// @alternative
|
||||
// @method contains (latlng: LatLng): Boolean
|
||||
// Returns `true` if the rectangle contains the given point.
|
||||
contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean
|
||||
if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {
|
||||
obj = toLatLng(obj);
|
||||
} else {
|
||||
obj = toLatLngBounds(obj);
|
||||
}
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2, ne2;
|
||||
|
||||
if (obj instanceof LatLngBounds) {
|
||||
sw2 = obj.getSouthWest();
|
||||
ne2 = obj.getNorthEast();
|
||||
} else {
|
||||
sw2 = ne2 = obj;
|
||||
}
|
||||
|
||||
return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&
|
||||
(sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);
|
||||
},
|
||||
|
||||
// @method intersects(otherBounds: LatLngBounds): Boolean
|
||||
// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
|
||||
intersects: function (bounds) {
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2 = bounds.getSouthWest(),
|
||||
ne2 = bounds.getNorthEast(),
|
||||
|
||||
latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),
|
||||
lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);
|
||||
|
||||
return latIntersects && lngIntersects;
|
||||
},
|
||||
|
||||
// @method overlaps(otherBounds: Bounds): Boolean
|
||||
// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
|
||||
overlaps: function (bounds) {
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2 = bounds.getSouthWest(),
|
||||
ne2 = bounds.getNorthEast(),
|
||||
|
||||
latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),
|
||||
lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);
|
||||
|
||||
return latOverlaps && lngOverlaps;
|
||||
},
|
||||
|
||||
// @method toBBoxString(): String
|
||||
// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
|
||||
toBBoxString: function () {
|
||||
return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');
|
||||
},
|
||||
|
||||
// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean
|
||||
// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.
|
||||
equals: function (bounds, maxMargin) {
|
||||
if (!bounds) { return false; }
|
||||
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
return this._southWest.equals(bounds.getSouthWest(), maxMargin) &&
|
||||
this._northEast.equals(bounds.getNorthEast(), maxMargin);
|
||||
},
|
||||
|
||||
// @method isValid(): Boolean
|
||||
// Returns `true` if the bounds are properly initialized.
|
||||
isValid: function () {
|
||||
return !!(this._southWest && this._northEast);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO International date line?
|
||||
|
||||
// @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)
|
||||
// Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLngBounds(latlngs: LatLng[])
|
||||
// Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).
|
||||
export function toLatLngBounds(a, b) {
|
||||
if (a instanceof LatLngBounds) {
|
||||
return a;
|
||||
}
|
||||
return new LatLngBounds(a, b);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {Mercator} from '../projection/Projection.Mercator';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG3395
|
||||
*
|
||||
* Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
|
||||
*/
|
||||
export var EPSG3395 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:3395',
|
||||
projection: Mercator,
|
||||
|
||||
transformation: (function () {
|
||||
var scale = 0.5 / (Math.PI * Mercator.R);
|
||||
return toTransformation(scale, 0.5, -scale, 0.5);
|
||||
}())
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {SphericalMercator} from '../projection/Projection.SphericalMercator';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG3857
|
||||
*
|
||||
* The most common CRS for online maps, used by almost all free and commercial
|
||||
* tile providers. Uses Spherical Mercator projection. Set in by default in
|
||||
* Map's `crs` option.
|
||||
*/
|
||||
|
||||
export var EPSG3857 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:3857',
|
||||
projection: SphericalMercator,
|
||||
|
||||
transformation: (function () {
|
||||
var scale = 0.5 / (Math.PI * SphericalMercator.R);
|
||||
return toTransformation(scale, 0.5, -scale, 0.5);
|
||||
}())
|
||||
});
|
||||
|
||||
export var EPSG900913 = Util.extend({}, EPSG3857, {
|
||||
code: 'EPSG:900913'
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {LonLat} from '../projection/Projection.LonLat';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG4326
|
||||
*
|
||||
* A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
|
||||
*
|
||||
* Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic),
|
||||
* which is a breaking change from 0.7.x behaviour. If you are using a `TileLayer`
|
||||
* with this CRS, ensure that there are two 256x256 pixel tiles covering the
|
||||
* whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
|
||||
* or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.
|
||||
*/
|
||||
|
||||
export var EPSG4326 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:4326',
|
||||
projection: LonLat,
|
||||
transformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import {CRS} from './CRS';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.Earth
|
||||
*
|
||||
* Serves as the base for CRS that are global such that they cover the earth.
|
||||
* Can only be used as the base for other CRS and cannot be used directly,
|
||||
* since it does not have a `code`, `projection` or `transformation`. `distance()` returns
|
||||
* meters.
|
||||
*/
|
||||
|
||||
export var Earth = Util.extend({}, CRS, {
|
||||
wrapLng: [-180, 180],
|
||||
|
||||
// Mean Earth Radius, as recommended for use by
|
||||
// the International Union of Geodesy and Geophysics,
|
||||
// see http://rosettacode.org/wiki/Haversine_formula
|
||||
R: 6371000,
|
||||
|
||||
// distance between two geographical points using spherical law of cosines approximation
|
||||
distance: function (latlng1, latlng2) {
|
||||
var rad = Math.PI / 180,
|
||||
lat1 = latlng1.lat * rad,
|
||||
lat2 = latlng2.lat * rad,
|
||||
sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),
|
||||
sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),
|
||||
a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,
|
||||
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
return this.R * c;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import {CRS} from './CRS';
|
||||
import {LonLat} from '../projection/Projection.LonLat';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.Simple
|
||||
*
|
||||
* A simple CRS that maps longitude and latitude into `x` and `y` directly.
|
||||
* May be used for maps of flat surfaces (e.g. game maps). Note that the `y`
|
||||
* axis should still be inverted (going from bottom to top). `distance()` returns
|
||||
* simple euclidean distance.
|
||||
*/
|
||||
|
||||
export var Simple = Util.extend({}, CRS, {
|
||||
projection: LonLat,
|
||||
transformation: toTransformation(1, 0, -1, 0),
|
||||
|
||||
scale: function (zoom) {
|
||||
return Math.pow(2, zoom);
|
||||
},
|
||||
|
||||
zoom: function (scale) {
|
||||
return Math.log(scale) / Math.LN2;
|
||||
},
|
||||
|
||||
distance: function (latlng1, latlng2) {
|
||||
var dx = latlng2.lng - latlng1.lng,
|
||||
dy = latlng2.lat - latlng1.lat;
|
||||
|
||||
return Math.sqrt(dx * dx + dy * dy);
|
||||
},
|
||||
|
||||
infinite: true
|
||||
});
|
||||
@@ -0,0 +1,139 @@
|
||||
|
||||
import {Bounds} from '../../geometry/Bounds';
|
||||
import {LatLng} from '../LatLng';
|
||||
import {LatLngBounds} from '../LatLngBounds';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.Base
|
||||
* Object that defines coordinate reference systems for projecting
|
||||
* geographical points into pixel (screen) coordinates and back (and to
|
||||
* coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See
|
||||
* [spatial reference system](http://en.wikipedia.org/wiki/Coordinate_reference_system).
|
||||
*
|
||||
* Leaflet defines the most usual CRSs by default. If you want to use a
|
||||
* CRS not defined by default, take a look at the
|
||||
* [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.
|
||||
*
|
||||
* Note that the CRS instances do not inherit from Leafet's `Class` object,
|
||||
* and can't be instantiated. Also, new classes can't inherit from them,
|
||||
* and methods can't be added to them with the `include` function.
|
||||
*/
|
||||
|
||||
export var CRS = {
|
||||
// @method latLngToPoint(latlng: LatLng, zoom: Number): Point
|
||||
// Projects geographical coordinates into pixel coordinates for a given zoom.
|
||||
latLngToPoint: function (latlng, zoom) {
|
||||
var projectedPoint = this.projection.project(latlng),
|
||||
scale = this.scale(zoom);
|
||||
|
||||
return this.transformation._transform(projectedPoint, scale);
|
||||
},
|
||||
|
||||
// @method pointToLatLng(point: Point, zoom: Number): LatLng
|
||||
// The inverse of `latLngToPoint`. Projects pixel coordinates on a given
|
||||
// zoom into geographical coordinates.
|
||||
pointToLatLng: function (point, zoom) {
|
||||
var scale = this.scale(zoom),
|
||||
untransformedPoint = this.transformation.untransform(point, scale);
|
||||
|
||||
return this.projection.unproject(untransformedPoint);
|
||||
},
|
||||
|
||||
// @method project(latlng: LatLng): Point
|
||||
// Projects geographical coordinates into coordinates in units accepted for
|
||||
// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
|
||||
project: function (latlng) {
|
||||
return this.projection.project(latlng);
|
||||
},
|
||||
|
||||
// @method unproject(point: Point): LatLng
|
||||
// Given a projected coordinate returns the corresponding LatLng.
|
||||
// The inverse of `project`.
|
||||
unproject: function (point) {
|
||||
return this.projection.unproject(point);
|
||||
},
|
||||
|
||||
// @method scale(zoom: Number): Number
|
||||
// Returns the scale used when transforming projected coordinates into
|
||||
// pixel coordinates for a particular zoom. For example, it returns
|
||||
// `256 * 2^zoom` for Mercator-based CRS.
|
||||
scale: function (zoom) {
|
||||
return 256 * Math.pow(2, zoom);
|
||||
},
|
||||
|
||||
// @method zoom(scale: Number): Number
|
||||
// Inverse of `scale()`, returns the zoom level corresponding to a scale
|
||||
// factor of `scale`.
|
||||
zoom: function (scale) {
|
||||
return Math.log(scale / 256) / Math.LN2;
|
||||
},
|
||||
|
||||
// @method getProjectedBounds(zoom: Number): Bounds
|
||||
// Returns the projection's bounds scaled and transformed for the provided `zoom`.
|
||||
getProjectedBounds: function (zoom) {
|
||||
if (this.infinite) { return null; }
|
||||
|
||||
var b = this.projection.bounds,
|
||||
s = this.scale(zoom),
|
||||
min = this.transformation.transform(b.min, s),
|
||||
max = this.transformation.transform(b.max, s);
|
||||
|
||||
return new Bounds(min, max);
|
||||
},
|
||||
|
||||
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
|
||||
// Returns the distance between two geographical coordinates.
|
||||
|
||||
// @property code: String
|
||||
// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)
|
||||
//
|
||||
// @property wrapLng: Number[]
|
||||
// An array of two numbers defining whether the longitude (horizontal) coordinate
|
||||
// axis wraps around a given range and how. Defaults to `[-180, 180]` in most
|
||||
// geographical CRSs. If `undefined`, the longitude axis does not wrap around.
|
||||
//
|
||||
// @property wrapLat: Number[]
|
||||
// Like `wrapLng`, but for the latitude (vertical) axis.
|
||||
|
||||
// wrapLng: [min, max],
|
||||
// wrapLat: [min, max],
|
||||
|
||||
// @property infinite: Boolean
|
||||
// If true, the coordinate space will be unbounded (infinite in both axes)
|
||||
infinite: false,
|
||||
|
||||
// @method wrapLatLng(latlng: LatLng): LatLng
|
||||
// Returns a `LatLng` where lat and lng has been wrapped according to the
|
||||
// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.
|
||||
wrapLatLng: function (latlng) {
|
||||
var lng = this.wrapLng ? Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,
|
||||
lat = this.wrapLat ? Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,
|
||||
alt = latlng.alt;
|
||||
|
||||
return new LatLng(lat, lng, alt);
|
||||
},
|
||||
|
||||
// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
|
||||
// Returns a `LatLngBounds` with the same size as the given one, ensuring
|
||||
// that its center is within the CRS's bounds.
|
||||
// Only accepts actual `L.LatLngBounds` instances, not arrays.
|
||||
wrapLatLngBounds: function (bounds) {
|
||||
var center = bounds.getCenter(),
|
||||
newCenter = this.wrapLatLng(center),
|
||||
latShift = center.lat - newCenter.lat,
|
||||
lngShift = center.lng - newCenter.lng;
|
||||
|
||||
if (latShift === 0 && lngShift === 0) {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
var sw = bounds.getSouthWest(),
|
||||
ne = bounds.getNorthEast(),
|
||||
newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),
|
||||
newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);
|
||||
|
||||
return new LatLngBounds(newSw, newNe);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import {CRS} from './CRS';
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {EPSG3395} from './CRS.EPSG3395';
|
||||
import {EPSG3857, EPSG900913} from './CRS.EPSG3857';
|
||||
import {EPSG4326} from './CRS.EPSG4326';
|
||||
import {Simple} from './CRS.Simple';
|
||||
|
||||
CRS.Earth = Earth;
|
||||
CRS.EPSG3395 = EPSG3395;
|
||||
CRS.EPSG3857 = EPSG3857;
|
||||
CRS.EPSG900913 = EPSG900913;
|
||||
CRS.EPSG4326 = EPSG4326;
|
||||
CRS.Simple = Simple;
|
||||
|
||||
export {CRS};
|
||||
@@ -0,0 +1,7 @@
|
||||
export {LatLng, toLatLng as latLng} from './LatLng';
|
||||
export {LatLngBounds, toLatLngBounds as latLngBounds} from './LatLngBounds';
|
||||
|
||||
import * as Projection from './projection/index';
|
||||
export {Projection};
|
||||
|
||||
export * from './crs/index';
|
||||
@@ -0,0 +1,28 @@
|
||||
import {LatLng} from '../LatLng';
|
||||
import {Bounds} from '../../geometry/Bounds';
|
||||
import {Point} from '../../geometry/Point';
|
||||
|
||||
/*
|
||||
* @namespace Projection
|
||||
* @section
|
||||
* Leaflet comes with a set of already defined Projections out of the box:
|
||||
*
|
||||
* @projection L.Projection.LonLat
|
||||
*
|
||||
* Equirectangular, or Plate Carree projection — the most simple projection,
|
||||
* mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as
|
||||
* latitude. Also suitable for flat worlds, e.g. game maps. Used by the
|
||||
* `EPSG:4326` and `Simple` CRS.
|
||||
*/
|
||||
|
||||
export var LonLat = {
|
||||
project: function (latlng) {
|
||||
return new Point(latlng.lng, latlng.lat);
|
||||
},
|
||||
|
||||
unproject: function (point) {
|
||||
return new LatLng(point.y, point.x);
|
||||
},
|
||||
|
||||
bounds: new Bounds([-180, -90], [180, 90])
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
import {LatLng} from '../LatLng';
|
||||
import {Bounds} from '../../geometry/Bounds';
|
||||
import {Point} from '../../geometry/Point';
|
||||
|
||||
/*
|
||||
* @namespace Projection
|
||||
* @projection L.Projection.Mercator
|
||||
*
|
||||
* Elliptical Mercator projection — more complex than Spherical Mercator. Takes into account that Earth is a geoid, not a perfect sphere. Used by the EPSG:3395 CRS.
|
||||
*/
|
||||
|
||||
export var Mercator = {
|
||||
R: 6378137,
|
||||
R_MINOR: 6356752.314245179,
|
||||
|
||||
bounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),
|
||||
|
||||
project: function (latlng) {
|
||||
var d = Math.PI / 180,
|
||||
r = this.R,
|
||||
y = latlng.lat * d,
|
||||
tmp = this.R_MINOR / r,
|
||||
e = Math.sqrt(1 - tmp * tmp),
|
||||
con = e * Math.sin(y);
|
||||
|
||||
var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);
|
||||
y = -r * Math.log(Math.max(ts, 1E-10));
|
||||
|
||||
return new Point(latlng.lng * d * r, y);
|
||||
},
|
||||
|
||||
unproject: function (point) {
|
||||
var d = 180 / Math.PI,
|
||||
r = this.R,
|
||||
tmp = this.R_MINOR / r,
|
||||
e = Math.sqrt(1 - tmp * tmp),
|
||||
ts = Math.exp(-point.y / r),
|
||||
phi = Math.PI / 2 - 2 * Math.atan(ts);
|
||||
|
||||
for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {
|
||||
con = e * Math.sin(phi);
|
||||
con = Math.pow((1 - con) / (1 + con), e / 2);
|
||||
dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;
|
||||
phi += dphi;
|
||||
}
|
||||
|
||||
return new LatLng(phi * d, point.x * d / r);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
import {LatLng} from '../LatLng';
|
||||
import {Bounds} from '../../geometry/Bounds';
|
||||
import {Point} from '../../geometry/Point';
|
||||
|
||||
/*
|
||||
* @namespace Projection
|
||||
* @projection L.Projection.SphericalMercator
|
||||
*
|
||||
* Spherical Mercator projection — the most common projection for online maps,
|
||||
* used by almost all free and commercial tile providers. Assumes that Earth is
|
||||
* a sphere. Used by the `EPSG:3857` CRS.
|
||||
*/
|
||||
|
||||
export var SphericalMercator = {
|
||||
|
||||
R: 6378137,
|
||||
MAX_LATITUDE: 85.0511287798,
|
||||
|
||||
project: function (latlng) {
|
||||
var d = Math.PI / 180,
|
||||
max = this.MAX_LATITUDE,
|
||||
lat = Math.max(Math.min(max, latlng.lat), -max),
|
||||
sin = Math.sin(lat * d);
|
||||
|
||||
return new Point(
|
||||
this.R * latlng.lng * d,
|
||||
this.R * Math.log((1 + sin) / (1 - sin)) / 2);
|
||||
},
|
||||
|
||||
unproject: function (point) {
|
||||
var d = 180 / Math.PI;
|
||||
|
||||
return new LatLng(
|
||||
(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,
|
||||
point.x * d / this.R);
|
||||
},
|
||||
|
||||
bounds: (function () {
|
||||
var d = 6378137 * Math.PI;
|
||||
return new Bounds([-d, -d], [d, d]);
|
||||
})()
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* @class Projection
|
||||
|
||||
* An object with methods for projecting geographical coordinates of the world onto
|
||||
* a flat surface (and back). See [Map projection](http://en.wikipedia.org/wiki/Map_projection).
|
||||
|
||||
* @property bounds: Bounds
|
||||
* The bounds (specified in CRS units) where the projection is valid
|
||||
|
||||
* @method project(latlng: LatLng): Point
|
||||
* Projects geographical coordinates into a 2D point.
|
||||
* Only accepts actual `L.LatLng` instances, not arrays.
|
||||
|
||||
* @method unproject(point: Point): LatLng
|
||||
* The inverse of `project`. Projects a 2D point into a geographical location.
|
||||
* Only accepts actual `L.Point` instances, not arrays.
|
||||
|
||||
* Note that the projection instances do not inherit from Leafet's `Class` object,
|
||||
* and can't be instantiated. Also, new classes can't inherit from them,
|
||||
* and methods can't be added to them with the `include` function.
|
||||
|
||||
*/
|
||||
|
||||
export {LonLat} from './Projection.LonLat';
|
||||
export {Mercator} from './Projection.Mercator';
|
||||
export {SphericalMercator} from './Projection.SphericalMercator';
|
||||
@@ -0,0 +1,173 @@
|
||||
import {Point, toPoint} from './Point';
|
||||
|
||||
/*
|
||||
* @class Bounds
|
||||
* @aka L.Bounds
|
||||
*
|
||||
* Represents a rectangular area in pixel coordinates.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var p1 = L.point(10, 10),
|
||||
* p2 = L.point(40, 60),
|
||||
* bounds = L.bounds(p1, p2);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
|
||||
*
|
||||
* ```js
|
||||
* otherBounds.intersects([[10, 10], [40, 60]]);
|
||||
* ```
|
||||
*
|
||||
* Note that `Bounds` does not inherit from Leafet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function Bounds(a, b) {
|
||||
if (!a) { return; }
|
||||
|
||||
var points = b ? [a, b] : a;
|
||||
|
||||
for (var i = 0, len = points.length; i < len; i++) {
|
||||
this.extend(points[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Bounds.prototype = {
|
||||
// @method extend(point: Point): this
|
||||
// Extends the bounds to contain the given point.
|
||||
extend: function (point) { // (Point)
|
||||
point = toPoint(point);
|
||||
|
||||
// @property min: Point
|
||||
// The top left corner of the rectangle.
|
||||
// @property max: Point
|
||||
// The bottom right corner of the rectangle.
|
||||
if (!this.min && !this.max) {
|
||||
this.min = point.clone();
|
||||
this.max = point.clone();
|
||||
} else {
|
||||
this.min.x = Math.min(point.x, this.min.x);
|
||||
this.max.x = Math.max(point.x, this.max.x);
|
||||
this.min.y = Math.min(point.y, this.min.y);
|
||||
this.max.y = Math.max(point.y, this.max.y);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getCenter(round?: Boolean): Point
|
||||
// Returns the center point of the bounds.
|
||||
getCenter: function (round) {
|
||||
return new Point(
|
||||
(this.min.x + this.max.x) / 2,
|
||||
(this.min.y + this.max.y) / 2, round);
|
||||
},
|
||||
|
||||
// @method getBottomLeft(): Point
|
||||
// Returns the bottom-left point of the bounds.
|
||||
getBottomLeft: function () {
|
||||
return new Point(this.min.x, this.max.y);
|
||||
},
|
||||
|
||||
// @method getTopRight(): Point
|
||||
// Returns the top-right point of the bounds.
|
||||
getTopRight: function () { // -> Point
|
||||
return new Point(this.max.x, this.min.y);
|
||||
},
|
||||
|
||||
// @method getTopLeft(): Point
|
||||
// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).
|
||||
getTopLeft: function () {
|
||||
return this.min; // left, top
|
||||
},
|
||||
|
||||
// @method getBottomRight(): Point
|
||||
// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).
|
||||
getBottomRight: function () {
|
||||
return this.max; // right, bottom
|
||||
},
|
||||
|
||||
// @method getSize(): Point
|
||||
// Returns the size of the given bounds
|
||||
getSize: function () {
|
||||
return this.max.subtract(this.min);
|
||||
},
|
||||
|
||||
// @method contains(otherBounds: Bounds): Boolean
|
||||
// Returns `true` if the rectangle contains the given one.
|
||||
// @alternative
|
||||
// @method contains(point: Point): Boolean
|
||||
// Returns `true` if the rectangle contains the given point.
|
||||
contains: function (obj) {
|
||||
var min, max;
|
||||
|
||||
if (typeof obj[0] === 'number' || obj instanceof Point) {
|
||||
obj = toPoint(obj);
|
||||
} else {
|
||||
obj = toBounds(obj);
|
||||
}
|
||||
|
||||
if (obj instanceof Bounds) {
|
||||
min = obj.min;
|
||||
max = obj.max;
|
||||
} else {
|
||||
min = max = obj;
|
||||
}
|
||||
|
||||
return (min.x >= this.min.x) &&
|
||||
(max.x <= this.max.x) &&
|
||||
(min.y >= this.min.y) &&
|
||||
(max.y <= this.max.y);
|
||||
},
|
||||
|
||||
// @method intersects(otherBounds: Bounds): Boolean
|
||||
// Returns `true` if the rectangle intersects the given bounds. Two bounds
|
||||
// intersect if they have at least one point in common.
|
||||
intersects: function (bounds) { // (Bounds) -> Boolean
|
||||
bounds = toBounds(bounds);
|
||||
|
||||
var min = this.min,
|
||||
max = this.max,
|
||||
min2 = bounds.min,
|
||||
max2 = bounds.max,
|
||||
xIntersects = (max2.x >= min.x) && (min2.x <= max.x),
|
||||
yIntersects = (max2.y >= min.y) && (min2.y <= max.y);
|
||||
|
||||
return xIntersects && yIntersects;
|
||||
},
|
||||
|
||||
// @method overlaps(otherBounds: Bounds): Boolean
|
||||
// Returns `true` if the rectangle overlaps the given bounds. Two bounds
|
||||
// overlap if their intersection is an area.
|
||||
overlaps: function (bounds) { // (Bounds) -> Boolean
|
||||
bounds = toBounds(bounds);
|
||||
|
||||
var min = this.min,
|
||||
max = this.max,
|
||||
min2 = bounds.min,
|
||||
max2 = bounds.max,
|
||||
xOverlaps = (max2.x > min.x) && (min2.x < max.x),
|
||||
yOverlaps = (max2.y > min.y) && (min2.y < max.y);
|
||||
|
||||
return xOverlaps && yOverlaps;
|
||||
},
|
||||
|
||||
isValid: function () {
|
||||
return !!(this.min && this.max);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// @factory L.bounds(corner1: Point, corner2: Point)
|
||||
// Creates a Bounds object from two corners coordinate pairs.
|
||||
// @alternative
|
||||
// @factory L.bounds(points: Point[])
|
||||
// Creates a Bounds object from the given array of points.
|
||||
export function toBounds(a, b) {
|
||||
if (!a || a instanceof Bounds) {
|
||||
return a;
|
||||
}
|
||||
return new Bounds(a, b);
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
import {Point} from './Point';
|
||||
import * as Util from '../core/Util';
|
||||
|
||||
|
||||
/*
|
||||
* @namespace LineUtil
|
||||
*
|
||||
* Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.
|
||||
*/
|
||||
|
||||
// Simplify polyline with vertex reduction and Douglas-Peucker simplification.
|
||||
// Improves rendering performance dramatically by lessening the number of points to draw.
|
||||
|
||||
// @function simplify(points: Point[], tolerance: Number): Point[]
|
||||
// Dramatically reduces the number of points in a polyline while retaining
|
||||
// its shape and returns a new array of simplified points, using the
|
||||
// [Douglas-Peucker algorithm](http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm).
|
||||
// Used for a huge performance boost when processing/displaying Leaflet polylines for
|
||||
// each zoom level and also reducing visual noise. tolerance affects the amount of
|
||||
// simplification (lesser value means higher quality but slower and with more points).
|
||||
// Also released as a separated micro-library [Simplify.js](http://mourner.github.com/simplify-js/).
|
||||
export function simplify(points, tolerance) {
|
||||
if (!tolerance || !points.length) {
|
||||
return points.slice();
|
||||
}
|
||||
|
||||
var sqTolerance = tolerance * tolerance;
|
||||
|
||||
// stage 1: vertex reduction
|
||||
points = _reducePoints(points, sqTolerance);
|
||||
|
||||
// stage 2: Douglas-Peucker simplification
|
||||
points = _simplifyDP(points, sqTolerance);
|
||||
|
||||
return points;
|
||||
}
|
||||
|
||||
// @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number
|
||||
// Returns the distance between point `p` and segment `p1` to `p2`.
|
||||
export function pointToSegmentDistance(p, p1, p2) {
|
||||
return Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true));
|
||||
}
|
||||
|
||||
// @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number
|
||||
// Returns the closest point from a point `p` on a segment `p1` to `p2`.
|
||||
export function closestPointOnSegment(p, p1, p2) {
|
||||
return _sqClosestPointOnSegment(p, p1, p2);
|
||||
}
|
||||
|
||||
// Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm
|
||||
function _simplifyDP(points, sqTolerance) {
|
||||
|
||||
var len = points.length,
|
||||
ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,
|
||||
markers = new ArrayConstructor(len);
|
||||
|
||||
markers[0] = markers[len - 1] = 1;
|
||||
|
||||
_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);
|
||||
|
||||
var i,
|
||||
newPoints = [];
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (markers[i]) {
|
||||
newPoints.push(points[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return newPoints;
|
||||
}
|
||||
|
||||
function _simplifyDPStep(points, markers, sqTolerance, first, last) {
|
||||
|
||||
var maxSqDist = 0,
|
||||
index, i, sqDist;
|
||||
|
||||
for (i = first + 1; i <= last - 1; i++) {
|
||||
sqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true);
|
||||
|
||||
if (sqDist > maxSqDist) {
|
||||
index = i;
|
||||
maxSqDist = sqDist;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxSqDist > sqTolerance) {
|
||||
markers[index] = 1;
|
||||
|
||||
_simplifyDPStep(points, markers, sqTolerance, first, index);
|
||||
_simplifyDPStep(points, markers, sqTolerance, index, last);
|
||||
}
|
||||
}
|
||||
|
||||
// reduce points that are too close to each other to a single point
|
||||
function _reducePoints(points, sqTolerance) {
|
||||
var reducedPoints = [points[0]];
|
||||
|
||||
for (var i = 1, prev = 0, len = points.length; i < len; i++) {
|
||||
if (_sqDist(points[i], points[prev]) > sqTolerance) {
|
||||
reducedPoints.push(points[i]);
|
||||
prev = i;
|
||||
}
|
||||
}
|
||||
if (prev < len - 1) {
|
||||
reducedPoints.push(points[len - 1]);
|
||||
}
|
||||
return reducedPoints;
|
||||
}
|
||||
|
||||
var _lastCode;
|
||||
|
||||
// @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean
|
||||
// Clips the segment a to b by rectangular bounds with the
|
||||
// [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)
|
||||
// (modifying the segment points directly!). Used by Leaflet to only show polyline
|
||||
// points that are on the screen or near, increasing performance.
|
||||
export function clipSegment(a, b, bounds, useLastCode, round) {
|
||||
var codeA = useLastCode ? _lastCode : _getBitCode(a, bounds),
|
||||
codeB = _getBitCode(b, bounds),
|
||||
|
||||
codeOut, p, newCode;
|
||||
|
||||
// save 2nd code to avoid calculating it on the next segment
|
||||
_lastCode = codeB;
|
||||
|
||||
while (true) {
|
||||
// if a,b is inside the clip window (trivial accept)
|
||||
if (!(codeA | codeB)) {
|
||||
return [a, b];
|
||||
}
|
||||
|
||||
// if a,b is outside the clip window (trivial reject)
|
||||
if (codeA & codeB) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// other cases
|
||||
codeOut = codeA || codeB;
|
||||
p = _getEdgeIntersection(a, b, codeOut, bounds, round);
|
||||
newCode = _getBitCode(p, bounds);
|
||||
|
||||
if (codeOut === codeA) {
|
||||
a = p;
|
||||
codeA = newCode;
|
||||
} else {
|
||||
b = p;
|
||||
codeB = newCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function _getEdgeIntersection(a, b, code, bounds, round) {
|
||||
var dx = b.x - a.x,
|
||||
dy = b.y - a.y,
|
||||
min = bounds.min,
|
||||
max = bounds.max,
|
||||
x, y;
|
||||
|
||||
if (code & 8) { // top
|
||||
x = a.x + dx * (max.y - a.y) / dy;
|
||||
y = max.y;
|
||||
|
||||
} else if (code & 4) { // bottom
|
||||
x = a.x + dx * (min.y - a.y) / dy;
|
||||
y = min.y;
|
||||
|
||||
} else if (code & 2) { // right
|
||||
x = max.x;
|
||||
y = a.y + dy * (max.x - a.x) / dx;
|
||||
|
||||
} else if (code & 1) { // left
|
||||
x = min.x;
|
||||
y = a.y + dy * (min.x - a.x) / dx;
|
||||
}
|
||||
|
||||
return new Point(x, y, round);
|
||||
}
|
||||
|
||||
export function _getBitCode(p, bounds) {
|
||||
var code = 0;
|
||||
|
||||
if (p.x < bounds.min.x) { // left
|
||||
code |= 1;
|
||||
} else if (p.x > bounds.max.x) { // right
|
||||
code |= 2;
|
||||
}
|
||||
|
||||
if (p.y < bounds.min.y) { // bottom
|
||||
code |= 4;
|
||||
} else if (p.y > bounds.max.y) { // top
|
||||
code |= 8;
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
// square distance (to avoid unnecessary Math.sqrt calls)
|
||||
function _sqDist(p1, p2) {
|
||||
var dx = p2.x - p1.x,
|
||||
dy = p2.y - p1.y;
|
||||
return dx * dx + dy * dy;
|
||||
}
|
||||
|
||||
// return closest point on segment or distance to that point
|
||||
export function _sqClosestPointOnSegment(p, p1, p2, sqDist) {
|
||||
var x = p1.x,
|
||||
y = p1.y,
|
||||
dx = p2.x - x,
|
||||
dy = p2.y - y,
|
||||
dot = dx * dx + dy * dy,
|
||||
t;
|
||||
|
||||
if (dot > 0) {
|
||||
t = ((p.x - x) * dx + (p.y - y) * dy) / dot;
|
||||
|
||||
if (t > 1) {
|
||||
x = p2.x;
|
||||
y = p2.y;
|
||||
} else if (t > 0) {
|
||||
x += dx * t;
|
||||
y += dy * t;
|
||||
}
|
||||
}
|
||||
|
||||
dx = p.x - x;
|
||||
dy = p.y - y;
|
||||
|
||||
return sqDist ? dx * dx + dy * dy : new Point(x, y);
|
||||
}
|
||||
|
||||
|
||||
// @function isFlat(latlngs: LatLng[]): Boolean
|
||||
// Returns true if `latlngs` is a flat array, false is nested.
|
||||
export function isFlat(latlngs) {
|
||||
return !Util.isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');
|
||||
}
|
||||
|
||||
export function _flat(latlngs) {
|
||||
console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');
|
||||
return isFlat(latlngs);
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
import {isArray, formatNum} from '../core/Util';
|
||||
|
||||
/*
|
||||
* @class Point
|
||||
* @aka L.Point
|
||||
*
|
||||
* Represents a point with `x` and `y` coordinates in pixels.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var point = L.point(200, 300);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
|
||||
*
|
||||
* ```js
|
||||
* map.panBy([200, 300]);
|
||||
* map.panBy(L.point(200, 300));
|
||||
* ```
|
||||
*
|
||||
* Note that `Point` does not inherit from Leafet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function Point(x, y, round) {
|
||||
// @property x: Number; The `x` coordinate of the point
|
||||
this.x = (round ? Math.round(x) : x);
|
||||
// @property y: Number; The `y` coordinate of the point
|
||||
this.y = (round ? Math.round(y) : y);
|
||||
}
|
||||
|
||||
var trunc = Math.trunc || function (v) {
|
||||
return v > 0 ? Math.floor(v) : Math.ceil(v);
|
||||
};
|
||||
|
||||
Point.prototype = {
|
||||
|
||||
// @method clone(): Point
|
||||
// Returns a copy of the current point.
|
||||
clone: function () {
|
||||
return new Point(this.x, this.y);
|
||||
},
|
||||
|
||||
// @method add(otherPoint: Point): Point
|
||||
// Returns the result of addition of the current and the given points.
|
||||
add: function (point) {
|
||||
// non-destructive, returns a new point
|
||||
return this.clone()._add(toPoint(point));
|
||||
},
|
||||
|
||||
_add: function (point) {
|
||||
// destructive, used directly for performance in situations where it's safe to modify existing point
|
||||
this.x += point.x;
|
||||
this.y += point.y;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method subtract(otherPoint: Point): Point
|
||||
// Returns the result of subtraction of the given point from the current.
|
||||
subtract: function (point) {
|
||||
return this.clone()._subtract(toPoint(point));
|
||||
},
|
||||
|
||||
_subtract: function (point) {
|
||||
this.x -= point.x;
|
||||
this.y -= point.y;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method divideBy(num: Number): Point
|
||||
// Returns the result of division of the current point by the given number.
|
||||
divideBy: function (num) {
|
||||
return this.clone()._divideBy(num);
|
||||
},
|
||||
|
||||
_divideBy: function (num) {
|
||||
this.x /= num;
|
||||
this.y /= num;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method multiplyBy(num: Number): Point
|
||||
// Returns the result of multiplication of the current point by the given number.
|
||||
multiplyBy: function (num) {
|
||||
return this.clone()._multiplyBy(num);
|
||||
},
|
||||
|
||||
_multiplyBy: function (num) {
|
||||
this.x *= num;
|
||||
this.y *= num;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method scaleBy(scale: Point): Point
|
||||
// Multiply each coordinate of the current point by each coordinate of
|
||||
// `scale`. In linear algebra terms, multiply the point by the
|
||||
// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)
|
||||
// defined by `scale`.
|
||||
scaleBy: function (point) {
|
||||
return new Point(this.x * point.x, this.y * point.y);
|
||||
},
|
||||
|
||||
// @method unscaleBy(scale: Point): Point
|
||||
// Inverse of `scaleBy`. Divide each coordinate of the current point by
|
||||
// each coordinate of `scale`.
|
||||
unscaleBy: function (point) {
|
||||
return new Point(this.x / point.x, this.y / point.y);
|
||||
},
|
||||
|
||||
// @method round(): Point
|
||||
// Returns a copy of the current point with rounded coordinates.
|
||||
round: function () {
|
||||
return this.clone()._round();
|
||||
},
|
||||
|
||||
_round: function () {
|
||||
this.x = Math.round(this.x);
|
||||
this.y = Math.round(this.y);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method floor(): Point
|
||||
// Returns a copy of the current point with floored coordinates (rounded down).
|
||||
floor: function () {
|
||||
return this.clone()._floor();
|
||||
},
|
||||
|
||||
_floor: function () {
|
||||
this.x = Math.floor(this.x);
|
||||
this.y = Math.floor(this.y);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method ceil(): Point
|
||||
// Returns a copy of the current point with ceiled coordinates (rounded up).
|
||||
ceil: function () {
|
||||
return this.clone()._ceil();
|
||||
},
|
||||
|
||||
_ceil: function () {
|
||||
this.x = Math.ceil(this.x);
|
||||
this.y = Math.ceil(this.y);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method trunc(): Point
|
||||
// Returns a copy of the current point with truncated coordinates (rounded towards zero).
|
||||
trunc: function () {
|
||||
return this.clone()._trunc();
|
||||
},
|
||||
|
||||
_trunc: function () {
|
||||
this.x = trunc(this.x);
|
||||
this.y = trunc(this.y);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method distanceTo(otherPoint: Point): Number
|
||||
// Returns the cartesian distance between the current and the given points.
|
||||
distanceTo: function (point) {
|
||||
point = toPoint(point);
|
||||
|
||||
var x = point.x - this.x,
|
||||
y = point.y - this.y;
|
||||
|
||||
return Math.sqrt(x * x + y * y);
|
||||
},
|
||||
|
||||
// @method equals(otherPoint: Point): Boolean
|
||||
// Returns `true` if the given point has the same coordinates.
|
||||
equals: function (point) {
|
||||
point = toPoint(point);
|
||||
|
||||
return point.x === this.x &&
|
||||
point.y === this.y;
|
||||
},
|
||||
|
||||
// @method contains(otherPoint: Point): Boolean
|
||||
// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
|
||||
contains: function (point) {
|
||||
point = toPoint(point);
|
||||
|
||||
return Math.abs(point.x) <= Math.abs(this.x) &&
|
||||
Math.abs(point.y) <= Math.abs(this.y);
|
||||
},
|
||||
|
||||
// @method toString(): String
|
||||
// Returns a string representation of the point for debugging purposes.
|
||||
toString: function () {
|
||||
return 'Point(' +
|
||||
formatNum(this.x) + ', ' +
|
||||
formatNum(this.y) + ')';
|
||||
}
|
||||
};
|
||||
|
||||
// @factory L.point(x: Number, y: Number, round?: Boolean)
|
||||
// Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.
|
||||
|
||||
// @alternative
|
||||
// @factory L.point(coords: Number[])
|
||||
// Expects an array of the form `[x, y]` instead.
|
||||
|
||||
// @alternative
|
||||
// @factory L.point(coords: Object)
|
||||
// Expects a plain object of the form `{x: Number, y: Number}` instead.
|
||||
export function toPoint(x, y, round) {
|
||||
if (x instanceof Point) {
|
||||
return x;
|
||||
}
|
||||
if (isArray(x)) {
|
||||
return new Point(x[0], x[1]);
|
||||
}
|
||||
if (x === undefined || x === null) {
|
||||
return x;
|
||||
}
|
||||
if (typeof x === 'object' && 'x' in x && 'y' in x) {
|
||||
return new Point(x.x, x.y);
|
||||
}
|
||||
return new Point(x, y, round);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import * as LineUtil from './LineUtil';
|
||||
|
||||
/*
|
||||
* @namespace PolyUtil
|
||||
* Various utility functions for polygon geometries.
|
||||
*/
|
||||
|
||||
/* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]
|
||||
* Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)).
|
||||
* Used by Leaflet to only show polygon points that are on the screen or near, increasing
|
||||
* performance. Note that polygon points needs different algorithm for clipping
|
||||
* than polyline, so there's a separate method for it.
|
||||
*/
|
||||
export function clipPolygon(points, bounds, round) {
|
||||
var clippedPoints,
|
||||
edges = [1, 4, 2, 8],
|
||||
i, j, k,
|
||||
a, b,
|
||||
len, edge, p;
|
||||
|
||||
for (i = 0, len = points.length; i < len; i++) {
|
||||
points[i]._code = LineUtil._getBitCode(points[i], bounds);
|
||||
}
|
||||
|
||||
// for each edge (left, bottom, right, top)
|
||||
for (k = 0; k < 4; k++) {
|
||||
edge = edges[k];
|
||||
clippedPoints = [];
|
||||
|
||||
for (i = 0, len = points.length, j = len - 1; i < len; j = i++) {
|
||||
a = points[i];
|
||||
b = points[j];
|
||||
|
||||
// if a is inside the clip window
|
||||
if (!(a._code & edge)) {
|
||||
// if b is outside the clip window (a->b goes out of screen)
|
||||
if (b._code & edge) {
|
||||
p = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);
|
||||
p._code = LineUtil._getBitCode(p, bounds);
|
||||
clippedPoints.push(p);
|
||||
}
|
||||
clippedPoints.push(a);
|
||||
|
||||
// else if b is inside the clip window (a->b enters the screen)
|
||||
} else if (!(b._code & edge)) {
|
||||
p = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);
|
||||
p._code = LineUtil._getBitCode(p, bounds);
|
||||
clippedPoints.push(p);
|
||||
}
|
||||
}
|
||||
points = clippedPoints;
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import {Point} from './Point';
|
||||
import * as Util from '../core/Util';
|
||||
|
||||
/*
|
||||
* @class Transformation
|
||||
* @aka L.Transformation
|
||||
*
|
||||
* Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`
|
||||
* for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing
|
||||
* the reverse. Used by Leaflet in its projections code.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var transformation = L.transformation(2, 5, -1, 10),
|
||||
* p = L.point(1, 2),
|
||||
* p2 = transformation.transform(p), // L.point(7, 8)
|
||||
* p3 = transformation.untransform(p2); // L.point(1, 2)
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
// factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)
|
||||
// Creates a `Transformation` object with the given coefficients.
|
||||
export function Transformation(a, b, c, d) {
|
||||
if (Util.isArray(a)) {
|
||||
// use array properties
|
||||
this._a = a[0];
|
||||
this._b = a[1];
|
||||
this._c = a[2];
|
||||
this._d = a[3];
|
||||
return;
|
||||
}
|
||||
this._a = a;
|
||||
this._b = b;
|
||||
this._c = c;
|
||||
this._d = d;
|
||||
}
|
||||
|
||||
Transformation.prototype = {
|
||||
// @method transform(point: Point, scale?: Number): Point
|
||||
// Returns a transformed point, optionally multiplied by the given scale.
|
||||
// Only accepts actual `L.Point` instances, not arrays.
|
||||
transform: function (point, scale) { // (Point, Number) -> Point
|
||||
return this._transform(point.clone(), scale);
|
||||
},
|
||||
|
||||
// destructive transform (faster)
|
||||
_transform: function (point, scale) {
|
||||
scale = scale || 1;
|
||||
point.x = scale * (this._a * point.x + this._b);
|
||||
point.y = scale * (this._c * point.y + this._d);
|
||||
return point;
|
||||
},
|
||||
|
||||
// @method untransform(point: Point, scale?: Number): Point
|
||||
// Returns the reverse transformation of the given point, optionally divided
|
||||
// by the given scale. Only accepts actual `L.Point` instances, not arrays.
|
||||
untransform: function (point, scale) {
|
||||
scale = scale || 1;
|
||||
return new Point(
|
||||
(point.x / scale - this._b) / this._a,
|
||||
(point.y / scale - this._d) / this._c);
|
||||
}
|
||||
};
|
||||
|
||||
// factory L.transformation(a: Number, b: Number, c: Number, d: Number)
|
||||
|
||||
// @factory L.transformation(a: Number, b: Number, c: Number, d: Number)
|
||||
// Instantiates a Transformation object with the given coefficients.
|
||||
|
||||
// @alternative
|
||||
// @factory L.transformation(coefficients: Array): Transformation
|
||||
// Expects an coefficients array of the form
|
||||
// `[a: Number, b: Number, c: Number, d: Number]`.
|
||||
|
||||
export function toTransformation(a, b, c, d) {
|
||||
return new Transformation(a, b, c, d);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export {Point, toPoint as point} from './Point';
|
||||
export {Bounds, toBounds as bounds} from './Bounds';
|
||||
export {Transformation, toTransformation as transformation} from './Transformation';
|
||||
|
||||
import * as LineUtil from './LineUtil';
|
||||
export {LineUtil};
|
||||
import * as PolyUtil from './PolyUtil';
|
||||
export {PolyUtil};
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="26" width="26"><path d="M.032 17.056l13-8 13 8-13 8-13-8" fill="#b9b9b9"/><path d="M.032 17.056l-.032.93 13 8 13-8 .032-.93-13 8z" fill="#737373"/><path d="M0 13.076l13-8 13 8-13 8-13-8" fill="#cdcdcd"/><path d="M0 13.076v.91l13 8 13-8v-.91l-13 8z" fill="#737373"/><path d="M0 8.986l13-8 13 8-13 8-13-8" fill-opacity=".585" stroke="#797979" stroke-width=".1" fill="#e9e9e9"/><path d="M0 8.986v1l13 8 13-8v-1l-13 8z" fill="#737373"/></svg>
|
||||
|
After Width: | Height: | Size: 486 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="909.493" height="241.328"><path fill="#6f6f6e" d="M138.146 154.633c-16.973 17.26-34.34 25.89-52.1 25.89-5.156 0-10.116-.665-14.878-1.99-4.764-1.323-10.564-3.56-17.402-6.712-6.84-3.15-12.874-5.44-18.1-6.87-9.67 10.6-18.407 15.9-26.212 15.9-2.723 0-4.98-.89-6.768-2.68C.896 176.37 0 174.19 0 171.61c0-5.44 2.667-10.225 8.003-14.34 5.334-4.12 12.872-6.967 22.612-8.54 4.082-5.59 6.695-11.05 7.842-16.386 1.145-5.33 2.04-14.12 2.686-26.37 1.217-25.203 7.966-44.952 20.25-59.24 12.28-14.286 25.62-21.43 40.014-21.43 9.883 0 17.993 3.134 24.33 9.4 6.34 6.267 9.508 14.27 9.508 24.01 0 11.242-3.33 21.09-9.99 29.54s-14.324 12.675-22.988 12.675c-4.512 0-8.057-1.24-10.635-3.71-2.578-2.47-3.867-5.86-3.867-10.15 0-2.22.43-4.8 1.29-7.74 1.933 2.22 4.366 3.33 7.304 3.33 4.86 0 9.13-2.9 12.78-8.7 3.65-5.8 5.48-12.71 5.48-20.74 0-6.16-1.4-11.01-4.19-14.56-2.79-3.55-6.62-5.32-11.48-5.32-5.87 0-10.43 2.11-13.69 6.34s-5.53 9.272-6.82 15.15c-1.29 5.87-2.66 15.36-4.12 28.47-1.46 13.1-3.89 24.72-7.3 34.852-3.42 10.13-9.79 20.065-19.13 29.8 6.09-.43 11.37-.07 15.84 1.08 4.47 1.143 10.88 3.31 19.23 6.495 8.34 3.19 15.52 4.78 21.53 4.78 11.74 0 22.95-6.01 33.62-18.04v12.35zm80.244 0c-9.096 8.953-17.26 15.56-24.492 19.818-7.234 4.26-15.22 6.4-23.955 6.4-9.74 0-17.6-3.11-23.58-9.34-5.98-6.23-8.97-14.43-8.97-24.6 0-15.18 5.265-28.91 15.792-41.19 10.527-12.28 22.2-18.42 35.02-18.42 6.66 0 11.994 1.72 16.006 5.16 4.01 3.44 6.02 7.95 6.02 13.54 0 14.83-15.75 26.86-47.26 36.1 2.87 13.97 10.35 20.95 22.45 20.95 4.73 0 9.24-1.27 13.54-3.81 4.3-2.54 10.78-8.18 19.45-16.92v12.36zM162.1 134.76c18.333-5.156 27.5-14.68 27.5-28.575 0-6.875-2.507-10.313-7.52-10.313-4.726 0-9.237 3.6-13.534 10.796-4.297 7.197-6.445 16.562-6.445 28.092zm171.017 19.873c-11.46 10.887-19.658 17.977-24.6 21.27-4.942 3.293-9.668 4.94-14.18 4.94-11.316 0-16.65-9.99-16.006-29.97-7.16 10.242-13.76 17.797-19.81 22.666-6.05 4.86-12.3 7.3-18.74 7.3-6.3 0-11.65-2.96-16.06-8.87-4.4-5.91-6.6-13.16-6.6-21.75 0-10.75 2.96-20.99 8.87-30.73 5.91-9.74 13.48-17.62 22.72-23.64 9.24-6.02 17.4-9.03 24.49-9.03 8.95 0 15.22 4.12 18.8 12.35l21.96-12.14h6.03l-9.47 31.48c-4.88 15.83-7.32 26.68-7.32 32.55 0 6.15 2.18 9.23 6.55 9.23 2.79 0 5.87-1.49 9.23-4.46 3.36-2.97 8.09-7.5 14.17-13.59v12.36zm-78.633 5.908c7.16 0 13.91-6.1 20.25-18.31 6.337-12.21 9.506-23.47 9.506-33.78 0-4.01-.896-7.14-2.686-9.4-1.79-2.25-4.19-3.38-7.197-3.38-7.162 0-13.948 6.09-20.356 18.27-6.41 12.18-9.61 23.39-9.61 33.63 0 3.87.95 7 2.85 9.4 1.9 2.4 4.31 3.6 7.25 3.6zm165.752-5.9c-7.44 8.38-14.808 14.84-22.104 19.39-7.296 4.55-13.806 6.82-19.53 6.82-2.718 0-6.437-1.03-11.157-3.1-3.02 15.75-5.682 32.76-7.983 51.01-7.456 1.01-16.417 2.55-26.882 4.63 2.29-19.62 6.266-45.08 11.922-76.37-.79-1.36-2.186-4.79-4.19-10.31l-7.195 7.95h-2.47v-9.67l20.478-21.23c3.892-19.21 7.056-33.12 9.492-41.71 2.434-8.59 5.836-18.1 10.205-28.52 4.367-10.42 7.125-16.4 8.27-17.94 1.146-1.54 3.922-3.01 8.326-4.4 4.404-1.39 9.112-2.72 14.126-3.97 5.012-1.25 7.697-1.88 8.057-1.88 2.73 0 4.95 1.77 6.66 5.32 1.72 3.54 2.58 8.21 2.58 14.007 0 10.02-2.64 19.677-7.93 28.977s-15.29 20.74-30 34.334l-9.03 44.9c3.5 7.51 8.76 11.267 15.76 11.267 10.01 0 20.88-7.27 32.6-21.81v12.357zM384.16 93.41c8.372-7.305 14.937-15.164 19.698-23.58 4.76-8.415 7.14-16.168 7.14-23.26 0-3.007-.554-5.478-1.66-7.41-1.107-1.935-2.48-2.9-4.122-2.9-3.142 0-6.338 4.12-9.586 12.36-3.25 8.24-7.073 23.17-11.47 44.79zm107.082 61.23c-9.74 8.95-18.28 15.56-25.62 19.816-7.342 4.26-14.34 6.395-21 6.395-7.665 0-13.842-2.97-18.53-8.91-4.692-5.94-7.037-13.93-7.037-23.95 0-15.04 3.258-33.08 9.775-54.14 6.516-21.05 14.43-40.46 23.74-58.22l27.285-10.1c.86-.28 1.504-.43 1.934-.43 2.07 0 3.77 1.53 5.1 4.57 1.32 3.05 1.98 7.15 1.98 12.3 0 14.61-3.37 28.76-10.1 42.44-6.73 13.68-17.26 28.29-31.58 43.83-.58 7.45-.86 12.57-.86 15.36 0 6.23 1.14 11.17 3.44 14.83 2.29 3.65 5.33 5.48 9.13 5.48 3.87 0 7.98-1.4 12.35-4.19 4.36-2.79 11.02-8.59 19.98-17.4v12.356zM450.1 112.63c9.093-10.11 16.47-21.442 22.128-33.994 5.656-12.55 8.486-23.342 8.486-32.38 0-2.653-.395-4.786-1.182-6.4-.79-1.614-1.79-2.42-3.008-2.42-2.65 0-6.5 6.597-11.548 19.793-5.048 13.19-10.008 31.66-14.877 55.4zm121.493 42.003c-9.096 8.953-17.26 15.56-24.492 19.818-7.23 4.26-15.21 6.4-23.95 6.4-9.74 0-17.6-3.11-23.58-9.34-5.98-6.23-8.97-14.43-8.97-24.6 0-15.18 5.27-28.91 15.79-41.19 10.53-12.28 22.2-18.42 35.02-18.42 6.66 0 12 1.72 16.01 5.16 4.01 3.44 6.02 7.95 6.02 13.54 0 14.83-15.75 26.86-47.26 36.1 2.87 13.97 10.35 20.95 22.45 20.95 4.73 0 9.24-1.27 13.54-3.81 4.3-2.54 10.78-8.18 19.45-16.92v12.36zm-56.29-19.873c18.333-5.156 27.5-14.68 27.5-28.575 0-6.875-2.507-10.313-7.52-10.313-4.726 0-9.237 3.6-13.534 10.796-4.3 7.197-6.45 16.562-6.45 28.092zm118.165 19.873c-9.023 8.953-16.83 15.56-23.418 19.818-6.59 4.26-12.855 6.4-18.8 6.4-6.16 0-11.154-2.59-14.984-7.79-3.832-5.19-5.747-12.01-5.747-20.46 0-7.44 1.83-17.28 5.51-29.5l4.56-16.26-8.25.43 3.44-16.86 10.21-.43 10.08-33.52 28.69-5.89-11.1 37.36 15.17-.86Line truncated
|
||||
|
After Width: | Height: | Size: 7.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="744.094" height="1052.362"><defs><linearGradient id="b"><stop offset="0" stop-color="#2e6c97"/><stop offset="1" stop-color="#3883b7"/></linearGradient><linearGradient id="a"><stop offset="0" stop-color="#126fc6"/><stop offset="1" stop-color="#4c9cd1"/></linearGradient><linearGradient xlink:href="#a" x1="351.138" y1="551.589" x2="351.138" y2="512.928" gradientUnits="userSpaceOnUse" gradientTransform="translate(-2.715)"/><linearGradient xlink:href="#a" x1="318.571" y1="550.052" x2="318.571" y2="512.422" gradientUnits="userSpaceOnUse" gradientTransform="translate(94.732 2.054)"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1 0 0 1 731.268 2.054)" x1="318.571" y1="550.052" x2="318.571" y2="512.422"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(94.232 2.054)" x1="318.571" y1="550.052" x2="318.571" y2="512.422"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/><linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/><linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/><linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/><linearGradient xlink:href="#a" id="c" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.846 -.287)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/><linearGradient xlink:href="#b" id="d" gradientUnits="userSpaceOnUse" gradientTransform="translate(62.734 -.288)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/><linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.846 -.287)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/><linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(62.734 -.288)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/></defs><image y="502.237" x="369.375" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABHNCSVQICAgIfAhkiAAABgRJREFU WIWdl2uIXGcZx3/nOjNnZueWZlPUtgiKF2gRugWD9UswJfWD+MG7WC1SQcGP6ZdAkvpp28LK0ohQ qASE0tKgELtaGiwEi0EWKXFtbKRmQ2wys5nZy8ycM+f+Pn6YvZ2dmd2J7/DAYc77vL/3/1zel6PN PPcn7mF8CqhsPl8H3MXTJw500mae++N+7+vAj4ATwHHbstANDYAoSlBKNYGLwKuLp5+8PB5ydiTE AE4Cp+q1cqlYLFB08kOTkiTF9Xy6XY++H7wFPLt45smlEZCFUbt/rVYpH6/VylimSZgqvChFJDvR NnWmbAOAjU6PldaqDzy1eOarF3bP00WEXVYXkb/Wq5Xjh++rk4hO24vpBSlKgUjWwljR9mJW+zGV 8hSf+NiRQqnovDFzduGnGcieEL1Rr1U/Uz9UY91P6IUpSjjQUgUtL8bO5anVqwAvzZxdOLYD2dna yUp56litXmO9nxClMnJBU9eQMbDVfoJl2Rw5Mm0g8trMmTfrg3AhCFIX5FS5UqUfKqJEUIptyxs6 tYJFrWBha0J187mSNzPzlIJWL8ZxilSq1cOCnNxUAgjfK09VSoZh4oZpJu51x8I2NNZWV7m5vIze X+Pm8g1WVlYIg4C6YwHZXHlhSqVSBeEnj57+g2Fulsy3nWKJMFGoXRVUyZuEQUiz8RFPf/nTPPX4 FynlB4u+vXSbFxaWCPNlapUqbS/e9vMiRcGyyOdy9SAIjuqClAQ5att5Ov00I93QNDqdDU597RF+ 9pXPbgMAnnj44/zmmcfxe+ukiSJn6EOhyxUcBDmhI/KgZVqGEkh3JdEydMIoYrqg+PqjD+3tJUSE B+pFvvHYQ3S7HfKWkSmCfqwwTRtEPq+LSF3T9aFKyZk6QeDz8AO1kQAApRRfeLCG73tDFZcoAU1H RComIpEoNUia2llIpYBAnKixABEhiFM0TRvy10RDDTrY10Fup0k8tBMvSrHzRRb/c5c4HQZtQf7y wR1y+RLJnr4yNI00SQC5rYtIM0liN1UKTdO2JwWJoOkmrspz7u33h1QAXPl3g0sfrJMvVugG2dNB 1zXiOEJEbhn3f+mbAjxmWIXPlQoFvFBlar7olHjvxl2u3rjD/VWHQ6Ucy3c7XPjbDZ5/cwmnPI1h 5ugGO/2lAQXLoLfWQKXJz7VHnn0d4JidL/65Ov1JWm6cCY1j6xRtg8DbwHfXSCIfw7TJORUKpTq6 YQ75HC5ZBN4G3dWPLl19/ltPbDXjO5HvXgl99+ghp0jbS3YaK1T4kXCoWCXnVDOL9WOF188CNAZq /N4aiPwCwITtFn/R763+zrJLqGyeUQgr3exi48Z0ySL0OsSh+87VF77zLmTvk4thf+PDOA4o582J jviRBvTdVURkdgu8+6hPEZnze21MQ/u/ADXHJPJdYr/793+8+N1L25A9t935oNdupWlCwRo+BQ4y TdPw3TYizO4OoU6W4iPyctBt4VgGopjYanmTJOgTe+vXEfl9BrLnjkdE5oNOw1dKYZuTq9F1jcBt ISKzS3PfT7NKNm+tXdYC+W3otpnKGRMBynmDNA6IvfYtkFf3VtzecG3ZXLhxKxUR9K3Dbx+zDZ3I bYHI3D9/+YNoCDIiXIjIdRFZiLw16gUDpWSsOZZOmkREvWZLRF4Z1TvjlIDIXOzdRbF/qAq2TuSu gMi59+d/6I6EjFGCiFxOg+6VNOhxX9EcuQ/H0hGVEnfvuCIyPwowLvG7bT72VkAb3ZxOziDuNQH5 9bWXnu6Mh+yf1Quq3/5QYp9Kwci8ypk6KCHp/jdCZG4c4KBwISKpiMwnbhPb0IfKNnYbiMj5a+d+ 3NwXckC4ADmfeo2WpDFFeyDc0jVEhLR7MwWZHb/8tpL9e0AEV4SXE6+JYw+as+qYJN4KIrz+r189 s3wg5MBOG9g51b0ViRJy5qaL2wA5WMWk4QKkCXJe9ZtU8gbKbyGJtwAy9FU1RskkDECYF68xUOE1 QJjduVQPgGx+OkzyuyaJd1GCFhJ1LgvyrkxImTQn20eNeHcGudj6byLIvY3LRJ1XgLfuxel/1MGY 0YvhJSIAAAAASUVORK5CYII=" height="41" width="25"/><rect y="507.575" x="410.279" height="14.5" width="12.625" fill="#fff"/><path d="M416.544 503.612c-6.573 0-12.044 5.691-12Line truncated
|
||||
|
After Width: | Height: | Size: 6.7 KiB |
@@ -0,0 +1,203 @@
|
||||
import {Layer} from './Layer';
|
||||
import * as Util from '../core/Util';
|
||||
import {toLatLng} from '../geo/LatLng';
|
||||
import {toPoint} from '../geometry/Point';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class DivOverlay
|
||||
* @inherits Layer
|
||||
* @aka L.DivOverlay
|
||||
* Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.
|
||||
*/
|
||||
|
||||
// @namespace DivOverlay
|
||||
export var DivOverlay = Layer.extend({
|
||||
|
||||
// @section
|
||||
// @aka DivOverlay options
|
||||
options: {
|
||||
// @option offset: Point = Point(0, 7)
|
||||
// The offset of the popup position. Useful to control the anchor
|
||||
// of the popup when opening it on some overlays.
|
||||
offset: [0, 7],
|
||||
|
||||
// @option className: String = ''
|
||||
// A custom CSS class name to assign to the popup.
|
||||
className: '',
|
||||
|
||||
// @option pane: String = 'popupPane'
|
||||
// `Map pane` where the popup will be added.
|
||||
pane: 'popupPane'
|
||||
},
|
||||
|
||||
initialize: function (options, source) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._source = source;
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._zoomAnimated = map._zoomAnimated;
|
||||
|
||||
if (!this._container) {
|
||||
this._initLayout();
|
||||
}
|
||||
|
||||
if (map._fadeAnimated) {
|
||||
DomUtil.setOpacity(this._container, 0);
|
||||
}
|
||||
|
||||
clearTimeout(this._removeTimeout);
|
||||
this.getPane().appendChild(this._container);
|
||||
this.update();
|
||||
|
||||
if (map._fadeAnimated) {
|
||||
DomUtil.setOpacity(this._container, 1);
|
||||
}
|
||||
|
||||
this.bringToFront();
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
if (map._fadeAnimated) {
|
||||
DomUtil.setOpacity(this._container, 0);
|
||||
this._removeTimeout = setTimeout(Util.bind(DomUtil.remove, undefined, this._container), 200);
|
||||
} else {
|
||||
DomUtil.remove(this._container);
|
||||
}
|
||||
},
|
||||
|
||||
// @namespace Popup
|
||||
// @method getLatLng: LatLng
|
||||
// Returns the geographical point of popup.
|
||||
getLatLng: function () {
|
||||
return this._latlng;
|
||||
},
|
||||
|
||||
// @method setLatLng(latlng: LatLng): this
|
||||
// Sets the geographical point where the popup will open.
|
||||
setLatLng: function (latlng) {
|
||||
this._latlng = toLatLng(latlng);
|
||||
if (this._map) {
|
||||
this._updatePosition();
|
||||
this._adjustPan();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getContent: String|HTMLElement
|
||||
// Returns the content of the popup.
|
||||
getContent: function () {
|
||||
return this._content;
|
||||
},
|
||||
|
||||
// @method setContent(htmlContent: String|HTMLElement|Function): this
|
||||
// Sets the HTML content of the popup. If a function is passed the source layer will be passed to the function. The function should return a `String` or `HTMLElement` to be used in the popup.
|
||||
setContent: function (content) {
|
||||
this._content = content;
|
||||
this.update();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getElement: String|HTMLElement
|
||||
// Alias for [getContent()](#popup-getcontent)
|
||||
getElement: function () {
|
||||
return this._container;
|
||||
},
|
||||
|
||||
// @method update: null
|
||||
// Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.
|
||||
update: function () {
|
||||
if (!this._map) { return; }
|
||||
|
||||
this._container.style.visibility = 'hidden';
|
||||
|
||||
this._updateContent();
|
||||
this._updateLayout();
|
||||
this._updatePosition();
|
||||
|
||||
this._container.style.visibility = '';
|
||||
|
||||
this._adjustPan();
|
||||
},
|
||||
|
||||
getEvents: function () {
|
||||
var events = {
|
||||
zoom: this._updatePosition,
|
||||
viewreset: this._updatePosition
|
||||
};
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
events.zoomanim = this._animateZoom;
|
||||
}
|
||||
return events;
|
||||
},
|
||||
|
||||
// @method isOpen: Boolean
|
||||
// Returns `true` when the popup is visible on the map.
|
||||
isOpen: function () {
|
||||
return !!this._map && this._map.hasLayer(this);
|
||||
},
|
||||
|
||||
// @method bringToFront: this
|
||||
// Brings this popup in front of other popups (in the same map pane).
|
||||
bringToFront: function () {
|
||||
if (this._map) {
|
||||
DomUtil.toFront(this._container);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method bringToBack: this
|
||||
// Brings this popup to the back of other popups (in the same map pane).
|
||||
bringToBack: function () {
|
||||
if (this._map) {
|
||||
DomUtil.toBack(this._container);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_updateContent: function () {
|
||||
if (!this._content) { return; }
|
||||
|
||||
var node = this._contentNode;
|
||||
var content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;
|
||||
|
||||
if (typeof content === 'string') {
|
||||
node.innerHTML = content;
|
||||
} else {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
node.appendChild(content);
|
||||
}
|
||||
this.fire('contentupdate');
|
||||
},
|
||||
|
||||
_updatePosition: function () {
|
||||
if (!this._map) { return; }
|
||||
|
||||
var pos = this._map.latLngToLayerPoint(this._latlng),
|
||||
offset = toPoint(this.options.offset),
|
||||
anchor = this._getAnchor();
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
DomUtil.setPosition(this._container, pos.add(anchor));
|
||||
} else {
|
||||
offset = offset.add(pos).add(anchor);
|
||||
}
|
||||
|
||||
var bottom = this._containerBottom = -offset.y,
|
||||
left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;
|
||||
|
||||
// bottom position the popup in case the height of the popup changes (images loading etc)
|
||||
this._container.style.bottom = bottom + 'px';
|
||||
this._container.style.left = left + 'px';
|
||||
},
|
||||
|
||||
_getAnchor: function () {
|
||||
return [0, 0];
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,94 @@
|
||||
import {LayerGroup} from './LayerGroup';
|
||||
import {LatLngBounds} from '../geo/LatLngBounds';
|
||||
|
||||
/*
|
||||
* @class FeatureGroup
|
||||
* @aka L.FeatureGroup
|
||||
* @inherits LayerGroup
|
||||
*
|
||||
* Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:
|
||||
* * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))
|
||||
* * Events are propagated to the `FeatureGroup`, so if the group has an event
|
||||
* handler, it will handle events from any of the layers. This includes mouse events
|
||||
* and custom events.
|
||||
* * Has `layeradd` and `layerremove` events
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.featureGroup([marker1, marker2, polyline])
|
||||
* .bindPopup('Hello world!')
|
||||
* .on('click', function() { alert('Clicked on a member of the group!'); })
|
||||
* .addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var FeatureGroup = LayerGroup.extend({
|
||||
|
||||
addLayer: function (layer) {
|
||||
if (this.hasLayer(layer)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
layer.addEventParent(this);
|
||||
|
||||
LayerGroup.prototype.addLayer.call(this, layer);
|
||||
|
||||
// @event layeradd: LayerEvent
|
||||
// Fired when a layer is added to this `FeatureGroup`
|
||||
return this.fire('layeradd', {layer: layer});
|
||||
},
|
||||
|
||||
removeLayer: function (layer) {
|
||||
if (!this.hasLayer(layer)) {
|
||||
return this;
|
||||
}
|
||||
if (layer in this._layers) {
|
||||
layer = this._layers[layer];
|
||||
}
|
||||
|
||||
layer.removeEventParent(this);
|
||||
|
||||
LayerGroup.prototype.removeLayer.call(this, layer);
|
||||
|
||||
// @event layerremove: LayerEvent
|
||||
// Fired when a layer is removed from this `FeatureGroup`
|
||||
return this.fire('layerremove', {layer: layer});
|
||||
},
|
||||
|
||||
// @method setStyle(style: Path options): this
|
||||
// Sets the given path options to each layer of the group that has a `setStyle` method.
|
||||
setStyle: function (style) {
|
||||
return this.invoke('setStyle', style);
|
||||
},
|
||||
|
||||
// @method bringToFront(): this
|
||||
// Brings the layer group to the top of all other layers
|
||||
bringToFront: function () {
|
||||
return this.invoke('bringToFront');
|
||||
},
|
||||
|
||||
// @method bringToBack(): this
|
||||
// Brings the layer group to the back of all other layers
|
||||
bringToBack: function () {
|
||||
return this.invoke('bringToBack');
|
||||
},
|
||||
|
||||
// @method getBounds(): LatLngBounds
|
||||
// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
|
||||
getBounds: function () {
|
||||
var bounds = new LatLngBounds();
|
||||
|
||||
for (var id in this._layers) {
|
||||
var layer = this._layers[id];
|
||||
bounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());
|
||||
}
|
||||
return bounds;
|
||||
}
|
||||
});
|
||||
|
||||
// @factory L.featureGroup(layers: Layer[])
|
||||
// Create a feature group, optionally given an initial set of layers.
|
||||
export var featureGroup = function (layers) {
|
||||
return new FeatureGroup(layers);
|
||||
};
|
||||
@@ -0,0 +1,419 @@
|
||||
import {LayerGroup} from './LayerGroup';
|
||||
import {FeatureGroup} from './FeatureGroup';
|
||||
import * as Util from '../core/Util';
|
||||
import {Marker} from './marker/Marker';
|
||||
import {Circle} from './vector/Circle';
|
||||
import {CircleMarker} from './vector/CircleMarker';
|
||||
import {Polyline} from './vector/Polyline';
|
||||
import {Polygon} from './vector/Polygon';
|
||||
import {LatLng} from '../geo/LatLng';
|
||||
import * as LineUtil from '../geometry/LineUtil';
|
||||
|
||||
|
||||
/*
|
||||
* @class GeoJSON
|
||||
* @aka L.GeoJSON
|
||||
* @inherits FeatureGroup
|
||||
*
|
||||
* Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse
|
||||
* GeoJSON data and display it on the map. Extends `FeatureGroup`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.geoJSON(data, {
|
||||
* style: function (feature) {
|
||||
* return {color: feature.properties.color};
|
||||
* }
|
||||
* }).bindPopup(function (layer) {
|
||||
* return layer.feature.properties.description;
|
||||
* }).addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var GeoJSON = FeatureGroup.extend({
|
||||
|
||||
/* @section
|
||||
* @aka GeoJSON options
|
||||
*
|
||||
* @option pointToLayer: Function = *
|
||||
* A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally
|
||||
* called when data is added, passing the GeoJSON point feature and its `LatLng`.
|
||||
* The default is to spawn a default `Marker`:
|
||||
* ```js
|
||||
* function(geoJsonPoint, latlng) {
|
||||
* return L.marker(latlng);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @option style: Function = *
|
||||
* A `Function` defining the `Path options` for styling GeoJSON lines and polygons,
|
||||
* called internally when data is added.
|
||||
* The default value is to not override any defaults:
|
||||
* ```js
|
||||
* function (geoJsonFeature) {
|
||||
* return {}
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @option onEachFeature: Function = *
|
||||
* A `Function` that will be called once for each created `Feature`, after it has
|
||||
* been created and styled. Useful for attaching events and popups to features.
|
||||
* The default is to do nothing with the newly created layers:
|
||||
* ```js
|
||||
* function (feature, layer) {}
|
||||
* ```
|
||||
*
|
||||
* @option filter: Function = *
|
||||
* A `Function` that will be used to decide whether to include a feature or not.
|
||||
* The default is to include all features:
|
||||
* ```js
|
||||
* function (geoJsonFeature) {
|
||||
* return true;
|
||||
* }
|
||||
* ```
|
||||
* Note: dynamically changing the `filter` option will have effect only on newly
|
||||
* added data. It will _not_ re-evaluate already included features.
|
||||
*
|
||||
* @option coordsToLatLng: Function = *
|
||||
* A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
|
||||
* The default is the `coordsToLatLng` static method.
|
||||
*/
|
||||
|
||||
initialize: function (geojson, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._layers = {};
|
||||
|
||||
if (geojson) {
|
||||
this.addData(geojson);
|
||||
}
|
||||
},
|
||||
|
||||
// @method addData( <GeoJSON> data ): this
|
||||
// Adds a GeoJSON object to the layer.
|
||||
addData: function (geojson) {
|
||||
var features = Util.isArray(geojson) ? geojson : geojson.features,
|
||||
i, len, feature;
|
||||
|
||||
if (features) {
|
||||
for (i = 0, len = features.length; i < len; i++) {
|
||||
// only add this if geometry or geometries are set and not null
|
||||
feature = features[i];
|
||||
if (feature.geometries || feature.geometry || feature.features || feature.coordinates) {
|
||||
this.addData(feature);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
var options = this.options;
|
||||
|
||||
if (options.filter && !options.filter(geojson)) { return this; }
|
||||
|
||||
var layer = geometryToLayer(geojson, options);
|
||||
if (!layer) {
|
||||
return this;
|
||||
}
|
||||
layer.feature = asFeature(geojson);
|
||||
|
||||
layer.defaultOptions = layer.options;
|
||||
this.resetStyle(layer);
|
||||
|
||||
if (options.onEachFeature) {
|
||||
options.onEachFeature(geojson, layer);
|
||||
}
|
||||
|
||||
return this.addLayer(layer);
|
||||
},
|
||||
|
||||
// @method resetStyle( <Path> layer ): this
|
||||
// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
|
||||
resetStyle: function (layer) {
|
||||
// reset any custom styles
|
||||
layer.options = Util.extend({}, layer.defaultOptions);
|
||||
this._setLayerStyle(layer, this.options.style);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method setStyle( <Function> style ): this
|
||||
// Changes styles of GeoJSON vector layers with the given style function.
|
||||
setStyle: function (style) {
|
||||
return this.eachLayer(function (layer) {
|
||||
this._setLayerStyle(layer, style);
|
||||
}, this);
|
||||
},
|
||||
|
||||
_setLayerStyle: function (layer, style) {
|
||||
if (typeof style === 'function') {
|
||||
style = style(layer.feature);
|
||||
}
|
||||
if (layer.setStyle) {
|
||||
layer.setStyle(style);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// @section
|
||||
// There are several static functions which can be called without instantiating L.GeoJSON:
|
||||
|
||||
// @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer
|
||||
// Creates a `Layer` from a given GeoJSON feature. Can use a custom
|
||||
// [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng)
|
||||
// functions if provided as options.
|
||||
export function geometryToLayer(geojson, options) {
|
||||
|
||||
var geometry = geojson.type === 'Feature' ? geojson.geometry : geojson,
|
||||
coords = geometry ? geometry.coordinates : null,
|
||||
layers = [],
|
||||
pointToLayer = options && options.pointToLayer,
|
||||
_coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng,
|
||||
latlng, latlngs, i, len;
|
||||
|
||||
if (!coords && !geometry) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (geometry.type) {
|
||||
case 'Point':
|
||||
latlng = _coordsToLatLng(coords);
|
||||
return pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng);
|
||||
|
||||
case 'MultiPoint':
|
||||
for (i = 0, len = coords.length; i < len; i++) {
|
||||
latlng = _coordsToLatLng(coords[i]);
|
||||
layers.push(pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng));
|
||||
}
|
||||
return new FeatureGroup(layers);
|
||||
|
||||
case 'LineString':
|
||||
case 'MultiLineString':
|
||||
latlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng);
|
||||
return new Polyline(latlngs, options);
|
||||
|
||||
case 'Polygon':
|
||||
case 'MultiPolygon':
|
||||
latlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng);
|
||||
return new Polygon(latlngs, options);
|
||||
|
||||
case 'GeometryCollection':
|
||||
for (i = 0, len = geometry.geometries.length; i < len; i++) {
|
||||
var layer = geometryToLayer({
|
||||
geometry: geometry.geometries[i],
|
||||
type: 'Feature',
|
||||
properties: geojson.properties
|
||||
}, options);
|
||||
|
||||
if (layer) {
|
||||
layers.push(layer);
|
||||
}
|
||||
}
|
||||
return new FeatureGroup(layers);
|
||||
|
||||
default:
|
||||
throw new Error('Invalid GeoJSON object.');
|
||||
}
|
||||
}
|
||||
|
||||
// @function coordsToLatLng(coords: Array): LatLng
|
||||
// Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)
|
||||
// or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
|
||||
export function coordsToLatLng(coords) {
|
||||
return new LatLng(coords[1], coords[0], coords[2]);
|
||||
}
|
||||
|
||||
// @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array
|
||||
// Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array.
|
||||
// `levelsDeep` specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).
|
||||
// Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function.
|
||||
export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {
|
||||
var latlngs = [];
|
||||
|
||||
for (var i = 0, len = coords.length, latlng; i < len; i++) {
|
||||
latlng = levelsDeep ?
|
||||
coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :
|
||||
(_coordsToLatLng || coordsToLatLng)(coords[i]);
|
||||
|
||||
latlngs.push(latlng);
|
||||
}
|
||||
|
||||
return latlngs;
|
||||
}
|
||||
|
||||
// @function latLngToCoords(latlng: LatLng, precision?: Number): Array
|
||||
// Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)
|
||||
export function latLngToCoords(latlng, precision) {
|
||||
precision = typeof precision === 'number' ? precision : 6;
|
||||
return latlng.alt !== undefined ?
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
|
||||
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
|
||||
}
|
||||
|
||||
// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array
|
||||
// Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)
|
||||
// `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default.
|
||||
export function latLngsToCoords(latlngs, levelsDeep, closed, precision) {
|
||||
var coords = [];
|
||||
|
||||
for (var i = 0, len = latlngs.length; i < len; i++) {
|
||||
coords.push(levelsDeep ?
|
||||
latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :
|
||||
latLngToCoords(latlngs[i], precision));
|
||||
}
|
||||
|
||||
if (!levelsDeep && closed) {
|
||||
coords.push(coords[0]);
|
||||
}
|
||||
|
||||
return coords;
|
||||
}
|
||||
|
||||
export function getFeature(layer, newGeometry) {
|
||||
return layer.feature ?
|
||||
Util.extend({}, layer.feature, {geometry: newGeometry}) :
|
||||
asFeature(newGeometry);
|
||||
}
|
||||
|
||||
// @function asFeature(geojson: Object): Object
|
||||
// Normalize GeoJSON geometries/features into GeoJSON features.
|
||||
export function asFeature(geojson) {
|
||||
if (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') {
|
||||
return geojson;
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'Feature',
|
||||
properties: {},
|
||||
geometry: geojson
|
||||
};
|
||||
}
|
||||
|
||||
var PointToGeoJSON = {
|
||||
toGeoJSON: function (precision) {
|
||||
return getFeature(this, {
|
||||
type: 'Point',
|
||||
coordinates: latLngToCoords(this.getLatLng(), precision)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// @namespace Marker
|
||||
// @method toGeoJSON(): Object
|
||||
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).
|
||||
Marker.include(PointToGeoJSON);
|
||||
|
||||
// @namespace CircleMarker
|
||||
// @method toGeoJSON(): Object
|
||||
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).
|
||||
Circle.include(PointToGeoJSON);
|
||||
CircleMarker.include(PointToGeoJSON);
|
||||
|
||||
|
||||
// @namespace Polyline
|
||||
// @method toGeoJSON(): Object
|
||||
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).
|
||||
Polyline.include({
|
||||
toGeoJSON: function (precision) {
|
||||
var multi = !LineUtil.isFlat(this._latlngs);
|
||||
|
||||
var coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);
|
||||
|
||||
return getFeature(this, {
|
||||
type: (multi ? 'Multi' : '') + 'LineString',
|
||||
coordinates: coords
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Polygon
|
||||
// @method toGeoJSON(): Object
|
||||
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).
|
||||
Polygon.include({
|
||||
toGeoJSON: function (precision) {
|
||||
var holes = !LineUtil.isFlat(this._latlngs),
|
||||
multi = holes && !LineUtil.isFlat(this._latlngs[0]);
|
||||
|
||||
var coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);
|
||||
|
||||
if (!holes) {
|
||||
coords = [coords];
|
||||
}
|
||||
|
||||
return getFeature(this, {
|
||||
type: (multi ? 'Multi' : '') + 'Polygon',
|
||||
coordinates: coords
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// @namespace LayerGroup
|
||||
LayerGroup.include({
|
||||
toMultiPoint: function (precision) {
|
||||
var coords = [];
|
||||
|
||||
this.eachLayer(function (layer) {
|
||||
coords.push(layer.toGeoJSON(precision).geometry.coordinates);
|
||||
});
|
||||
|
||||
return getFeature(this, {
|
||||
type: 'MultiPoint',
|
||||
coordinates: coords
|
||||
});
|
||||
},
|
||||
|
||||
// @method toGeoJSON(): Object
|
||||
// Returns a [`GeoJSON`](http://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).
|
||||
toGeoJSON: function (precision) {
|
||||
|
||||
var type = this.feature && this.feature.geometry && this.feature.geometry.type;
|
||||
|
||||
if (type === 'MultiPoint') {
|
||||
return this.toMultiPoint(precision);
|
||||
}
|
||||
|
||||
var isGeometryCollection = type === 'GeometryCollection',
|
||||
jsons = [];
|
||||
|
||||
this.eachLayer(function (layer) {
|
||||
if (layer.toGeoJSON) {
|
||||
var json = layer.toGeoJSON(precision);
|
||||
if (isGeometryCollection) {
|
||||
jsons.push(json.geometry);
|
||||
} else {
|
||||
var feature = asFeature(json);
|
||||
// Squash nested feature collections
|
||||
if (feature.type === 'FeatureCollection') {
|
||||
jsons.push.apply(jsons, feature.features);
|
||||
} else {
|
||||
jsons.push(feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (isGeometryCollection) {
|
||||
return getFeature(this, {
|
||||
geometries: jsons,
|
||||
type: 'GeometryCollection'
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'FeatureCollection',
|
||||
features: jsons
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace GeoJSON
|
||||
// @factory L.geoJSON(geojson?: Object, options?: GeoJSON options)
|
||||
// Creates a GeoJSON layer. Optionally accepts an object in
|
||||
// [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map
|
||||
// (you can alternatively add it later with `addData` method) and an `options` object.
|
||||
export function geoJSON(geojson, options) {
|
||||
return new GeoJSON(geojson, options);
|
||||
}
|
||||
|
||||
// Backward compatibility.
|
||||
export var geoJson = geoJSON;
|
||||
@@ -0,0 +1,264 @@
|
||||
import {Layer} from './Layer';
|
||||
import * as Util from '../core/Util';
|
||||
import {toLatLngBounds} from '../geo/LatLngBounds';
|
||||
import {Bounds} from '../geometry/Bounds';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class ImageOverlay
|
||||
* @aka L.ImageOverlay
|
||||
* @inherits Interactive layer
|
||||
*
|
||||
* Used to load and display a single image over specific bounds of the map. Extends `Layer`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
|
||||
* imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
|
||||
* L.imageOverlay(imageUrl, imageBounds).addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var ImageOverlay = Layer.extend({
|
||||
|
||||
// @section
|
||||
// @aka ImageOverlay options
|
||||
options: {
|
||||
// @option opacity: Number = 1.0
|
||||
// The opacity of the image overlay.
|
||||
opacity: 1,
|
||||
|
||||
// @option alt: String = ''
|
||||
// Text for the `alt` attribute of the image (useful for accessibility).
|
||||
alt: '',
|
||||
|
||||
// @option interactive: Boolean = false
|
||||
// If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.
|
||||
interactive: false,
|
||||
|
||||
// @option crossOrigin: Boolean|String = false
|
||||
// Whether the crossOrigin attribute will be added to the image.
|
||||
// If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
|
||||
// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
|
||||
crossOrigin: false,
|
||||
|
||||
// @option errorOverlayUrl: String = ''
|
||||
// URL to the overlay image to show in place of the overlay that failed to load.
|
||||
errorOverlayUrl: '',
|
||||
|
||||
// @option zIndex: Number = 1
|
||||
// The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.
|
||||
zIndex: 1,
|
||||
|
||||
// @option className: String = ''
|
||||
// A custom class name to assign to the image. Empty by default.
|
||||
className: ''
|
||||
},
|
||||
|
||||
initialize: function (url, bounds, options) { // (String, LatLngBounds, Object)
|
||||
this._url = url;
|
||||
this._bounds = toLatLngBounds(bounds);
|
||||
|
||||
Util.setOptions(this, options);
|
||||
},
|
||||
|
||||
onAdd: function () {
|
||||
if (!this._image) {
|
||||
this._initImage();
|
||||
|
||||
if (this.options.opacity < 1) {
|
||||
this._updateOpacity();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.interactive) {
|
||||
DomUtil.addClass(this._image, 'leaflet-interactive');
|
||||
this.addInteractiveTarget(this._image);
|
||||
}
|
||||
|
||||
this.getPane().appendChild(this._image);
|
||||
this._reset();
|
||||
},
|
||||
|
||||
onRemove: function () {
|
||||
DomUtil.remove(this._image);
|
||||
if (this.options.interactive) {
|
||||
this.removeInteractiveTarget(this._image);
|
||||
}
|
||||
},
|
||||
|
||||
// @method setOpacity(opacity: Number): this
|
||||
// Sets the opacity of the overlay.
|
||||
setOpacity: function (opacity) {
|
||||
this.options.opacity = opacity;
|
||||
|
||||
if (this._image) {
|
||||
this._updateOpacity();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setStyle: function (styleOpts) {
|
||||
if (styleOpts.opacity) {
|
||||
this.setOpacity(styleOpts.opacity);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method bringToFront(): this
|
||||
// Brings the layer to the top of all overlays.
|
||||
bringToFront: function () {
|
||||
if (this._map) {
|
||||
DomUtil.toFront(this._image);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method bringToBack(): this
|
||||
// Brings the layer to the bottom of all overlays.
|
||||
bringToBack: function () {
|
||||
if (this._map) {
|
||||
DomUtil.toBack(this._image);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method setUrl(url: String): this
|
||||
// Changes the URL of the image.
|
||||
setUrl: function (url) {
|
||||
this._url = url;
|
||||
|
||||
if (this._image) {
|
||||
this._image.src = url;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method setBounds(bounds: LatLngBounds): this
|
||||
// Update the bounds that this ImageOverlay covers
|
||||
setBounds: function (bounds) {
|
||||
this._bounds = toLatLngBounds(bounds);
|
||||
|
||||
if (this._map) {
|
||||
this._reset();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
getEvents: function () {
|
||||
var events = {
|
||||
zoom: this._reset,
|
||||
viewreset: this._reset
|
||||
};
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
events.zoomanim = this._animateZoom;
|
||||
}
|
||||
|
||||
return events;
|
||||
},
|
||||
|
||||
// @method setZIndex(value: Number): this
|
||||
// Changes the [zIndex](#imageoverlay-zindex) of the image overlay.
|
||||
setZIndex: function (value) {
|
||||
this.options.zIndex = value;
|
||||
this._updateZIndex();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getBounds(): LatLngBounds
|
||||
// Get the bounds that this ImageOverlay covers
|
||||
getBounds: function () {
|
||||
return this._bounds;
|
||||
},
|
||||
|
||||
// @method getElement(): HTMLElement
|
||||
// Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)
|
||||
// used by this overlay.
|
||||
getElement: function () {
|
||||
return this._image;
|
||||
},
|
||||
|
||||
_initImage: function () {
|
||||
var wasElementSupplied = this._url.tagName === 'IMG';
|
||||
var img = this._image = wasElementSupplied ? this._url : DomUtil.create('img');
|
||||
|
||||
DomUtil.addClass(img, 'leaflet-image-layer');
|
||||
if (this._zoomAnimated) { DomUtil.addClass(img, 'leaflet-zoom-animated'); }
|
||||
if (this.options.className) { DomUtil.addClass(img, this.options.className); }
|
||||
|
||||
img.onselectstart = Util.falseFn;
|
||||
img.onmousemove = Util.falseFn;
|
||||
|
||||
// @event load: Event
|
||||
// Fired when the ImageOverlay layer has loaded its image
|
||||
img.onload = Util.bind(this.fire, this, 'load');
|
||||
img.onerror = Util.bind(this._overlayOnError, this, 'error');
|
||||
|
||||
if (this.options.crossOrigin || this.options.crossOrigin === '') {
|
||||
img.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;
|
||||
}
|
||||
|
||||
if (this.options.zIndex) {
|
||||
this._updateZIndex();
|
||||
}
|
||||
|
||||
if (wasElementSupplied) {
|
||||
this._url = img.src;
|
||||
return;
|
||||
}
|
||||
|
||||
img.src = this._url;
|
||||
img.alt = this.options.alt;
|
||||
},
|
||||
|
||||
_animateZoom: function (e) {
|
||||
var scale = this._map.getZoomScale(e.zoom),
|
||||
offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;
|
||||
|
||||
DomUtil.setTransform(this._image, offset, scale);
|
||||
},
|
||||
|
||||
_reset: function () {
|
||||
var image = this._image,
|
||||
bounds = new Bounds(
|
||||
this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
|
||||
this._map.latLngToLayerPoint(this._bounds.getSouthEast())),
|
||||
size = bounds.getSize();
|
||||
|
||||
DomUtil.setPosition(image, bounds.min);
|
||||
|
||||
image.style.width = size.x + 'px';
|
||||
image.style.height = size.y + 'px';
|
||||
},
|
||||
|
||||
_updateOpacity: function () {
|
||||
DomUtil.setOpacity(this._image, this.options.opacity);
|
||||
},
|
||||
|
||||
_updateZIndex: function () {
|
||||
if (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) {
|
||||
this._image.style.zIndex = this.options.zIndex;
|
||||
}
|
||||
},
|
||||
|
||||
_overlayOnError: function () {
|
||||
// @event error: Event
|
||||
// Fired when the ImageOverlay layer fails to load its image
|
||||
this.fire('error');
|
||||
|
||||
var errorUrl = this.options.errorOverlayUrl;
|
||||
if (errorUrl && this._url !== errorUrl) {
|
||||
this._url = errorUrl;
|
||||
this._image.src = errorUrl;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options)
|
||||
// Instantiates an image overlay object given the URL of the image and the
|
||||
// geographical bounds it is tied to.
|
||||
export var imageOverlay = function (url, bounds, options) {
|
||||
return new ImageOverlay(url, bounds, options);
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
@class Interactive layer
|
||||
@inherits Layer
|
||||
|
||||
Some `Layer`s can be made interactive - when the user interacts
|
||||
with such a layer, mouse events like `click` and `mouseover` can be handled.
|
||||
Use the [event handling methods](#evented-method) to handle these events.
|
||||
|
||||
@option interactive: Boolean = true
|
||||
If `false`, the layer will not emit mouse events and will act as a part of the underlying map.
|
||||
|
||||
@option bubblingMouseEvents: Boolean = true
|
||||
When `true`, a mouse event on this layer will trigger the same event on the map
|
||||
(unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
|
||||
|
||||
@section Mouse events
|
||||
|
||||
@event click: MouseEvent
|
||||
Fired when the user clicks (or taps) the layer.
|
||||
|
||||
@event dblclick: MouseEvent
|
||||
Fired when the user double-clicks (or double-taps) the layer.
|
||||
|
||||
@event mousedown: MouseEvent
|
||||
Fired when the user pushes the mouse button on the layer.
|
||||
|
||||
@event mouseup: MouseEvent
|
||||
Fired when the user releases the mouse button pushed on the layer.
|
||||
|
||||
@event mouseover: MouseEvent
|
||||
Fired when the mouse enters the layer.
|
||||
|
||||
@event mouseout: MouseEvent
|
||||
Fired when the mouse leaves the layer.
|
||||
|
||||
@event contextmenu: MouseEvent
|
||||
Fired when the user right-clicks on the layer, prevents
|
||||
default browser context menu from showing if there are listeners on
|
||||
this event. Also fired on mobile when the user holds a single touch
|
||||
for a second (also called long press).
|
||||
@@ -0,0 +1,279 @@
|
||||
import {Evented} from '../core/Events';
|
||||
import {Map} from '../map/Map';
|
||||
import * as Util from '../core/Util';
|
||||
|
||||
/*
|
||||
* @class Layer
|
||||
* @inherits Evented
|
||||
* @aka L.Layer
|
||||
* @aka ILayer
|
||||
*
|
||||
* A set of methods from the Layer base class that all Leaflet layers use.
|
||||
* Inherits all methods, options and events from `L.Evented`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var layer = L.Marker(latlng).addTo(map);
|
||||
* layer.addTo(map);
|
||||
* layer.remove();
|
||||
* ```
|
||||
*
|
||||
* @event add: Event
|
||||
* Fired after the layer is added to a map
|
||||
*
|
||||
* @event remove: Event
|
||||
* Fired after the layer is removed from a map
|
||||
*/
|
||||
|
||||
|
||||
export var Layer = Evented.extend({
|
||||
|
||||
// Classes extending `L.Layer` will inherit the following options:
|
||||
options: {
|
||||
// @option pane: String = 'overlayPane'
|
||||
// By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.
|
||||
pane: 'overlayPane',
|
||||
|
||||
// @option attribution: String = null
|
||||
// String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
|
||||
attribution: null,
|
||||
|
||||
bubblingMouseEvents: true
|
||||
},
|
||||
|
||||
/* @section
|
||||
* Classes extending `L.Layer` will inherit the following methods:
|
||||
*
|
||||
* @method addTo(map: Map|LayerGroup): this
|
||||
* Adds the layer to the given map or layer group.
|
||||
*/
|
||||
addTo: function (map) {
|
||||
map.addLayer(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method remove: this
|
||||
// Removes the layer from the map it is currently active on.
|
||||
remove: function () {
|
||||
return this.removeFrom(this._map || this._mapToAdd);
|
||||
},
|
||||
|
||||
// @method removeFrom(map: Map): this
|
||||
// Removes the layer from the given map
|
||||
removeFrom: function (obj) {
|
||||
if (obj) {
|
||||
obj.removeLayer(this);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getPane(name? : String): HTMLElement
|
||||
// Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.
|
||||
getPane: function (name) {
|
||||
return this._map.getPane(name ? (this.options[name] || name) : this.options.pane);
|
||||
},
|
||||
|
||||
addInteractiveTarget: function (targetEl) {
|
||||
this._map._targets[Util.stamp(targetEl)] = this;
|
||||
return this;
|
||||
},
|
||||
|
||||
removeInteractiveTarget: function (targetEl) {
|
||||
delete this._map._targets[Util.stamp(targetEl)];
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getAttribution: String
|
||||
// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).
|
||||
getAttribution: function () {
|
||||
return this.options.attribution;
|
||||
},
|
||||
|
||||
_layerAdd: function (e) {
|
||||
var map = e.target;
|
||||
|
||||
// check in case layer gets added and then removed before the map is ready
|
||||
if (!map.hasLayer(this)) { return; }
|
||||
|
||||
this._map = map;
|
||||
this._zoomAnimated = map._zoomAnimated;
|
||||
|
||||
if (this.getEvents) {
|
||||
var events = this.getEvents();
|
||||
map.on(events, this);
|
||||
this.once('remove', function () {
|
||||
map.off(events, this);
|
||||
}, this);
|
||||
}
|
||||
|
||||
this.onAdd(map);
|
||||
|
||||
if (this.getAttribution && map.attributionControl) {
|
||||
map.attributionControl.addAttribution(this.getAttribution());
|
||||
}
|
||||
|
||||
this.fire('add');
|
||||
map.fire('layeradd', {layer: this});
|
||||
}
|
||||
});
|
||||
|
||||
/* @section Extension methods
|
||||
* @uninheritable
|
||||
*
|
||||
* Every layer should extend from `L.Layer` and (re-)implement the following methods.
|
||||
*
|
||||
* @method onAdd(map: Map): this
|
||||
* Should contain code that creates DOM elements for the layer, adds them to `map panes` where they should belong and puts listeners on relevant map events. Called on [`map.addLayer(layer)`](#map-addlayer).
|
||||
*
|
||||
* @method onRemove(map: Map): this
|
||||
* Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in [`onAdd`](#layer-onadd). Called on [`map.removeLayer(layer)`](#map-removelayer).
|
||||
*
|
||||
* @method getEvents(): Object
|
||||
* This optional method should return an object like `{ viewreset: this._reset }` for [`addEventListener`](#evented-addeventlistener). The event handlers in this object will be automatically added and removed from the map with your layer.
|
||||
*
|
||||
* @method getAttribution(): String
|
||||
* This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible.
|
||||
*
|
||||
* @method beforeAdd(map: Map): this
|
||||
* Optional method. Called on [`map.addLayer(layer)`](#map-addlayer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
|
||||
*/
|
||||
|
||||
|
||||
/* @namespace Map
|
||||
* @section Layer events
|
||||
*
|
||||
* @event layeradd: LayerEvent
|
||||
* Fired when a new layer is added to the map.
|
||||
*
|
||||
* @event layerremove: LayerEvent
|
||||
* Fired when some layer is removed from the map
|
||||
*
|
||||
* @section Methods for Layers and Controls
|
||||
*/
|
||||
Map.include({
|
||||
// @method addLayer(layer: Layer): this
|
||||
// Adds the given layer to the map
|
||||
addLayer: function (layer) {
|
||||
if (!layer._layerAdd) {
|
||||
throw new Error('The provided object is not a Layer.');
|
||||
}
|
||||
|
||||
var id = Util.stamp(layer);
|
||||
if (this._layers[id]) { return this; }
|
||||
this._layers[id] = layer;
|
||||
|
||||
layer._mapToAdd = this;
|
||||
|
||||
if (layer.beforeAdd) {
|
||||
layer.beforeAdd(this);
|
||||
}
|
||||
|
||||
this.whenReady(layer._layerAdd, layer);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeLayer(layer: Layer): this
|
||||
// Removes the given layer from the map.
|
||||
removeLayer: function (layer) {
|
||||
var id = Util.stamp(layer);
|
||||
|
||||
if (!this._layers[id]) { return this; }
|
||||
|
||||
if (this._loaded) {
|
||||
layer.onRemove(this);
|
||||
}
|
||||
|
||||
if (layer.getAttribution && this.attributionControl) {
|
||||
this.attributionControl.removeAttribution(layer.getAttribution());
|
||||
}
|
||||
|
||||
delete this._layers[id];
|
||||
|
||||
if (this._loaded) {
|
||||
this.fire('layerremove', {layer: layer});
|
||||
layer.fire('remove');
|
||||
}
|
||||
|
||||
layer._map = layer._mapToAdd = null;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method hasLayer(layer: Layer): Boolean
|
||||
// Returns `true` if the given layer is currently added to the map
|
||||
hasLayer: function (layer) {
|
||||
return !!layer && (Util.stamp(layer) in this._layers);
|
||||
},
|
||||
|
||||
/* @method eachLayer(fn: Function, context?: Object): this
|
||||
* Iterates over the layers of the map, optionally specifying context of the iterator function.
|
||||
* ```
|
||||
* map.eachLayer(function(layer){
|
||||
* layer.bindPopup('Hello');
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
eachLayer: function (method, context) {
|
||||
for (var i in this._layers) {
|
||||
method.call(context, this._layers[i]);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_addLayers: function (layers) {
|
||||
layers = layers ? (Util.isArray(layers) ? layers : [layers]) : [];
|
||||
|
||||
for (var i = 0, len = layers.length; i < len; i++) {
|
||||
this.addLayer(layers[i]);
|
||||
}
|
||||
},
|
||||
|
||||
_addZoomLimit: function (layer) {
|
||||
if (isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {
|
||||
this._zoomBoundLayers[Util.stamp(layer)] = layer;
|
||||
this._updateZoomLevels();
|
||||
}
|
||||
},
|
||||
|
||||
_removeZoomLimit: function (layer) {
|
||||
var id = Util.stamp(layer);
|
||||
|
||||
if (this._zoomBoundLayers[id]) {
|
||||
delete this._zoomBoundLayers[id];
|
||||
this._updateZoomLevels();
|
||||
}
|
||||
},
|
||||
|
||||
_updateZoomLevels: function () {
|
||||
var minZoom = Infinity,
|
||||
maxZoom = -Infinity,
|
||||
oldZoomSpan = this._getZoomSpan();
|
||||
|
||||
for (var i in this._zoomBoundLayers) {
|
||||
var options = this._zoomBoundLayers[i].options;
|
||||
|
||||
minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);
|
||||
maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);
|
||||
}
|
||||
|
||||
this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;
|
||||
this._layersMinZoom = minZoom === Infinity ? undefined : minZoom;
|
||||
|
||||
// @section Map state change events
|
||||
// @event zoomlevelschange: Event
|
||||
// Fired when the number of zoomlevels on the map is changed due
|
||||
// to adding or removing a layer.
|
||||
if (oldZoomSpan !== this._getZoomSpan()) {
|
||||
this.fire('zoomlevelschange');
|
||||
}
|
||||
|
||||
if (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {
|
||||
this.setZoom(this._layersMaxZoom);
|
||||
}
|
||||
if (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {
|
||||
this.setZoom(this._layersMinZoom);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,158 @@
|
||||
|
||||
import {Layer} from './Layer';
|
||||
import * as Util from '../core/Util';
|
||||
|
||||
/*
|
||||
* @class LayerGroup
|
||||
* @aka L.LayerGroup
|
||||
* @inherits Layer
|
||||
*
|
||||
* Used to group several layers and handle them as one. If you add it to the map,
|
||||
* any layers added or removed from the group will be added/removed on the map as
|
||||
* well. Extends `Layer`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.layerGroup([marker1, marker2])
|
||||
* .addLayer(polyline)
|
||||
* .addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var LayerGroup = Layer.extend({
|
||||
|
||||
initialize: function (layers, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._layers = {};
|
||||
|
||||
var i, len;
|
||||
|
||||
if (layers) {
|
||||
for (i = 0, len = layers.length; i < len; i++) {
|
||||
this.addLayer(layers[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// @method addLayer(layer: Layer): this
|
||||
// Adds the given layer to the group.
|
||||
addLayer: function (layer) {
|
||||
var id = this.getLayerId(layer);
|
||||
|
||||
this._layers[id] = layer;
|
||||
|
||||
if (this._map) {
|
||||
this._map.addLayer(layer);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeLayer(layer: Layer): this
|
||||
// Removes the given layer from the group.
|
||||
// @alternative
|
||||
// @method removeLayer(id: Number): this
|
||||
// Removes the layer with the given internal ID from the group.
|
||||
removeLayer: function (layer) {
|
||||
var id = layer in this._layers ? layer : this.getLayerId(layer);
|
||||
|
||||
if (this._map && this._layers[id]) {
|
||||
this._map.removeLayer(this._layers[id]);
|
||||
}
|
||||
|
||||
delete this._layers[id];
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method hasLayer(layer: Layer): Boolean
|
||||
// Returns `true` if the given layer is currently added to the group.
|
||||
// @alternative
|
||||
// @method hasLayer(id: Number): Boolean
|
||||
// Returns `true` if the given internal ID is currently added to the group.
|
||||
hasLayer: function (layer) {
|
||||
return !!layer && (layer in this._layers || this.getLayerId(layer) in this._layers);
|
||||
},
|
||||
|
||||
// @method clearLayers(): this
|
||||
// Removes all the layers from the group.
|
||||
clearLayers: function () {
|
||||
return this.eachLayer(this.removeLayer, this);
|
||||
},
|
||||
|
||||
// @method invoke(methodName: String, …): this
|
||||
// Calls `methodName` on every layer contained in this group, passing any
|
||||
// additional parameters. Has no effect if the layers contained do not
|
||||
// implement `methodName`.
|
||||
invoke: function (methodName) {
|
||||
var args = Array.prototype.slice.call(arguments, 1),
|
||||
i, layer;
|
||||
|
||||
for (i in this._layers) {
|
||||
layer = this._layers[i];
|
||||
|
||||
if (layer[methodName]) {
|
||||
layer[methodName].apply(layer, args);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this.eachLayer(map.addLayer, map);
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
this.eachLayer(map.removeLayer, map);
|
||||
},
|
||||
|
||||
// @method eachLayer(fn: Function, context?: Object): this
|
||||
// Iterates over the layers of the group, optionally specifying context of the iterator function.
|
||||
// ```js
|
||||
// group.eachLayer(function (layer) {
|
||||
// layer.bindPopup('Hello');
|
||||
// });
|
||||
// ```
|
||||
eachLayer: function (method, context) {
|
||||
for (var i in this._layers) {
|
||||
method.call(context, this._layers[i]);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getLayer(id: Number): Layer
|
||||
// Returns the layer with the given internal ID.
|
||||
getLayer: function (id) {
|
||||
return this._layers[id];
|
||||
},
|
||||
|
||||
// @method getLayers(): Layer[]
|
||||
// Returns an array of all the layers added to the group.
|
||||
getLayers: function () {
|
||||
var layers = [];
|
||||
this.eachLayer(layers.push, layers);
|
||||
return layers;
|
||||
},
|
||||
|
||||
// @method setZIndex(zIndex: Number): this
|
||||
// Calls `setZIndex` on every layer contained in this group, passing the z-index.
|
||||
setZIndex: function (zIndex) {
|
||||
return this.invoke('setZIndex', zIndex);
|
||||
},
|
||||
|
||||
// @method getLayerId(layer: Layer): Number
|
||||
// Returns the internal ID for a layer
|
||||
getLayerId: function (layer) {
|
||||
return Util.stamp(layer);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// @factory L.layerGroup(layers?: Layer[], options?: Object)
|
||||
// Create a layer group, optionally given an initial set of layers and an `options` object.
|
||||
export var layerGroup = function (layers, options) {
|
||||
return new LayerGroup(layers, options);
|
||||
};
|
||||
@@ -0,0 +1,533 @@
|
||||
import {DivOverlay} from './DivOverlay';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
import {Point, toPoint} from '../geometry/Point';
|
||||
import {Map} from '../map/Map';
|
||||
import {Layer} from './Layer';
|
||||
import {FeatureGroup} from './FeatureGroup';
|
||||
import * as Util from '../core/Util';
|
||||
import {Path} from './vector/Path';
|
||||
|
||||
/*
|
||||
* @class Popup
|
||||
* @inherits DivOverlay
|
||||
* @aka L.Popup
|
||||
* Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to
|
||||
* open popups while making sure that only one popup is open at one time
|
||||
* (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* If you want to just bind a popup to marker click and then open it, it's really easy:
|
||||
*
|
||||
* ```js
|
||||
* marker.bindPopup(popupContent).openPopup();
|
||||
* ```
|
||||
* Path overlays like polylines also have a `bindPopup` method.
|
||||
* Here's a more complicated way to open a popup on a map:
|
||||
*
|
||||
* ```js
|
||||
* var popup = L.popup()
|
||||
* .setLatLng(latlng)
|
||||
* .setContent('<p>Hello world!<br />This is a nice popup.</p>')
|
||||
* .openOn(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
// @namespace Popup
|
||||
export var Popup = DivOverlay.extend({
|
||||
|
||||
// @section
|
||||
// @aka Popup options
|
||||
options: {
|
||||
// @option maxWidth: Number = 300
|
||||
// Max width of the popup, in pixels.
|
||||
maxWidth: 300,
|
||||
|
||||
// @option minWidth: Number = 50
|
||||
// Min width of the popup, in pixels.
|
||||
minWidth: 50,
|
||||
|
||||
// @option maxHeight: Number = null
|
||||
// If set, creates a scrollable container of the given height
|
||||
// inside a popup if its content exceeds it.
|
||||
maxHeight: null,
|
||||
|
||||
// @option autoPan: Boolean = true
|
||||
// Set it to `false` if you don't want the map to do panning animation
|
||||
// to fit the opened popup.
|
||||
autoPan: true,
|
||||
|
||||
// @option autoPanPaddingTopLeft: Point = null
|
||||
// The margin between the popup and the top left corner of the map
|
||||
// view after autopanning was performed.
|
||||
autoPanPaddingTopLeft: null,
|
||||
|
||||
// @option autoPanPaddingBottomRight: Point = null
|
||||
// The margin between the popup and the bottom right corner of the map
|
||||
// view after autopanning was performed.
|
||||
autoPanPaddingBottomRight: null,
|
||||
|
||||
// @option autoPanPadding: Point = Point(5, 5)
|
||||
// Equivalent of setting both top left and bottom right autopan padding to the same value.
|
||||
autoPanPadding: [5, 5],
|
||||
|
||||
// @option keepInView: Boolean = false
|
||||
// Set it to `true` if you want to prevent users from panning the popup
|
||||
// off of the screen while it is open.
|
||||
keepInView: false,
|
||||
|
||||
// @option closeButton: Boolean = true
|
||||
// Controls the presence of a close button in the popup.
|
||||
closeButton: true,
|
||||
|
||||
// @option autoClose: Boolean = true
|
||||
// Set it to `false` if you want to override the default behavior of
|
||||
// the popup closing when another popup is opened.
|
||||
autoClose: true,
|
||||
|
||||
// @option closeOnEscapeKey: Boolean = true
|
||||
// Set it to `false` if you want to override the default behavior of
|
||||
// the ESC key for closing of the popup.
|
||||
closeOnEscapeKey: true,
|
||||
|
||||
// @option closeOnClick: Boolean = *
|
||||
// Set it if you want to override the default behavior of the popup closing when user clicks
|
||||
// on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.
|
||||
|
||||
// @option className: String = ''
|
||||
// A custom CSS class name to assign to the popup.
|
||||
className: ''
|
||||
},
|
||||
|
||||
// @namespace Popup
|
||||
// @method openOn(map: Map): this
|
||||
// Adds the popup to the map and closes the previous one. The same as `map.openPopup(popup)`.
|
||||
openOn: function (map) {
|
||||
map.openPopup(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
DivOverlay.prototype.onAdd.call(this, map);
|
||||
|
||||
// @namespace Map
|
||||
// @section Popup events
|
||||
// @event popupopen: PopupEvent
|
||||
// Fired when a popup is opened in the map
|
||||
map.fire('popupopen', {popup: this});
|
||||
|
||||
if (this._source) {
|
||||
// @namespace Layer
|
||||
// @section Popup events
|
||||
// @event popupopen: PopupEvent
|
||||
// Fired when a popup bound to this layer is opened
|
||||
this._source.fire('popupopen', {popup: this}, true);
|
||||
// For non-path layers, we toggle the popup when clicking
|
||||
// again the layer, so prevent the map to reopen it.
|
||||
if (!(this._source instanceof Path)) {
|
||||
this._source.on('preclick', DomEvent.stopPropagation);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
DivOverlay.prototype.onRemove.call(this, map);
|
||||
|
||||
// @namespace Map
|
||||
// @section Popup events
|
||||
// @event popupclose: PopupEvent
|
||||
// Fired when a popup in the map is closed
|
||||
map.fire('popupclose', {popup: this});
|
||||
|
||||
if (this._source) {
|
||||
// @namespace Layer
|
||||
// @section Popup events
|
||||
// @event popupclose: PopupEvent
|
||||
// Fired when a popup bound to this layer is closed
|
||||
this._source.fire('popupclose', {popup: this}, true);
|
||||
if (!(this._source instanceof Path)) {
|
||||
this._source.off('preclick', DomEvent.stopPropagation);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getEvents: function () {
|
||||
var events = DivOverlay.prototype.getEvents.call(this);
|
||||
|
||||
if (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {
|
||||
events.preclick = this._close;
|
||||
}
|
||||
|
||||
if (this.options.keepInView) {
|
||||
events.moveend = this._adjustPan;
|
||||
}
|
||||
|
||||
return events;
|
||||
},
|
||||
|
||||
_close: function () {
|
||||
if (this._map) {
|
||||
this._map.closePopup(this);
|
||||
}
|
||||
},
|
||||
|
||||
_initLayout: function () {
|
||||
var prefix = 'leaflet-popup',
|
||||
container = this._container = DomUtil.create('div',
|
||||
prefix + ' ' + (this.options.className || '') +
|
||||
' leaflet-zoom-animated');
|
||||
|
||||
var wrapper = this._wrapper = DomUtil.create('div', prefix + '-content-wrapper', container);
|
||||
this._contentNode = DomUtil.create('div', prefix + '-content', wrapper);
|
||||
|
||||
DomEvent.disableClickPropagation(wrapper);
|
||||
DomEvent.disableScrollPropagation(this._contentNode);
|
||||
DomEvent.on(wrapper, 'contextmenu', DomEvent.stopPropagation);
|
||||
|
||||
this._tipContainer = DomUtil.create('div', prefix + '-tip-container', container);
|
||||
this._tip = DomUtil.create('div', prefix + '-tip', this._tipContainer);
|
||||
|
||||
if (this.options.closeButton) {
|
||||
var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);
|
||||
closeButton.href = '#close';
|
||||
closeButton.innerHTML = '×';
|
||||
|
||||
DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this);
|
||||
}
|
||||
},
|
||||
|
||||
_updateLayout: function () {
|
||||
var container = this._contentNode,
|
||||
style = container.style;
|
||||
|
||||
style.width = '';
|
||||
style.whiteSpace = 'nowrap';
|
||||
|
||||
var width = container.offsetWidth;
|
||||
width = Math.min(width, this.options.maxWidth);
|
||||
width = Math.max(width, this.options.minWidth);
|
||||
|
||||
style.width = (width + 1) + 'px';
|
||||
style.whiteSpace = '';
|
||||
|
||||
style.height = '';
|
||||
|
||||
var height = container.offsetHeight,
|
||||
maxHeight = this.options.maxHeight,
|
||||
scrolledClass = 'leaflet-popup-scrolled';
|
||||
|
||||
if (maxHeight && height > maxHeight) {
|
||||
style.height = maxHeight + 'px';
|
||||
DomUtil.addClass(container, scrolledClass);
|
||||
} else {
|
||||
DomUtil.removeClass(container, scrolledClass);
|
||||
}
|
||||
|
||||
this._containerWidth = this._container.offsetWidth;
|
||||
},
|
||||
|
||||
_animateZoom: function (e) {
|
||||
var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),
|
||||
anchor = this._getAnchor();
|
||||
DomUtil.setPosition(this._container, pos.add(anchor));
|
||||
},
|
||||
|
||||
_adjustPan: function () {
|
||||
if (!this.options.autoPan) { return; }
|
||||
if (this._map._panAnim) { this._map._panAnim.stop(); }
|
||||
|
||||
var map = this._map,
|
||||
marginBottom = parseInt(DomUtil.getStyle(this._container, 'marginBottom'), 10) || 0,
|
||||
containerHeight = this._container.offsetHeight + marginBottom,
|
||||
containerWidth = this._containerWidth,
|
||||
layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom);
|
||||
|
||||
layerPos._add(DomUtil.getPosition(this._container));
|
||||
|
||||
var containerPos = map.layerPointToContainerPoint(layerPos),
|
||||
padding = toPoint(this.options.autoPanPadding),
|
||||
paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),
|
||||
paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),
|
||||
size = map.getSize(),
|
||||
dx = 0,
|
||||
dy = 0;
|
||||
|
||||
if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right
|
||||
dx = containerPos.x + containerWidth - size.x + paddingBR.x;
|
||||
}
|
||||
if (containerPos.x - dx - paddingTL.x < 0) { // left
|
||||
dx = containerPos.x - paddingTL.x;
|
||||
}
|
||||
if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom
|
||||
dy = containerPos.y + containerHeight - size.y + paddingBR.y;
|
||||
}
|
||||
if (containerPos.y - dy - paddingTL.y < 0) { // top
|
||||
dy = containerPos.y - paddingTL.y;
|
||||
}
|
||||
|
||||
// @namespace Map
|
||||
// @section Popup events
|
||||
// @event autopanstart: Event
|
||||
// Fired when the map starts autopanning when opening a popup.
|
||||
if (dx || dy) {
|
||||
map
|
||||
.fire('autopanstart')
|
||||
.panBy([dx, dy]);
|
||||
}
|
||||
},
|
||||
|
||||
_onCloseButtonClick: function (e) {
|
||||
this._close();
|
||||
DomEvent.stop(e);
|
||||
},
|
||||
|
||||
_getAnchor: function () {
|
||||
// Where should we anchor the popup on the source layer?
|
||||
return toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// @namespace Popup
|
||||
// @factory L.popup(options?: Popup options, source?: Layer)
|
||||
// Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers.
|
||||
export var popup = function (options, source) {
|
||||
return new Popup(options, source);
|
||||
};
|
||||
|
||||
|
||||
/* @namespace Map
|
||||
* @section Interaction Options
|
||||
* @option closePopupOnClick: Boolean = true
|
||||
* Set it to `false` if you don't want popups to close when user clicks the map.
|
||||
*/
|
||||
Map.mergeOptions({
|
||||
closePopupOnClick: true
|
||||
});
|
||||
|
||||
|
||||
// @namespace Map
|
||||
// @section Methods for Layers and Controls
|
||||
Map.include({
|
||||
// @method openPopup(popup: Popup): this
|
||||
// Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).
|
||||
// @alternative
|
||||
// @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this
|
||||
// Creates a popup with the specified content and options and opens it in the given point on a map.
|
||||
openPopup: function (popup, latlng, options) {
|
||||
if (!(popup instanceof Popup)) {
|
||||
popup = new Popup(options).setContent(popup);
|
||||
}
|
||||
|
||||
if (latlng) {
|
||||
popup.setLatLng(latlng);
|
||||
}
|
||||
|
||||
if (this.hasLayer(popup)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (this._popup && this._popup.options.autoClose) {
|
||||
this.closePopup();
|
||||
}
|
||||
|
||||
this._popup = popup;
|
||||
return this.addLayer(popup);
|
||||
},
|
||||
|
||||
// @method closePopup(popup?: Popup): this
|
||||
// Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).
|
||||
closePopup: function (popup) {
|
||||
if (!popup || popup === this._popup) {
|
||||
popup = this._popup;
|
||||
this._popup = null;
|
||||
}
|
||||
if (popup) {
|
||||
this.removeLayer(popup);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* @namespace Layer
|
||||
* @section Popup methods example
|
||||
*
|
||||
* All layers share a set of methods convenient for binding popups to it.
|
||||
*
|
||||
* ```js
|
||||
* var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);
|
||||
* layer.openPopup();
|
||||
* layer.closePopup();
|
||||
* ```
|
||||
*
|
||||
* Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.
|
||||
*/
|
||||
|
||||
// @section Popup methods
|
||||
Layer.include({
|
||||
|
||||
// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this
|
||||
// Binds a popup to the layer with the passed `content` and sets up the
|
||||
// necessary event listeners. If a `Function` is passed it will receive
|
||||
// the layer as the first argument and should return a `String` or `HTMLElement`.
|
||||
bindPopup: function (content, options) {
|
||||
|
||||
if (content instanceof Popup) {
|
||||
Util.setOptions(content, options);
|
||||
this._popup = content;
|
||||
content._source = this;
|
||||
} else {
|
||||
if (!this._popup || options) {
|
||||
this._popup = new Popup(options, this);
|
||||
}
|
||||
this._popup.setContent(content);
|
||||
}
|
||||
|
||||
if (!this._popupHandlersAdded) {
|
||||
this.on({
|
||||
click: this._openPopup,
|
||||
keypress: this._onKeyPress,
|
||||
remove: this.closePopup,
|
||||
move: this._movePopup
|
||||
});
|
||||
this._popupHandlersAdded = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method unbindPopup(): this
|
||||
// Removes the popup previously bound with `bindPopup`.
|
||||
unbindPopup: function () {
|
||||
if (this._popup) {
|
||||
this.off({
|
||||
click: this._openPopup,
|
||||
keypress: this._onKeyPress,
|
||||
remove: this.closePopup,
|
||||
move: this._movePopup
|
||||
});
|
||||
this._popupHandlersAdded = false;
|
||||
this._popup = null;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method openPopup(latlng?: LatLng): this
|
||||
// Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
|
||||
openPopup: function (layer, latlng) {
|
||||
if (!(layer instanceof Layer)) {
|
||||
latlng = layer;
|
||||
layer = this;
|
||||
}
|
||||
|
||||
if (layer instanceof FeatureGroup) {
|
||||
for (var id in this._layers) {
|
||||
layer = this._layers[id];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!latlng) {
|
||||
latlng = layer.getCenter ? layer.getCenter() : layer.getLatLng();
|
||||
}
|
||||
|
||||
if (this._popup && this._map) {
|
||||
// set popup source to this layer
|
||||
this._popup._source = layer;
|
||||
|
||||
// update the popup (content, layout, ect...)
|
||||
this._popup.update();
|
||||
|
||||
// open the popup on the map
|
||||
this._map.openPopup(this._popup, latlng);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method closePopup(): this
|
||||
// Closes the popup bound to this layer if it is open.
|
||||
closePopup: function () {
|
||||
if (this._popup) {
|
||||
this._popup._close();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method togglePopup(): this
|
||||
// Opens or closes the popup bound to this layer depending on its current state.
|
||||
togglePopup: function (target) {
|
||||
if (this._popup) {
|
||||
if (this._popup._map) {
|
||||
this.closePopup();
|
||||
} else {
|
||||
this.openPopup(target);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method isPopupOpen(): boolean
|
||||
// Returns `true` if the popup bound to this layer is currently open.
|
||||
isPopupOpen: function () {
|
||||
return (this._popup ? this._popup.isOpen() : false);
|
||||
},
|
||||
|
||||
// @method setPopupContent(content: String|HTMLElement|Popup): this
|
||||
// Sets the content of the popup bound to this layer.
|
||||
setPopupContent: function (content) {
|
||||
if (this._popup) {
|
||||
this._popup.setContent(content);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getPopup(): Popup
|
||||
// Returns the popup bound to this layer.
|
||||
getPopup: function () {
|
||||
return this._popup;
|
||||
},
|
||||
|
||||
_openPopup: function (e) {
|
||||
var layer = e.layer || e.target;
|
||||
|
||||
if (!this._popup) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._map) {
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent map click
|
||||
DomEvent.stop(e);
|
||||
|
||||
// if this inherits from Path its a vector and we can just
|
||||
// open the popup at the new location
|
||||
if (layer instanceof Path) {
|
||||
this.openPopup(e.layer || e.target, e.latlng);
|
||||
return;
|
||||
}
|
||||
|
||||
// otherwise treat it like a marker and figure out
|
||||
// if we should toggle it open/closed
|
||||
if (this._map.hasLayer(this._popup) && this._popup._source === layer) {
|
||||
this.closePopup();
|
||||
} else {
|
||||
this.openPopup(layer, e.latlng);
|
||||
}
|
||||
},
|
||||
|
||||
_movePopup: function (e) {
|
||||
this._popup.setLatLng(e.latlng);
|
||||
},
|
||||
|
||||
_onKeyPress: function (e) {
|
||||
if (e.originalEvent.keyCode === 13) {
|
||||
this._openPopup(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,418 @@
|
||||
|
||||
import * as Browser from '../core/Browser';
|
||||
import {DivOverlay} from './DivOverlay';
|
||||
import {toPoint} from '../geometry/Point';
|
||||
import {Map} from '../map/Map';
|
||||
import {Layer} from './Layer';
|
||||
import {FeatureGroup} from './FeatureGroup';
|
||||
import * as Util from '../core/Util';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Tooltip
|
||||
* @inherits DivOverlay
|
||||
* @aka L.Tooltip
|
||||
* Used to display small texts on top of map layers.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* marker.bindTooltip("my tooltip text").openTooltip();
|
||||
* ```
|
||||
* Note about tooltip offset. Leaflet takes two options in consideration
|
||||
* for computing tooltip offsetting:
|
||||
* - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
|
||||
* Add a positive x offset to move the tooltip to the right, and a positive y offset to
|
||||
* move it to the bottom. Negatives will move to the left and top.
|
||||
* - the `tooltipAnchor` Icon option: this will only be considered for Marker. You
|
||||
* should adapt this value if you use a custom icon.
|
||||
*/
|
||||
|
||||
|
||||
// @namespace Tooltip
|
||||
export var Tooltip = DivOverlay.extend({
|
||||
|
||||
// @section
|
||||
// @aka Tooltip options
|
||||
options: {
|
||||
// @option pane: String = 'tooltipPane'
|
||||
// `Map pane` where the tooltip will be added.
|
||||
pane: 'tooltipPane',
|
||||
|
||||
// @option offset: Point = Point(0, 0)
|
||||
// Optional offset of the tooltip position.
|
||||
offset: [0, 0],
|
||||
|
||||
// @option direction: String = 'auto'
|
||||
// Direction where to open the tooltip. Possible values are: `right`, `left`,
|
||||
// `top`, `bottom`, `center`, `auto`.
|
||||
// `auto` will dynamically switch between `right` and `left` according to the tooltip
|
||||
// position on the map.
|
||||
direction: 'auto',
|
||||
|
||||
// @option permanent: Boolean = false
|
||||
// Whether to open the tooltip permanently or only on mouseover.
|
||||
permanent: false,
|
||||
|
||||
// @option sticky: Boolean = false
|
||||
// If true, the tooltip will follow the mouse instead of being fixed at the feature center.
|
||||
sticky: false,
|
||||
|
||||
// @option interactive: Boolean = false
|
||||
// If true, the tooltip will listen to the feature events.
|
||||
interactive: false,
|
||||
|
||||
// @option opacity: Number = 0.9
|
||||
// Tooltip container opacity.
|
||||
opacity: 0.9
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
DivOverlay.prototype.onAdd.call(this, map);
|
||||
this.setOpacity(this.options.opacity);
|
||||
|
||||
// @namespace Map
|
||||
// @section Tooltip events
|
||||
// @event tooltipopen: TooltipEvent
|
||||
// Fired when a tooltip is opened in the map.
|
||||
map.fire('tooltipopen', {tooltip: this});
|
||||
|
||||
if (this._source) {
|
||||
// @namespace Layer
|
||||
// @section Tooltip events
|
||||
// @event tooltipopen: TooltipEvent
|
||||
// Fired when a tooltip bound to this layer is opened.
|
||||
this._source.fire('tooltipopen', {tooltip: this}, true);
|
||||
}
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
DivOverlay.prototype.onRemove.call(this, map);
|
||||
|
||||
// @namespace Map
|
||||
// @section Tooltip events
|
||||
// @event tooltipclose: TooltipEvent
|
||||
// Fired when a tooltip in the map is closed.
|
||||
map.fire('tooltipclose', {tooltip: this});
|
||||
|
||||
if (this._source) {
|
||||
// @namespace Layer
|
||||
// @section Tooltip events
|
||||
// @event tooltipclose: TooltipEvent
|
||||
// Fired when a tooltip bound to this layer is closed.
|
||||
this._source.fire('tooltipclose', {tooltip: this}, true);
|
||||
}
|
||||
},
|
||||
|
||||
getEvents: function () {
|
||||
var events = DivOverlay.prototype.getEvents.call(this);
|
||||
|
||||
if (Browser.touch && !this.options.permanent) {
|
||||
events.preclick = this._close;
|
||||
}
|
||||
|
||||
return events;
|
||||
},
|
||||
|
||||
_close: function () {
|
||||
if (this._map) {
|
||||
this._map.closeTooltip(this);
|
||||
}
|
||||
},
|
||||
|
||||
_initLayout: function () {
|
||||
var prefix = 'leaflet-tooltip',
|
||||
className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');
|
||||
|
||||
this._contentNode = this._container = DomUtil.create('div', className);
|
||||
},
|
||||
|
||||
_updateLayout: function () {},
|
||||
|
||||
_adjustPan: function () {},
|
||||
|
||||
_setPosition: function (pos) {
|
||||
var map = this._map,
|
||||
container = this._container,
|
||||
centerPoint = map.latLngToContainerPoint(map.getCenter()),
|
||||
tooltipPoint = map.layerPointToContainerPoint(pos),
|
||||
direction = this.options.direction,
|
||||
tooltipWidth = container.offsetWidth,
|
||||
tooltipHeight = container.offsetHeight,
|
||||
offset = toPoint(this.options.offset),
|
||||
anchor = this._getAnchor();
|
||||
|
||||
if (direction === 'top') {
|
||||
pos = pos.add(toPoint(-tooltipWidth / 2 + offset.x, -tooltipHeight + offset.y + anchor.y, true));
|
||||
} else if (direction === 'bottom') {
|
||||
pos = pos.subtract(toPoint(tooltipWidth / 2 - offset.x, -offset.y, true));
|
||||
} else if (direction === 'center') {
|
||||
pos = pos.subtract(toPoint(tooltipWidth / 2 + offset.x, tooltipHeight / 2 - anchor.y + offset.y, true));
|
||||
} else if (direction === 'right' || direction === 'auto' && tooltipPoint.x < centerPoint.x) {
|
||||
direction = 'right';
|
||||
pos = pos.add(toPoint(offset.x + anchor.x, anchor.y - tooltipHeight / 2 + offset.y, true));
|
||||
} else {
|
||||
direction = 'left';
|
||||
pos = pos.subtract(toPoint(tooltipWidth + anchor.x - offset.x, tooltipHeight / 2 - anchor.y - offset.y, true));
|
||||
}
|
||||
|
||||
DomUtil.removeClass(container, 'leaflet-tooltip-right');
|
||||
DomUtil.removeClass(container, 'leaflet-tooltip-left');
|
||||
DomUtil.removeClass(container, 'leaflet-tooltip-top');
|
||||
DomUtil.removeClass(container, 'leaflet-tooltip-bottom');
|
||||
DomUtil.addClass(container, 'leaflet-tooltip-' + direction);
|
||||
DomUtil.setPosition(container, pos);
|
||||
},
|
||||
|
||||
_updatePosition: function () {
|
||||
var pos = this._map.latLngToLayerPoint(this._latlng);
|
||||
this._setPosition(pos);
|
||||
},
|
||||
|
||||
setOpacity: function (opacity) {
|
||||
this.options.opacity = opacity;
|
||||
|
||||
if (this._container) {
|
||||
DomUtil.setOpacity(this._container, opacity);
|
||||
}
|
||||
},
|
||||
|
||||
_animateZoom: function (e) {
|
||||
var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);
|
||||
this._setPosition(pos);
|
||||
},
|
||||
|
||||
_getAnchor: function () {
|
||||
// Where should we anchor the tooltip on the source layer?
|
||||
return toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// @namespace Tooltip
|
||||
// @factory L.tooltip(options?: Tooltip options, source?: Layer)
|
||||
// Instantiates a Tooltip object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.
|
||||
export var tooltip = function (options, source) {
|
||||
return new Tooltip(options, source);
|
||||
};
|
||||
|
||||
// @namespace Map
|
||||
// @section Methods for Layers and Controls
|
||||
Map.include({
|
||||
|
||||
// @method openTooltip(tooltip: Tooltip): this
|
||||
// Opens the specified tooltip.
|
||||
// @alternative
|
||||
// @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this
|
||||
// Creates a tooltip with the specified content and options and open it.
|
||||
openTooltip: function (tooltip, latlng, options) {
|
||||
if (!(tooltip instanceof Tooltip)) {
|
||||
tooltip = new Tooltip(options).setContent(tooltip);
|
||||
}
|
||||
|
||||
if (latlng) {
|
||||
tooltip.setLatLng(latlng);
|
||||
}
|
||||
|
||||
if (this.hasLayer(tooltip)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return this.addLayer(tooltip);
|
||||
},
|
||||
|
||||
// @method closeTooltip(tooltip?: Tooltip): this
|
||||
// Closes the tooltip given as parameter.
|
||||
closeTooltip: function (tooltip) {
|
||||
if (tooltip) {
|
||||
this.removeLayer(tooltip);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
* @namespace Layer
|
||||
* @section Tooltip methods example
|
||||
*
|
||||
* All layers share a set of methods convenient for binding tooltips to it.
|
||||
*
|
||||
* ```js
|
||||
* var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);
|
||||
* layer.openTooltip();
|
||||
* layer.closeTooltip();
|
||||
* ```
|
||||
*/
|
||||
|
||||
// @section Tooltip methods
|
||||
Layer.include({
|
||||
|
||||
// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this
|
||||
// Binds a tooltip to the layer with the passed `content` and sets up the
|
||||
// necessary event listeners. If a `Function` is passed it will receive
|
||||
// the layer as the first argument and should return a `String` or `HTMLElement`.
|
||||
bindTooltip: function (content, options) {
|
||||
|
||||
if (content instanceof Tooltip) {
|
||||
Util.setOptions(content, options);
|
||||
this._tooltip = content;
|
||||
content._source = this;
|
||||
} else {
|
||||
if (!this._tooltip || options) {
|
||||
this._tooltip = new Tooltip(options, this);
|
||||
}
|
||||
this._tooltip.setContent(content);
|
||||
|
||||
}
|
||||
|
||||
this._initTooltipInteractions();
|
||||
|
||||
if (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) {
|
||||
this.openTooltip();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method unbindTooltip(): this
|
||||
// Removes the tooltip previously bound with `bindTooltip`.
|
||||
unbindTooltip: function () {
|
||||
if (this._tooltip) {
|
||||
this._initTooltipInteractions(true);
|
||||
this.closeTooltip();
|
||||
this._tooltip = null;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_initTooltipInteractions: function (remove) {
|
||||
if (!remove && this._tooltipHandlersAdded) { return; }
|
||||
var onOff = remove ? 'off' : 'on',
|
||||
events = {
|
||||
remove: this.closeTooltip,
|
||||
move: this._moveTooltip
|
||||
};
|
||||
if (!this._tooltip.options.permanent) {
|
||||
events.mouseover = this._openTooltip;
|
||||
events.mouseout = this.closeTooltip;
|
||||
if (this._tooltip.options.sticky) {
|
||||
events.mousemove = this._moveTooltip;
|
||||
}
|
||||
if (Browser.touch) {
|
||||
events.click = this._openTooltip;
|
||||
}
|
||||
} else {
|
||||
events.add = this._openTooltip;
|
||||
}
|
||||
this[onOff](events);
|
||||
this._tooltipHandlersAdded = !remove;
|
||||
},
|
||||
|
||||
// @method openTooltip(latlng?: LatLng): this
|
||||
// Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.
|
||||
openTooltip: function (layer, latlng) {
|
||||
if (!(layer instanceof Layer)) {
|
||||
latlng = layer;
|
||||
layer = this;
|
||||
}
|
||||
|
||||
if (layer instanceof FeatureGroup) {
|
||||
for (var id in this._layers) {
|
||||
layer = this._layers[id];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!latlng) {
|
||||
latlng = layer.getCenter ? layer.getCenter() : layer.getLatLng();
|
||||
}
|
||||
|
||||
if (this._tooltip && this._map) {
|
||||
|
||||
// set tooltip source to this layer
|
||||
this._tooltip._source = layer;
|
||||
|
||||
// update the tooltip (content, layout, ect...)
|
||||
this._tooltip.update();
|
||||
|
||||
// open the tooltip on the map
|
||||
this._map.openTooltip(this._tooltip, latlng);
|
||||
|
||||
// Tooltip container may not be defined if not permanent and never
|
||||
// opened.
|
||||
if (this._tooltip.options.interactive && this._tooltip._container) {
|
||||
DomUtil.addClass(this._tooltip._container, 'leaflet-clickable');
|
||||
this.addInteractiveTarget(this._tooltip._container);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method closeTooltip(): this
|
||||
// Closes the tooltip bound to this layer if it is open.
|
||||
closeTooltip: function () {
|
||||
if (this._tooltip) {
|
||||
this._tooltip._close();
|
||||
if (this._tooltip.options.interactive && this._tooltip._container) {
|
||||
DomUtil.removeClass(this._tooltip._container, 'leaflet-clickable');
|
||||
this.removeInteractiveTarget(this._tooltip._container);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method toggleTooltip(): this
|
||||
// Opens or closes the tooltip bound to this layer depending on its current state.
|
||||
toggleTooltip: function (target) {
|
||||
if (this._tooltip) {
|
||||
if (this._tooltip._map) {
|
||||
this.closeTooltip();
|
||||
} else {
|
||||
this.openTooltip(target);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method isTooltipOpen(): boolean
|
||||
// Returns `true` if the tooltip bound to this layer is currently open.
|
||||
isTooltipOpen: function () {
|
||||
return this._tooltip.isOpen();
|
||||
},
|
||||
|
||||
// @method setTooltipContent(content: String|HTMLElement|Tooltip): this
|
||||
// Sets the content of the tooltip bound to this layer.
|
||||
setTooltipContent: function (content) {
|
||||
if (this._tooltip) {
|
||||
this._tooltip.setContent(content);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getTooltip(): Tooltip
|
||||
// Returns the tooltip bound to this layer.
|
||||
getTooltip: function () {
|
||||
return this._tooltip;
|
||||
},
|
||||
|
||||
_openTooltip: function (e) {
|
||||
var layer = e.layer || e.target;
|
||||
|
||||
if (!this._tooltip || !this._map) {
|
||||
return;
|
||||
}
|
||||
this.openTooltip(layer, this._tooltip.options.sticky ? e.latlng : undefined);
|
||||
},
|
||||
|
||||
_moveTooltip: function (e) {
|
||||
var latlng = e.latlng, containerPoint, layerPoint;
|
||||
if (this._tooltip.options.sticky && e.originalEvent) {
|
||||
containerPoint = this._map.mouseEventToContainerPoint(e.originalEvent);
|
||||
layerPoint = this._map.containerPointToLayerPoint(containerPoint);
|
||||
latlng = this._map.layerPointToLatLng(layerPoint);
|
||||
}
|
||||
this._tooltip.setLatLng(latlng);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,86 @@
|
||||
import {ImageOverlay} from './ImageOverlay';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
import * as Util from '../core/Util';
|
||||
|
||||
/*
|
||||
* @class VideoOverlay
|
||||
* @aka L.VideoOverlay
|
||||
* @inherits ImageOverlay
|
||||
*
|
||||
* Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`.
|
||||
*
|
||||
* A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video)
|
||||
* HTML5 element.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',
|
||||
* videoBounds = [[ 32, -130], [ 13, -100]];
|
||||
* L.videoOverlay(videoUrl, videoBounds ).addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var VideoOverlay = ImageOverlay.extend({
|
||||
|
||||
// @section
|
||||
// @aka VideoOverlay options
|
||||
options: {
|
||||
// @option autoplay: Boolean = true
|
||||
// Whether the video starts playing automatically when loaded.
|
||||
autoplay: true,
|
||||
|
||||
// @option loop: Boolean = true
|
||||
// Whether the video will loop back to the beginning when played.
|
||||
loop: true
|
||||
},
|
||||
|
||||
_initImage: function () {
|
||||
var wasElementSupplied = this._url.tagName === 'VIDEO';
|
||||
var vid = this._image = wasElementSupplied ? this._url : DomUtil.create('video');
|
||||
|
||||
DomUtil.addClass(vid, 'leaflet-image-layer');
|
||||
if (this._zoomAnimated) { DomUtil.addClass(vid, 'leaflet-zoom-animated'); }
|
||||
|
||||
vid.onselectstart = Util.falseFn;
|
||||
vid.onmousemove = Util.falseFn;
|
||||
|
||||
// @event load: Event
|
||||
// Fired when the video has finished loading the first frame
|
||||
vid.onloadeddata = Util.bind(this.fire, this, 'load');
|
||||
|
||||
if (wasElementSupplied) {
|
||||
var sourceElements = vid.getElementsByTagName('source');
|
||||
var sources = [];
|
||||
for (var j = 0; j < sourceElements.length; j++) {
|
||||
sources.push(sourceElements[j].src);
|
||||
}
|
||||
|
||||
this._url = (sourceElements.length > 0) ? sources : [vid.src];
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Util.isArray(this._url)) { this._url = [this._url]; }
|
||||
|
||||
vid.autoplay = !!this.options.autoplay;
|
||||
vid.loop = !!this.options.loop;
|
||||
for (var i = 0; i < this._url.length; i++) {
|
||||
var source = DomUtil.create('source');
|
||||
source.src = this._url[i];
|
||||
vid.appendChild(source);
|
||||
}
|
||||
}
|
||||
|
||||
// @method getElement(): HTMLVideoElement
|
||||
// Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)
|
||||
// used by this overlay.
|
||||
});
|
||||
|
||||
|
||||
// @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options)
|
||||
// Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the
|
||||
// geographical bounds it is tied to.
|
||||
|
||||
export function videoOverlay(video, bounds, options) {
|
||||
return new VideoOverlay(video, bounds, options);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export {Layer} from './Layer';
|
||||
export {LayerGroup, layerGroup} from './LayerGroup';
|
||||
export {FeatureGroup, featureGroup} from './FeatureGroup';
|
||||
import {GeoJSON, geoJSON, geoJson, geometryToLayer, coordsToLatLng, coordsToLatLngs, latLngToCoords, latLngsToCoords, getFeature, asFeature} from './GeoJSON';
|
||||
GeoJSON.geometryToLayer = geometryToLayer;
|
||||
GeoJSON.coordsToLatLng = coordsToLatLng;
|
||||
GeoJSON.coordsToLatLngs = coordsToLatLngs;
|
||||
GeoJSON.latLngToCoords = latLngToCoords;
|
||||
GeoJSON.latLngsToCoords = latLngsToCoords;
|
||||
GeoJSON.getFeature = getFeature;
|
||||
GeoJSON.asFeature = asFeature;
|
||||
export {GeoJSON, geoJSON, geoJson};
|
||||
|
||||
export {ImageOverlay, imageOverlay} from './ImageOverlay';
|
||||
export {VideoOverlay, videoOverlay} from './VideoOverlay';
|
||||
|
||||
export {DivOverlay} from './DivOverlay';
|
||||
export {Popup, popup} from './Popup';
|
||||
export {Tooltip, tooltip} from './Tooltip';
|
||||
|
||||
export * from './marker/index';
|
||||
export * from './tile/index';
|
||||
export * from './vector/index';
|
||||
@@ -0,0 +1,67 @@
|
||||
import {Icon} from './Icon';
|
||||
import {toPoint as point} from '../../geometry/Point';
|
||||
|
||||
/*
|
||||
* @class DivIcon
|
||||
* @aka L.DivIcon
|
||||
* @inherits Icon
|
||||
*
|
||||
* Represents a lightweight icon for markers that uses a simple `<div>`
|
||||
* element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var myIcon = L.divIcon({className: 'my-div-icon'});
|
||||
* // you can set .my-div-icon styles in CSS
|
||||
*
|
||||
* L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
|
||||
* ```
|
||||
*
|
||||
* By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
|
||||
*/
|
||||
|
||||
export var DivIcon = Icon.extend({
|
||||
options: {
|
||||
// @section
|
||||
// @aka DivIcon options
|
||||
iconSize: [12, 12], // also can be set through CSS
|
||||
|
||||
// iconAnchor: (Point),
|
||||
// popupAnchor: (Point),
|
||||
|
||||
// @option html: String = ''
|
||||
// Custom HTML code to put inside the div element, empty by default.
|
||||
html: false,
|
||||
|
||||
// @option bgPos: Point = [0, 0]
|
||||
// Optional relative position of the background, in pixels
|
||||
bgPos: null,
|
||||
|
||||
className: 'leaflet-div-icon'
|
||||
},
|
||||
|
||||
createIcon: function (oldIcon) {
|
||||
var div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),
|
||||
options = this.options;
|
||||
|
||||
div.innerHTML = options.html !== false ? options.html : '';
|
||||
|
||||
if (options.bgPos) {
|
||||
var bgPos = point(options.bgPos);
|
||||
div.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';
|
||||
}
|
||||
this._setIconStyles(div, 'icon');
|
||||
|
||||
return div;
|
||||
},
|
||||
|
||||
createShadow: function () {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
// @factory L.divIcon(options: DivIcon options)
|
||||
// Creates a `DivIcon` instance with the given options.
|
||||
export function divIcon(options) {
|
||||
return new DivIcon(options);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import {Icon} from './Icon';
|
||||
import * as DomUtil from '../../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @miniclass Icon.Default (Icon)
|
||||
* @aka L.Icon.Default
|
||||
* @section
|
||||
*
|
||||
* A trivial subclass of `Icon`, represents the icon to use in `Marker`s when
|
||||
* no icon is specified. Points to the blue marker image distributed with Leaflet
|
||||
* releases.
|
||||
*
|
||||
* In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`
|
||||
* (which is a set of `Icon options`).
|
||||
*
|
||||
* If you want to _completely_ replace the default icon, override the
|
||||
* `L.Marker.prototype.options.icon` with your own icon instead.
|
||||
*/
|
||||
|
||||
export var IconDefault = Icon.extend({
|
||||
|
||||
options: {
|
||||
iconUrl: 'marker-icon.png',
|
||||
iconRetinaUrl: 'marker-icon-2x.png',
|
||||
shadowUrl: 'marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
tooltipAnchor: [16, -28],
|
||||
shadowSize: [41, 41]
|
||||
},
|
||||
|
||||
_getIconUrl: function (name) {
|
||||
if (!IconDefault.imagePath) { // Deprecated, backwards-compatibility only
|
||||
IconDefault.imagePath = this._detectIconPath();
|
||||
}
|
||||
|
||||
// @option imagePath: String
|
||||
// `Icon.Default` will try to auto-detect the location of the
|
||||
// blue icon images. If you are placing these images in a non-standard
|
||||
// way, set this option to point to the right path.
|
||||
return (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);
|
||||
},
|
||||
|
||||
_detectIconPath: function () {
|
||||
var el = DomUtil.create('div', 'leaflet-default-icon-path', document.body);
|
||||
var path = DomUtil.getStyle(el, 'background-image') ||
|
||||
DomUtil.getStyle(el, 'backgroundImage'); // IE8
|
||||
|
||||
document.body.removeChild(el);
|
||||
|
||||
if (path === null || path.indexOf('url') !== 0) {
|
||||
path = '';
|
||||
} else {
|
||||
path = path.replace(/^url\(["']?/, '').replace(/marker-icon\.png["']?\)$/, '');
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,155 @@
|
||||
import {Class} from '../../core/Class';
|
||||
import {setOptions} from '../../core/Util';
|
||||
import {toPoint as point} from '../../geometry/Point';
|
||||
import {retina} from '../../core/Browser';
|
||||
|
||||
/*
|
||||
* @class Icon
|
||||
* @aka L.Icon
|
||||
*
|
||||
* Represents an icon to provide when creating a marker.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var myIcon = L.icon({
|
||||
* iconUrl: 'my-icon.png',
|
||||
* iconRetinaUrl: 'my-icon@2x.png',
|
||||
* iconSize: [38, 95],
|
||||
* iconAnchor: [22, 94],
|
||||
* popupAnchor: [-3, -76],
|
||||
* shadowUrl: 'my-icon-shadow.png',
|
||||
* shadowRetinaUrl: 'my-icon-shadow@2x.png',
|
||||
* shadowSize: [68, 95],
|
||||
* shadowAnchor: [22, 94]
|
||||
* });
|
||||
*
|
||||
* L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
|
||||
* ```
|
||||
*
|
||||
* `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.
|
||||
*
|
||||
*/
|
||||
|
||||
export var Icon = Class.extend({
|
||||
|
||||
/* @section
|
||||
* @aka Icon options
|
||||
*
|
||||
* @option iconUrl: String = null
|
||||
* **(required)** The URL to the icon image (absolute or relative to your script path).
|
||||
*
|
||||
* @option iconRetinaUrl: String = null
|
||||
* The URL to a retina sized version of the icon image (absolute or relative to your
|
||||
* script path). Used for Retina screen devices.
|
||||
*
|
||||
* @option iconSize: Point = null
|
||||
* Size of the icon image in pixels.
|
||||
*
|
||||
* @option iconAnchor: Point = null
|
||||
* The coordinates of the "tip" of the icon (relative to its top left corner). The icon
|
||||
* will be aligned so that this point is at the marker's geographical location. Centered
|
||||
* by default if size is specified, also can be set in CSS with negative margins.
|
||||
*
|
||||
* @option popupAnchor: Point = [0, 0]
|
||||
* The coordinates of the point from which popups will "open", relative to the icon anchor.
|
||||
*
|
||||
* @option tooltipAnchor: Point = [0, 0]
|
||||
* The coordinates of the point from which tooltips will "open", relative to the icon anchor.
|
||||
*
|
||||
* @option shadowUrl: String = null
|
||||
* The URL to the icon shadow image. If not specified, no shadow image will be created.
|
||||
*
|
||||
* @option shadowRetinaUrl: String = null
|
||||
*
|
||||
* @option shadowSize: Point = null
|
||||
* Size of the shadow image in pixels.
|
||||
*
|
||||
* @option shadowAnchor: Point = null
|
||||
* The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
|
||||
* as iconAnchor if not specified).
|
||||
*
|
||||
* @option className: String = ''
|
||||
* A custom class name to assign to both icon and shadow images. Empty by default.
|
||||
*/
|
||||
|
||||
options: {
|
||||
popupAnchor: [0, 0],
|
||||
tooltipAnchor: [0, 0]
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
setOptions(this, options);
|
||||
},
|
||||
|
||||
// @method createIcon(oldIcon?: HTMLElement): HTMLElement
|
||||
// Called internally when the icon has to be shown, returns a `<img>` HTML element
|
||||
// styled according to the options.
|
||||
createIcon: function (oldIcon) {
|
||||
return this._createIcon('icon', oldIcon);
|
||||
},
|
||||
|
||||
// @method createShadow(oldIcon?: HTMLElement): HTMLElement
|
||||
// As `createIcon`, but for the shadow beneath it.
|
||||
createShadow: function (oldIcon) {
|
||||
return this._createIcon('shadow', oldIcon);
|
||||
},
|
||||
|
||||
_createIcon: function (name, oldIcon) {
|
||||
var src = this._getIconUrl(name);
|
||||
|
||||
if (!src) {
|
||||
if (name === 'icon') {
|
||||
throw new Error('iconUrl not set in Icon options (see the docs).');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
var img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);
|
||||
this._setIconStyles(img, name);
|
||||
|
||||
return img;
|
||||
},
|
||||
|
||||
_setIconStyles: function (img, name) {
|
||||
var options = this.options;
|
||||
var sizeOption = options[name + 'Size'];
|
||||
|
||||
if (typeof sizeOption === 'number') {
|
||||
sizeOption = [sizeOption, sizeOption];
|
||||
}
|
||||
|
||||
var size = point(sizeOption),
|
||||
anchor = point(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||
|
||||
size && size.divideBy(2, true));
|
||||
|
||||
img.className = 'leaflet-marker-' + name + ' ' + (options.className || '');
|
||||
|
||||
if (anchor) {
|
||||
img.style.marginLeft = (-anchor.x) + 'px';
|
||||
img.style.marginTop = (-anchor.y) + 'px';
|
||||
}
|
||||
|
||||
if (size) {
|
||||
img.style.width = size.x + 'px';
|
||||
img.style.height = size.y + 'px';
|
||||
}
|
||||
},
|
||||
|
||||
_createImg: function (src, el) {
|
||||
el = el || document.createElement('img');
|
||||
el.src = src;
|
||||
return el;
|
||||
},
|
||||
|
||||
_getIconUrl: function (name) {
|
||||
return retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// @factory L.icon(options: Icon options)
|
||||
// Creates an icon instance with the given options.
|
||||
export function icon(options) {
|
||||
return new Icon(options);
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
import {Handler} from '../../core/Handler';
|
||||
import * as DomUtil from '../../dom/DomUtil';
|
||||
import {Draggable} from '../../dom/Draggable';
|
||||
import {toBounds} from '../../geometry/Bounds';
|
||||
import {toPoint} from '../../geometry/Point';
|
||||
import {requestAnimFrame, cancelAnimFrame} from '../../core/Util';
|
||||
|
||||
/*
|
||||
* L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.
|
||||
*/
|
||||
|
||||
|
||||
/* @namespace Marker
|
||||
* @section Interaction handlers
|
||||
*
|
||||
* Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example:
|
||||
*
|
||||
* ```js
|
||||
* marker.dragging.disable();
|
||||
* ```
|
||||
*
|
||||
* @property dragging: Handler
|
||||
* Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).
|
||||
*/
|
||||
|
||||
export var MarkerDrag = Handler.extend({
|
||||
initialize: function (marker) {
|
||||
this._marker = marker;
|
||||
},
|
||||
|
||||
addHooks: function () {
|
||||
var icon = this._marker._icon;
|
||||
|
||||
if (!this._draggable) {
|
||||
this._draggable = new Draggable(icon, icon, true);
|
||||
}
|
||||
|
||||
this._draggable.on({
|
||||
dragstart: this._onDragStart,
|
||||
predrag: this._onPreDrag,
|
||||
drag: this._onDrag,
|
||||
dragend: this._onDragEnd
|
||||
}, this).enable();
|
||||
|
||||
DomUtil.addClass(icon, 'leaflet-marker-draggable');
|
||||
},
|
||||
|
||||
removeHooks: function () {
|
||||
this._draggable.off({
|
||||
dragstart: this._onDragStart,
|
||||
predrag: this._onPreDrag,
|
||||
drag: this._onDrag,
|
||||
dragend: this._onDragEnd
|
||||
}, this).disable();
|
||||
|
||||
if (this._marker._icon) {
|
||||
DomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable');
|
||||
}
|
||||
},
|
||||
|
||||
moved: function () {
|
||||
return this._draggable && this._draggable._moved;
|
||||
},
|
||||
|
||||
_adjustPan: function (e) {
|
||||
var marker = this._marker,
|
||||
map = marker._map,
|
||||
speed = this._marker.options.autoPanSpeed,
|
||||
padding = this._marker.options.autoPanPadding,
|
||||
iconPos = DomUtil.getPosition(marker._icon),
|
||||
bounds = map.getPixelBounds(),
|
||||
origin = map.getPixelOrigin();
|
||||
|
||||
var panBounds = toBounds(
|
||||
bounds.min._subtract(origin).add(padding),
|
||||
bounds.max._subtract(origin).subtract(padding)
|
||||
);
|
||||
|
||||
if (!panBounds.contains(iconPos)) {
|
||||
// Compute incremental movement
|
||||
var movement = toPoint(
|
||||
(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -
|
||||
(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),
|
||||
|
||||
(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -
|
||||
(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)
|
||||
).multiplyBy(speed);
|
||||
|
||||
map.panBy(movement, {animate: false});
|
||||
|
||||
this._draggable._newPos._add(movement);
|
||||
this._draggable._startPos._add(movement);
|
||||
|
||||
DomUtil.setPosition(marker._icon, this._draggable._newPos);
|
||||
this._onDrag(e);
|
||||
|
||||
this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
|
||||
}
|
||||
},
|
||||
|
||||
_onDragStart: function () {
|
||||
// @section Dragging events
|
||||
// @event dragstart: Event
|
||||
// Fired when the user starts dragging the marker.
|
||||
|
||||
// @event movestart: Event
|
||||
// Fired when the marker starts moving (because of dragging).
|
||||
|
||||
this._oldLatLng = this._marker.getLatLng();
|
||||
this._marker
|
||||
.closePopup()
|
||||
.fire('movestart')
|
||||
.fire('dragstart');
|
||||
},
|
||||
|
||||
_onPreDrag: function (e) {
|
||||
if (this._marker.options.autoPan) {
|
||||
cancelAnimFrame(this._panRequest);
|
||||
this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
|
||||
}
|
||||
},
|
||||
|
||||
_onDrag: function (e) {
|
||||
var marker = this._marker,
|
||||
shadow = marker._shadow,
|
||||
iconPos = DomUtil.getPosition(marker._icon),
|
||||
latlng = marker._map.layerPointToLatLng(iconPos);
|
||||
|
||||
// update shadow position
|
||||
if (shadow) {
|
||||
DomUtil.setPosition(shadow, iconPos);
|
||||
}
|
||||
|
||||
marker._latlng = latlng;
|
||||
e.latlng = latlng;
|
||||
e.oldLatLng = this._oldLatLng;
|
||||
|
||||
// @event drag: Event
|
||||
// Fired repeatedly while the user drags the marker.
|
||||
marker
|
||||
.fire('move', e)
|
||||
.fire('drag', e);
|
||||
},
|
||||
|
||||
_onDragEnd: function (e) {
|
||||
// @event dragend: DragEndEvent
|
||||
// Fired when the user stops dragging the marker.
|
||||
|
||||
cancelAnimFrame(this._panRequest);
|
||||
|
||||
// @event moveend: Event
|
||||
// Fired when the marker stops moving (because of dragging).
|
||||
delete this._oldLatLng;
|
||||
this._marker
|
||||
.fire('moveend')
|
||||
.fire('dragend', e);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,369 @@
|
||||
import {Layer} from '../Layer';
|
||||
import {IconDefault} from './Icon.Default';
|
||||
import * as Util from '../../core/Util';
|
||||
import {toLatLng as latLng} from '../../geo/LatLng';
|
||||
import * as DomUtil from '../../dom/DomUtil';
|
||||
import {MarkerDrag} from './Marker.Drag';
|
||||
|
||||
/*
|
||||
* @class Marker
|
||||
* @inherits Interactive layer
|
||||
* @aka L.Marker
|
||||
* L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.marker([50.5, 30.5]).addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Marker = Layer.extend({
|
||||
|
||||
// @section
|
||||
// @aka Marker options
|
||||
options: {
|
||||
// @option icon: Icon = *
|
||||
// Icon instance to use for rendering the marker.
|
||||
// See [Icon documentation](#L.Icon) for details on how to customize the marker icon.
|
||||
// If not specified, a common instance of `L.Icon.Default` is used.
|
||||
icon: new IconDefault(),
|
||||
|
||||
// Option inherited from "Interactive layer" abstract class
|
||||
interactive: true,
|
||||
|
||||
// @option keyboard: Boolean = true
|
||||
// Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
|
||||
keyboard: true,
|
||||
|
||||
// @option title: String = ''
|
||||
// Text for the browser tooltip that appear on marker hover (no tooltip by default).
|
||||
title: '',
|
||||
|
||||
// @option alt: String = ''
|
||||
// Text for the `alt` attribute of the icon image (useful for accessibility).
|
||||
alt: '',
|
||||
|
||||
// @option zIndexOffset: Number = 0
|
||||
// By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).
|
||||
zIndexOffset: 0,
|
||||
|
||||
// @option opacity: Number = 1.0
|
||||
// The opacity of the marker.
|
||||
opacity: 1,
|
||||
|
||||
// @option riseOnHover: Boolean = false
|
||||
// If `true`, the marker will get on top of others when you hover the mouse over it.
|
||||
riseOnHover: false,
|
||||
|
||||
// @option riseOffset: Number = 250
|
||||
// The z-index offset used for the `riseOnHover` feature.
|
||||
riseOffset: 250,
|
||||
|
||||
// @option pane: String = 'markerPane'
|
||||
// `Map pane` where the markers icon will be added.
|
||||
pane: 'markerPane',
|
||||
|
||||
// @option bubblingMouseEvents: Boolean = false
|
||||
// When `true`, a mouse event on this marker will trigger the same event on the map
|
||||
// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
|
||||
bubblingMouseEvents: false,
|
||||
|
||||
// @section Draggable marker options
|
||||
// @option draggable: Boolean = false
|
||||
// Whether the marker is draggable with mouse/touch or not.
|
||||
draggable: false,
|
||||
|
||||
// @option autoPan: Boolean = false
|
||||
// Whether to pan the map when dragging this marker near its edge or not.
|
||||
autoPan: false,
|
||||
|
||||
// @option autoPanPadding: Point = Point(50, 50)
|
||||
// Distance (in pixels to the left/right and to the top/bottom) of the
|
||||
// map edge to start panning the map.
|
||||
autoPanPadding: [50, 50],
|
||||
|
||||
// @option autoPanSpeed: Number = 10
|
||||
// Number of pixels the map should pan by.
|
||||
autoPanSpeed: 10
|
||||
},
|
||||
|
||||
/* @section
|
||||
*
|
||||
* In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
|
||||
*/
|
||||
|
||||
initialize: function (latlng, options) {
|
||||
Util.setOptions(this, options);
|
||||
this._latlng = latLng(latlng);
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
map.on('zoomanim', this._animateZoom, this);
|
||||
}
|
||||
|
||||
this._initIcon();
|
||||
this.update();
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
if (this.dragging && this.dragging.enabled()) {
|
||||
this.options.draggable = true;
|
||||
this.dragging.removeHooks();
|
||||
}
|
||||
delete this.dragging;
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
map.off('zoomanim', this._animateZoom, this);
|
||||
}
|
||||
|
||||
this._removeIcon();
|
||||
this._removeShadow();
|
||||
},
|
||||
|
||||
getEvents: function () {
|
||||
return {
|
||||
zoom: this.update,
|
||||
viewreset: this.update
|
||||
};
|
||||
},
|
||||
|
||||
// @method getLatLng: LatLng
|
||||
// Returns the current geographical position of the marker.
|
||||
getLatLng: function () {
|
||||
return this._latlng;
|
||||
},
|
||||
|
||||
// @method setLatLng(latlng: LatLng): this
|
||||
// Changes the marker position to the given point.
|
||||
setLatLng: function (latlng) {
|
||||
var oldLatLng = this._latlng;
|
||||
this._latlng = latLng(latlng);
|
||||
this.update();
|
||||
|
||||
// @event move: Event
|
||||
// Fired when the marker is moved via [`setLatLng`](#marker-setlatlng) or by [dragging](#marker-dragging). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.
|
||||
return this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});
|
||||
},
|
||||
|
||||
// @method setZIndexOffset(offset: Number): this
|
||||
// Changes the [zIndex offset](#marker-zindexoffset) of the marker.
|
||||
setZIndexOffset: function (offset) {
|
||||
this.options.zIndexOffset = offset;
|
||||
return this.update();
|
||||
},
|
||||
|
||||
// @method setIcon(icon: Icon): this
|
||||
// Changes the marker icon.
|
||||
setIcon: function (icon) {
|
||||
|
||||
this.options.icon = icon;
|
||||
|
||||
if (this._map) {
|
||||
this._initIcon();
|
||||
this.update();
|
||||
}
|
||||
|
||||
if (this._popup) {
|
||||
this.bindPopup(this._popup, this._popup.options);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
getElement: function () {
|
||||
return this._icon;
|
||||
},
|
||||
|
||||
update: function () {
|
||||
|
||||
if (this._icon && this._map) {
|
||||
var pos = this._map.latLngToLayerPoint(this._latlng).round();
|
||||
this._setPos(pos);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_initIcon: function () {
|
||||
var options = this.options,
|
||||
classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');
|
||||
|
||||
var icon = options.icon.createIcon(this._icon),
|
||||
addIcon = false;
|
||||
|
||||
// if we're not reusing the icon, remove the old one and init new one
|
||||
if (icon !== this._icon) {
|
||||
if (this._icon) {
|
||||
this._removeIcon();
|
||||
}
|
||||
addIcon = true;
|
||||
|
||||
if (options.title) {
|
||||
icon.title = options.title;
|
||||
}
|
||||
|
||||
if (icon.tagName === 'IMG') {
|
||||
icon.alt = options.alt || '';
|
||||
}
|
||||
}
|
||||
|
||||
DomUtil.addClass(icon, classToAdd);
|
||||
|
||||
if (options.keyboard) {
|
||||
icon.tabIndex = '0';
|
||||
}
|
||||
|
||||
this._icon = icon;
|
||||
|
||||
if (options.riseOnHover) {
|
||||
this.on({
|
||||
mouseover: this._bringToFront,
|
||||
mouseout: this._resetZIndex
|
||||
});
|
||||
}
|
||||
|
||||
var newShadow = options.icon.createShadow(this._shadow),
|
||||
addShadow = false;
|
||||
|
||||
if (newShadow !== this._shadow) {
|
||||
this._removeShadow();
|
||||
addShadow = true;
|
||||
}
|
||||
|
||||
if (newShadow) {
|
||||
DomUtil.addClass(newShadow, classToAdd);
|
||||
newShadow.alt = '';
|
||||
}
|
||||
this._shadow = newShadow;
|
||||
|
||||
|
||||
if (options.opacity < 1) {
|
||||
this._updateOpacity();
|
||||
}
|
||||
|
||||
|
||||
if (addIcon) {
|
||||
this.getPane().appendChild(this._icon);
|
||||
}
|
||||
this._initInteraction();
|
||||
if (newShadow && addShadow) {
|
||||
this.getPane('shadowPane').appendChild(this._shadow);
|
||||
}
|
||||
},
|
||||
|
||||
_removeIcon: function () {
|
||||
if (this.options.riseOnHover) {
|
||||
this.off({
|
||||
mouseover: this._bringToFront,
|
||||
mouseout: this._resetZIndex
|
||||
});
|
||||
}
|
||||
|
||||
DomUtil.remove(this._icon);
|
||||
this.removeInteractiveTarget(this._icon);
|
||||
|
||||
this._icon = null;
|
||||
},
|
||||
|
||||
_removeShadow: function () {
|
||||
if (this._shadow) {
|
||||
DomUtil.remove(this._shadow);
|
||||
}
|
||||
this._shadow = null;
|
||||
},
|
||||
|
||||
_setPos: function (pos) {
|
||||
DomUtil.setPosition(this._icon, pos);
|
||||
|
||||
if (this._shadow) {
|
||||
DomUtil.setPosition(this._shadow, pos);
|
||||
}
|
||||
|
||||
this._zIndex = pos.y + this.options.zIndexOffset;
|
||||
|
||||
this._resetZIndex();
|
||||
},
|
||||
|
||||
_updateZIndex: function (offset) {
|
||||
this._icon.style.zIndex = this._zIndex + offset;
|
||||
},
|
||||
|
||||
_animateZoom: function (opt) {
|
||||
var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round();
|
||||
|
||||
this._setPos(pos);
|
||||
},
|
||||
|
||||
_initInteraction: function () {
|
||||
|
||||
if (!this.options.interactive) { return; }
|
||||
|
||||
DomUtil.addClass(this._icon, 'leaflet-interactive');
|
||||
|
||||
this.addInteractiveTarget(this._icon);
|
||||
|
||||
if (MarkerDrag) {
|
||||
var draggable = this.options.draggable;
|
||||
if (this.dragging) {
|
||||
draggable = this.dragging.enabled();
|
||||
this.dragging.disable();
|
||||
}
|
||||
|
||||
this.dragging = new MarkerDrag(this);
|
||||
|
||||
if (draggable) {
|
||||
this.dragging.enable();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// @method setOpacity(opacity: Number): this
|
||||
// Changes the opacity of the marker.
|
||||
setOpacity: function (opacity) {
|
||||
this.options.opacity = opacity;
|
||||
if (this._map) {
|
||||
this._updateOpacity();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_updateOpacity: function () {
|
||||
var opacity = this.options.opacity;
|
||||
|
||||
DomUtil.setOpacity(this._icon, opacity);
|
||||
|
||||
if (this._shadow) {
|
||||
DomUtil.setOpacity(this._shadow, opacity);
|
||||
}
|
||||
},
|
||||
|
||||
_bringToFront: function () {
|
||||
this._updateZIndex(this.options.riseOffset);
|
||||
},
|
||||
|
||||
_resetZIndex: function () {
|
||||
this._updateZIndex(0);
|
||||
},
|
||||
|
||||
_getPopupAnchor: function () {
|
||||
return this.options.icon.options.popupAnchor;
|
||||
},
|
||||
|
||||
_getTooltipAnchor: function () {
|
||||
return this.options.icon.options.tooltipAnchor;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// factory L.marker(latlng: LatLng, options? : Marker options)
|
||||
|
||||
// @factory L.marker(latlng: LatLng, options? : Marker options)
|
||||
// Instantiates a Marker object given a geographical point and optionally an options object.
|
||||
export function marker(latlng, options) {
|
||||
return new Marker(latlng, options);
|
||||
}
|
||||