From 4042a9bb41cbb0b185274e9859f78f264d980669 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 16 May 2011 11:41:30 -0700 Subject: [PATCH 001/816] Update features with WMS support --- features.html | 299 +++++++++++++++++++++++++------------------------- 1 file changed, 150 insertions(+), 149 deletions(-) diff --git a/features.html b/features.html index 53fa9acf9d1..00b78bac39d 100644 --- a/features.html +++ b/features.html @@ -1,150 +1,151 @@ - - - - Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Features - - - - - - - - - - - - - - - - - - - - - - - -
-

Leaflet

-

A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

- - - -

Leaflet features

- -

Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being flexible enough to be easily extended by writing third-party plugins.

- -

- - -

- -
-
-

Available map layers

-
    -
  • Tile layers
  • -
  • Polylines, polygons, circles
  • -
  • Markers
  • -
  • Popups
  • -
  • Image overlays
  • -
  • GeoJSON
  • -
- -

Interaction features

-

On desktop browsers

-
    -
  • Drag panning
  • -
  • Scroll wheel zoom
  • -
  • Double click zoom
  • -
  • Shift-drag zoom to bounding box
  • -
-

On mobile browsers (iOS, Android)

-
    -
  • Touch-drag panning
  • -
  • Multi-touch zoom (iOS only)
  • -
  • Double tap zoom
  • -
  • Panning inertia
  • -
-
- -
-

Visual features

-
    -
  • Panning animation
  • -
  • Zooming animation on modern browsers (except IE)
  • -
  • Smooth continuous zoom on iOS
  • -
  • Tile and popup fade animation
  • -
  • Very nice default design for markers and popups
  • -
- -

Customization features

-
    -
  • Pure CSS3 popups for easy restyling
  • - -
  • A simple interface for implementing custom map layers
  • -
  • The same for custom map controls
  • -
  • Ability to implement custom map projections
  • -
- -

Performance features

-
    -
  • Hardware acceleration on iOS makes it feel as smooth as native apps
  • -
  • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
  • -
  • Modular build system allows you to reduce the size of the library by leaving out the code you don't need
  • -
-
- -
-

Map controls

-
    -
  • Zoom buttons
  • -
  • Attribution
  • -
  • Zoom slider
  • -
  • Layer switcher
  • - -
- -

Browser support

-

On desktop

-
    -
  • Firefox 3.6+
  • -
  • Chrome
  • -
  • Safari 5+
  • -
  • IE 7–9
  • -
  • IE 6 (not perfect but accessible)
  • -
-

On mobile

-
    -
  • Safari for iOS 3/4+
  • -
  • WebKit for Android 2.2+
  • -
-
-
- -

If you find some feature really missing in Leaflet, please submit it to the issue tracker.

- - -
- -

© 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

-
- - Fork me on GitHub - - - - + + + + Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Features + + + + + + + + + + + + + + + + + + + + + + + +
+

Leaflet

+

A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

+ + + +

Leaflet features

+ +

Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being flexible enough to be easily extended by writing third-party plugins.

+ +

+ + +

+ +
+
+

Available map layers

+
    +
  • Tile layers
  • +
  • Polylines, polygons, circles
  • +
  • Markers
  • +
  • Popups
  • +
  • Image overlays
  • +
  • WMS layers
  • +
  • GeoJSON
  • +
+ +

Interaction features

+

On desktop browsers

+
    +
  • Drag panning
  • +
  • Scroll wheel zoom
  • +
  • Double click zoom
  • +
  • Shift-drag zoom to bounding box
  • +
+

On mobile browsers (iOS, Android)

+
    +
  • Touch-drag panning
  • +
  • Multi-touch zoom (iOS only)
  • +
  • Double tap zoom
  • +
  • Panning inertia
  • +
+
+ +
+

Visual features

+
    +
  • Panning animation
  • +
  • Zooming animation on modern browsers (except IE)
  • +
  • Smooth continuous zoom on iOS
  • +
  • Tile and popup fade animation
  • +
  • Very nice default design for markers and popups
  • +
+ +

Customization features

+
    +
  • Pure CSS3 popups for easy restyling
  • + +
  • A simple interface for implementing custom map layers
  • +
  • The same for custom map controls
  • +
  • Ability to implement custom map projections
  • +
+ +

Performance features

+
    +
  • Hardware acceleration on iOS makes it feel as smooth as native apps
  • +
  • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
  • +
  • Modular build system allows you to reduce the size of the library by leaving out the code you don't need
  • +
+
+ +
+

Map controls

+
    +
  • Zoom buttons
  • +
  • Attribution
  • +
  • Zoom slider
  • +
  • Layer switcher
  • + +
+ +

Browser support

+

On desktop

+
    +
  • Firefox 3.6+
  • +
  • Chrome
  • +
  • Safari 5+
  • +
  • IE 7–9
  • +
  • IE 6 (not perfect but accessible)
  • +
+

On mobile

+
    +
  • Safari for iOS 3/4+
  • +
  • WebKit for Android 2.2+
  • +
+
+
+ +

If you find some feature really missing in Leaflet, please submit it to the issue tracker.

+ + +
+ +

© 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

+
+ + Fork me on GitHub + + + + \ No newline at end of file From 201d4ca3066bbaf1488cd77afeec2bd9803cb4e5 Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 18 May 2011 12:15:05 +0300 Subject: [PATCH 002/816] changelog link --- download.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.html b/download.html index 5cfd5421b37..40632b8b7f1 100644 --- a/download.html +++ b/download.html @@ -43,7 +43,7 @@

Download Leaflet

Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

-

Download Leaflet edge (zip)

+

Download Leaflet edge (zip) — Changelog

From c8c18fc7790c8abe77850a466290b9039f054269 Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 18 May 2011 14:02:56 +0300 Subject: [PATCH 003/816] L.Icon documentation --- reference.html | 73 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index d2d03303946..b2db9f7fc5e 100644 --- a/reference.html +++ b/reference.html @@ -82,7 +82,7 @@

Basic types

  • LatLngBounds
  • Point
  • Bounds
  • -
  • Icon
  • +
  • Icon
  • Controls

    @@ -89,22 +91,13 @@

    Controls

  • Zoom
  • Attribution
  • -
    - -
    +

    Utility

    -->
    +
    +

    Interfaces

    + +

    @@ -367,6 +369,11 @@

    Events

    LocationEvent Fired when geolocation (using locate or locateAndSetView method) went successfully. + + locationerror + ErrorEvent + Fired when geolocation (using locate or locateAndSetView method) failed. + @@ -399,17 +406,17 @@

    Methods that modify map state

    Decreases the zoom of the map by 1. - fitBounds( <LatLngBounds> bounds ) + fitBounds( <LatLngBounds> bounds ) this Sets a map view that contains the given geographical bounds with the maximum zoom level possible. - panTo( <LatLng> latlng ) + panTo( <LatLnglatlng ) this Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. - panBy( <Point> point ) + panBy( <Pointpoint ) this Pans the map by a given number of pixels (animated). @@ -419,9 +426,18 @@

    Methods that modify map state

    Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - locate( <Boolean> noAutoFitBounds? ) + locate() + this + Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. + + + locateAndSetView( <Number> maxZoom ) this - Tries to locate the user using Geolocation API and zooms the map if successful, firing locationfound (with location data) or locationerror event. Set noAutoFitBounds to true if you don't want the map view to be set automatically (false by default). + The same as locate method, but it automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). You can optionally specify the maximum zoom of the view. @@ -935,6 +951,77 @@

    Options

    If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false. + + + +

    L.TileLayer.WMS

    + +

    Used to display WMS services as tile layers on the map. Extends TileLayer, implements ILayer interface.

    + +

    Usage example

    + +
    var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
    +	layers: 'nexrad-n0r-900913',
    +	format: 'image/png',
    +	transparent: true,
    +	attribution: "Weather data © 2011 IEM Nexrad"
    +});
    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS optionsoptions )Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
    + +

    Options

    + +

    Includes all TileLayer options and additionally:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionTypeDefault valueDescription
    layersString-(required) Comma-separated list of WMS layers to show.
    stylesStringComma-separated list of WMS styles.
    formatStringimage/jpegWMS image format (use 'image/png' for layers with transparency).
    transparentBooleanfalseIf true, the WMS service will return images with transparency.
    versionString1.1.1Version of the WMS service to use.
    @@ -1146,7 +1233,7 @@

    Constructor

    L.Circle

    -

    A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    +

    A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    Constructor

    @@ -1157,11 +1244,28 @@

    Constructor

    L.Circle( <LatLnglatlng, <Number> radius, <Path optionsoptions? ) - Instantiates a polygon object given an geographical point, a radius in pixels and optionally an options object. + Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. +

    L.CircleMarker

    + +

    A circle of a fixed size with radius specified in pixels. Extends Circe. Use Map#addLayer to add it to the map.

    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.CircleMarker( <LatLnglatlng, <Number> radius, <Path optionsoptions? )Instantiates a circle marker given a geographical point, a radius in pixels and optionally an options object.
    +

    L.LatLng

    @@ -1746,6 +1850,26 @@

    LocationEvent

    +

    ErrorEvent

    + + + + + + + + + + + + + + + + + +
    propertytypedescription
    messageStringError message.
    codeNumberError code (if applicable).
    +

    LayerEvent

    From 41a84e44ea5a270c4d7007978cd6c70045a3e3a3 Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 19 May 2011 17:29:37 +0300 Subject: [PATCH 007/816] update geolocation example --- examples/mobile-example.html | 9 ++++++--- examples/mobile.html | 13 ++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/mobile-example.html b/examples/mobile-example.html index 24ba6f96adb..3bd91670c4b 100644 --- a/examples/mobile-example.html +++ b/examples/mobile-example.html @@ -38,15 +38,18 @@ map.locateAndSetView(); function onLocationFound(e) { + var radius = e.accuracy / 2; + var marker = new L.Marker(e.latlng); map.addLayer(marker); + marker.bindPopup("You are within " + radius + " meters from this point").openPopup(); - marker.bindPopup("You are within " + (e.accuracy/2) + " meters from this point").openPopup(); + var circle = new L.Circle(e.latlng, radius); + map.addLayer(circle); } function onLocationError(e) { - alert("Geolocation error: " + e.message); - map.fitWorld(); + alert(e.message); } diff --git a/examples/mobile.html b/examples/mobile.html index a74472dfd30..d22ee729fdf 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -76,19 +76,23 @@

    Initializing the map

    Geolocation

    -

    Leaflet has a very handy shortcut for zooming the map view to the detected location, replacing the usual setView method in the code:

    +

    Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

    -
    map.locateAndSetView();
    +
    map.locateAndSetView(16);
    -

    Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

    +

    Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

    map.on('locationfound', onLocationFound);
     		
     function onLocationFound(e) {
    +	var radius = e.accuracy / 2;
    +
     	var marker = new L.Marker(e.latlng);
     	map.addLayer(marker);
    +	marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
     	
    -	marker.bindPopup("You are within " + (e.accuracy / 2) + " meters from this point").openPopup();
    +	var circle = new L.Circle(e.latlng, radius);
    +	map.addLayer(circle);	
     }

    Excellent! But it would also be nice to show an error message if the geolocation failed:

    @@ -97,7 +101,6 @@

    Geolocation

    function onLocationError(e) { alert(e.message); - map.fitWorld(); }

    Now the example is complete — try it on your mobile phone: View the full example →

    From e932016bada5279d5309b1b31037c2ede7aa820e Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 19 May 2011 17:39:47 +0300 Subject: [PATCH 008/816] map/marker dragstart/drag/dragend event docs --- reference.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/reference.html b/reference.html index da7f81504ef..7b6f6aa1774 100644 --- a/reference.html +++ b/reference.html @@ -349,6 +349,21 @@

    Events

    + + + + + + + + + + + + + + + + + + + + + + + +
    Event Fired when the view of the map ends changed (e.g. user stopped dragging the map).
    dragstartEvent + Fired when the user starts dragging the map.
    dragEvent + Fired repeatedly while the user drags the map.
    dragendEvent + Fired when the user stops dragging the map.
    zoomend Event @@ -726,6 +741,21 @@

    Events

    Event Fired when the user double-clicks (or double-taps) the marker.
    dragstartEvent + Fired when the user starts dragging the marker.
    dragEvent + Fired repeatedly while the user drags the marker.
    dragendEvent + Fired when the user stops dragging the marker.

    Methods

    From 2e459e734e9f23bcea1c7f6f527a96aa9c629566 Mon Sep 17 00:00:00 2001 From: Mourner Date: Fri, 20 May 2011 16:37:35 +0300 Subject: [PATCH 009/816] add Opera to the list of supported browsers --- features.html | 1 + 1 file changed, 1 insertion(+) diff --git a/features.html b/features.html index 00b78bac39d..2b296ca9264 100644 --- a/features.html +++ b/features.html @@ -121,6 +121,7 @@

    On desktop

  • Firefox 3.6+
  • Chrome
  • Safari 5+
  • +
  • Opera 11.11+
  • IE 7–9
  • IE 6 (not perfect but accessible)
  • From 1c2696eeafb7a5aed7e46d7c8c371f6ff8b57abc Mon Sep 17 00:00:00 2001 From: Mourner Date: Mon, 23 May 2011 12:26:27 +0300 Subject: [PATCH 010/816] fix map occasionally breaking while zooming on iOS, fixes #32 --- CHANGELOG.md | 1 + dist/leaflet.js | 8 ++++---- src/map/ext/Map.ZoomAnimation.js | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e37063b0d65..37cae1992da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Leaflet Changelog * Improved geolocation error handling: better error messages, explicit timeout, set world view on locateAndSetView failure. [#61](https://github.com/CloudMade/Leaflet/issues/61) * Fixed a bug where paths would not appear in IE8. * Fixed a bug where zooming is broken if the map contains a polygon and you zoom to an area where it's not visible. [#47](https://github.com/CloudMade/Leaflet/issues/47) + * Fixed a bug where map would occasionally break while multi-touch-zooming on iOS. [#32] * Fixed a bug where closed polylines would not appear on the map. * Fixed incorrect zoom animation & popup styling in Opera 11.11. * Fixed a bug where double click zoom wouldn't work if popup is opened on map click diff --git a/dist/leaflet.js b/dist/leaflet.js index d90a9a5eee5..7a4bbb7dac1 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -92,8 +92,8 @@ this._clearTileBgTimer=setTimeout(L.Util.bind(this._clearTileBg,this),500)},_get "timeout";if(this._setViewOnLocate)this.fitWorld(),this._setViewOnLocate=!1;this.fire("locationerror",{code:a,message:"Geolocation error: "+b+"."})},_handleGeolocationResponse:function(a){var b=180*a.coords.accuracy/4E7,c=b*2,d=a.coords.latitude,e=a.coords.longitude,f=new L.LatLng(d-b,e-c);b=new L.LatLng(d+b,e+c);f=new L.LatLngBounds(f,b);if(this._setViewOnLocate)b=Math.min(this.getBoundsZoom(f),this._maxLocateZoom),this.setView(f.getCenter(),b),this._setViewOnLocate=!1;this.fire("locationfound", {latlng:new L.LatLng(d,e),bounds:f,accuracy:a.coords.accuracy})}});L.Map.include({openPopup:function(a){this.closePopup();this._popup=a;return this.addLayer(a)},closePopup:function(){this._popup&&this.removeLayer(this._popup);return this}});L.Map.include(!L.Transition||!L.Transition.implemented()?{}:{setView:function(a,b,c){b=this._limitZoom(b);var d=this._zoom!=b;if(this._loaded&&!c&&this._layers&&(c=this._getNewTopLeftPoint(a).subtract(this._getTopLeftPoint()),d?this._zoomToIfCenterInView&&this._zoomToIfCenterInView(a,b,c):this._panByIfClose(c)))return this;this._resetView(a,b);return this},panBy:function(a){if(!this._panTransition)this._panTransition=new L.Transition(this._mapPane,{duration:0.3}),this._panTransition.on("step",this._onPanTransitionStep, this),this._panTransition.on("end",this._onPanTransitionEnd,this);this.fire(this,"movestart");this._panTransition.run({position:L.DomUtil.getPosition(this._mapPane).subtract(a)});return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){this.fire("moveend")},_panByIfClose:function(a){if(this._offsetIsWithinView(a))return this.panBy(a),!0;return!1},_offsetIsWithinView:function(a,b){var c=b||1,d=this.getSize();return Math.abs(a.x)<=d.x*c&&Math.abs(a.y)<=d.y*c}});L.Map.include(!L.DomUtil.TRANSITION?{}:{_zoomToIfCenterInView:function(a,b,c){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var d=Math.pow(2,b-this._zoom);c=c.divideBy(1-1/d);if(!this._offsetIsWithinView(c,1))return!1;this._mapPane.className+=" leaflet-zoom-anim";c=this.containerPointToLayerPoint(this.getSize().divideBy(2)).add(c);this._prepareTileBg();this._runAnimation(a,b,d,c);return!0},_runAnimation:function(a,b,c,d){this._animatingZoom=!0;this._animateToCenter=a;this._animateToZoom= -b;a=L.DomUtil.TRANSFORM;if(L.Browser.gecko||window.opera)this._tileBg.style[a]+=" translate(0,0)";L.Browser.android?(this._tileBg.style[a+"Origin"]=d.x+"px "+d.y+"px",c="scale("+c+")"):c=L.DomUtil.getScaleString(c,d);L.Util.falseFn(this._tileBg.offsetWidth);d={};d[a]=this._tileBg.style[a]+" "+c;this._tileBg.transition.run(d)},_prepareTileBg:function(){if(!this._tileBg)this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),this._tileBg.style.zIndex=1;var a=this._tilePane,b=this._tileBg;b.innerHTML= -"";b.style[L.DomUtil.TRANSFORM]="";b.style.display="none";b.empty=!0;a.empty=!1;this._tilePane=this._panes.tilePane=b;this._tileBg=a;if(!this._tileBg.transition)this._tileBg.transition=new L.Transition(this._tileBg,{duration:0.3,easing:"cubic-bezier(0.25,0.1,0.25,0.75)"}),this._tileBg.transition.on("end",this._onZoomTransitionEnd,this);this._removeExcessiveBgTiles()},_removeExcessiveBgTiles:function(){for(var a=[].slice.call(this._tileBg.getElementsByTagName("img")),b=this._container.getBoundingClientRect(), -c=0,d=a.length;c=b.right||e.top>=b.bottom||e.bottom<=b.top)a[c].src="",a[c].parentNode.removeChild(a[c])}},_onZoomTransitionEnd:function(){this._restoreTileFront();L.Util.falseFn(this._tileBg.offsetWidth);this._resetView(this._animateToCenter,this._animateToZoom,!0);this._mapPane.className=this._mapPane.className.replace(" leaflet-zoom-anim","");this._animatingZoom=!1},_restoreTileFront:function(){this._tilePane.style.display= -"";this._tilePane.style.zIndex=2;this._tileBg.style.zIndex=1},_clearTileBg:function(){if(!this._animatingZoom)this._tileBg.innerHTML=""}});L.Map.include({addControl:function(a){a.onAdd(this);var b=a.getPosition(),c=this._controlCorners[b];a=a.getContainer();L.DomUtil.addClass(a,"leaflet-control");b.indexOf("bottom")!=-1?c.insertBefore(a,c.firstChild):c.appendChild(a);return this},removeControl:function(){var a=this._controlCorners[control.getPosition()],b=control.getContainer();a.removeChild(b);if(control.onRemove)control.onRemove(this);return this},_initControlPos:function(){var a=this._controlCorners={},b=L.DomUtil.create("div","leaflet-control-container", +b;a=L.DomUtil.TRANSFORM;if(L.Browser.gecko||window.opera)this._tileBg.style[a]+=" translate(0,0)";L.Browser.android?(this._tileBg.style[a+"Origin"]=d.x+"px "+d.y+"px",c="scale("+c+")"):c=L.DomUtil.getScaleString(c,d);L.Util.falseFn(this._tileBg.offsetWidth);d={};d[a]=this._tileBg.style[a]+" "+c;this._tileBg.transition.run(d)},_prepareTileBg:function(){if(!this._tileBg)this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),this._tileBg.style.zIndex=1;var a=this._tilePane,b=this._tileBg;b.style[L.DomUtil.TRANSFORM]= +"";b.style.visibility="hidden";b.empty=!0;a.empty=!1;this._tilePane=this._panes.tilePane=b;this._tileBg=a;if(!this._tileBg.transition)this._tileBg.transition=new L.Transition(this._tileBg,{duration:0.3,easing:"cubic-bezier(0.25,0.1,0.25,0.75)"}),this._tileBg.transition.on("end",this._onZoomTransitionEnd,this);this._removeExcessiveBgTiles()},_removeExcessiveBgTiles:function(){for(var a=[].slice.call(this._tileBg.getElementsByTagName("img")),b=this._container.getBoundingClientRect(),c=0,d=a.length;c< +d;c++){var e=a[c].getBoundingClientRect();if(!a[c].complete||e.right<=b.left||e.left>=b.right||e.top>=b.bottom||e.bottom<=b.top)a[c].src="",a[c].parentNode.removeChild(a[c])}},_onZoomTransitionEnd:function(){this._restoreTileFront();L.Util.falseFn(this._tileBg.offsetWidth);this._resetView(this._animateToCenter,this._animateToZoom,!0);this._mapPane.className=this._mapPane.className.replace(" leaflet-zoom-anim","");this._animatingZoom=!1},_restoreTileFront:function(){this._tilePane.innerHTML="";this._tilePane.style.visibility= +"";this._tilePane.style.zIndex=2;this._tileBg.style.zIndex=1},_clearTileBg:function(){if(!this._animatingZoom&&!this.touchZoom._zooming)this._tileBg.innerHTML=""}});L.Map.include({addControl:function(a){a.onAdd(this);var b=a.getPosition(),c=this._controlCorners[b];a=a.getContainer();L.DomUtil.addClass(a,"leaflet-control");b.indexOf("bottom")!=-1?c.insertBefore(a,c.firstChild):c.appendChild(a);return this},removeControl:function(){var a=this._controlCorners[control.getPosition()],b=control.getContainer();a.removeChild(b);if(control.onRemove)control.onRemove(this);return this},_initControlPos:function(){var a=this._controlCorners={},b=L.DomUtil.create("div","leaflet-control-container", this._container);L.Browser.mobileWebkit&&(b.className+=" leaflet-big-buttons");a.topLeft=L.DomUtil.create("div","leaflet-top leaflet-left",b);a.topRight=L.DomUtil.create("div","leaflet-top leaflet-right",b);a.bottomLeft=L.DomUtil.create("div","leaflet-bottom leaflet-left",b);a.bottomRight=L.DomUtil.create("div","leaflet-bottom leaflet-right",b)}}); diff --git a/src/map/ext/Map.ZoomAnimation.js b/src/map/ext/Map.ZoomAnimation.js index 5b0f1b3a51f..0d0e0112f32 100644 --- a/src/map/ext/Map.ZoomAnimation.js +++ b/src/map/ext/Map.ZoomAnimation.js @@ -66,9 +66,9 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : { tileBg = this._tileBg; // prepare the background pane to become the main tile pane - tileBg.innerHTML = ''; + //tileBg.innerHTML = ''; tileBg.style[L.DomUtil.TRANSFORM] = ''; - tileBg.style.display = 'none'; + tileBg.style.visibility = 'hidden'; // tells tile layers to reinitialize their containers tileBg.empty = true; @@ -118,13 +118,14 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : { }, _restoreTileFront: function() { - this._tilePane.style.display = ''; + this._tilePane.innerHTML = ''; + this._tilePane.style.visibility = ''; this._tilePane.style.zIndex = 2; this._tileBg.style.zIndex = 1; }, _clearTileBg: function() { - if (!this._animatingZoom) { + if (!this._animatingZoom && !this.touchZoom._zooming) { this._tileBg.innerHTML = ''; } } From 0221151957c8ac0a6d24e209528962fddd7b404d Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 25 May 2011 19:11:45 +0300 Subject: [PATCH 011/816] new polyline methods docs --- reference.html | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 7b6f6aa1774..255af9b21f7 100644 --- a/reference.html +++ b/reference.html @@ -1240,12 +1240,38 @@

    Options

    false Disabled polyline clipping. + + +

    Methods

    + + + + + + + + + + + + + + + + + + + + + +
    MethodReturnsDescription
    addLatLng( <LatLnglatlng )thisAdds a given point to the polyline.
    setLatLngs( <LatLng[]> latlngs )thisReplaces all the points in the polyline with the given array of geographical points.
    spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLnglatlng1?, <LatLnglatlng2?, … )LatLng[]Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any).
    +

    L.Polygon

    -

    A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

    +

    A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

    Constructor

    @@ -1260,6 +1286,8 @@

    Constructor

    +

    Polygon the same options and methods as Polyline.

    +

    L.Circle

    From 716c5d1727bc9a018f0cd158b17855576b563e4b Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 26 May 2011 11:58:58 +0300 Subject: [PATCH 012/816] update bounds/latlngbounds docs --- reference.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference.html b/reference.html index 255af9b21f7..c7d6dbdcb2e 100644 --- a/reference.html +++ b/reference.html @@ -1482,6 +1482,11 @@

    Methods

    Boolean Returns true if the rectangle contains the given one. + + contains( <LatLnglatlng ) + Boolean + Returns true if the rectangle contains the given point. + @@ -1643,6 +1648,11 @@

    Methods

    Boolean Returns true if the rectangle contains the given one. + + contains( <Pointpoint ) + Boolean + Returns true if the rectangle contains the given point. + From d8b008148a878aea90ab913eb285a71cde1b53b3 Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 26 May 2011 12:03:29 +0300 Subject: [PATCH 013/816] Marker setLatLng docs --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index c7d6dbdcb2e..d4530ba0692 100644 --- a/reference.html +++ b/reference.html @@ -771,6 +771,11 @@

    Methods

    LatLng Returns the current geographical position of the marker. + + setLatLng(<LatLnglatlng ) + this + Changes the marker position to the given point. + bindPopup( <String> htmlContent, <Popup optionsoptions? ) this From df3bd4f3dc338deef9a34f494bd7fda17e30e7ea Mon Sep 17 00:00:00 2001 From: Mourner Date: Mon, 30 May 2011 15:13:43 +0300 Subject: [PATCH 014/816] TileLayer.Canvas docs --- reference.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index d4530ba0692..ad6e95de7e7 100644 --- a/reference.html +++ b/reference.html @@ -66,6 +66,7 @@

    Raster layers

    Vector layers

    @@ -973,6 +974,12 @@

    Options

    '' e.g. "© CloudMade" — the string used by the attribution control, describes the layer data. + + scheme + String + 'xyz' + Either 'xyz' or 'tms', affects tile numbering (TMS servers use inverse Y axis numbering). + unloadInvisibleTiles Boolean @@ -1057,7 +1064,49 @@

    Options

    Version of the WMS service to use. - + + + +

    L.TileLayer.Canvas

    + +

    Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer, implements ILayer interface.

    + +

    Usage example

    + +
    var canvasTiles = new L.TileLayer.Canvas();
    +		
    +canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
    +	var ctx = canvas.getContext('2d');
    +	// draw something on the tile canvas
    +}
    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.TileLayer.Canvas( <TileLayer optionsoptions? )Instantiates a Canvas tile layer object given an options object (optionally).
    + +

    Methods

    + + + + + + + + + + + + +
    MethodReturnsDescription
    drawTile( <HTMLCanvasElement> canvas, <PointtilePoint, <Number> zoom )thisYou need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.

    L.ImageOverlay

    From 46545bd93c7678e4df8c0ddb5478a95d66af6c0c Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 31 May 2011 00:51:48 +0300 Subject: [PATCH 015/816] crs option --- reference.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference.html b/reference.html index d2d03303946..3be75ea1440 100644 --- a/reference.html +++ b/reference.html @@ -192,6 +192,12 @@

    Options

    [] Layers that will be added to the map initially. + + crs + L.CRS.* + new L.CRS.EPSG3857() + Coordinate Reference System to use. Don't change this if you're not sure what it means. Currently supported: EPSG:3587 (Spherical Mercator), EPSG:4326 (Plate Carree). + dragging Boolean From 357273d95264b5a36f4eb98c361d1240ce6fc145 Mon Sep 17 00:00:00 2001 From: Mourner Date: Tue, 31 May 2011 12:45:36 +0300 Subject: [PATCH 016/816] CRS docs --- reference.html | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/reference.html b/reference.html index 12514db7a2e..d6c958024a5 100644 --- a/reference.html +++ b/reference.html @@ -197,9 +197,9 @@

    Options

    crs - L.CRS.* - new L.CRS.EPSG3857() - Coordinate Reference System to use. Don't change this if you're not sure what it means. Currently supported: EPSG:3587 (Spherical Mercator), EPSG:4326 (Plate Carree). + CRS + L.CRS.EPSG3857 + Coordinate Reference System to use. Don't change this if you're not sure what it means. dragging @@ -399,6 +399,30 @@

    Events

    +

    Projections

    + +

    You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

    + + + + + + + + + + + + + + + + + + +
    CRSData
    L.CRS.EPSG3857EPSG:3857 (Spherical Mercator), used by most of commercial map providers (CloudMade, Google, Yahoo, Bing, etc.).
    L.CRS.EPSG4326EPSG:4326 (Plate Carree), very popular among GIS enthusiasts.
    L.CRS.EPSG3395EPSG:4326 (Mercator), used by some map providers.
    + +

    Methods that modify map state

    From 87ab22177c46985d646fafaf027280e6f3043028 Mon Sep 17 00:00:00 2001 From: Mourner Date: Tue, 31 May 2011 12:48:02 +0300 Subject: [PATCH 017/816] update CRS docs --- reference.html | 100 ++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 47 deletions(-) diff --git a/reference.html b/reference.html index d6c958024a5..b3a2b03ca33 100644 --- a/reference.html +++ b/reference.html @@ -46,6 +46,8 @@

    Map

  • Options
  • Properties
  • Events
  • +
  • Projections
  • +
  • Panes
  • Map methods

      @@ -197,7 +199,7 @@

      Options

    - + @@ -399,7 +401,7 @@

    Events

    crsCRSCRS L.CRS.EPSG3857 Coordinate Reference System to use. Don't change this if you're not sure what it means.
    -

    Projections

    +

    Projections

    You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

    @@ -423,6 +425,55 @@

    Projections

    +

    Map panes

    + +

    An object literal that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PropertyTypeDescription
    mapPaneHTMLElementPane that contains all other map panes.
    tilePaneHTMLElementPane for tile layers.
    objectsPaneHTMLElementPane that contains all the panes except tile pane.
    shadowPaneHTMLElementPane for overlay shadows (e.g. marker shadows).
    overlayPaneHTMLElementPane for overlays like polylines and polygons.
    markerPaneHTMLElementPane for marker icons.
    popupPaneHTMLElementPane for popups.
    + + +

    Methods that modify map state

    @@ -654,52 +705,7 @@

    Other methods

    -

    Map panes

    - -

    An object literal that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyTypeDescription
    mapPaneHTMLElementPane that contains all other map panes.
    tilePaneHTMLElementPane for tile layers.
    objectsPaneHTMLElementPane that contains all the panes except tile pane.
    shadowPaneHTMLElementPane for overlay shadows (e.g. marker shadows).
    overlayPaneHTMLElementPane for overlays like polylines and polygons.
    markerPaneHTMLElementPane for marker icons.
    popupPaneHTMLElementPane for popups.

    L.Marker

    From 8ec5cff4e13ee3b7848e788b31ba879a693c8ad8 Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 1 Jun 2011 16:50:18 +0300 Subject: [PATCH 018/816] fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 42a97dc19c7..df9412fb8ba 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@

    Basic usage example

    // create a CloudMade tile layer
     var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
     	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
    -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
    +	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
     
     // initialize the map on the "map" div
     var map = new L.Map('map');
    
    From e447bbb12586879d6e3a06872522bf3863092d38 Mon Sep 17 00:00:00 2001
    From: Mourner 
    Date: Tue, 7 Jun 2011 16:27:12 +0300
    Subject: [PATCH 019/816] fix non-async canvas tile layers
    
    ---
     dist/leaflet.js                    | 2 +-
     src/layer/tile/TileLayer.Canvas.js | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/dist/leaflet.js b/dist/leaflet.js
    index 13c5a1bc41d..d9e141da6b3 100644
    --- a/dist/leaflet.js
    +++ b/dist/leaflet.js
    @@ -42,7 +42,7 @@ b)),c=new L.Bounds(c,a);this._addTilesFromCenterOut(c);this.options.unloadInvisi
     _getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)},getTileUrl:function(a,b){return this._url.replace("{s}",this.options.subdomains[(a.x+a.y)%this.options.subdomains.length]).replace("{z}",b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=
     this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError;a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=
     a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code;
    -L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this.options.tileSize,a=a.multiplyBy(b),b=a.add(new L.Point(b,b)),a=this._map.unproject(a,this._zoom,!0),b=this._map.unproject(b,this._zoom,!0),a=this._map.options.crs.project(a),b=this._map.options.crs.project(b),b=[a.x,b.y,b.x,a.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+b}});L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a;this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;this.drawTile(a,b,c);this.options.async||this.tileDrawn()},drawTile:function(){},
    +L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this.options.tileSize,a=a.multiplyBy(b),b=a.add(new L.Point(b,b)),a=this._map.unproject(a,this._zoom,!0),b=this._map.unproject(b,this._zoom,!0),a=this._map.options.crs.project(a),b=this._map.options.crs.project(b),b=[a.x,b.y,b.x,a.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+b}});L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a;this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;this.drawTile(a,b,c);this.options.async||this.tileDrawn(a)},drawTile:function(){},
     tileDrawn:function(a){this._tileOnLoad.call(a)}});L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a;this._bounds=b},onAdd:function(a){this._map=a;this._image||this._initImage();a.getPanes().overlayPane.appendChild(this._image);a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image);a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer");this._image.style.visibility="hidden";L.Util.extend(this._image,
     {galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:this._onImageLoad,src:this._url})},_reset:function(){var a=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(a);L.DomUtil.setPosition(this._image,a);this._image.style.width=b.x+"px";this._image.style.height=b.y+"px"},_onImageLoad:function(){this.style.visibility=""}});L.Popup=L.Class.extend({includes:L.Mixin.Events,options:{maxWidth:300,autoPan:!0,closeButton:!0,offset:new L.Point(0,2),autoPanPadding:new L.Point(5,5)},initialize:function(a){L.Util.setOptions(this,a)},onAdd:function(a){this._map=a;this._container||this._initLayout();this._updateContent();this._container.style.opacity="0";this._map._panes.popupPane.appendChild(this._container);this._map.on("viewreset",this._updatePosition,this);if(this._map.options.closePopupOnClick)this._map.on("preclick",this._close,
     this);this._update();this._container.style.opacity="1";this._opened=!0},onRemove:function(a){a._panes.popupPane.removeChild(this._container);a.off("viewreset",this._updatePosition,this);a.off("click",this._close,this);this._container.style.opacity="0";this._opened=!1},setLatLng:function(a){this._latlng=a;this._opened&&this._update();return this},setContent:function(a){this._content=a;this._opened&&this._update();return this},_close:function(){this._opened&&this._map.removeLayer(this)},_initLayout:function(){this._container=
    diff --git a/src/layer/tile/TileLayer.Canvas.js b/src/layer/tile/TileLayer.Canvas.js
    index d714215786a..08bbaae2534 100644
    --- a/src/layer/tile/TileLayer.Canvas.js
    +++ b/src/layer/tile/TileLayer.Canvas.js
    @@ -27,7 +27,7 @@ L.TileLayer.Canvas = L.TileLayer.extend({
     		this.drawTile(tile, tilePoint, zoom);
     		
     		if (!this.options.async) {
    -			this.tileDrawn();
    +			this.tileDrawn(tile);
     		}
     	},
     	
    
    From 5d2c204cc4687f24bd6f428120d81d3fa16aaf0e Mon Sep 17 00:00:00 2001
    From: Mourner 
    Date: Wed, 8 Jun 2011 15:48:34 +0300
    Subject: [PATCH 020/816] update link in copyright notice
    
    ---
     src/Leaflet.js | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/Leaflet.js b/src/Leaflet.js
    index bbdd3b86c12..aef4136d802 100644
    --- a/src/Leaflet.js
    +++ b/src/Leaflet.js
    @@ -1,7 +1,7 @@
     /**
      * @preserve Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin
    - * Leaflet is a BSD-licensed JavaScript library for map display and interaction.
    - * See http://cloudmade.github.com/Leaflet/ for more information.
    + * Leaflet is a modern BSD-licensed JavaScript library for interactive maps. 
    + * See http://leaflet.cloudmade.com for more information.
      */
     
     var L = {
    
    From 50c7e92e091fb9629c3c0294df6805cf872abc74 Mon Sep 17 00:00:00 2001
    From: Mourner 
    Date: Wed, 8 Jun 2011 19:32:14 +0300
    Subject: [PATCH 021/816] fix webkit memory leak, closes #107
    
    ---
     dist/leaflet.js             | 6 +++---
     src/layer/tile/TileLayer.js | 1 +
     2 files changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/dist/leaflet.js b/dist/leaflet.js
    index d9e141da6b3..29cf42af91b 100644
    --- a/dist/leaflet.js
    +++ b/dist/leaflet.js
    @@ -1,7 +1,7 @@
     /*
      Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin
    - Leaflet is a BSD-licensed JavaScript library for map display and interaction.
    - See http://cloudmade.github.com/Leaflet/ for more information.
    + Leaflet is a modern BSD-licensed JavaScript library for interactive maps. 
    + See http://leaflet.cloudmade.com for more information.
     */
     var L={VERSION:"0.2",ROOT_URL:function(){for(var a=document.getElementsByTagName("script"),b=/^(.*\/)leaflet-?([\w-]*)\.js.*$/,c=0,d=a.length;c1.0E-7&&--h>0;)i=f*Math.sin(g)
     this._reset,this);if(this.options.updateWhenIdle)a.on("moveend",this._update,this);else this._limitedUpdate=L.Util.limitExecByInterval(this._update,100,this),a.on("move",this._limitedUpdate,this);this._reset();this._update()},onRemove:function(){this._map.getPanes().tilePane.removeChild(this._container);this._container=null;this._map.off("viewreset",this._reset,this);this.options.updateWhenIdle?this._map.off("moveend",this._update,this):this._map.off("move",this._limitedUpdate,this)},getAttribution:function(){return this.options.attribution},
     _initContainer:function(){var a=this._map.getPanes().tilePane;if(!this._container||a.empty)this._container=L.DomUtil.create("div","leaflet-layer",a),this.options.opacity<1&&L.DomUtil.setOpacity(this._container,this.options.opacity)},_reset:function(){this._tiles={};this._initContainer();this._container.innerHTML=""},_update:function(){var a=this._map.getPixelBounds(),b=this.options.tileSize,c=new L.Point(Math.floor(a.min.x/b),Math.floor(a.min.y/b)),a=new L.Point(Math.floor(a.max.x/b),Math.floor(a.max.y/
     b)),c=new L.Bounds(c,a);this._addTilesFromCenterOut(c);this.options.unloadInvisibleTiles&&this._removeOtherTiles(c)},_addTilesFromCenterOut:function(a){for(var b=[],c=a.getCenter(),d=a.min.y;d<=a.max.y;d++)for(var e=a.min.x;e<=a.max.x;e++)e+":"+d in this._tiles||b.push(new L.Point(e,d));b.sort(function(a,b){return a.distanceTo(c)-b.distanceTo(c)});this._tilesToLoad=b.length;a=0;for(d=this._tilesToLoad;aa.max.x||ba.max.y))this._tiles[d].parentNode==this._container&&this._container.removeChild(this._tiles[d]),delete this._tiles[d]},_addTile:function(a){var b=this._getTilePos(a),c=this._map.getZoom(),d=a.x+":"+a.y,e=1<=e)){var f=this._createTile();L.DomUtil.setPosition(f,b);this._tiles[d]=f;if(this.options.scheme=="tms")a.y=e-a.y-1;this._loadTile(f,a,c);this._container.appendChild(f)}},
    +(b=d.split(":"),c=parseInt(b[0],10),b=parseInt(b[1],10),ca.max.x||ba.max.y))this._tiles[d].src="",this._tiles[d].parentNode==this._container&&this._container.removeChild(this._tiles[d]),delete this._tiles[d]},_addTile:function(a){var b=this._getTilePos(a),c=this._map.getZoom(),d=a.x+":"+a.y,e=1<=e)){var f=this._createTile();L.DomUtil.setPosition(f,b);this._tiles[d]=f;if(this.options.scheme=="tms")a.y=e-a.y-1;this._loadTile(f,a,c);this._container.appendChild(f)}},
     _getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)},getTileUrl:function(a,b){return this._url.replace("{s}",this.options.subdomains[(a.x+a.y)%this.options.subdomains.length]).replace("{z}",b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=
     this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError;a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=
     a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code;
    diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js
    index bf8ef8e5093..db3ae3f44ae 100644
    --- a/src/layer/tile/TileLayer.js
    +++ b/src/layer/tile/TileLayer.js
    @@ -139,6 +139,7 @@ L.TileLayer = L.Class.extend({
     				
     				// remove tile if it's out of bounds
     				if (x < bounds.min.x || x > bounds.max.x || y < bounds.min.y || y > bounds.max.y) {
    +					this._tiles[key].src = '';
     					if (this._tiles[key].parentNode == this._container) {
     						this._container.removeChild(this._tiles[key]);
     					}
    
    From 7081349c626c9a168b50fbe3f8b808a82bb1655e Mon Sep 17 00:00:00 2001
    From: Mourner 
    Date: Wed, 8 Jun 2011 19:34:11 +0300
    Subject: [PATCH 022/816] update changelog
    
    ---
     CHANGELOG.md | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/CHANGELOG.md b/CHANGELOG.md
    index b1f0a18c341..b9e1cf51e89 100644
    --- a/CHANGELOG.md
    +++ b/CHANGELOG.md
    @@ -40,6 +40,7 @@ Leaflet Changelog
      * Fixed a bug where map div with `position: absolute` is reset to `relative`. [#100](https://github.com/CloudMade/Leaflet/issues/100) 
      * Fixed a bug that caused an error when trying to add a marker without shadow in its icon.
      * Fixed a bug where popup content would not update on `setContent` call. [#94](https://github.com/CloudMade/Leaflet/issues/94)
    + * Fixed memory leak in webkit when unloading tiles, thanks to [@Scalar4eg](https://github.com/Scalar4eg). [#107](https://github.com/CloudMade/Leaflet/issues/107)
      * Fixed incorrect zoom animation & popup styling in Opera 11.11.
      * Fixed a bug where double click zoom wouldn't work if popup is opened on map click
      * Fixed a bug with click propagation on popup close button. [#99](https://github.com/CloudMade/Leaflet/issues/99)
    
    From e0313befea6a42cd50195f4661f029f583fb1946 Mon Sep 17 00:00:00 2001
    From: mourner 
    Date: Fri, 10 Jun 2011 20:22:44 +0300
    Subject: [PATCH 023/816] placeholders for docs
    
    ---
     reference.html | 19 +++++++++++++++++--
     1 file changed, 17 insertions(+), 2 deletions(-)
    
    diff --git a/reference.html b/reference.html
    index b3a2b03ca33..9a4bd77ad4b 100644
    --- a/reference.html
    +++ b/reference.html
    @@ -75,12 +75,20 @@ 

    Vector layers

    +

    Other layers

    +

    Basic types

    +
    + -

    Utility

    From da6204c8cfbc346cdb44ca7585c25f40ffe53a22 Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 10 Jun 2011 22:02:00 +0300 Subject: [PATCH 024/816] multipolyline and multipolygon docs --- reference.html | 66 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/reference.html b/reference.html index 9a4bd77ad4b..abe4ebcc420 100644 --- a/reference.html +++ b/reference.html @@ -75,9 +75,9 @@

    Vector layers

    @@ -1294,10 +1294,24 @@

    Constants

    +

    Methods

    + + + + + + + + + + + +
    MethodReturnsDescription
    bindPopup( <String> htmlContent, <Popup optionsoptions? )thisBinds a popup with a particular HTML content to a click on this path.
    +

    L.Polyline

    -

    A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    +

    A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    Usage example

    // create a red polyline from an arrays of LatLng points
    @@ -1349,6 +1363,8 @@ 

    Options

    Methods

    +

    You can use Path methods and additionally the following methods:

    + @@ -1374,6 +1390,25 @@

    Methods

    +

    L.MultiPolyline

    + +

    Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

    + +

    Constructor

    + +
    Method
    + + + + + + + + +
    ConstructorDescription
    L.MultiPolyline( <LatLng[][]> latlngs, <Polyline optionsoptions? )Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
    + + +

    L.Polygon

    A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

    @@ -1386,14 +1421,35 @@

    Constructor

    Description - L.Polygon( <LatLng[]> latlngs, <Polyline optionsoptions? ) - Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). + L.Polygon( <LatLng[]> latlngs, <Polyline optionsoptions? ) + Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.

    Polygon the same options and methods as Polyline.

    + +

    L.MultiPolygon

    + +

    Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.MultiPolygon( <LatLng[][]> latlngs, <Polyline optionsoptions? )Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
    + + + +

    L.Circle

    A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    From b6e222f815aa6bac9766228f5415a992729e013a Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 13 Jun 2011 22:15:43 +0300 Subject: [PATCH 025/816] Fixed regression related to global map variable, closes #117 --- dist/leaflet.js | 2 +- src/layer/marker/Marker.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/leaflet.js b/dist/leaflet.js index 13115fab244..9bb3cc38966 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -54,7 +54,7 @@ this._container);this._tip=L.DomUtil.create("div","leaflet-popup-tip",this._tipC "px";this._container.style.left=this._containerLeft+"px"},_adjustPan:function(){if(this.options.autoPan){var a=this._container.offsetHeight,b=this._map.layerPointToContainerPoint(new L.Point(this._containerLeft,-a-this._containerBottom)),c=new L.Point(0,0),d=this.options.autoPanPadding,e=this._map.getSize();if(b.x<0)c.x=b.x-d.x;if(b.x+this._containerWidth>e.x)c.x=b.x+this._containerWidth-e.x+d.x;if(b.y<0)c.y=b.y-d.y;if(b.y+a>e.y)c.y=b.y+a-e.y+d.y;(c.x||c.y)&&this._map.panBy(c)}},_onCloseButtonClick:function(a){this._close(); L.DomEvent.stop(a)}});L.Icon=L.Class.extend({iconUrl:L.ROOT_URL+"images/marker.png",shadowUrl:L.ROOT_URL+"images/marker-shadow.png",iconSize:new L.Point(25,41),shadowSize:new L.Point(41,41),iconAnchor:new L.Point(13,41),popupAnchor:new L.Point(0,-33),initialize:function(a){if(a)this.iconUrl=a},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(a){var b=this[a+"Size"],c=this[a+"Url"],d=this._createImg(c);if(!c)return null;d.className="leaflet-marker-"+ a;d.style.marginLeft=-this.iconAnchor.x+"px";d.style.marginTop=-this.iconAnchor.y+"px";if(b)d.style.width=b.x+"px",d.style.height=b.y+"px";return d},_createImg:function(a){var b;L.Browser.ie6?(b=document.createElement("div"),b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'):(b=document.createElement("img"),b.src=a);return b}});L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon,title:"",clickable:!0,draggable:!1},initialize:function(a,b){L.Util.setOptions(this,b);this._latlng=a},onAdd:function(a){this._map=a;this._initIcon();a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){this._removeIcon();a.off("viewreset",this._reset,this)},getLatLng:function(){return this._latlng},setLatLng:function(a){this._latlng=a;this._reset()},setIcon:function(a){this._removeIcon();this._icon=this._shadow= -null;this.options.icon=a;this._initIcon()},_initIcon:function(){if(!this._icon){this._icon=this.options.icon.createIcon();if(this.options.title)this._icon.title=this.options.title;this._initInteraction()}if(!this._shadow)this._shadow=this.options.icon.createShadow();map._panes.markerPane.appendChild(this._icon);this._shadow&&map._panes.shadowPane.appendChild(this._shadow)},_removeIcon:function(){map._panes.markerPane.removeChild(this._icon);this._shadow&&map._panes.shadowPane.removeChild(this._shadow)}, +null;this.options.icon=a;this._initIcon()},_initIcon:function(){if(!this._icon){this._icon=this.options.icon.createIcon();if(this.options.title)this._icon.title=this.options.title;this._initInteraction()}if(!this._shadow)this._shadow=this.options.icon.createShadow();this._map._panes.markerPane.appendChild(this._icon);this._shadow&&this._map._panes.shadowPane.appendChild(this._shadow)},_removeIcon:function(){map._panes.markerPane.removeChild(this._icon);this._shadow&&map._panes.shadowPane.removeChild(this._shadow)}, _reset:function(){var a=this._map.latLngToLayerPoint(this._latlng).round();L.DomUtil.setPosition(this._icon,a);this._shadow&&L.DomUtil.setPosition(this._shadow,a);this._icon.style.zIndex=a.y},_initInteraction:function(){if(this.options.clickable){this._icon.className+=" leaflet-clickable";L.DomEvent.addListener(this._icon,"click",this._onMouseClick,this);for(var a=["dblclick","mousedown","mouseover","mouseout"],b=0;b Date: Mon, 13 Jun 2011 15:15:43 -0600 Subject: [PATCH 026/816] Adding options to L.Map.locate that follows the PositionOptions spec for the W3C Geolocation API. You can now pass "enableHighAccuracy" and "maximumAge" to get fresh, accurate positions. --- reference.html | 4 ++-- src/map/ext/Map.Geolocation.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reference.html b/reference.html index abe4ebcc420..2dc4936a477 100644 --- a/reference.html +++ b/reference.html @@ -538,9 +538,9 @@

    Methods that modify map state

    Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - locate() + locate( <Object> options? ) this - Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. From 21f39ded2d914e73152bff3b7ec33c232db19632 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 15 Jun 2011 23:33:37 -0600 Subject: [PATCH 029/816] Adding "setLatLng" documentation for L.Circle. --- reference.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index d53136a63e5..72dc97483fc 100644 --- a/reference.html +++ b/reference.html @@ -1465,7 +1465,23 @@

    Constructor

    L.Circle( <LatLnglatlng, <Number> radius, <Path optionsoptions? ) Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. - + + +

    Methods

    + + + + + + + + + + + + +
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle to a new location.
    +

    L.CircleMarker

    From fa07ec9c11eb19b5cbb5b280d8e7d6638b2528bc Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 15 Jun 2011 23:39:57 -0600 Subject: [PATCH 030/816] Adding "setLatLng" documentation for L.CircleMarker. I'm assuming this will work because CircleMarker extends Circle --- reference.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 72dc97483fc..b81d59caac0 100644 --- a/reference.html +++ b/reference.html @@ -1499,9 +1499,24 @@

    Constructor

    L.CircleMarker( <LatLnglatlng, <Number> radius, <Path optionsoptions? ) Instantiates a circle marker given a geographical point, a radius in pixels and optionally an options object. - + +

    Methods

    + + + + + + + + + + + + +
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle marker to a new location.
    +

    L.GeoJSON

    From 6e27aeddb5521e899ebc22743b85f898cae8103d Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 16 Jun 2011 15:00:51 +0300 Subject: [PATCH 031/816] CSS cleanup (thanks to CSSLint) --- dist/leaflet.css | 29 +++++++++++++++++------------ dist/leaflet.ie.css | 4 ++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/dist/leaflet.css b/dist/leaflet.css index 40235dc3ad1..b47c502d5ad 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -25,6 +25,7 @@ .leaflet-marker-shadow { -moz-user-select: none; -webkit-user-select: none; + user-select: none; } .leaflet-marker-icon, .leaflet-marker-shadow { @@ -81,7 +82,6 @@ .leaflet-control { float: left; clear: both; - display: inline; } .leaflet-right .leaflet-control { float: right; @@ -103,9 +103,9 @@ padding: 5px; background: rgba(0, 0, 0, 0.25); - border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; + border-radius: 7px; } .leaflet-control-zoom a { display: block; @@ -115,9 +115,9 @@ background-repeat: no-repeat; background-color: rgba(255, 255, 255, 0.75); - border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; + border-radius: 4px; } .leaflet-control-zoom a:hover { background-color: #fff; @@ -143,6 +143,8 @@ background-color: rgba(255, 255, 255, 0.7); + -moz-box-shadow: 0 0 7px #ccc; + -webkit-box-shadow: 0 0 7px #ccc; box-shadow: 0 0 7px #ccc; } @@ -156,20 +158,22 @@ -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; -} + } .leaflet-fade-anim .leaflet-tile-loaded { opacity: 1; -} + } .leaflet-fade-anim .leaflet-popup { + opacity: 0; + -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; - opacity: 0; -} + transition: opacity 0.2s linear; + } .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { opacity: 1; -} + } .leaflet-zoom-anim .leaflet-tile { -webkit-transition: none; @@ -215,15 +219,15 @@ -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); + transform: rotate(45deg); } .leaflet-popup-close-button { position: absolute; top: 9px; right: 9px; - width: 8px; - height: 8px; - padding: 1px; + width: 10px; + height: 10px; overflow: hidden; } @@ -247,8 +251,9 @@ } .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: white; + box-shadow: 0 1px 10px #888; - -moz-box-shadow: 0 1px 10px #888; + -moz-box-shadow: 0 1px 10px #888; -webkit-box-shadow: 0 1px 14px #999; } .leaflet-popup-content-wrapper { diff --git a/dist/leaflet.ie.css b/dist/leaflet.ie.css index 9accbe84687..141a16f5f91 100644 --- a/dist/leaflet.ie.css +++ b/dist/leaflet.ie.css @@ -11,6 +11,10 @@ display: inline-block; position: absolute; } + +.leaflet-control { + display: inline; + } .leaflet-popup-tip { width: 21px; From 1e7e732ad90a9f2fbc4faf3d4520a956e1e26e13 Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 16 Jun 2011 15:01:19 +0300 Subject: [PATCH 032/816] Revert "CSS cleanup (thanks to CSSLint)" This reverts commit 6e27aeddb5521e899ebc22743b85f898cae8103d --- dist/leaflet.css | 29 ++++++++++++----------------- dist/leaflet.ie.css | 4 ---- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/dist/leaflet.css b/dist/leaflet.css index b47c502d5ad..40235dc3ad1 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -25,7 +25,6 @@ .leaflet-marker-shadow { -moz-user-select: none; -webkit-user-select: none; - user-select: none; } .leaflet-marker-icon, .leaflet-marker-shadow { @@ -82,6 +81,7 @@ .leaflet-control { float: left; clear: both; + display: inline; } .leaflet-right .leaflet-control { float: right; @@ -103,9 +103,9 @@ padding: 5px; background: rgba(0, 0, 0, 0.25); + border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; - border-radius: 7px; } .leaflet-control-zoom a { display: block; @@ -115,9 +115,9 @@ background-repeat: no-repeat; background-color: rgba(255, 255, 255, 0.75); + border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; - border-radius: 4px; } .leaflet-control-zoom a:hover { background-color: #fff; @@ -143,8 +143,6 @@ background-color: rgba(255, 255, 255, 0.7); - -moz-box-shadow: 0 0 7px #ccc; - -webkit-box-shadow: 0 0 7px #ccc; box-shadow: 0 0 7px #ccc; } @@ -158,22 +156,20 @@ -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; - } +} .leaflet-fade-anim .leaflet-tile-loaded { opacity: 1; - } +} .leaflet-fade-anim .leaflet-popup { - opacity: 0; - -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; - } + opacity: 0; +} .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { opacity: 1; - } +} .leaflet-zoom-anim .leaflet-tile { -webkit-transition: none; @@ -219,15 +215,15 @@ -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); - transform: rotate(45deg); } .leaflet-popup-close-button { position: absolute; top: 9px; right: 9px; - width: 10px; - height: 10px; + width: 8px; + height: 8px; + padding: 1px; overflow: hidden; } @@ -251,9 +247,8 @@ } .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: white; - box-shadow: 0 1px 10px #888; - -moz-box-shadow: 0 1px 10px #888; + -moz-box-shadow: 0 1px 10px #888; -webkit-box-shadow: 0 1px 14px #999; } .leaflet-popup-content-wrapper { diff --git a/dist/leaflet.ie.css b/dist/leaflet.ie.css index 141a16f5f91..9accbe84687 100644 --- a/dist/leaflet.ie.css +++ b/dist/leaflet.ie.css @@ -11,10 +11,6 @@ display: inline-block; position: absolute; } - -.leaflet-control { - display: inline; - } .leaflet-popup-tip { width: 21px; From 090eff81e2a0d28455731b34b4a74b1dfcec8361 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 16 Jun 2011 13:19:29 -0600 Subject: [PATCH 033/816] Updating CricleMarker documentation (radius passed in path options object). --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index b81d59caac0..04be5f39994 100644 --- a/reference.html +++ b/reference.html @@ -1496,8 +1496,8 @@

    Constructor

    Description - L.CircleMarker( <LatLnglatlng, <Number> radius, <Path optionsoptions? ) - Instantiates a circle marker given a geographical point, a radius in pixels and optionally an options object. + L.CircleMarker( <LatLnglatlng, <Path optionsoptions? ) + Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object. From f2c32b9e2ae573c9bddb8524f1a06c4f8b56dd12 Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 17 Jun 2011 01:56:11 +0300 Subject: [PATCH 034/816] add google analytics code --- download.html | 17 +++++++++++++++++ examples.html | 17 +++++++++++++++++ examples/custom-icons.html | 17 +++++++++++++++++ examples/mobile.html | 17 +++++++++++++++++ examples/quick-start.html | 17 +++++++++++++++++ features.html | 17 +++++++++++++++++ index.html | 19 ++++++++++++++++++- reference.html | 17 +++++++++++++++++ 8 files changed, 137 insertions(+), 1 deletion(-) diff --git a/download.html b/download.html index 40632b8b7f1..c21c6512d33 100644 --- a/download.html +++ b/download.html @@ -73,5 +73,22 @@

    Building a custom version of Leaflet

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/examples.html b/examples.html index 2b0f26105e5..27d3341103a 100644 --- a/examples.html +++ b/examples.html @@ -91,5 +91,22 @@

    OOP in Leaflet

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/examples/custom-icons.html b/examples/custom-icons.html index 8bad7dd7caa..9f82a3a1dd9 100644 --- a/examples/custom-icons.html +++ b/examples/custom-icons.html @@ -148,5 +148,22 @@

    Using icons in markers

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/examples/mobile.html b/examples/mobile.html index d22ee729fdf..4fc6065b1b7 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -118,5 +118,22 @@

    Geolocation

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/examples/quick-start.html b/examples/quick-start.html index 31b230656dc..cb4f16cd068 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -277,5 +277,22 @@

    Dealing with events

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/features.html b/features.html index 2b296ca9264..00e5777f2b1 100644 --- a/features.html +++ b/features.html @@ -147,6 +147,23 @@

    On mobile

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + \ No newline at end of file diff --git a/index.html b/index.html index df9412fb8ba..73fd42a3cec 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,24 @@

    Contributing to Leaflet

    + + + \ No newline at end of file diff --git a/reference.html b/reference.html index 04be5f39994..349c9c4ed00 100644 --- a/reference.html +++ b/reference.html @@ -2327,5 +2327,22 @@

    IHandler

    hljs.tabReplace = ' '; hljs.initHighlightingOnLoad(); + + From e1034aa5dc6180cfc6f24d6fee92441d365d6cdf Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 17 Jun 2011 02:09:56 +0300 Subject: [PATCH 035/816] update features --- features.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/features.html b/features.html index 00e5777f2b1..d64e4815f5e 100644 --- a/features.html +++ b/features.html @@ -58,7 +58,9 @@

    Available map layers

  • Popups
  • Image overlays
  • WMS layers
  • -
  • GeoJSON
  • +
  • GeoJSON
  • +
  • KML
  • +
  • GeoRSS
  • Interaction features

    @@ -82,7 +84,7 @@

    On mobile browsers (iOS, Android)

    Visual features

    • Panning animation
    • -
    • Zooming animation on modern browsers (except IE)
    • +
    • Zooming animation on modern browsers (except IE)
    • Smooth continuous zoom on iOS
    • Tile and popup fade animation
    • Very nice default design for markers and popups
    • @@ -94,12 +96,13 @@

      Customization features

    • A simple interface for implementing custom map layers
    • The same for custom map controls
    • -
    • Ability to implement custom map projections
    • +
    • Custom map projections (with EPSG:4326, EPSG:3857 and EPSG:3395 out of the box)

    Performance features

    • Hardware acceleration on iOS makes it feel as smooth as native apps
    • +
    • Clever tricks to make panning and zooming really smooth
    • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
    • Modular build system allows you to reduce the size of the library by leaving out the code you don't need
    @@ -129,13 +132,16 @@

    On mobile

    • Safari for iOS 3/4+
    • WebKit for Android 2.2+
    • +
    • Windows Phone 7
    • +
    • Firefox for Android

    If you find some feature really missing in Leaflet, please submit it to the issue tracker.

    - +

    * Grayed out features are in the roadmap and coming soon.

    +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    From ec9c6f93c87772d9943c28c9b4c58469464940b4 Mon Sep 17 00:00:00 2001 From: Mourner Date: Fri, 17 Jun 2011 14:04:48 +0300 Subject: [PATCH 036/816] add twitter follow button --- download.html | 7 +++++-- examples.html | 7 +++++-- features.html | 7 +++++-- index.html | 7 +++++-- reference.html | 7 +++++-- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/download.html b/download.html index c21c6512d33..31cf05c8a2d 100644 --- a/download.html +++ b/download.html @@ -46,8 +46,11 @@

    Download Leaflet

    Download Leaflet edge (zip) — Changelog

    - - + + + + +

    Including Leaflet on your page

    diff --git a/examples.html b/examples.html index 27d3341103a..814b9f21304 100644 --- a/examples.html +++ b/examples.html @@ -44,8 +44,11 @@

    Leaflet examples

    Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers.

    - - + + + + +


    diff --git a/features.html b/features.html index d64e4815f5e..4445822506b 100644 --- a/features.html +++ b/features.html @@ -44,8 +44,11 @@

    Leaflet features

    Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being flexible enough to be easily extended by writing third-party plugins.

    - - + + + + +

    diff --git a/index.html b/index.html index 73fd42a3cec..891b5c58147 100644 --- a/index.html +++ b/index.html @@ -46,8 +46,11 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    It is built from the ground up to work efficiently and smoothly on both platforms, utilizing cutting-edge technologies included in HTML5. Its top priorities are usability, performance, small size, A-grade browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand. Find out more on the features page.

    - - + + + + +

    Basic usage example

    diff --git a/reference.html b/reference.html index 349c9c4ed00..9f4552164f6 100644 --- a/reference.html +++ b/reference.html @@ -149,8 +149,11 @@

    Misc


    - - + + + + +

    L.Map

    From d61849cf9da8c274f9603d92e1aa046b1a3377f4 Mon Sep 17 00:00:00 2001 From: Mourner Date: Fri, 17 Jun 2011 16:42:57 +0300 Subject: [PATCH 037/816] parse string coordinates in GeoJSON, closes #136 --- dist/leaflet.js | 3 ++- src/layer/GeoJSON.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/leaflet.js b/dist/leaflet.js index 5f3d6ba4c6b..93abbdde245 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -75,7 +75,8 @@ for(d=c=0;c Date: Fri, 17 Jun 2011 19:28:27 +0300 Subject: [PATCH 038/816] layergroup and featuregroup docs --- reference.html | 123 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 9f4552164f6..e332ccb03ac 100644 --- a/reference.html +++ b/reference.html @@ -85,8 +85,8 @@

    Vector layers

    Other layers

    Basic types

    @@ -1519,6 +1519,125 @@

    Methods

    + + +

    L.LayerGroup

    + +

    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. Implements ILayer interface.

    + +
    var group = new L.LayerGroup();
    +
    +group.addLayer(marker1);
    +group.addLayer(marker2);
    +group.addLayer(polyline);
    +		
    +map.addLayer(group);
    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.LayerGroup( <ILayer[]> layers? )Create a layer group, optionally given an initial set of layers.
    + +

    Methods

    + + + + + + + + + + + + + + + + + + + + + + +
    MethodReturnsDescription
    addLayer( <ILayerlayer )thisAdds a given layer to the group.
    removeLayer( <ILayerlayer )thisRemoves a given layer from the group.
    clearLayers()thisRemoves all the layers from the group.
    + + + +

    L.FeatureGroup

    + +

    Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

    + +
    var group = new L.FeatureGroup([marker1, marker2, polyline]);
    +
    +group.bindPopup('Hello world!');
    +
    +group.on('click', function() { 
    +	alert('Clicked on a group!'); 
    +});
    +		
    +map.addLayer(group);
    + +

    Constructor

    + + + + + + + + + + +
    ConstructorDescription
    L.FeatureGroup( <IFeature[]> layers? )Create a layer group, optionally given an initial set of layers.
    + +

    Methods

    + +

    Has all LayerGroup methods and additionally:

    + + + + + + + + + + + + +
    MethodReturnsDescription
    bindPopup( <String> htmlContent, <Popup optionsoptions? )thisBinds a popup with a particular HTML content to a click on any layer from the group.
    + +

    Events

    + +

    You can subscribe to the following events using these methods.

    + + + + + + + + + + + + + + + +
    EventDataDescription
    clickEvent + Fired when the user clicks (or taps) on the group.
    dblclickEvent + Fired when the user double-clicks (or double-taps) on the group.

    L.GeoJSON

    From 157e5f058f35292659236660a65b08bdd36dd373 Mon Sep 17 00:00:00 2001 From: Mourner Date: Fri, 17 Jun 2011 19:45:04 +0300 Subject: [PATCH 039/816] initial geojson example work --- examples/geojson-example.html | 55 +++++++++++++++++++++++++++++++++++ examples/geojson-sample.js | 50 +++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 examples/geojson-example.html create mode 100644 examples/geojson-sample.js diff --git a/examples/geojson-example.html b/examples/geojson-example.html new file mode 100644 index 00000000000..9b361788f79 --- /dev/null +++ b/examples/geojson-example.html @@ -0,0 +1,55 @@ + + + + Leaflet debug page + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/examples/geojson-sample.js b/examples/geojson-sample.js new file mode 100644 index 00000000000..24ecf05002e --- /dev/null +++ b/examples/geojson-sample.js @@ -0,0 +1,50 @@ +var geojsonSample = { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [102.0, 0.5] + }, + "properties": { + "prop0": "value0", + "color": "blue" + } + }, + + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]] + }, + "properties": { + "color": "red", + "prop1": 0.0 + } + }, + + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]] + }, + "properties": { + "color": "green", + "prop1": { + "this": "that" + } + } + }, + + { + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [[[[100.0, 1.5], [100.5, 1.5], [100.5, 2.0], [100.0, 2.0], [100.0, 1.5]]], [[[100.5, 2.0], [100.5, 2.5], [101.0, 2.5], [101.0, 2.0], [100.5, 2.0]]]] + } + } + ] +}; \ No newline at end of file From 6d6caa4fd1cc4767dc50967aa5d4fb4d8e8c8814 Mon Sep 17 00:00:00 2001 From: Mourner Date: Fri, 17 Jun 2011 19:54:37 +0300 Subject: [PATCH 040/816] update download links --- download.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/download.html b/download.html index 31cf05c8a2d..7bba7b7fe36 100644 --- a/download.html +++ b/download.html @@ -43,7 +43,14 @@

    Download Leaflet

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

    -

    Download Leaflet edge (zip) — Changelog

    +

    + Download Leaflet 0.2 (zip, stable)
    + Download Leaflet master (zip, development version) +

    + +

    + View Changelog +

    From 5e0d9a7bd2125ea479471a7f8ee819240a4ab505 Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 18 Jun 2011 13:37:55 +0300 Subject: [PATCH 041/816] update download link to 0.2.1 --- download.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.html b/download.html index 7bba7b7fe36..c17a2a86f59 100644 --- a/download.html +++ b/download.html @@ -44,7 +44,7 @@

    Download Leaflet

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

    - Download Leaflet 0.2 (zip, stable)
    + Download Leaflet 0.2.1 (zip, stable)
    Download Leaflet master (zip, development version)

    From cbe6df25189c96bfd7315c1f469002882415b3f7 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 22 Jun 2011 09:00:10 -0600 Subject: [PATCH 042/816] Adding minZoom/maxZoom documentation for Map. --- reference.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference.html b/reference.html index e332ccb03ac..84587a591a4 100644 --- a/reference.html +++ b/reference.html @@ -274,6 +274,18 @@

    Options

    Boolean depends Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. + + + minZoom + Number + 0 + Minimum zoom level of map. This overrides any minZoom set on a layer. + + + maxZoom + Number + 18 + Maximum zoom level of map. This overrides any maxZoom set on a layer. From b0ac337d440a69eb28e77cfbcadb52b57669e9fb Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 23 Jun 2011 14:03:02 +0300 Subject: [PATCH 043/816] minor docs update, closes #145 --- reference.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/reference.html b/reference.html index 84587a591a4..65b3331d4dc 100644 --- a/reference.html +++ b/reference.html @@ -215,6 +215,18 @@

    Options

    [] Layers that will be added to the map initially. + + minZoom + Number + 0 + Minimum zoom level of the map. Overrides any minZoom set on map layers. + + + maxZoom + Number + 18 + Maximum zoom level of the map. This overrides any maxZoom set on map layers. + crs CRS @@ -275,17 +287,11 @@

    Options

    depends Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. - - minZoom - Number - 0 - Minimum zoom level of map. This overrides any minZoom set on a layer. - - - maxZoom - Number - 18 - Maximum zoom level of map. This overrides any maxZoom set on a layer. + + closePopupOnClick + Boolean + true + Set it to false if you don't want popups to close when user clicks the map. @@ -932,12 +938,6 @@ true Controls the presense of a close button in the popup. - - closeMapOnClick - Boolean - true - Set it to false if you don't want the popup to close when user clicks the map. - offset Point From 6dbb8dcef2d294dd8af8e9acf404e419d8aee67d Mon Sep 17 00:00:00 2001 From: Mourner Date: Thu, 23 Jun 2011 14:27:43 +0300 Subject: [PATCH 044/816] use documentFragment when adding tiles, closes #152 --- dist/leaflet.js | 10 +++++----- src/layer/tile/TileLayer.js | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dist/leaflet.js b/dist/leaflet.js index 673f1c7c924..62b2b576c5f 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -40,13 +40,13 @@ a=a.getNorthEast()):d=a;return d.lat>=b.lat&&a.lat<=c.lat&&d.lng>=b.lng&&a.lng<= g=Math.PI/2-2*Math.atan(d),h=15,j=0.1;Math.abs(j)>1.0E-7&&--h>0;)j=f*Math.sin(g),j=Math.PI/2-2*Math.atan(d*Math.pow((1-j)/(1+j),0.5*f))-g,g+=j;return new L.LatLng(g*c,e,b)}};L.CRS={latLngToPoint:function(a,b){return this.transformation._transform(this.projection.project(a),b)},pointToLatLng:function(a,b,c){return this.projection.unproject(this.transformation.untransform(a,b),c)},project:function(a){return this.projection.project(a)}};L.CRS.EPSG3857=L.Util.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(0.5/Math.PI,0.5,-0.5/Math.PI,0.5),project:function(a){return this.projection.project(a).multiplyBy(6378137)}});L.CRS.EPSG900913=L.Util.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"});L.CRS.EPSG4326=L.Util.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,0.5,-1/360,0.5)});L.CRS.EPSG3395=L.Util.extend({},L.CRS,{code:"EPSG:3395",projection:L.Projection.Mercator,transformation:function(){var a=L.Projection.Mercator;return new L.Transformation(0.5/(Math.PI*a.R_MAJOR),0.5,-0.5/(Math.PI*a.R_MINOR),0.5)}()});L.LayerGroup=L.Class.extend({initialize:function(a){this._layers={};if(a)for(var b=0,c=a.length;ba.max.x||ba.max.y))this._tiles[d].src="",this._tiles[d].parentNode==this._container&&this._container.removeChild(this._tiles[d]),delete this._tiles[d]},_addTile:function(a){var b= -this._getTilePos(a),c=this._map.getZoom(),d=a.x+":"+a.y,e=1<=e)){var f=this._createTile();L.DomUtil.setPosition(f,b);this._tiles[d]=f;if(this.options.scheme=="tms")a.y=e-a.y-1;this._loadTile(f,a,c);this._container.appendChild(f)}},_getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)},getTileUrl:function(a,b){return this._url.replace("{s}",this.options.subdomains[(a.x+a.y)%this.options.subdomains.length]).replace("{z}", -b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError;a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a= -this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code; +b.push(new L.Point(e,d));b.sort(function(a,b){return a.distanceTo(c)-b.distanceTo(c)});a=document.createDocumentFragment();this._tilesToLoad=b.length;d=0;for(e=this._tilesToLoad;da.max.x||ba.max.y))this._tiles[d].src="",this._tiles[d].parentNode==this._container&& +this._container.removeChild(this._tiles[d]),delete this._tiles[d]},_addTile:function(a,b){var c=this._getTilePos(a),d=this._map.getZoom(),e=a.x+":"+a.y,f=1<=f)){var g=this._createTile();L.DomUtil.setPosition(g,c);this._tiles[e]=g;if(this.options.scheme=="tms")a.y=f-a.y-1;this._loadTile(g,a,d);b.appendChild(g)}},_getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)},getTileUrl:function(a, +b){return this._url.replace("{s}",this.options.subdomains[(a.x+a.y)%this.options.subdomains.length]).replace("{z}",b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer= +this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError;a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code; L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this.options.tileSize,a=a.multiplyBy(b),b=a.add(new L.Point(b,b)),a=this._map.unproject(a,this._zoom,!0),b=this._map.unproject(b,this._zoom,!0),a=this._map.options.crs.project(a),b=this._map.options.crs.project(b),b=[a.x,b.y,b.x,a.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+b}});L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a;this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;this.drawTile(a,b,c);this.options.async||this.tileDrawn(a)},drawTile:function(){}, tileDrawn:function(a){this._tileOnLoad.call(a)}});L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a;this._bounds=b},onAdd:function(a){this._map=a;this._image||this._initImage();a.getPanes().overlayPane.appendChild(this._image);a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image);a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer");this._image.style.visibility="hidden";L.Util.extend(this._image, {galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:this._onImageLoad,src:this._url})},_reset:function(){var a=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(a);L.DomUtil.setPosition(this._image,a);this._image.style.width=b.x+"px";this._image.style.height=b.y+"px"},_onImageLoad:function(){this.style.visibility=""}});L.Popup=L.Class.extend({includes:L.Mixin.Events,options:{maxWidth:300,autoPan:!0,closeButton:!0,offset:new L.Point(0,2),autoPanPadding:new L.Point(5,5)},initialize:function(a){L.Util.setOptions(this,a)},onAdd:function(a){this._map=a;this._container||this._initLayout();this._updateContent();this._container.style.opacity="0";this._map._panes.popupPane.appendChild(this._container);this._map.on("viewreset",this._updatePosition,this);if(this._map.options.closePopupOnClick)this._map.on("preclick",this._close, diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 68072ee9cfd..3d78feddd6a 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -14,7 +14,7 @@ L.TileLayer = L.Class.extend({ attribution: '', opacity: 1, scheme: 'xyz', - noWrap: false, + noWrap: false, unloadInvisibleTiles: L.Browser.mobileWebkit, updateWhenIdle: L.Browser.mobileWebkit @@ -45,7 +45,7 @@ L.TileLayer = L.Class.extend({ if (this.options.updateWhenIdle) { map.on('moveend', this._update, this); } else { - this._limitedUpdate = L.Util.limitExecByInterval(this._update, 100, this); + this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this); map.on('move', this._limitedUpdate, this); } @@ -140,10 +140,14 @@ L.TileLayer = L.Class.extend({ return a.distanceTo(center) - b.distanceTo(center); }); + var fragment = document.createDocumentFragment(); + this._tilesToLoad = queue.length; for (var k = 0, len = this._tilesToLoad; k < len; k++) { - this._addTile(queue[k]); + this._addTile(queue[k], fragment); } + + this._container.appendChild(fragment); }, _removeOtherTiles: function(bounds) { @@ -167,16 +171,16 @@ L.TileLayer = L.Class.extend({ } }, - _addTile: function(tilePoint) { + _addTile: function(tilePoint, container) { var tilePos = this._getTilePos(tilePoint), zoom = this._map.getZoom(), - key = tilePoint.x + ':' + tilePoint.y; + key = tilePoint.x + ':' + tilePoint.y, + tileLimit = (1 << zoom); // wrap tile coordinates - var tileLimit = (1 << zoom); if (!this.options.noWrap) { - tilePoint.x = ((tilePoint.x % tileLimit) + tileLimit) % tileLimit; - } + tilePoint.x = ((tilePoint.x % tileLimit) + tileLimit) % tileLimit; + } if (tilePoint.y < 0 || tilePoint.y >= tileLimit) { return; } // create tile @@ -191,7 +195,7 @@ L.TileLayer = L.Class.extend({ this._loadTile(tile, tilePoint, zoom); - this._container.appendChild(tile); + container.appendChild(tile); }, _getTilePos: function(tilePoint) { From c0d20fcda77edb629b75ebd714ab72e63edb4a60 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 23 Jun 2011 22:42:56 -0600 Subject: [PATCH 045/816] Adding docs for map.getBounds() --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index 65b3331d4dc..fa3c21ddc38 100644 --- a/reference.html +++ b/reference.html @@ -601,6 +601,11 @@

    Methods that get map state

    getMaxZoom() Number Returns the maximum zoom level of the map. + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the current map view. getBoundsZoom( <LatLngBounds> bounds ) From e6c8d1b12c0fbb1f384c677e44bdf50469f2b757 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 5 Jul 2011 21:19:08 -0600 Subject: [PATCH 046/816] Adding setStyle docs for Path. --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index fa3c21ddc38..40e18f41e3e 100644 --- a/reference.html +++ b/reference.html @@ -1325,6 +1325,11 @@

    Methods

    bindPopup( <String> htmlContent, <Popup optionsoptions? ) this Binds a popup with a particular HTML content to a click on this path. + + + setStyle( <Path optionsobject) + this + Changes the appearance of a Path based on the options in the Path options object. From 9912457cfdf2b2c2df52d7737045d225fb8aa2b5 Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 13 Jul 2011 15:10:13 +0300 Subject: [PATCH 047/816] minor docs update, update features --- examples.html | 4 ++++ features.html | 6 ++++-- reference.html | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples.html b/examples.html index 814b9f21304..e22b123a9a3 100644 --- a/examples.html +++ b/examples.html @@ -69,6 +69,10 @@

    Markers With Custom Icons

    In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map.


    +

    Layer Groups and Layers Control

    +

    A tutorial on how to manage groups of layers and use the layer switching control.

    +
    +

    Custom Controls

    A brief tutorial on implementing custom map controls.


    diff --git a/features.html b/features.html index 4445822506b..8c038f371c7 100644 --- a/features.html +++ b/features.html @@ -95,7 +95,7 @@

    Visual features

    Customization features

      -
    • Pure CSS3 popups for easy restyling
    • +
    • Pure CSS3 popups and controls for easy restyling
    • A simple interface for implementing custom map layers
    • The same for custom map controls
    • @@ -117,7 +117,7 @@

      Map controls

    • Zoom buttons
    • Attribution
    • Zoom slider
    • -
    • Layer switcher
    • +
    • Layer switcher
    @@ -135,6 +135,8 @@

    On mobile

    • Safari for iOS 3/4+
    • WebKit for Android 2.2+
    • +
    • webOS browser
    • +
    • Blackberry 6+
    • Windows Phone 7
    • Firefox for Android
    diff --git a/reference.html b/reference.html index 40e18f41e3e..8b9eb8ec7d5 100644 --- a/reference.html +++ b/reference.html @@ -101,6 +101,7 @@

    Controls

    From 2d41ad1e7267434536cf2d203447953b4ba24576 Mon Sep 17 00:00:00 2001 From: Mourner Date: Wed, 20 Jul 2011 14:11:23 +0300 Subject: [PATCH 048/816] update build with Layers control --- build/Makefile | 1 + build/build.bat | 1 + dist/leaflet.js | 52 +++++++++++++++++++++++++++---------------------- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/build/Makefile b/build/Makefile index 22d65483e92..fc4adb0b1f7 100644 --- a/build/Makefile +++ b/build/Makefile @@ -56,6 +56,7 @@ --js ../src/control/Control.js \ --js ../src/control/Control.Zoom.js \ --js ../src/control/Control.Attribution.js \ + --js ../src/control/Control.Layers.js \ --js ../src/map/Map.js \ --js ../src/map/ext/Map.Geolocation.js \ --js ../src/map/ext/Map.Popup.js \ diff --git a/build/build.bat b/build/build.bat index 5e98956573d..18646aef626 100644 --- a/build/build.bat +++ b/build/build.bat @@ -61,6 +61,7 @@ java -jar ../lib/closure-compiler/compiler.jar ^ --js ../src/control/Control.js ^ --js ../src/control/Control.Zoom.js ^ --js ../src/control/Control.Attribution.js ^ +--js ../src/control/Control.Layers.js ^ --js ../src/map/Map.js ^ --js ../src/map/ext/Map.Geolocation.js ^ --js ../src/map/ext/Map.Popup.js ^ diff --git a/dist/leaflet.js b/dist/leaflet.js index 949f2f11436..500d939d7aa 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -12,7 +12,7 @@ L.Mixin.Events={addEventListener:function(a,b,c){var d=this._leaflet_events=this b){if(this.hasEventListeners(a)){for(var c=L.Util.extend({type:a,target:this},b),d=this._leaflet_events[a].slice(),e=0,f=d.length;e=this.min.x&&a.x<=this.max.x&&b.y>=this.min.y&&a.y<=this.max.y}});L.Transformation=L.Class.extend({initialize:function(a,b,c,d){this._a=a;this._b=b;this._c=c;this._d=d},transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){b=b||1;a.x=b*(this._a*a.x+this._b);a.y=b*(this._c*a.y+this._d);return a},untransform:function(a,b){b=b||1;return new L.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}});L.LineUtil={simplify:function(a,b){if(!b)return a.slice();a=this.reducePoints(a,b);return a=this.simplifyDP(a,b)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqPointToSegmentDist(a,b,c))},simplifyDP:function(a,b){for(var c=0,d=0,e=b*b,f=1,g=a.length,h;fc&&(d=f,c=h);return c>=e?(c=a.slice(0,d),d=a.slice(d),g=this.simplifyDP(c,b).slice(0,g-2),d=this.simplifyDP(d,b),g.concat(d)):[a[0],a[g-1]]},reducePoints:function(a,b){for(var c= +a instanceof L.Bounds?(b=a.min,a=a.max):b=a;return b.x>=this.min.x&&a.x<=this.max.x&&b.y>=this.min.y&&a.y<=this.max.y}});L.Transformation=L.Class.extend({initialize:function(a,b,c,d){this._a=a;this._b=b;this._c=c;this._d=d},transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){b=b||1;a.x=b*(this._a*a.x+this._b);a.y=b*(this._c*a.y+this._d);return a},untransform:function(a,b){b=b||1;return new L.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}});L.LineUtil={simplify:function(a,b){if(!b)return a.slice();a=this.reducePoints(a,b);return a=this.simplifyDP(a,b)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqPointToSegmentDist(a,b,c))},simplifyDP:function(a,b){for(var c=0,d=0,e=b*b,f=1,g=a.length,h;fc&&(d=f,c=h);return c>=e?(c=a.slice(0,d),d=a.slice(d),g=this.simplifyDP(c,b).slice(0,g-2),d=this.simplifyDP(d,b),g.concat(d)):[a[0],a[g-1]]},reducePoints:function(a,b){for(var c= [a[0]],d=b*b,e=1,f=0,g=a.length;eb.max.x&&(c|=2);a.yb.max.y&&(c|=8);return c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqPointToSegmentDist:function(a,b,c){var d=c.x-b.x,e=c.y-b.y;if(!d&&!e)return this._sqDist(a,b);var f=((a.x-b.x)*d+(a.y-b.y)*e)/this._sqDist(b,c);if(f< 0)return this._sqDist(a,b);if(f>1)return this._sqDist(a,c);b=new L.Point(b.x+d*f,b.y+e*f);return this._sqDist(a,b)}};L.PolyUtil={};L.PolyUtil.clipPolygon=function(a,b){var c,d=[1,4,2,8],e,f,g,h,j,k,l=L.LineUtil;e=0;for(j=a.length;e=b.lat&&a.lat<=c.lat&&d.lng>=b.lng&&a.lng<=c.lng}});L.Projection={};L.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=L.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=a.lng*b,a=Math.max(Math.min(c,a.lat),-c)*b,a=Math.log(Math.tan(Math.PI/4+a/2));return new L.Point(d,a)},unproject:function(a,b){var c=L.LatLng.RAD_TO_DEG;return new L.LatLng((2*Math.atan(Math.exp(a.y))-Math.PI/2)*c,a.x*c,b)}};L.Projection.LonLat={project:function(a){return new L.Point(a.lng,a.lat)},unproject:function(a,b){return new L.LatLng(a.y,a.x,b)}};L.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(a){var b=L.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=this.R_MAJOR,e=a.lng*b*d,a=Math.max(Math.min(c,a.lat),-c)*b,b=this.R_MINOR/d,b=Math.sqrt(1-b*b),c=b*Math.sin(a),c=Math.pow((1-c)/(1+c),b*0.5),a=-d*Math.log(Math.tan(0.5*(Math.PI*0.5-a))/c);return new L.Point(e,a)},unproject:function(a,b){for(var c=L.LatLng.RAD_TO_DEG,d=this.R_MAJOR,e=a.x*c/d,f=this.R_MINOR/d,f=Math.sqrt(1-f*f),d=Math.exp(-a.y/d), g=Math.PI/2-2*Math.atan(d),h=15,j=0.1;Math.abs(j)>1.0E-7&&--h>0;)j=f*Math.sin(g),j=Math.PI/2-2*Math.atan(d*Math.pow((1-j)/(1+j),0.5*f))-g,g+=j;return new L.LatLng(g*c,e,b)}};L.CRS={latLngToPoint:function(a,b){return this.transformation._transform(this.projection.project(a),b)},pointToLatLng:function(a,b,c){return this.projection.unproject(this.transformation.untransform(a,b),c)},project:function(a){return this.projection.project(a)}};L.CRS.EPSG3857=L.Util.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(0.5/Math.PI,0.5,-0.5/Math.PI,0.5),project:function(a){return this.projection.project(a).multiplyBy(6378137)}});L.CRS.EPSG900913=L.Util.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"});L.CRS.EPSG4326=L.Util.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,0.5,-1/360,0.5)});L.CRS.EPSG3395=L.Util.extend({},L.CRS,{code:"EPSG:3395",projection:L.Projection.Mercator,transformation:function(){var a=L.Projection.Mercator;return new L.Transformation(0.5/(Math.PI*a.R_MAJOR),0.5,-0.5/(Math.PI*a.R_MINOR),0.5)}()});L.LayerGroup=L.Class.extend({initialize:function(a){this._layers={};if(a)for(var b=0,c=a.length;ba.max.x||ba.max.y)){if(!L.Browser.android)this._tiles[d].src="";this._tiles[d].parentNode==this._container&&this._container.removeChild(this._tiles[d]);delete this._tiles[d]}}, -_addTile:function(a,b){var c=this._getTilePos(a),d=this._map.getZoom(),e=a.x+":"+a.y,f=1<=f)){var g=this._createTile();L.DomUtil.setPosition(g,c);this._tiles[e]=g;if(this.options.scheme=="tms")a.y=f-a.y-1;this._loadTile(g,a,d);b.appendChild(g)}},_getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)},getTileUrl:function(a,b){return this._url.replace("{s}",this.options.subdomains[(a.x+ -a.y)%this.options.subdomains.length]).replace("{z}",b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError; -a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code; +setOpacity:function(a){this.options.opacity=a;this._setOpacity(a);if(L.Browser.webkit)for(i in this._tiles)this._tiles[i].style.webkitTransform+=" translate(0,0)"},_setOpacity:function(a){a<1&&L.DomUtil.setOpacity(this._container,a)},_initContainer:function(a){var b=this._map.getPanes().tilePane,c=b.firstChild;if(!this._container||b.empty)this._container=L.DomUtil.create("div","leaflet-layer"),a&&c?b.insertBefore(this._container,c):b.appendChild(this._container),this._setOpacity(this.options.opacity)}, +_reset:function(){this._tiles={};this._initContainer();this._container.innerHTML=""},_update:function(){var a=this._map.getPixelBounds(),b=this.options.tileSize,c=new L.Point(Math.floor(a.min.x/b),Math.floor(a.min.y/b)),a=new L.Point(Math.floor(a.max.x/b),Math.floor(a.max.y/b)),c=new L.Bounds(c,a);this._addTilesFromCenterOut(c);this.options.unloadInvisibleTiles&&this._removeOtherTiles(c)},_addTilesFromCenterOut:function(a){for(var b=[],c=a.getCenter(),d=a.min.y;d<=a.max.y;d++)for(var e=a.min.x;e<= +a.max.x;e++)e+":"+d in this._tiles||b.push(new L.Point(e,d));b.sort(function(a,b){return a.distanceTo(c)-b.distanceTo(c)});a=document.createDocumentFragment();this._tilesToLoad=b.length;d=0;for(e=this._tilesToLoad;da.max.x||ba.max.y)){if(!L.Browser.android)this._tiles[d].src= +"";this._tiles[d].parentNode==this._container&&this._container.removeChild(this._tiles[d]);delete this._tiles[d]}},_addTile:function(a,b){var c=this._getTilePos(a),d=this._map.getZoom(),e=a.x+":"+a.y,f=1<=f)){var g=this._createTile();L.DomUtil.setPosition(g,c);this._tiles[e]=g;if(this.options.scheme=="tms")a.y=f-a.y-1;this._loadTile(g,a,d);b.appendChild(g)}},_getTilePos:function(a){var b=this._map.getPixelOrigin();return a.multiplyBy(this.options.tileSize).subtract(b)}, +getTileUrl:function(a,b){return this._url.replace("{s}",this.options.subdomains[(a.x+a.y)%this.options.subdomains.length]).replace("{z}",b).replace("{x}",a.x).replace("{y}",a.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=this._tileImg.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a, +b,c){a._layer=this;a.onload=this._tileOnLoad;a.onerror=this._tileOnError;a.src=this.getTileUrl(b,c)},_tileOnLoad:function(){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;a._tilesToLoad||a.fire("load")},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});if(a=a.options.errorTileUrl)this.src=a}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){this.wmsParams[parseFloat(this.wmsParams.version)>=1.3?"crs":"srs"]=a.options.crs.code; L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this.options.tileSize,a=a.multiplyBy(b),b=a.add(new L.Point(b,b)),a=this._map.unproject(a,this._zoom,!0),b=this._map.unproject(b,this._zoom,!0),a=this._map.options.crs.project(a),b=this._map.options.crs.project(b),b=[a.x,b.y,b.x,a.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+b}});L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a;this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(a,b,c){a._layer=this;this.drawTile(a,b,c);this.options.async||this.tileDrawn(a)},drawTile:function(){}, tileDrawn:function(a){this._tileOnLoad.call(a)}});L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a;this._bounds=b},onAdd:function(a){this._map=a;this._image||this._initImage();a.getPanes().overlayPane.appendChild(this._image);a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image);a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer");this._image.style.visibility="hidden";L.Util.extend(this._image, {galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:this._onImageLoad,src:this._url})},_reset:function(){var a=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(a);L.DomUtil.setPosition(this._image,a);this._image.style.width=b.x+"px";this._image.style.height=b.y+"px"},_onImageLoad:function(){this.style.visibility=""}});L.Popup=L.Class.extend({includes:L.Mixin.Events,options:{maxWidth:300,autoPan:!0,closeButton:!0,offset:new L.Point(0,2),autoPanPadding:new L.Point(5,5)},initialize:function(a){L.Util.setOptions(this,a)},onAdd:function(a){this._map=a;this._container||this._initLayout();this._updateContent();this._container.style.opacity="0";this._map._panes.popupPane.appendChild(this._container);this._map.on("viewreset",this._updatePosition,this);if(this._map.options.closePopupOnClick)this._map.on("preclick",this._close, @@ -92,22 +92,28 @@ b=new L.Point(Math.min(b.x,this._startLayerPoint.x),Math.min(b.y,this._startLaye this._map.layerPointToLatLng(a)))}});L.Handler.MarkerDrag=L.Handler.extend({initialize:function(a){this._marker=a},enable:function(){if(!this._enabled){if(!this._draggable)this._draggable=new L.Draggable(this._marker._icon,this._marker._icon),this._draggable.on("dragstart",this._onDragStart,this),this._draggable.on("drag",this._onDrag,this),this._draggable.on("dragend",this._onDragEnd,this);this._draggable.enable();this._enabled=!0}},disable:function(){if(this._enabled)this._draggable.disable(),this._enabled=!1},moved:function(){return this._draggable&& this._draggable._moved},_onDragStart:function(){this._marker.closePopup();this._marker.fire("movestart");this._marker.fire("dragstart")},_onDrag:function(){var a=L.DomUtil.getPosition(this._marker._icon);this._marker._shadow&&L.DomUtil.setPosition(this._marker._shadow,a);this._marker._latlng=this._marker._map.layerPointToLatLng(a);this._marker.fire("move");this._marker.fire("drag")},_onDragEnd:function(){this._marker.fire("moveend");this._marker.fire("dragend")}});L.Control={};L.Control.Position={TOP_LEFT:"topLeft",TOP_RIGHT:"topRight",BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight"};L.Control.Zoom=L.Class.extend({onAdd:function(a){this._map=a;this._container=L.DomUtil.create("div","leaflet-control-zoom");this._zoomInButton=this._createButton("Zoom in","leaflet-control-zoom-in",this._map.zoomIn,this._map);this._zoomOutButton=this._createButton("Zoom out","leaflet-control-zoom-out",this._map.zoomOut,this._map);this._container.appendChild(this._zoomInButton);this._container.appendChild(this._zoomOutButton)},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_LEFT}, _createButton:function(a,b,c,d){var e=document.createElement("a");e.href="#";e.title=a;e.className=b;L.DomEvent.disableClickPropagation(e);L.DomEvent.addListener(e,"click",L.DomEvent.preventDefault);L.DomEvent.addListener(e,"click",c,d);return e}});L.Control.Attribution=L.Class.extend({onAdd:function(a){this._container=L.DomUtil.create("div","leaflet-control-attribution");this._map=a;this._prefix='Powered by Leaflet';this._attributions={};this._update()},getPosition:function(){return L.Control.Position.BOTTOM_RIGHT},getContainer:function(){return this._container},setPrefix:function(a){this._prefix=a},addAttribution:function(a){a&&(this._attributions[a]=!0,this._update())},removeAttribution:function(a){a&& -(delete this._attributions[a],this._update())},_update:function(){if(this._map){var a=[],b;for(b in this._attributions)this._attributions.hasOwnProperty(b)&&a.push(b);b=[];this._prefix&&b.push(this._prefix);a.length&&b.push(a.join(", "));this._container.innerHTML=b.join(" — ")}}});L.Map=L.Class.extend({includes:L.Mixin.Events,options:{crs:L.CRS.EPSG3857||L.CRS.EPSG4326,scale:function(a){return 256*(1< Date: Sun, 14 Aug 2011 22:36:05 -0600 Subject: [PATCH 049/816] Fix geojson-options link --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 8b9eb8ec7d5..1817e904c7f 100644 --- a/reference.html +++ b/reference.html @@ -1684,7 +1684,7 @@

    Constructor

    Description - L.GeoJSON( <Object> geojson?, <GeoJSON optionsoptions? ) + L.GeoJSON( <Object> geojson?, <GeoJSON optionsoptions? ) Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it with addGeoJSON method) and an options object. From 9fb1d7d1e4fbb5ed74bb55eaf8e19873330d4e03 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Sun, 14 Aug 2011 22:44:20 -0600 Subject: [PATCH 050/816] Adding "getLatLngs" method documentation for L.Polyline. --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index 1817e904c7f..6337c0173f0 100644 --- a/reference.html +++ b/reference.html @@ -1406,6 +1406,11 @@

    Methods

    setLatLngs( <LatLng[]> latlngs ) this Replaces all the points in the polyline with the given array of geographical points. + + + getLatLngs() + LatLng[] + Returns an array of the points in the path. spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLnglatlng1?, <LatLnglatlng2?, … ) From 8acab197f9bed4ef5e8e3bc099dba565e31bb986 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Sun, 14 Aug 2011 22:49:56 -0600 Subject: [PATCH 051/816] Adding "getBounds" method documentation for L.Path. --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index 6337c0173f0..c3da9a3ca27 100644 --- a/reference.html +++ b/reference.html @@ -1331,6 +1331,11 @@

    Methods

    setStyle( <Path optionsobject) this Changes the appearance of a Path based on the options in the Path options object. + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the path. From f04412b4e31966e102c0fcd86827da805fd3055e Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 16 Aug 2011 14:44:04 -0600 Subject: [PATCH 052/816] Adding "getBounds" documentation for Polyline. --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index c3da9a3ca27..d4c23192407 100644 --- a/reference.html +++ b/reference.html @@ -1421,6 +1421,11 @@

    Methods

    spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLnglatlng1?, <LatLnglatlng2?, … ) LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the polyline. From 833fee53bbb6cfae5f398c4e46956cd78ec83811 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 20 Sep 2011 17:20:00 +0300 Subject: [PATCH 053/816] update highlight.js and leaflet build --- dist/leaflet.js | 2 +- docs/highlight/highlight.pack.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/leaflet.js b/dist/leaflet.js index d49d589179c..9c5610d61be 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -17,7 +17,7 @@ a.slice(d),g=this.simplifyDP(c,b).slice(0,g-2),d=this.simplifyDP(d,b),g.concat(d b]},_getEdgeIntersection:function(a,b,c,d){var e=b.x-a.x,b=b.y-a.y,f=d.min,d=d.max;if(c&8)return new L.Point(a.x+e*(d.y-a.y)/b,d.y);else if(c&4)return new L.Point(a.x+e*(f.y-a.y)/b,f.y);else if(c&2)return new L.Point(d.x,a.y+b*(d.x-a.x)/e);else if(c&1)return new L.Point(f.x,a.y+b*(f.x-a.x)/e)},_getBitCode:function(a,b){var c=0;a.xb.max.x&&(c|=2);a.yb.max.y&&(c|=8);return c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a, b,c){var d=c.x-b.x,e=c.y-b.y,f=b;if(d||e){var g=((a.x-b.x)*d+(a.y-b.y)*e)/this._sqDist(b,c);g>1?f=c:g>0&&(f=new L.Point(b.x+d*g,b.y+e*g))}f._sqDist=this._sqDist(a,f);return f},_sqPointToSegmentDist:function(a,b,c){return this._sqClosestPointOnSegment(a,b,c)._sqDist}};L.PolyUtil={};L.PolyUtil.clipPolygon=function(a,b){var c,d=[1,4,2,8],e,f,g,h,j,k,l=L.LineUtil;e=0;for(j=a.length;e0&&c<=h;f=b}}function e(){if(g)j.type="dblclick",b(j),f=null}var f,g=!1,h=250,j;a["_leaflet_touchstart"+c]=d;a["_leaflet_touchend"+c]=e;a.addEventListener("touchstart",d,!1);a.addEventListener("touchend",e,!1)},removeDoubleTapListener:function(a,b){a.removeEventListener(a,a["_leaflet_touchstart"+b],!1);a.removeEventListener(a,a["_leaflet_touchend"+b], !1)}});L.DomUtil={get:function(a){return typeof a=="string"?document.getElementById(a):a},getStyle:function(a,b){var c=a.style[b];!c&&a.currentStyle&&(c=a.currentStyle[b]);if(!c||c=="auto")c=(c=document.defaultView.getComputedStyle(a,null))?c[b]:null;return c=="auto"?null:c},getViewportOffset:function(a){var b=0,c=0,d=a,e=document.body;do if(b+=d.offsetTop||0,c+=d.offsetLeft||0,d.offsetParent==e&&L.DomUtil.getStyle(d,"position")=="absolute")break;while(d=d.offsetParent);d=a;do{if(d===e)break;b-=d.scrollTop|| diff --git a/docs/highlight/highlight.pack.js b/docs/highlight/highlight.pack.js index 9c01de2ac89..076cfecc736 100644 --- a/docs/highlight/highlight.pack.js +++ b/docs/highlight/highlight.pack.js @@ -1 +1 @@ -var hljs=new function(){var p={};var a={};function n(c){return c.replace(/&/gm,"&").replace(//gm,">")}function k(s,r){if(!s){return false}for(var c=0;c"}function B(C){return""}while(z.length||A.length){var w=v().splice(0,1)[0];x+=n(y.substr(s,w.offset-s));s=w.offset;if(w.event=="start"){x+=t(w.node);u.push(w.node)}else{if(w.event=="stop"){var r=u.length;do{r--;var c=u[r];x+=B(c)}while(c!=w.node);u.splice(r,1);while(r'+n(M[0])+""}else{O+=n(M[0])}R=Q.lR.lastIndex;M=Q.lR.exec(N)}O+=n(N.substr(R,N.length-R));return O}function L(r,N){if(N.subLanguage&&a[N.subLanguage]){var M=g(N.subLanguage,r);u+=M.keyword_count;C+=M.r;return M.value}else{return G(r,N)}}function J(N,r){var M=N.nM?"":'';if(N.rB){s+=M;N.buffer=""}else{if(N.eB){s+=n(r)+M;N.buffer=""}else{s+=M;N.buffer=r}}D[D.length]=N}function F(M,O,R){var P=D[D.length-1];if(R){s+=L(P.buffer+M,P);return false}var S=A(O,P);if(S){s+=L(P.buffer+M,P);J(S,O);C+=S.r;return S.rB}var r=x(D.length-1,O);if(r){var T=P.nM?"":"";if(P.rE){s+=L(P.buffer+M,P)+T}else{if(P.eE){s+=L(P.buffer+M,P)+T+n(O)}else{s+=L(P.buffer+M+O,P)+T}}while(r>1){T=D[D.length-2].nM?"":"";s+=T;r--;D.length--}var Q=D[D.length-1];D.length--;D[D.length-1].buffer="";if(Q.starts){for(var N=0;N1){throw"Illegal"}return{language:K,r:C,keyword_count:u,value:s}}catch(H){if(H=="Illegal"){return{language:null,r:0,keyword_count:0,value:n(E)}}else{throw H}}}function i(){function r(y,x){if(y.compiled){return}if(y.b){y.bR=e(x,"^"+y.b)}if(y.e){y.eR=e(x,"^"+y.e)}if(y.i){y.iR=e(x,"^(?:"+y.i+")")}if(y.r==undefined){y.r=1}if(!y.displayClassName){y.displayClassName=y.cN}if(!y.cN){y.nM=true}for(var w in y.k){if(!y.k.hasOwnProperty(w)){continue}if(y.k[w] instanceof Object){y.keywordGroups=y.k}else{y.keywordGroups={keyword:y.k}}break}y.sm=[];if(y.c){for(var v=0;vz.keyword_count+z.r){z=w}if(w.keyword_count+w.r>y.keyword_count+y.r){z=y;y=w}}}var u=v.className;if(!u.match(y.language)){u=u?(u+" "+y.language):y.language}var c=d(v);if(c.length){var s=document.createElement("pre");s.innerHTML=y.value;y.value=m(c,d(s),C)}if(A){y.value=y.value.replace(/^((<[^>]+>|\t)+)/gm,function(D,G,F,E){return G.replace(/\t/g,A)})}if(r){y.value=y.value.replace(/\n/g,"
    ")}if(/MSIE [678]/.test(navigator.userAgent)&&v.tagName=="CODE"&&v.parentNode.tagName=="PRE"){var s=v.parentNode;var x=document.createElement("div");x.innerHTML="
    "+y.value+"
    ";v=x.firstChild.firstChild;x.firstChild.cN=s.cN;s.parentNode.replaceChild(x.firstChild,s)}else{v.innerHTML=y.value}v.className=u;v.dataset={};v.dataset.result={language:y.language,kw:y.keyword_count,re:y.r};if(z&&z.language){v.dataset.second_best={language:z.language,kw:z.keyword_count,re:z.r}}}function l(){if(l.called){return}l.called=true;f();if(arguments.length){for(var c=0;c|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:["escape"],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:["escape"],r:0};this.BE={cN:"escape",b:"\\\\.",e:this.IMR,nM:true,r:0};this.CLCM={cN:"comment",b:"//",e:"$",r:0};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NUMBER_MODE={cN:"number",b:this.NR,e:this.IMR,r:0};this.CNM={cN:"number",b:this.CNR,e:this.IMR,r:0};this.inherit=function(c,t){var s={};for(var r in c){s[r]=c[r]}if(t){for(var r in t){s[r]=t[r]}}return s}}();var initHighlightingOnLoad=hljs.initHighlightingOnLoad;(function(){var d="[A-Za-z0-9\\._:-]+";var k={cN:"pi",b:"<\\?",e:"\\?>",r:10};var i={cN:"doctype",b:"",r:10};var j={cN:"comment",b:""};var g={cN:"tag",b:"",c:["title","tag_internal"]};var e={cN:"title",b:d,e:hljs.IMR};var b={cN:"tag_internal",b:hljs.IMR,eW:true,nM:true,c:["attribute","value_container"],r:0};var f={cN:"attribute",b:d,e:hljs.IMR,r:0};var a={cN:"value_container",b:'="',rB:true,e:'"',nM:true,c:[{cN:"value",b:'"',eW:true}]};var c={cN:"value_container",b:"='",rB:true,e:"'",nM:true,c:[{cN:"value",b:"'",eW:true}]};hljs.LANGUAGES.xml={dM:{c:["pi","doctype","comment","cdata","tag"]},cI:true,m:[{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},k,i,j,g,hljs.inherit(e,{r:1.75}),b,f,a,c]};var h={code:1,kbd:1,font:1,noscript:1,style:1,img:1,title:1,menu:1,tt:1,tr:1,param:1,li:1,tfoot:1,th:1,input:1,td:1,dl:1,blockquote:1,fieldset:1,big:1,dd:1,abbr:1,optgroup:1,dt:1,button:1,isindex:1,p:1,small:1,div:1,dir:1,em:1,frame:1,meta:1,sub:1,bdo:1,label:1,acronym:1,sup:1,body:1,basefont:1,base:1,br:1,address:1,strong:1,legend:1,ol:1,script:1,caption:1,s:1,col:1,h2:1,h3:1,h1:1,h6:1,h4:1,h5:1,table:1,select:1,noframes:1,span:1,area:1,dfn:1,strike:1,cite:1,thead:1,head:1,option:1,form:1,hr:1,"var":1,link:1,b:1,colgroup:1,ul:1,applet:1,del:1,iframe:1,pre:1,frameset:1,ins:1,tbody:1,html:1,samp:1,map:1,object:1,a:1,xmlns:1,center:1,textarea:1,i:1,q:1,u:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,figure:1,figurecaption:1,time:1,mark:1,wbr:1,embed:1,video:1,audio:1,source:1,canvas:1,datalist:1,keygen:1,output:1,progress:1,meter:1,details:1,summary:1,command:1};hljs.LANGUAGES.html={dM:{c:["comment","pi","doctype","vbscript","tag"]},cI:true,m:[{cN:"tag",b:"",l:[hljs.IR],k:{style:1},c:["tag_internal"],starts:"css"},{cN:"tag",b:"",l:[hljs.IR],k:{script:1},c:["tag_internal"],starts:"javascript"},{cN:"css",e:"",rE:true,subLanguage:"css"},{cN:"javascript",e:"<\/script>",rE:true,subLanguage:"javascript"},{cN:"vbscript",b:"<%",e:"%>",subLanguage:"vbscript"},j,k,i,hljs.inherit(g),hljs.inherit(e,{l:[hljs.IR],k:h,}),hljs.inherit(b),f,a,c,{cN:"value_container",b:"=",e:hljs.IMR,c:[{cN:"unquoted_value",displayClassName:"value",b:"[^\\s/>]+",e:hljs.IMR}]}]}})();hljs.LANGUAGES.javascript={dM:{l:[hljs.UIR],c:["string","comment","number","regexp_container","function"],k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}}},m:[hljs.CLCM,hljs.CBLCLM,hljs.CNM,hljs.ASM,hljs.QSM,hljs.BE,{cN:"regexp_container",b:"("+hljs.RSR+"|case|return|throw)\\s*",e:hljs.IMR,nM:true,l:[hljs.IR],k:{"return":1,"throw":1,"case":1},c:["comment",{cN:"regexp",b:"/.*?[^\\\\/]/[gim]*",e:hljs.IMR}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",l:[hljs.UIR],k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*",e:hljs.IMR},{cN:"params",b:"\\(",e:"\\)",c:["string","comment"]}]}]};hljs.LANGUAGES.css={dM:{c:["at_rule","id","class","attr_selector","pseudo","rules","comment"],k:hljs.HTML_TAGS,l:[hljs.IR],i:"="},cI:true,m:[{cN:"at_rule",b:"@",e:"[{;]",eE:true,l:[hljs.IR],k:{"import":1,page:1,media:1,charset:1,"font-face":1},c:["function","string","number","pseudo"]},{cN:"id",b:"\\#[A-Za-z0-9_-]+",e:hljs.IMR},{cN:"class",b:"\\.[A-Za-z0-9_-]+",e:hljs.IMR,r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+",e:hljs.IMR},{cN:"rules",b:"{",e:"}",c:[{cN:"rule",b:"[A-Z\\_\\.\\-]+\\s*:",e:";",eW:true,l:["[A-Za-z-]+"],k:{"play-during":1,"counter-reset":1,"counter-increment":1,"min-height":1,quotes:1,"border-top":1,pitch:1,font:1,pause:1,"list-style-image":1,"border-width":1,cue:1,"outline-width":1,"border-left":1,elevation:1,richness:1,"speech-rate":1,"border-bottom":1,"border-spacing":1,background:1,"list-style-type":1,"text-align":1,"page-break-inside":1,orphans:1,"page-break-before":1,"text-transform":1,"line-height":1,"padding-left":1,"font-size":1,right:1,"word-spacing":1,"padding-top":1,"outline-style":1,bottom:1,content:1,"border-right-style":1,"padding-right":1,"border-left-style":1,"voice-family":1,"background-color":1,"border-bottom-color":1,"outline-color":1,"unicode-bidi":1,"max-width":1,"font-family":1,"caption-side":1,"border-right-width":1,"pause-before":1,"border-top-style":1,color:1,"border-collapse":1,"border-bottom-width":1,"float":1,height:1,"max-height":1,"margin-right":1,"border-top-width":1,speak:1,"speak-header":1,top:1,"cue-before":1,"min-width":1,width:1,"font-variant":1,"border-top-color":1,"background-position":1,"empty-cells":1,direction:1,"border-right":1,visibility:1,padding:1,"border-style":1,"background-attachment":1,overflow:1,"border-bottom-style":1,cursor:1,margin:1,display:1,"border-left-width":1,"letter-spacing":1,"vertical-align":1,clip:1,"border-color":1,"list-style":1,"padding-bottom":1,"pause-after":1,"speak-numeral":1,"margin-left":1,widows:1,border:1,"font-style":1,"border-left-color":1,"pitch-range":1,"background-repeat":1,"table-layout":1,"margin-bottom":1,"speak-punctuation":1,"font-weight":1,"border-right-color":1,"page-break-after":1,position:1,"white-space":1,"text-indent":1,"background-image":1,volume:1,stress:1,outline:1,clear:1,"z-index":1,"text-decoration":1,"margin-top":1,azimuth:1,"cue-after":1,left:1,"list-style-position":1},c:[{cN:"value",b:hljs.IMR,eW:true,eE:true,c:["function","number","hexcolor","string","important","comment"]}]},"comment"],i:"[^\\s]"},hljs.CBLCLM,{cN:"number",b:hljs.NR,e:hljs.IMR},{cN:"hexcolor",b:"\\#[0-9A-F]+",e:hljs.IMR},{cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{cN:"params",b:hljs.IMR,eW:true,eE:true,c:["number","string"]}]},{cN:"important",b:"!important",e:hljs.IMR},hljs.ASM,hljs.QSM,hljs.BE]}; \ No newline at end of file +var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(/"}while(x.length||y.length){var u=t().splice(0,1)[0];v+=l(w.substr(q,u.offset-q));q=u.offset;if(u.event=="start"){v+=r(u.node);s.push(u.node)}else{if(u.event=="stop"){var p=s.length;do{p--;var o=s[p];v+=("")}while(o!=u.node);s.splice(p,1);while(p'+l(K[0])+""}else{M+=l(K[0])}O=N.lR.lastIndex;K=N.lR.exec(L)}M+=l(L.substr(O,L.length-O));return M}function J(r,L){if(L.sL&&d[L.sL]){var K=f(L.sL,r);s+=K.keyword_count;return K.value}else{return E(r,L)}}function H(L,r){var K=L.cN?'':"";if(L.rB){p+=K;L.buffer=""}else{if(L.eB){p+=l(r)+K;L.buffer=""}else{p+=K;L.buffer=r}}B.push(L);A+=L.r}function D(N,K,P){var Q=B[B.length-1];if(P){p+=J(Q.buffer+N,Q);return false}var L=y(K,Q);if(L){p+=J(Q.buffer+N,Q);H(L,K);return L.rB}var r=v(B.length-1,K);if(r){var M=Q.cN?"":"";if(Q.rE){p+=J(Q.buffer+N,Q)+M}else{if(Q.eE){p+=J(Q.buffer+N,Q)+M+l(K)}else{p+=J(Q.buffer+N+K,Q)+M}}while(r>1){M=B[B.length-2].cN?"":"";p+=M;r--;B.length--}var O=B[B.length-1];B.length--;B[B.length-1].buffer="";if(O.starts){H(O.starts,"")}return Q.rE}if(w(K,Q)){throw"Illegal"}}var G=d[I];var B=[G.dM];var A=0;var s=0;var p="";try{var u=0;G.dM.buffer="";do{var x=q(C,u);var t=D(x[0],x[1],x[2]);u+=x[0].length;if(!t){u+=x[1].length}}while(!x[2]);if(B.length>1){throw"Illegal"}return{language:I,r:A,keyword_count:s,value:p}}catch(F){if(F=="Illegal"){return{language:null,r:0,keyword_count:0,value:l(C)}}else{throw F}}}function h(){function o(t,s,u){if(t.compiled){return}if(!u){t.bR=c(s,t.b?t.b:"\\B|\\b");if(!t.e&&!t.eW){t.e="\\B|\\b"}if(t.e){t.eR=c(s,t.e)}}if(t.i){t.iR=c(s,t.i)}if(t.r==undefined){t.r=1}if(t.k){t.lR=c(s,t.l||hljs.IR,true)}for(var r in t.k){if(!t.k.hasOwnProperty(r)){continue}if(t.k[r] instanceof Object){t.kG=t.k}else{t.kG={keyword:t.k}}break}if(!t.c){t.c=[]}t.compiled=true;for(var q=0;qx.keyword_count+x.r){x=u}if(u.keyword_count+u.r>w.keyword_count+w.r){x=w;w=u}}}var s=t.className;if(!s.match(w.language)){s=s?(s+" "+w.language):w.language}var o=b(t);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=k(o,b(q),A)}if(y){w.value=w.value.replace(/^((<[^>]+>|\t)+)/gm,function(B,E,D,C){return E.replace(/\t/g,y)})}if(p){w.value=w.value.replace(/\n/g,"
    ")}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){var q=t.parentNode;var v=document.createElement("div");v.innerHTML="
    "+w.value+"
    ";t=v.firstChild.firstChild;v.firstChild.cN=q.cN;q.parentNode.replaceChild(v.firstChild,q)}else{t.innerHTML=w.value}t.className=s;t.dataset={};t.dataset.result={language:w.language,kw:w.keyword_count,re:w.r};if(x&&x.language){t.dataset.second_best={language:x.language,kw:x.keyword_count,re:x.r}}}function j(){if(j.called){return}j.called=true;e();var q=document.getElementsByTagName("pre");for(var o=0;o|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(o,r){var q={};for(var p in o){q[p]=o[p]}if(r){for(var p in r){q[p]=r[p]}}return q}}();hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/.*?[^\\\\/]/[gim]*"}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@font-face",l:"[a-z-]+",k:{"font-face":1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"",rE:true,sL:"css"}},{cN:"tag",b:"",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",c:[{cN:"title",b:"[^ />]+"},a]}]}}}(); \ No newline at end of file From ddd0fd16d7842eedb911aa0f257d3dd1e40a47ac Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 20 Sep 2011 22:50:47 -0600 Subject: [PATCH 054/816] debug page for geojson was broken. Missing "color" property for MultiPolygon. --- debug/geojson/geojson-sample.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debug/geojson/geojson-sample.js b/debug/geojson/geojson-sample.js index 24ecf05002e..811bfbd953e 100644 --- a/debug/geojson/geojson-sample.js +++ b/debug/geojson/geojson-sample.js @@ -44,6 +44,9 @@ var geojsonSample = { "geometry": { "type": "MultiPolygon", "coordinates": [[[[100.0, 1.5], [100.5, 1.5], [100.5, 2.0], [100.0, 2.0], [100.0, 1.5]]], [[[100.5, 2.0], [100.5, 2.5], [101.0, 2.5], [101.0, 2.0], [100.5, 2.0]]]] + }, + "properties": { + "color": "#ff7800" } } ] From f0957521344f42b853c80ec8bc5cb90cc686a851 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 21 Sep 2011 00:08:12 -0600 Subject: [PATCH 055/816] Getting started with a GeoJSON example page. --- examples.html | 5 + examples/geojson-example.html | 67 ++++---- examples/geojson-sample.js | 50 ------ examples/geojson.html | 139 ++++++++++++++++ examples/sample-geojson.js | 293 ++++++++++++++++++++++++++++++++++ 5 files changed, 464 insertions(+), 90 deletions(-) delete mode 100644 examples/geojson-sample.js create mode 100644 examples/geojson.html create mode 100644 examples/sample-geojson.js diff --git a/examples.html b/examples.html index e22b123a9a3..d41997c524e 100644 --- a/examples.html +++ b/examples.html @@ -67,6 +67,11 @@

    Leaflet on Mobile

    Markers With Custom Icons

    In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map.

    +
    + + +

    Using GeoJSON with Leaflet

    +

    Blah Blah Blah. GeoJSON. Blah Blah Blah.


    Layer Groups and Layers Control

    diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 9b361788f79..c9cb497f851 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -1,55 +1,42 @@ - Leaflet debug page - - - + Leaflet GeoJSON example - + + - + + +
    -
    - - - - \ No newline at end of file diff --git a/examples/geojson-sample.js b/examples/geojson-sample.js deleted file mode 100644 index 24ecf05002e..00000000000 --- a/examples/geojson-sample.js +++ /dev/null @@ -1,50 +0,0 @@ -var geojsonSample = { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "geometry": { - "type": "Point", - "coordinates": [102.0, 0.5] - }, - "properties": { - "prop0": "value0", - "color": "blue" - } - }, - - { - "type": "Feature", - "geometry": { - "type": "LineString", - "coordinates": [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]] - }, - "properties": { - "color": "red", - "prop1": 0.0 - } - }, - - { - "type": "Feature", - "geometry": { - "type": "Polygon", - "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]] - }, - "properties": { - "color": "green", - "prop1": { - "this": "that" - } - } - }, - - { - "type": "Feature", - "geometry": { - "type": "MultiPolygon", - "coordinates": [[[[100.0, 1.5], [100.5, 1.5], [100.5, 2.0], [100.0, 2.0], [100.0, 1.5]]], [[[100.5, 2.0], [100.5, 2.5], [101.0, 2.5], [101.0, 2.0], [100.5, 2.0]]]] - } - } - ] -}; \ No newline at end of file diff --git a/examples/geojson.html b/examples/geojson.html new file mode 100644 index 00000000000..3deca67ee92 --- /dev/null +++ b/examples/geojson.html @@ -0,0 +1,139 @@ + + + + Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Leaflet on Mobile Example + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Leaflet

    +

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    + + + +

    ← Back to the list of examples

    +

    Using GeoJSON with Leaflet

    + +

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON.

    + +

    View example →

    + +

    Preparing the page

    + +

    First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

    + +
    body {
    +	padding: 0;
    +	margin: 0;
    +}
    +html, body, #map {
    +	height: 100%;
    +}
    + +

    Also, we need to tell the mobile browser to disable scaling of the page and set it to its actual size by placing the following line in the head section:

    + +
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    + +

    Initializing the map

    + +

    We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

    + +
    var map = new L.Map('map');
    +	
    +var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
    +	cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    +	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
    +
    +map.addLayer(cloudmade);
    + +

    Geolocation

    + +

    Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

    + +
    map.locateAndSetView(16);
    + +

    Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

    + +
    map.on('locationfound', onLocationFound);
    +		
    +function onLocationFound(e) {
    +	var radius = e.accuracy / 2;
    +
    +	var marker = new L.Marker(e.latlng);
    +	map.addLayer(marker);
    +	marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
    +	
    +	var circle = new L.Circle(e.latlng, radius);
    +	map.addLayer(circle);	
    +}
    + +

    Excellent! But it would also be nice to show an error message if the geolocation failed:

    + +
    map.on('locationerror', onLocationError);
    +		
    +function onLocationError(e) {
    +	alert(e.message);
    +}
    + +

    Now the example is complete — try it on your mobile phone: View the full example →

    + +

    Next steps would be to take a look at the detailed documentation and browse other examples.

    + +
    + +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +
    + + Fork me on GitHub + + + + + + \ No newline at end of file diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js new file mode 100644 index 00000000000..0657bd99cb0 --- /dev/null +++ b/examples/sample-geojson.js @@ -0,0 +1,293 @@ +var free_bus = { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -104.9872612953186, + 39.74136172336104 + ], + [ + -104.9872076511383, + 39.74132459919613 + ], + [ + -104.987154006958, + 39.74127097536707 + ], + [ + -104.98713791370392, + 39.741176102336496 + ], + [ + -104.98712182044983, + 39.7410647294818 + ], + [ + -104.9871164560318, + 39.74098223095487 + ], + [ + -104.98707354068755, + 39.7409533564471 + ], + [ + -104.9869179725647, + 39.74096160630769 + ], + [ + -104.98688042163849, + 39.74099460574021 + ], + [ + -104.9868643283844, + 39.74104410485933 + ], + [ + -104.98688578605652, + 39.74110597870824 + ], + [ + -104.98693406581877, + 39.7411389780716 + ], + [ + -104.98726665973663, + 39.74137409807824 + ], + [ + -104.98783528804779, + 39.74183608592994 + ], + [ + -104.9886828660965, + 39.74249606320252 + ], + [ + -104.98956263065338, + 39.74318078294193 + ], + [ + -104.99041557312012, + 39.74383249781977 + ], + [ + -104.99128460884093, + 39.74450483012657 + ], + [ + -104.9921590089798, + 39.745181280550725 + ], + [ + -104.99301731586455, + 39.74583710114599 + ], + [ + -104.99392926692963, + 39.746534161476056 + ], + [ + -104.99477684497833, + 39.74719821830812 + ], + [ + -104.99564051628113, + 39.74785401970543 + ], + [ + -104.996520280838, + 39.74853043724829 + ], + [ + -104.99739468097687, + 39.74920684815003 + ], + [ + -104.99827444553374, + 39.74989562559743 + ], + [ + -104.99917566776276, + 39.75054727696244 + ], + [ + -105.00002861022949, + 39.7512112951138 + ], + [ + -105.00090301036835, + 39.751875306864676 + ], + [ + -105.0020295381546, + 39.75273727530449 + ], + [ + -105.00257134437561, + 39.753298167635116 + ], + [ + -105.00342428684235, + 39.75393741435492 + ], + [ + -105.00234067440032, + 39.75481172929469 + ], + [ + -105.00259280204773, + 39.75499318949525 + ], + [ + -105.00265181064606, + 39.75501793403101 + ], + [ + -105.00271081924438, + 39.75501793403101 + ], + [ + -105.00313997268677, + 39.75488596307089 + ], + [ + -105.0033438205719, + 39.754799356990866 + ], + [ + -105.0033974647522, + 39.7547622400661 + ], + [ + -105.00344038009644, + 39.75471687490865 + ], + [ + -105.00349938869476, + 39.754617896279655 + ], + [ + -105.00351548194885, + 39.75455603456428 + ], + [ + -105.00353157520293, + 39.75450654515198 + ], + [ + -105.00342965126036, + 39.753941538508016 + ] + ] + }, + "properties": { + "name": "16th Street Free Bus", + "popup_content": "This is the 16th street free bus in Denver, a good way to cross town." + }, + "id": 1 +}; + +var bicycle_rental = { + "type": "FeatureCollection", + "features": [ + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9998241, + 39.7471494 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 51 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9983545, + 39.7502833 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 52 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9963919, + 39.7444271 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 54 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9960754, + 39.7498956 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 55 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9933717, + 39.7477264 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 57 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9913392, + 39.7432392 + ] + }, + "type": "Feature", + "properties": { + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + }, + "id": 58 + }, + { + "geometry": { + "type": "Point", + "coordinates": [ + -104.9788452, + 39.6933755 + ] + }, + "type": "Feature", + "properties": { + "name": "Denver B-cycle" + }, + "id": 74 + } + ] +}; \ No newline at end of file From a86ea1a8c3be9220ac8ec7528216d3dac6a96fda Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 21 Sep 2011 22:50:23 -0600 Subject: [PATCH 056/816] Adding GeoJSON MultiPolygon (one with a donut hole) to example. --- examples/geojson-example.html | 3 +- examples/sample-geojson.js | 55 +++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index c9cb497f851..6d7d089b180 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -35,7 +35,8 @@ map.addLayer( geojson_layer ); geojson_layer.addGeoJSON( free_bus ); - geojson_layer.addGeoJSON( bicycle_rental ); + geojson_layer.addGeoJSON( bicycle_rental ); + geojson_layer.addGeoJSON( campus ); diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index 0657bd99cb0..d16c3b84420 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -285,9 +285,60 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "name": "Denver B-cycle" + "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 74 } ] -}; \ No newline at end of file +}; + +var campus = { + "type": "Feature", + "properties": { + "popup_content": "This is the Auraria West Campus" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-105.00432014465332, 39.74732195489861], + [-105.00715255737305, 39.74620006835170], + [-105.00921249389647, 39.74468219277038], + [-105.01067161560059, 39.74362625960105], + [-105.01195907592773, 39.74290029616054], + [-105.00989913940431, 39.74078835902781], + [-105.00758171081543, 39.74059036160317], + [-105.00346183776855, 39.74059036160317], + [-105.00097274780272, 39.74059036160317], + [-105.00062942504881, 39.74072235994946], + [-105.00020027160645, 39.74191033368865], + [-105.00071525573731, 39.74276830198601], + [-105.00097274780272, 39.74369225589818], + [-105.00097274780272, 39.74461619742136], + [-105.00123023986816, 39.74534214278395], + [-105.00183105468751, 39.74613407445653], + [-105.00432014465332, 39.74732195489861] + ],[ + [-105.00361204147337, 39.74354376414072], + [-105.00301122665405, 39.74278480127163], + [-105.00221729278564, 39.74316428375108], + [-105.00283956527711, 39.74390674342741], + [-105.00361204147337, 39.74354376414072] + ] + ],[ + [ + [-105.00942707061768, 39.73989736613708], + [-105.00942707061768, 39.73910536278566], + [-105.00685214996338, 39.73923736397631], + [-105.00384807586671, 39.73910536278566], + [-105.00174522399902, 39.73903936209552], + [-105.00041484832764, 39.73910536278566], + [-105.00041484832764, 39.73979836621592], + [-105.00535011291504, 39.73986436617916], + [-105.00942707061768, 39.73989736613708] + ] + ] + ] + } +}; From 6bfe2a6a41a058499bf4246ff57fbd56f5e2c20c Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 21 Sep 2011 23:05:00 -0600 Subject: [PATCH 057/816] Styling the GeoJSON features a bit. Styles are based on a "style" object in the GeoJSON properties. --- examples/geojson-example.html | 3 +++ examples/sample-geojson.js | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 6d7d089b180..005c72f9e1a 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -30,6 +30,9 @@ popup_content += e.properties.popup_content; } e.layer.bindPopup( popup_content ); + if ( e.properties && e.properties.style ) { + e.layer.setStyle( e.properties.style ); + } } ); map.addLayer( geojson_layer ); diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index d16c3b84420..d537af5e220 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -183,6 +183,11 @@ var free_bus = { }, "properties": { "name": "16th Street Free Bus", + "style": { + color: "#004070", + weight: 4, + opacity: 0.9 + }, "popup_content": "This is the 16th street free bus in Denver, a good way to cross town." }, "id": 1 @@ -295,7 +300,14 @@ var bicycle_rental = { var campus = { "type": "Feature", "properties": { - "popup_content": "This is the Auraria West Campus" + "popup_content": "This is the Auraria West Campus", + "style": { + weight: 2, + color: "#999", + opacity: 1, + fillColor: "#B0DE5C", + fillOpacity: 0.8 + } }, "geometry": { "type": "MultiPolygon", From f813568a2d73a250240899bc52a971b309ee3eb6 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 27 Sep 2011 19:20:16 -0600 Subject: [PATCH 058/816] More progress on geojson example. --- examples/baseball-marker.png | Bin 0 -> 1315 bytes examples/geojson-example.html | 48 ++++++++++- examples/geojson.html | 153 +++++++++++++++++++++------------- examples/sample-geojson.js | 11 +++ 4 files changed, 148 insertions(+), 64 deletions(-) create mode 100644 examples/baseball-marker.png diff --git a/examples/baseball-marker.png b/examples/baseball-marker.png new file mode 100644 index 0000000000000000000000000000000000000000..187492b913b41c8b2b00b8c387ebee617e893f13 GIT binary patch literal 1315 zcmV+;1>E|HP)xsENr${1d!3av=$sI&Zu) zG0_kbg$ox(1~e#2fW$Gj!N9_Pbd0Tx(w_G8hZjBPtnE2H?PNU3H*eqfoagy|-{*ba zoIXN6p9i43yW0WS0H-=SSXs*eIUo(>1_lN)075>W*T|iKONCPvU|S*boGKs<$STqU z0|OZ$6bfnNBH&d=7cV9QGLQfk)iJH@(xsC7g1u8$R+zZN!u|eE^=A&q6sKMc_D)@C z+q?~r=)vt4s|I_Ph~p6@eYCPONHkGkUU;Qu^vINTOu-f zkLaT*ghX>;tn$7n)+2emnjWprYz_)%tpU+pUv=mA9^59I&G5mSKjC$4;OF7@5wKVF zD~hdiYK5j(yC7H>{(Y7Fqt4TKoNM|1(jk;wlDYY5*84Ugx~-3*$ZRFVORM&Zn4F$K z$)q{D_eVU=we$^j(b@J1A9tQ%gSUgpnF&jOn@N@o0tCTkipQ}iN>-t#<0Na`8~N^X zh^idB(US6Mri+ zyj@;Q529lL9Pb(epl_&4e-@Xc3{U??pkWW^N52B#X*`BkTKgOV%F^Ut*T%lqWBUAf z*AU-ce47vV{etLh(ARr9zUJKU7d%Z*uv%!US%9$!1xE>{=k9aq&Z&}}A3Jcqgj_S9 zw4Jn)GQ=oGxfxbssfm)gw7L$v-9;o4qi?8-&kkHb5NzCz{>~0xs3c>#e3oSTi6MrS zRjnAiy-*W@K!8Xj!Z#NW>d$sIzf&{O{}xbefj~h29f?Ft-w_01Sprt-dk;XK9JyTX z#S2I#lcwv^Dj$lXJf8poTUEpsVzf5wF$8O0f2eAVssgO8kOn2Auz$;O-DfU-SN8>2 zSXij}8kz{GvxF?C0BH1V20+QmoFDyC_us$ea~7XIsp$XQ0v^vlDoOvy%vm1A$MyNH zmLAJERR!3EI!mM#nPA(e`ui8}oB|-0e5eu^(mXdmW9nanfK?TdP8BMAowTLI$LVl! z`A(lc54Ig+;mNFNj7kFZ%WJneD?$<*@ku*$=UdZf0q{3%<^KHApXrW`M_5(oHjPna zIZZ&O2*^pfVg}@t%xrvAk1#lPf<|u(4fQQ0g2rbrkW!3s*>YNUi+9eqvo>;^t z)FFv$4C(T^3!mBIFJs$=*8y0!x|PAP6NK;ekx~*g*0*36mUbLZ#E2&rwW+Lf=7dlv z9+-guic} zBi!%bO=)daZceMT=h|4@zFptbewaY>OC{uy=rDhc{7Sgr|C+i>?VO7Rn78LvrV4XW zs1r#QadU5b51ZD%48XrL|8RBW4B>u%he{q-A!|gHtg3(tBBWsN)b)Ms?*Z_~$Z2io zah5?|vj7tjURA_3Ks)m|h2pB2d|3j@M2IT1i=L*C`owa`mo1=3gjST=Rn@LodO73( Z{{cKA=3m()Hbwvd002ovPDHLkV1ndPe7pbv literal 0 HcmV?d00001 diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 005c72f9e1a..f9747d6de7c 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -7,6 +7,7 @@ + @@ -19,10 +20,39 @@ cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}); - map.setView(new L.LatLng(39.74402223643582, -104.99264717102051), 14) + map.setView(new L.LatLng(39.74738794765598, -105.00002861022949), 14) .addLayer(cloudmade); + + var BaseballIcon = L.Icon.extend({ + iconUrl: 'baseball-marker.png', + shadowUrl: null, + iconSize: new L.Point(32, 37), + shadowSize: null, + iconAnchor: new L.Point(14, 37), + popupAnchor: new L.Point(2, -32) + }); - var geojson_layer = new L.GeoJSON(); + var geojson_layer = new L.GeoJSON( null, { + pointToLayer: function ( latlng ) { + return new L.CircleMarker( latlng, { + radius: 8, + fillColor: "#ff7800", + color: "#000", + weight: 1, + opacity: 1, + fillOpacity: 0.8 + } ); + + } + } ); + + var another_geojson_layer = new L.GeoJSON( coors_field, { + pointToLayer: function ( latlng ) { + return new L.Marker( latlng, { + icon: new BaseballIcon() + } ); + } + } ); geojson_layer.on( "featureparse", function( e ) { var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; @@ -35,11 +65,21 @@ } } ); - map.addLayer( geojson_layer ); + another_geojson_layer.on( "featureparse", function ( e ) { + var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if ( e.properties && e.properties.popup_content ) { + popup_content += e.properties.popup_content; + } + e.layer.bindPopup( popup_content ); + } ); + + map.addLayer( geojson_layer ).addLayer( another_geojson_layer ); geojson_layer.addGeoJSON( free_bus ); geojson_layer.addGeoJSON( bicycle_rental ); - geojson_layer.addGeoJSON( campus ); + geojson_layer.addGeoJSON( campus ); + + another_geojson_layer.addGeoJSON( coors_field ); diff --git a/examples/geojson.html b/examples/geojson.html index 3deca67ee92..0b88f66411f 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -42,70 +42,103 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    ← Back to the list of examples

    Using GeoJSON with Leaflet

    -

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON.

    +

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    View example →

    -

    Preparing the page

    - -

    First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

    - -
    body {
    -	padding: 0;
    -	margin: 0;
    -}
    -html, body, #map {
    -	height: 100%;
    -}
    +

    About GeoJSON

    + +

    According to http://geojson.org:

    + +
    GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
    + +

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    + +

    The GeoJSON layer

    + +

    GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

    + +
    var geojson_layer = new L.GeoJSON();
    +
    +map.addLayer( geojson_layer );
    + +

    This creates an empty GeoJSON layer that we can easily add vectors to.

    + +
    var a_geojson_feature = {
    +    "type": "Feature",
    +    "properties": {
    +        "name": "Coors Field",
    +        "amenity": "Baseball Stadium"
    +    },
    +    "geometry": {
    +        "type": "Point",
    +        "coordinates": [-104.99404, 39.75621]
    +    }
    +};
    +
    +geojson_layer.addGeoJSON( a_geojson_feature );
    + +

    We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

    + +
    var a_geojson_feature = {
    +    "type": "Feature",
    +    "properties": {
    +        "name": "Coors Field",
    +        "amenity": "Baseball Stadium"
    +    },
    +    "geometry": {
    +        "type": "Point",
    +        "coordinates": [-104.99404, 39.75621]
    +    }
    +};
    +        
    +var geojson_layer = new L.GeoJSON( a_geojson_feature );
    +
    +map.addLayer( geojson_layer );
    + +

    Popups

    + +

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popup_content" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    + +
    geojson_layer.on( "featureparse", function ( e ) {
    +    if ( e.properties && e.properties.popup_content ) {
    +        e.layer.bindPopup( e.properties.popup_content );
    +    }
    +} );
    + +

    Styling Features

    -

    Also, we need to tell the mobile browser to disable scaling of the page and set it to its actual size by placing the following line in the head section:

    - -
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    - -

    Initializing the map

    - -

    We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

    - -
    var map = new L.Map('map');
    -	
    -var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
    -	cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
    -
    -map.addLayer(cloudmade);
    - -

    Geolocation

    - -

    Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

    - -
    map.locateAndSetView(16);
    - -

    Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

    - -
    map.on('locationfound', onLocationFound);
    -		
    -function onLocationFound(e) {
    -	var radius = e.accuracy / 2;
    -
    -	var marker = new L.Marker(e.latlng);
    -	map.addLayer(marker);
    -	marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
    -	
    -	var circle = new L.Circle(e.latlng, radius);
    -	map.addLayer(circle);	
    -}
    - -

    Excellent! But it would also be nice to show an error message if the geolocation failed:

    - -
    map.on('locationerror', onLocationError);
    -		
    -function onLocationError(e) {
    -	alert(e.message);
    -}
    - -

    Now the example is complete — try it on your mobile phone: View the full example →

    - -

    Next steps would be to take a look at the detailed documentation and browse other examples.

    +

    We can also listen to the featureparse event to style our LineString and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

    + +
    var free_bus = {
    +    "type": "Feature",
    +    "geometry": {
    +        "type": "LineString",
    +        "coordinates": [
    +            [-104.98726, 39.74136],
    +            [-104.98720, 39.74132],
    +            [-104.98715, 39.74127],
    +            [-104.98713, 39.74117],
    +            [-104.98712, 39.74106], ...
    +        ]
    +    },
    +    "properties": {
    +        "name": "16th Street Free Bus",
    +        "style": {
    +            "color": "#004070",
    +            "weight": 4,
    +            "opacity": 0.9
    +        },
    +        "popup_content": "This is the 16th street free bus ..."
    +    }
    +};
    + +
    geojson_layer.on( "featureparse", function ( e ) {
    +	if ( e.properties && e.properties.style && e.layer.setStyle ) {
    +	    // The setStyle method isn't available for Points. More on that later ...
    +		e.layer.setStyle( e.properties.style );
    +	}
    +} );

    diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index d537af5e220..f96f8b4fc51 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -354,3 +354,14 @@ var campus = { ] } }; + +var coors_field = { + "type": "Feature", + "properties": { + "popup_content": "Coors Field" + }, + "geometry": { + "type": "Point", + "coordinates": [-104.99404191970824, 39.756213909328125] + } +}; From e18e1fa7a24b92bb949f4a2a6ce047bbc8d5739c Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 27 Sep 2011 23:38:05 -0600 Subject: [PATCH 059/816] Adding image for main examples page. --- docs/images/geojson.png | Bin 0 -> 30839 bytes examples.html | 4 +- examples/geojson-example.html | 1 - examples/geojson.html | 106 ++++++++++++++++++++++++++++++++-- 4 files changed, 103 insertions(+), 8 deletions(-) create mode 100644 docs/images/geojson.png diff --git a/docs/images/geojson.png b/docs/images/geojson.png new file mode 100644 index 0000000000000000000000000000000000000000..06de11419f5b162c4d5e5fc895574ae63dbb7279 GIT binary patch literal 30839 zcmV)DK*7I>P)EX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>`#Q*^C19^CUbg)1C0k3ZW0swH; zE+i7i;s1lWP$pLZAdvvzA`<5d0gzGv$SzdK6adH=0I*ZDWC{S3003-xd_p1ssto|_ z^hrJi0NAOM+!p}Yq8zCR0F40vnJ7mj0zkU}U{!%qECRs70HCZuA}$2Lt^t5qwlYTo zfV~9(c8*w(4?ti5fSE!p%m5%b0suoE6U_r4Oaq`W(!b!TUvP!ENC5!A%azTSOVTqG zxRuZvck=My;vwR~Y_URN7by^C3FIQ2mzyIKNaq7g&I|wm8u`(|{y0C7=jP<$=4R(? z@ASo@{%i1WB0eGU-~POe0t5gMPS5Y!U*+Z218~Oyuywy{sapWrRsd+<`CT*H37}dE z(0cicc{uz)9-g64$UGe!3JVMEC1RnyFyo6p|1;rl;ER6t{6HT5+j{T-ahgDxt-zy$ z{c&M#cCJ#6=gR~_F>d$gBmT#QfBlXr(c(0*Tr3re@mPttP$EsodAU-NL?OwQ;u7h9 zGVvdl{RxwI4FIf$Pry#L2er#=z<%xl0*ek<(slqqe)BDi8VivC5N9+pdG`PSlfU_o zKq~;2Moa!tiTSO!5zH77Xo1hL_iEAz&sE_ z2IPPo3ZWR5K^auQI@koYumc*P5t`u;w81er4d>tzT!HIw7Y1M$p28Tsh6w~g$Osc* zAv%Z=Vvg7%&IlKojszlMNHmgwq#)^t6j36@$a16tsX}UzT}UJHEpik&ja)$bklV;0 zGK&0)yhkyVfwEBp)B<%txu_o+ipHRG(R4HqU4WLNYtb6C9zB4zqNmYI=yh}eeTt4_ zfYC7yW{lZkT#ScBV2M~7CdU?I?5=ix(HVZgM=}{CnA%mPqZa^68Xe5gFH?u96Et<2 zCC!@_L(8Nsqt(!wX=iEoXfNq>x(VHb9z~bXm(pwK2kGbOgYq4YG!XMxcgB zqf}$J#u<$v7REAV@mNCEa#jQDENhreVq3EL>`ZnA`x|yIdrVV9bE;;nW|3x{=5fsd z4#u(I@HyF>O3oq94bFQl11&!-vDRv>X03j$H`;pIzS?5#a_tuF>)P*iaGgM%ES>c_ zZ94aL3A#4AQM!e?+jYlFJ5+DSzi0S9#6BJCZ5(XZOGfi zTj0IRdtf>~J!SgN=>tB-J_4V5pNGDtz9Qc}z9W9tewls;{GR(e`pf-~_`l(K@)q$< z1z-We0p$U`ff|9c18V~x1epY-2Q>wa1-k|>3_cY?3<(WcA99m#z!&lx`C~KOXDpi0 z70L*m6G6C?@k ziR8rC#65}Qa{}jVnlqf_npBo_W3J`gqPZ95>CVfZcRX1&S&)1jiOPpx423?lIEROmG(H@JAFg?XogQlb;dIZPf{y+kr|S? zBlAsGMAqJ{&)IR=Ejg5&l$@hd4QZCNE7vf$D7Q~$D=U)?Nn}(WA6du22pZOfRS_cv~1-c(_QtNLti0-)8>m`6CO07JR*suu!$(^sg%jf zZm#rNxnmV!m1I@#YM0epR(~oNm0zrItf;Q|utvD%;#W>z)qM4NZQ9!2O1H}G>qzUQ z>u#*~S--DJy=p<#(1!30tsC);y-IHSJr>wyfLop*ExT zdYyk=%U1oZtGB+{Cfe4&-FJKQ4uc&PJKpb5^_C@dOYIJXG+^@gCvI%WcHjN%gI&kHifN$EH?V5MBa9S!3!a?Q1 zC*P)gd*e{(q0YnH!_D8Bf4B7r>qvPk(mKC&tSzH$pgp0z@92!9ogH2sN4~fJe(y2k zV|B+hk5`_cohUu=`Q(C=R&z?UQbnZ;IU-!xL z-sg{9@Vs#JBKKn3CAUkhJ+3`ResKNaNUvLO>t*-L?N>ambo5Q@JJIjcfBI^`)pOVQ z*DhV3dA;w(>>IakCfyvkCA#(acJ}QTcM9%I++BK)c(44v+WqPW`VZ=VwEnSWz-{38 zV8CF{!&wjS4he^z{*?dIhvCvk%tzHDMk9@nogW_?4H~`jWX_Y}r?RIL&&qyQ|9R_k ztLNYS;`>X_Sp3-V3;B!Bzpi-%HQ%$Yg&qTloJJb9RV&di)Wd+%9$t#`fa-E`D3$1;OKATR&|n4SND zK&6iWp!7962hLZ{m(mgtnnZ0)o|UwTR3wL6zP*>`)aLQaUmlGONg%2f(A^$^&?S;d z4LQj$H9!#z$;5_klOovt9S{*o$q-O5IIM!T9NW1f38jEUA_@hJY`zHHFj#@pRJ&L} zw7MP>6DIH8y@w*x7V-aFb2*u+WFBs%yKej$_ST)i_x|R`wDI9P`N21L;PP7^poN=P z@x^z&Nq0VeKR5TT#t(n_64lnkAf-expF_jEldx>w1hgM+)g5S1zNp+55M){0a8>IV5jGZh@3yj>13~e+39#Hb*%F_Gcyqp zxb!KJd$Bhh-VK;RMBZ4Td>?iPtm3$QA~A!B%8db2xs6QTfIG)vW+;u#EjM|WIIVHc zCxAfY-oMl^F8w4q4@n>b` z*Hk8EVgeHrgrZS4mE_LBBgqMvyJJ1QzIr_d3ks8}P(v(^6PF!HtsibD zqi!nBId2&)Jmoz8>L(V^^Upj(8}<%z#MB7V=7J>@=#>w$e-^;?i~Q zP1VwzFU>KAb5n0hdo!3QFq_M-MrmRS0t`b!w*|Kz3ZuOssr9u<_}=fPB2<^d%wyZI zWOf?Ohi%;U%~rhj)D+x$^FGuRR5aCF{J?{=>Gr1@Fmvu8e_~z=+qc$Y*TFEF=B9Az z>Ag4{B}`e8#zo(n4<+RGfPe%ufxyH7Gc;X?PGD)&$6Nk(#;U`OfNrp z*PZmJ8R4j=pzZ%WOwsIeHnSsmtbYq{+usjESHWN~Gaxk7MHH~KplUjY<1s3>jbJ#H z2Pq+D073xC;S7#B^8#G>$#Y=$9N^xRKq6*<8J$vo4gTUlJ$(eHAb(Lf34mFo=$Y7tTDlJSz{(Ax{z@??gzd{9WP0a3tI>)8QCwSAF zJ+o@tgm_I3bDC|e%^6hFTm%;ty!v`QZuv|H-7%N2=h+$fb9)gN>MCx&c@g-;R$P0+ z5LO>l@rxht#K^%YYR~VcAKtVWtyv8_HdWIAiX1)^rIDOKV^q@6U=mU>C>{$lq%7M> zFxfV-s@a&*lEdJziP5ZzkS1Z}B^B%tSJjvxX+a7B&WzxxC!T^0Cd(pDB;tsfDoM#8 zMWv8nta;%{Ym7z*csR0@VizBKI`VL zK<=^9*gWwjB64khNK)Y6*= z!}#juhj}SftoX?soOR(r@PS&o=H7`o>Ff^7GflE)_TsEs6~BAE4yT3riauA>&am$&U|hidB1%TjU=vS|&IW{%L~ckDn&E6}AU zWbv;x)fBBOa7$eg`K+L1PCyY1O;gDXg%J*i5sjEmr`NcQFm>l0E_pieFGD_)PUYVV4uH3gIm@E= z9r-^mf8bmln5*s@Sh7y;Pq_CY-?B))b<;bKg9Bgs1u8FFPnoJ*VGZ8aw6pBRMoe}O7OkqPo&X81JrDIelvTTb@B4Sx? zuWbpgo0!CKR}{KxV}>cv*018h+jrCHQ*xZl3+&(Agc}}iMpD`^RSUKxk`i2U4BQcL zOn_kMssO7h48!qZN_L$~la07&arB5q^zjqt;=RA#f`N=h)z!q7%~Ucl?s7pvXB57f zI@T*Fo2a1o>;Ig}o^0j%F~&&_Ov=&;?DxaRtfHteN{+)!091Fq`N(C9z4h65>~sb* zpsF^KITg7P1<_~`VVz+!BM~oP=bkVUQ%CXG1M4wA0X(~E1|HiKLw!pM3nu5WZCx{R zMaK7j*n)rTjDa`R;Jk~vab&N6p$Z&si@-1>gaASzyEFhM#OOAB`7@WHuCW%8L>z3} zfsQvLMRf12#yx%2NHmS&(EBwoYBD%sY94pqH3w@tfa9l1WD11AlmS};p^$~@s126o zfh1y(0CH&!Sqn(SiYUcQ2)yykkfb71=ttk+AeLQt1-_8~GhTmhA52p#^*#qy8DBg# z)|rIsCzYcW|B!o;7yB1N8g~RaFbmjQ>s*Uj9^=4lb3;9Vf@a0v6xIJFJJXN?v)^aV zoMY!|K|s=GTz}nWi1(Y3tS{oFSDWZyzXDTdNCv8F3ZS%xU*2^jLMapP?g~SX6cLYG zu=}cU|1*>EL7R@+>H;-Q%;AmaTJXK@2%WuT7`^-BNLv62=aHl&BG^c!CFUIWS$uj@ z7B9Z=Zxp3;PALsG1JHFz?X7X_lORRJA#Ko%DM{#tg(;KLw7tIuFT7h9rrLKh}?fJFD^K zYj)twMis+K2A3R@#WSzeWA@4Ixby0LIQ6I`RLR)7JC1K&zZqxOS$Ooh7DN(7q*EH0 z7`g&Tb|yH1Stu$AE@J1-eQ58?B4TPROO9B{v1ZTgyTK1rV96q);9}%`792(%Gd}De zVZS>~zFFj3^Jv`P4BU6jA{UIdl*ZKe?O zI|7{us$n6SQlYDiLP3B*WEBK62#UhUTh9Mk5~KrzfB_hqglXCc8?K)~r8kVhq#$H4 z4sLr7e|zyQ46*`E5kAKgrGErwBF8l$43Db#)Ti1pLp5>QH;%&7uQU)J)yp@0q7SY6 zt1zNkST-+*Z3Dn>zT1k8s~gd{a0DNll|)^lh)M(StEsEj=K@290W>jSJD)L1EU6+p2O=GNxe*%!>GzG$-@yCbA z@8nhn&CYL>*JSveaQ|mPPpop#J(K4;%wv{R`bcQ9E+z0LAjzpdq&!P zx^FUm_IeF&{PqE8qhUPzj~474&=683hLRd`Srw635jC+QibVm-Cg_^<{22m+gwKRB zK?tYKlF9RZyycyNnraKb{_T;_RYojq!&DfZ2deSM^;Nk1%Lj2VO?d0M>4+OeXrUoo z{P}(OpL4Rf=f^P&2^(YsKl$lgyw`2u6PNCTo-?tv-Nd4khH!KZqhJxPym}vwRTU^P z8#~@_#;5L>jLW~g3sXWW{_^4^tlMYcV-qsCV15pcQ1{K#q&AeZ+Ca zIUHQV{5guU=j~-j5Oi=W;%Pr-$z`(=z>9qzzcQhD;?3m4z61Ukxwrw9F$AA)#7v$= z&Sg~0TRec{qY=9Fj#)JQ^g~#zso2t~eEX)O@L@g+bI`=+zP1N5IS#8jkCn#{ z;f-xky6&3YIDNqgK660__3n?*-i|P&;y?g{BRWDM8#1p@GN+ajY|iABMTPoCbQmGW zKOzB0TToZ83DuOOE6zh%HX&~jG=)imUpP*=d+f1H8~F4<2t?X~n$o4}Vo(SucYETQ*% z7=|Wj{<02SI+xLB<><@HlX&6vMw-x)0u>BuqZ~Rn)!>c&QHq3Z1n@d{q4tM!4`tgM0QpmjxL7rz;hF@W?elBH936$ z{1ndn#!+}=O&nLR=taRMUU7CG6?=7r8&iDFG{S5947&Zgt+?h>otV=IytcL)wG-1+ z7b(KB1+oQ!fq@Wa9@EX&eEKkLT33&pVC1qYsv9$W`HDl-*&5@tB}fohkYlh)fG!Dz zSyO<0ttM?f9O4v98t6>$-&Qx`FaKi7isrOJE9k!%1j!$Cs+qJxIR~+x} z2vh6M1h%(@!3wh=AA;!izvJV%xvN01CP{1MD7?dt4E<^V(A?-`!Ej20$I#hG$(_B-Y{fF$1m=jk9*%p;FdG@ zBGcN0f^H!KK#k=fv?9V9VbOvC)Cd(ua|WGn*W&!kkHZ;X-;P@^?Z=nDn!+iyA>8;( zHGX>4LA>$C1mNUO+`Xb7T>~mIqY7^P`FtF+YzU{#N#Qr6CUVsopdgU3B~Dp9jJIBz zj2;Fw0xa8^PL?Sza(v83$n;DA0dh`M5lLN{dtJd-9<+f#A=L)SRq(^UeMc zFE~%A?54XeJ5xoQN~TVcIP1hAy#4$%-0r2cwuW zYY&K>d$hR^c&(WoH0XK1d-6mc-tmCIQeTcIf zG^EWO2DdffvfF0hj#X<>wW}W2Ki_~ERT67^1h4w(X4g8=@;cmRhtFg|aMT3Z(uQpT!$}p( zPaNh+A&YkJk70YC0#jv{C4i0#X$;5a;>K&ggu^dCgTKDM5n3$d07vEgTF}Z@K*xS- z6$s19L+QE8{!lcCDY8F)_wEZnzlZ&)`0{xI0bn`+Q*ILx&01{j zbtg{w{Ut>M^26LRZz;}Q*a9wQz@(In1aWXI7(PgQoP37M4r4Dqrm-QKZ!C$utXA-= ziY!DRIWp#+sz2rKJzHR=`&05x7MIJ$(;wE6qDbGmN&d`#`Oi{l9Shq4+a&V_?zwj! z4(->VDH5bfR4G8`o;ZK?hWV&AC1ncCdep)XZ=J^-J%UVCvZ+`!lGeDhOU36_cJRDY z2Jqb9nyA>2JmW-uswh`1lHPz-E`y~@98aaOx#ec&avVog&IeE#$M!F;qwY%~dp-lla0# zhp~4{4XtYpfu*1wZ6z4<+QXGc5Cu<4l3Qv4za7)_=z z@t8~L=igioH8ViHJssF}cnBdwBPl(aNPyNy06{1e(F)kG`c-;&_aMb0Ccx4kNs}Kj zDdo{z|HsMdmp(7MKQ5VsDvgpm4DNN_ad}vnJW4@n4!DUGFDK<5yC}d>$1G((^oTJr zSIJ2x-|={!5YbrfELSG>E5ZRwAREr(?%Ox<(5sWloRh)*k4)o^6ksUM6!+8b$cYr; zric{5$Yd4H3G}z=!e{MKy;~BAG}bz-EbwO$|s7_G2I`p(%nTv*$=Es^HFp9awz+ zRdmZ|LVU>;|4Uk80u0q-Z1_@10d6t?Mj@AD3o1oS%~?cBOwJ%5i(QhZ7n1wA6I{ll z**C~MW<^8A_r3|?(guSZW{;{9K$uID2LMC$1C6DI5RaG2VkWxpI$Ff3i<0=+uu20-1*RrpOF~t=2u+kIAjG~tazgG<$fmHfJixXc zK6O5)(p#Hjh=grw&?SC$=UjSjRt8#@aG*~owYd&o_+l#=s>GlEGy&adBHeH%4KpAh zQLqS+ST))@dtfoaR0O2k;S4a_$Yuqd@~IU#Uyg#iQ*YqXwj8_JLw$4zp)iJUT=miT%;l6XRJPfAvIZ`fz!n2~Z%sR27dw z@!XLsTb}Z{9GnB=RZmR3nf$I*nX*&rrt(_HK1iIog0|s3cxg@aCKd%T3Q*aNB8IR9 z_O(T*t1F6EH^ec2c_%&kKZogrBl~grie6-Q)!_A36PJBuH-GN5K^o}|p}kj!l!TF# zhM`fNY$2fuLcSoNsm|0cz38sjMuyHXRE8i>ENVN?BP4|kc7fQ^XfuIS7@Cb-@-TL7 z+>E`QLx8S9`0@xsRUtS@|M=^>wB)Rhp*VDi-{00nQB#9-YY_(8Y9I(kusjUjN|v3GhJ%{uu5mg6R;p zEkG!&2tktBTaw050elT7qA}p9OQIveh(;^|6NhXIM@~;t&$?=y`mOo+&h=Yy;u(F6 zX!!P&f^d`3k^G9sER8A>8m zk*qqEIiQ4IFXO**GGU#vj&hfn>!c zqEjWA+?Pl4z15YUk2!r@tPNwzVgl!m3pBGYy74AjFoO?&xs98mpo+2dw@Xw&;qI@K zf8FzzPG*p%V`OB6`bUzEnIkHG<#weZ@=1veR*KP z5qb1!1zI+#h}*7Pj8ES<18Z}6`oc*`EI(UTB|;U!us3dsaA>C`K#;^G<|SrHErD6wyBr z!Z6!7_v7untfhz*pF6BDp^L0Oa1WnD&sE_K%7bS!UdZ84ULm$=G{ys0GcVqi4 zz>Nral@-MI$~KG{SB$-P#rJ`8xdJqXT1hFYNJRL6CjnDstb6V;G{=94D_5S5wHvo! z$Tnao#%$AQJ?w&LcC2Jpd?QxRX(gVAV)S5q+mm@j=3l0u;ra*-0(sK&;NEWPMV*^ zvs(=$Ob1U90ESX3rY#u3H;x@ZTWb{WZ%m-A*Mua80U3%~s4^t-1qGUJgKdJU0E!}! z&1e|OMX>3;)mZ;F5DtY9G8A7bW4yYE@%}~yk7^vtQJEw9kA3~0j1`Y>R00&U|F`?9 zJZ|*_`)F(K5-1?7ECz-xTc$AHXQlsZx&=e(Sifch{`68k zHWq9&#cWKhweZ+|vv6?fD8i8V=bN?o?k!s}X;v1iuI)klo0DtbFGKk-u z+=h=eOZ?N8I9&+b@{8Hn+%y1PXS9zHG~wm{Fgl`R;TauRbyX|c*ViDtxEsxR1@F)6 z$NyZ?iLL_){N|w}&@FAmV-|*zI+AG>v1k!g)G&R{Fj`C%Yj?&F3cL9)4v_KvylOub zU4d+q?_573T&|cX$HX*FhJ$?+O!D8kT-)q}TAXiHF9dLF zRNa~-VxRNxto1@wK&Zl$2`1V;%t06tC<1V5ro4_RlR*NLgagz9Kk`Hj(o7r4gHinW z!5Eq0Jf=ngTM{HQ;?W}BSQmpO1(fP6mdz;OclXW5qwnj8m`rIKc=-M!@!d~#qortJ z)7l!!s21vKEV}UO-T2wrZM1LoM6B5!1BVL4wt%XDGDXJsKhuHDuT7#AH_t%rgaVy# zMmwIksvQsfZZ_texevEpc3F@P7ytku07*naR0y}fZ{W9A9YSwUh-wUh>wh~NYxab3 z!Fk=ZI9G#bUa!IA$!X{;&_Aq0(=CccYXD2+`mH-D6gq98E< zU>j0~u;{pBvGVeBVDH$3_4~V_83u%Jl2x+v{r4ZwD7p<53PV*&eIm<9GJ#+k5@AD< zp)tBUO>EyELJAUL1BmDnhYv;Y+#8Mf`)e)u%e%Fhd&VK0*+AIaXW-z5TKw$qjrjOE z-I(8O14OVb1zAgA`B{fhpE2>`2en8^!r2!e#1X9%aPjR&V2?S9l}j?PN#fK67M^)> z8sf8hF^>#PJFyd=Up53=wJ>Y4g|7WE9Lh?%;LJ``>k2vsbl8$GG^$ZHry!M8Ayf$g zqHv@L+ZH9~yu`#TD9B`0r1FHYDc$JTX9dP58wU@AMSB!TY|(%Ax5phL3LJCbJc8=+a7Aloy`%nw^iguYH1-LZFRj9q78}sKi z(S@fCbGj>m36qBL;`6n1{Ua0k&N)3awLioU{NBVSMq_etL65 zE%JSFes)a^n#L{zzNBbThV`6f&>1SFRQ|)hgt=S(&TgNLVRCriyWk%C=r-il!v|Nw zikfwHR5ED1$?2QP4xdH9h7LP#pw6(-IXaAP8G|Ktoc+b`VrjSy4?gr9vbq8V^dFFh z;EOYE`in4@dPHTvArZI0l3;T=0AO}-2L_M`+xX`nkH8xWqh(SGiUJgd!}#$X^Pw9O zb%_F|G-WZA1`Zx-#QEQg;k+eD^mHhAd0Q10E*!zrcW;E2S8)CB>+toTcVp+e5TcWk zST-|*S6&T6j~8ItIv#j@I^H=5eD+5>aKTI)_x!OAvrfw43m@;t&{p7@Z@1yY)iKOn z(19oulqo69j04*nZOlKSh+PK^Or1Rn-O_OUoM9NT5FUS1L7kdKCTqbkP0tsi5{Bt0 zb1(`y1p|44t`LMG5ixB9(`e{}-g;jy zC38~<@L>MZOIe~>mooa!CAqvnh8ViSuq=Y2+i0k@$+n4;DGlp)7zl+eB;rN%cbHgp zFhW9=9MvVRyKMm-IXQAs#Ej)FrVj7o!Iy9Ll~`xmKM5V?b0HOS!e`&azdB4g~WF%z&c7v{Ur@ zQ%_^lixM4eohT|1kex$h(mX6~R`L8lp2NX{0y8X#VPlMoK3lepX3i
    *7U$zwav(H6$VUt0`iN}6J^BL4N-B#>$&v@r&S1S$DJOgjH-c>KF3 z(08u-Hs0Pof<#P*lw}%gDo0p;LO)hcQn0_F7oAVfq8~js0aYz&eD>USirWIOzBPgS zG6Jf~rSwuc`ASq-$nIm2azLts#&?Jqsvp2};cY5I&g@1{fMAxpXzu|XSu2ci2+)Lv zFp_xX@w>5p!(Ol%hXKjb%b##yNg7kk=nua9z8;kW1^5N;0vNatBno(TrDfmKmf@0e z7sxFSbgD_qJOnA31FURfGIjRkA!-r@NZSobKo&6!5dQr16n^2k$&hSQ!4mk&wMSv) z*?p+)Gnh4-db`5daahNcnO$g!fDiX;IA#7IMAn2_BM~;hY=a_^B3KeETfi2~p-3D9 z8(*OZ?%Tnw-5D|r)rX!COEBpQBW?@4zB`KAcpu)|8e@IRC_VMRn~=z8T-0pLf{7nL z+X#+WP=#bcOwtn_b0-tK0hlN7RL)GYpFkE&S+T=mmI18=$KNVt^ocZ7snPnNfDDjJ2sj}c=Typy=GPiE!V*t;hAPnVZ zc>S4P`082xMc{58iOM7t_5=pFf(l$#reH4H-Eu5j60dWo977R+ElWn67@3@cTwWoY znWGU4(h|^AiAbVAi>9Xd-8GG9TGUVXeB%%+Eb#oZ&A9*N21FA@uyj!ohbosG9>GYK z(K4Z$gcHPoJ&Ws*%nVJksxf9x8^s6jHQbak>P?@NhgS_7&~OaY(88C9_e+ojJm`w1{zvfCx9SB; zPEaAOMSjccbKZT5+#(n}3g6R;@-PWCkA5eJ|2E1;{a0zcT@PJcn}^ zWbyQGTQF=(grT8_)41vS9XNZo#G!)`+Zbof`+^eXbM9D z2$h~e5#>nEAMLq)uLd%+9$4Tt(>Yx*%)ExDo}7-HZDZ*97IY5jlwljkE*XH9SFmkQ z6qY0uvKl2bC3V#50%-(?Fz#@d%Sl?UU=sMmr^@P}1h4p`tgBcdpv9F;fdCJ|BmDX) zzk#!9Ou?NaW&$61fYEF?z+y+0U*u1TnhEHPV4 z22-e{+6DCPdLOdA7q$e1LL_bWE6X`bAgUxHpgLZJQk{n&psgbcOJy1w7Wn2hZG7$& zl~(>>KCb$~7F@o(AE_M%9=U!ug)QLVo;rN#=DC=DbQgtf4Z}G?Ur!iCTTmgVVl?Zt zDp6HLSeG7S#Z$s{$zbC})#R0GIfg%(QJ^Y7q2N?OT=~5n_|~yW^o(eroPsZW=O}JI zxr5GGn8#ah)M3r`1fUSo1t6DG5DME!gl%N=3KT^`*BFXm*m69=U5W2Q4$|z>U;_(W zP*?=znpXDnT*mm_egjJtX!rO>mD-SFOA}mR-Cw%L!I~B4>Byyjj3F47V-(v$HkX4C zI?RynmBIKT0zWSlM1-Lfxg}U!Fn7~IKH2`BMMr#ji94ZA70)+mwLaw+I`KUyJ zQhI-RG&7M9pk!9T$4=>?6HJqS@OTS-`AhpLlv2<%$)=W=q)mH5v}D;RdJm}dtt(rp zf8%8ADoR{&dLMNRGTn8{PWtkhJv4bz3g;g`gm*ruB_&$Gq{adUh7Gc8P%5j?WmoK` zCQHSx_7G{hBr4UL`(mp=`Lv7u*tQ@=Fof`^z3y`9JclQZ<#&Bb49F4^=PREhpIA;g z3lKOz@DCM#y9`WEz@V%i!Q^iTc^oJ9RC^fy^If$AkZ)}zW};BYrp|p4ytbhZoHppa zjZu2({W_Yvc#y6-ua~;EHqbZkokB}b?!l=u3e<8;7p8))s zdTnhrI{I{4GQSs1A<%Cgn@I2Mi9pkBPhv`dD9zHT81-TwE(dJmDT6VbTJKCs!^~rP zanIHJG0+yqf~9FZe%EA7S>D6>eG};JR}+|CmxmtB;+D(%amDWu)G86cs8R(vAm%ehX3bCP_tm1Yuc8t`B%OWf z^I!}ZsAFTIanyCn+3!F#N>D4_cNxQ>jkRx2z`|*1JoRcbrhe=&R$SV~a}c3hpHAS{ z*Bs;(Z%x3w(+^Wa5jgA9ZJ0PGhg+XZ;F9y(km-rQCSb$1IEF@aqzejH$BUFrYZx8T zF!i`j+_0jP*T30Bg&6qnuho$(sZo@(b)~@DSG45jd}s^{lKhkiZ-V%M5R@hUeRYr? zX_dzi3SC-*%YEgs63jkstX~$atXvYD_|6oyZ6edOVVX{Ukc16QvyqjAXw1QRlD%Qv zaOX@G1hN$yRiP?;`MUWSwHP5Cuq?u| zr3VrHH$h7PP#Bz1(K0QC^N#LE+EUQ{eiL5Z6UY8R6<7QsO2<#nqO()Q+iR-v_~H@V z`-@G`6blbNJQGVlbpY{L0S&r@G_z5M?mQlKc3qNa^>R>P4~a>(^-Xtg9xUN8zPCvaSI0f+08n4Qrere}Du zq0sHmH{gf_^Iu+Rz-Pa`kyg$CPX6@q$ixdcZ{=Qo@PZ+_{Mw_DIOQNFcf~RBoDLk* zUeC+!YoyhGSd0F5rs4Y4QLJ1z%vybxqQkX(+p{rhY%p0cD4WedS3N3w*=h*EvY01| zHuCIQM<74kL5Es9!9sXRHg>gYe5EkueIq;|-a}=}K^ar!x&FR}zfLZ29z4ttL6wY> zcj4b`W^CzA8SwNe0+Nr8?!gVdl$EQh25>s7P|+r+n&gP#@MB8A4Hb(56Q?F!HPm2c zHJDR}ufU@;k;u`O85%NhcuIWvY|r)>VnFK@CX&VFB!Iji775z&m@R zXxmeT5B5~y-OW{)c4U$+I(Y!$(J)@#97WyaBz^k$Bw8lr&|oqe=l0`hnDppNjo5P_ zj`jOu&}wry`?vv2n3SZG8ddz@r!z2=Q?PMw99wrMXme`_R(61nIP)?*d(XFM_xjb? z)scm%D}FzO2#j>vrj_6OKCb@Uad&b+wL1FrSDqlTpKZ^Yl>N62Xu@m(sA3t5Lp$s-#r5g z6Kr9jwmysXuTAD(k%==GjL`b^Q8tPi+73oIt=d#mRp7kJ^zPdYY<;mE*G|ju_pV=p zeTqdb5u0u4w8LUTBo@cOrq^))J^Qe)JF3*_<&lD3NB042>XVc_vu79Q3Lh95sIyG{Zo)F9(JM zJLsgB%3zEqtxn^p+5W!}(Rpk>g(?apDsRO9B@Kg${O}lc6`z*#c$*e*9V0Ly})Vj_ocUbzSPHz%U*_!0d0_9MA{l#tCS z2uEx-1>kN3AQVPTqF93cod=f;a6#d0bpbbBy^)tr&p~NR;A?+sLT#ext9mZ|s#QQr zujOm+Uxmo-C;2D$yo_ix;%$WhB1ma*!>pt6)9b$r{ou>^?Y0Am#3CSBR_Lv$@?uwy zV*G(3{tvYxexIg-XI4Qu#X-TO(E0ba`{9%*=4N+3*wS%isGq z!XX~7+Cz+6(N%_XKjOt<`tL<(fm(G^6owkH!Gk6S$-?9s3mu&yqDYP&`pJH@XoAuf zh;89mG%n@DBzbBX1OTcey&%wjI7%B{pNPwEn}-gvVLEh75Bg^SP!y=LNWHt(puMe| zind$y$DSsi5sA}*e?O1w?zk6SN-e?#8zjgp?xV`*@uQC8ch3Ls_cWF)hYHs4*#4&f zIu7Gi?FF{sTw#N8?>TnYo1lszjcai$6Vfgfl&Cz%*@w?FK$?U)9HQSoIs-~L zkL`zQQ8!~0pE$Dz^P3B#sRA-5K?>7wT0w2xLLsMMBr6ayB$>K&Toi?YoI>|KHVdk5 zQ7n>2RB@V;9MJ*YCPQ@`dXPf8oxAO9`)zy+rCSNS)>^oP**}2fF)4 zp-+l}q%2LK!2UFT=b=()GEl7L7wYpF{}O1%fmkV66IjV~^QlSslOH~gO8|S|u{`*o zq6&}kZC#3wzk0%Bkp}4WL7S;GG&SEmcER=+zVo<+fFB_&?F&PFNOj24B2kyaF|#ws=Nv)GWJX2SB1FSB zVx|o#g_rBGC1K9|L70|;T)`>XREWVsfu?CtRHZCF9;ly^$m9s0{NhT?Qc`$l>p>K4 ztGwe2V@%b+SjVuud81$Q!rPXtV!;`&3@<=t!x%~I3a5(4Vb}!g9T=5Gq!jd>$9*1* z+2w|a#>g$X|0xq%#%$IW&|xksGyuW#{NGi6hQQzKN@@ybLu2TgL{-Gb2W#tS^6V6{ zJ6rhb2byT_p)jT_>gIE1S-Ah%MqK-|b+~N0q+>qT!xx{^fh#WRK(4cjHXevDn>IB! z=6PgDM=q~`!v)-U{dPJT3SaoS4(!-cO&!Auo0_j8#N&dv>zZTG@fk)5?AA3)eB; z7?eev1L_*Sc6td_3hZI(Ysa{P7sQowK$Mm(8i!6l-g4_-m)&EkRE4Nuy!wT!$d=B( zqD@rSki`iLlQ`6_VrN?f?IQyJ`d1_3%}IRzE3Nd&DwBTp_d3j9I7)}#Y{IUjpsPN! zA4V)szxc^kJaXN3dgf=_F}sQ>qe{|7H4MR`SRSbHxu5Rt9aspej(+J}&s- zE)#(!NWf-+IScx6?g>3OZE23OLnhYj3S-$how)kEA-e6Rx#+9SV388R**{!>@Zxq_ zAa&Hv=)=n6a=7n_893&=PE;R^((0XYw6;dExnD!qfogoPlL_$z&idpEsux4(=u43x z0e`tku`VSiuF#9PP_(-Mk$|8mU6z*4g;mU#^C*sPcH7x(s0nEyo*xF^H zXCRD@eif?15DKHNwt#Aq=NTOQwMQMqpbMA1E-cpd|+-%RGd^78uS7eEXISIK8_X zbtetr@!!wHL;s4SE-GQ!1Wjc~o6tX`!y<`z%tlCal4O$`@)+zlF<4|aoX8x-f`XBZ zg0K$cEJi$PLGfvC5*P!+NqqLk2XO0Y7S6o*hZxFf(3D^iqAMuws?!gT>NxhiRy_2j zc6_)aj3eh|@#>Q^u(c|MThHxAPl}N4uEl5Xn1O4q+=D__7=L-C0RsgUnj$%!RVkNK zP?SJ*q5wkyw@e(R;l2nm1p(U@Y??(<2pCD}$XSf4u=M(LEE$Xg)gt9cy?jn^FRV(7 z;m3J`dzip?dyr4ivQoPkAE5`t988Q-nPT!EG0O2mD}U0^UlUElAdN9{AVIHn>wMNc z9eehNQOv6th7HMtY+j(Qx`5j1BGMV*AeV5IGIk#h!7wBYL69X6O4DuB>oz0H~b{=tk`BG4RtbwBf_I>an|9|G&MRcbH^lnf8Cr36-n5I`>S^ z^aLg_1H-U_BA|#87DQAqr(H!ceg-h-Mc0J7uDajqqN|^{iUAc_R#!2BB3XeMCUj5i z>7Jg>-PM)rob!BtR63`s2L1l{cCL$y?&?$Ng!jDf^W69E=E7%A^3wCNx~L^qj-~nb zPez!t3w-kv`}DStZI`dy->orQx%7%-`kD*p`Rzk#%*8JL`Hmi9QI`M#xrHARr0{o| z+y;X0JD_)hu_OMzTsxjX+D4$0^bP84?RAZrNg`q9kID8b%|IsXD% z>-H6W!SiP2j_(cdqQ5_?g=I^+w`Fu=7}@!xELTW~Uq6sw)%uLg9*eVSr~rj-&6W*G z#$8;uzUXewI-BEwN+%_u1fAU4^mmE|NF-9%0X0b^fiAvu=)cvhpRFie|MM*UEBe0# zs+O&H=gye4I(VR7n+t_q)HOJI!ls{=WYzk!>O3$%7Wnum`XZT!IWxfiXEa;w$HLr8{{@7;7NiF}B4>vGt@_}(7=d@RgoKDmn%$rT2UrMP2niVLn9 z!&;1TXf}c!D{pZ+ zOV?i8yT^gGq|^vmDD({$*d7h@{BMl#yQ9K)e$~&%Kk;WypBdu9w{7IZpSquGUp&FH z!UbOSlsvOJVPW4qSAS{?mtTIILBnFsaX5Y?$+4LTWyfHABFbq`UFMcgjq!}D&S&k# zd-=fA3cT-AJD3!QsBa|}AoEKT<7SGmcYg{(9tpe3EsR$T-g?7!-gwmXBt+Ad}Q*y!tFQTzXJH{_Z7g zOXSGmgqC9ka#KCrb#IBHrx-S5vKE%DY8i@cdkyPzwdAf1AbULKpon_4A=M0dXfeb; zePgXC5RX?_)l=4cZr{MmAM2;b_DIK6A9%Q%-IJD%oSKs^;KY)t7p=?FA2s!ivom5w z9j50jQmIPAgrp`7~xJ z)e3VX^(HtE>zI1etWx^CN!pe$=j-hFX3!#`kSF<-kn9?_<%L&H@v2K_VJ5``ODeCv zVv?np$Mr9oV(-1ZvSD3CzVsg>EDkNoE1r_!v3m#Pl8dMK>DRZ&hi_R$N-W8&UE-#< zACsfI`eoC$We)7=mhi|DU%vK;eD}81JU$ndXsp6We_1Ln;&{SJ!ID_mqg1rW6-{xf zgi|p@$QMisio|TKXS0iGsf0rw(TImpbML8&j8DcmG8Z9aA$Q!}OU|lDc_GR#e%sGf z&X&pPDCa$8QC|JrJ=WjHrI~U$)7Yev{TS|7L;Vq$hhule)ZOOD0m*PrPG{M{e09 zKRs;Im#VJlJg@qhH6Y`p%3H4fT`G=f)no{ciblh(6!WIqVWcO*4*Jj2s9Yx4{yL_hJN)7f^-UY>dWgdUD9@R>Iqr!W`Rcvp!VKE6Y9 z8|S%V=Q2~b8|qmGp1S07HkpC}qV#o_u?^93rE0J<48?T?HB}Qym&{T~vlXEyRY6_R zNYuq~L{BW6*p^~6Y+BXf!U~6Ri#g2~SLjNmkwO^~QN(RbpPSBfX;&k52xrrF{!w$_ zZ~ojkDQHVH4XDD}1K0gA5msy4#lMUb=`2T8pLOMAkEyl-EqzOQ6oG@UGy+tei(-#NrvpL>jdE-PK0A*16_ zUAJkG(*|8hr9=(elhd~3^pXEwFJJs)x8C?l4?I7kU;Dxt+_c+}pWXC`CM}nz zoxea_;N|b!&EGuKEAP2+qn>uzIIq8WhJB9>$v1yKpeuP1!}7FHFeo`DwxO(h(hUFh zk_G-SS;3g;l7Icth?XN2OsYT!)Aam3&MNdsgi@i%wx?ZAWa56l{;gX@lSxcf_5Q-X zexhUWM91xkk4y0Ht=n~aFH7r$#FGdQ>wmAq|9sAa4ifC({JeFWh6f4t`R1Da6t}@; zuN9#zkFHd8g5Y|hVj-?eHIW#htE(cn-@aZS`28Bm7oo4O#EC^i;?a=q9!>E2YsUEF z`?j-fV}bcc`-t>sciz`0qg!Y7%zT2ke|e+0u?pM% zc2d6m{v&+n+v~aPibG_Nq}i2Ro<~yp4`1EP`ks=+#n#xy6&cPa$>dC8 z(X3>a9gW0eVmBtjP2#8m(L_vl{o+UR<~s`Hoe+J!UHP-dFd$LcMTShONDnd)3`aXdyM=8&C8%HO?vC%xTev7#Q|x_P}+7Gn(b zlo)+1B@aEA=8SU>$^ZV${j5H%NN#^Zri<{Lk&>*;q`7xb7v=sOAA9Y7I3CAM6^X=! zEn72^-mu8&X?W|`H`CLdlX%Q!ZYsfzw;GZ-Rr&Mo6h*TnJ&E;Q}+~D~)wVk{^oLsZl2Z_d>_9vm?a2HD0NnOy{%n1gzk7 zIb3ytpq7bPCPYG2eX?bHnvA=mo~W2ACuYK$aXkrpHoy4IkRDu!$it)Enpuo-$8RHY z_+UyO-k+B4ft^mOTvEAKrXvxBLin`;H*U5MO`IUO_EkBi`1&6R@sz2+>b4nyPJWD_J zx^rcIYJ$^tZew|Dj04ll8VcL~TSaSBkv2)O0W`b%m4wZvb|Z-0Uzzr`NINO`I>cSI zFtwYFQ4Q!%>alczO4KnX&;5pB6$HYWe|u6+RR)Dm6QsI1r8 z4vL7;cxuxWRmhuKa0GQtF+z^^B^}8Y4L#?aWzHSS%bmX*Vt=BiF+(Y#38qrHWHB2P#h$*6;R~_RGDjG_p<<#LW9o=_Ca$;i%>NQx0 z%F0TSvz~LkzVCv0dByc#qF{H^6$??vr}^g|PiQyxWsKH>h6Av6ZOa&K+NJ}#W?z%L zK>|N%d!klh?r3Cds|ikfBFf*t`%Ip+InT3W9^{g{TyY-1YD@sZ;_}t5xL2(%7p|azm_N(@!pY2*PQS(Fjd4>0jzl zs87?=Y2N8C`?pAE^yE4zpiMM*{7z-Lyc$cnj%TW-0Li64K7kKFWgjC2w_ueMtSaB;0Po7N^d zHabqh71D;FHQ7KgDYBlQ(7JE61+mz9KUQ^r>f3)!SBQUC3c&)OXw$de0py6H)$9pr zS?vq7;z9#Ix3GX|Q1cq-Fgf={`2^my;2NaD zMSXH2&tx{m!HS_}&#W&0ECo|Zm{oY>>PU&DoTzQN#BIQ9?sgSbjEE$yDQ>&@E4s3G z4-yVFWibsAscIiejG6Wj ziN-OI_9G@L(lGte7IoU@R93(F4E!+m&S8VvAx1?`Vxw(SUlN49`+IvDG(l;nZ97tS z1;KMQmn$HqML1;RNr+YPMLx3jh-?YF`q|N)JnYyq99`ntHAm&lu+7cm>-pJAh?M1# zb4(D#!^NtldpA5is$!TXxLJPkz1xIvRHMT6C+@Ch`dq&3x^Jw*Hwmhx=wx<^TIXRsJXc`ER84 z(t=wq;w6VU|Duc8e(ENou_)l+RFeGDku5xwNwDbHs8!-^>kg325Au!qDA%q%$QH}s zL?z5XY?1d4A7{N`koUybjjp~&(KT6gV-#b(*tT8IC-tqDm9isrr&A0J4|C4nzJeD# z`{_iDs=m6-1ONZB-~K1}aU)~Y@0ielHBf@FlD>(SwnvHjyw1{4=KBfI+96}KK9;M` z9H4%~fKND}zV~ekKBUb{;2->bh6B&@h;;SK)i1b`_kZZU^0^PcR!&KlIg|~_F?C3a z$dPhHwkBp7Hj{jAs*iQCMTVm#lBPj-WI?{Lbw3v-S1754SBI_EzF)~T>5F7|%i4qT zlAa~hvv5=>dM3-RB};C#SQv}NDNg*B4}Ib*BGE3Me*RXvOmM5Me5ofL`N@P5Fi*71 zUA4)~_T6Zt#lsJzg!&v9*mQTjoYAco+U3X~m>baxL!eQ{<^%rcsdb9Uc2@8~M=#)GGF z{;K`FqOZtuxlAun77gK^xfDPF3`tk&v8)!pqWW;m*mXq1(ejP4nm z(yV%1HE=>-*ga3#wKZ&c8a7-e*r{JYS(CbIfD}zo2pF88tN%6C zce60+e{D>BX>saxXn843cv7R<+hK@mpvvl5OdY#n?f0DEZ>?^Qb`FV1CvUH|7*cA} zTF*lS!r?IScmx||O*BKwfJAbd53D}UiF^+$D&-@z@~uuf+LvCMGZHo9Fk_TlsM&Oi4W17|Th;wK2qFZ?;>K;SyJ*%7R&D zCELfS=gQfsB{p?U%f+c2_sy>pFLs>kSIrY~4Ee?E8j|UwyfN)^-RNm->>rg2LlL=c zG0l>PymI&euSk3RVktqvGqJ6TY>m2TnDEDL%j8!bULo57X$Kx3JUhc|<*_p`6-E*t>V@Y{_?-IYA9pT?*`ek#h zjI9|I<>J~YKkdRNFhUHoXaiB;qz zL|c;ITjYnWp0MD7gxbmTQ3)i#HK_!FURB@#)tYvJv8W}Erk*9&=+d?q3B~t50c}YG zB|<&xqs{Kn2wD{h?g0^B%3HO^C7?@=CC^_qt{+%C&BfhIvRH`g{!*B-imZ+l)$wd{ zo)9yuS8v30#lh2<>0#Di3PX40<5Ce|O5R(R_p%&){jjN4akJs63~4LHEpU z;G4@~E=@1-)46V0+cl%7S{9FHyCh;*x-~h&hFFfiuuIx5u{O3WXWJGJ<`Ozri7=d) z;lilF1KF62<$LwPys+7Zm5N0d20xtdm&;Zk&{y}A`2BK%s|UxK$PUQCvT$~KMqk*Q zWvLwHc-bPaCTk-FDy~h|6R{0+rF!cVrygw7&~w+<8RD<}*0R&Y&xI1JW6N9QiMvys z?__|ma;++8q;%=Yt)zC(O?Fw8IK2YB9^ zDK^o^-;HkOg&Q7YL!`n*ktH5j8YUiICQ;1OXNLIIQV(h`vRT3`s>3Cz48J~cCLf)Q zv!-i`r^mCDEr*Y;KS~!-ez!10(J1k*b%(e(Q6g7P@}2{ykTFU;v%AbxG0aTGuGXu> zrR17qT!W!Zl>Ts$(-JeRi+HkJ=s}{> zyfA6XEB9_^r0X!}heP~oDM`e18zJ^9p20ckMgBIOmAD}|o+Tv}3bnaLedmU14bsVq zC0T`p>0qeELz!OgT^f+@&h;?kdGuPYI4BXbg6+omm+3y%#tQU^iXA<{3laujnb^cb zE8TS41sHDwIqfSA4$FJhKBJ+Z*fq{rH@$^SljirA4U zPLGI=7o+UYC1kW{Y1T6(YPjTG6VE^*hHA<4WXgev;bMtWQGl;RzO?Pn3>kfL z`Kkl_eNT~PSJ)Y;@QybA{_`Q|hxehU>!{&O*|R}G#ZTejJjoMn}f>(`u+^Wzmp zb4fCuvMyRe)s$t&By3czJ4Me>F+7rnhX(Uw48}>_3}FbWW}voaVuWetG@KKFwzb zIJM`5MBOBZ+#;Xdc$lmE7g=Xl8>8)ZQq{k#C+WC>fvCgSp=rviT$ZMfaCEjn$c~(( z?b4*EHnnZia@z_hRD!m(lYFe;fCU-H;(3FU>94he2 zRYmfZ5Jgo&YU1HlL+267s=RdVKHfEuQwb@mH zxao2v)5~?4USg)h#%PX`V{vZJG}jIt#dA}9{_s}DG|xY-KgtE&iyU6+VPm+=Ore|q zwLi_8P=Pm(l$kDvDB$v;jk|fKnc~&^*0Z*Mj8dkL-tw*6 zLDcYYod`diUPG2L?_WDw15%tc?KRNI4+7&YAb+hVge*_!JR(A@`Q8O<6(!gP5go8*lC8F~BAyzZadz`stXdFk3Q`hip=%O)!+ z*UfdQWjG9m3X*lg6g@*09h-Cej_{tL44*r28ow!foNg!N;guXW?YK`Ln%&4pkEi6x zVbOaQlCp@y7bn&cvWjxg?1RdyMA}9OqY=bzHUP5SONM^0Vo!{Oe3qFX*0^ zOS&^0$))+_d^dSqO0G>sRTR}O%K?zE;bI}UYU=K6mxw4wr#8wjXFcXBf`e*LNSJX< z?q29+OJtTy(h=g}S+Uh15nt3HFC}-(q`7Edl*&&Cnk=uQWlb7@dcl?cY&otA4gjJK&{HK!1><7osq`#>MDO_rjX<_<6YP& zS*`Yu_AK}EoSr3C@Hhz{h7!Em% z=Tp4@KtJ1OCi&v#qdYHf5wo-Gh_CR}-bH4!MQ#`$;y^jdP<)mPk~topSxeX|(=9ep z)1y>#i*#9KJSWU0eUogqU2d2d;3>V6ytsdvgUbVad#0PRC?(IpHarTRkTP8?fuaW! z6^I)iVNr5UnD0-I;2~Jz5;Z(F#d^6Sy+k&%hIcLWamXw4w~;c3v%Tzclx`E|JcDl2 z;)6%FVW;=f>xQ^;)fnW~^V-n@f8R4tLI)XFhj(q<&1-u~eCqJ&SU4qS7M5`ho4&s8 zYRZeYc3C@6el$qR5Chywg+j4FN!GG{Fv|D?Cveon6mYe}?J&qMYPEed=Ti-^y#`tz zf%{a;#|;1i6r!fn*sKq55e^m-eD+uuic8FL=&=OHwfXXq9ps%5VZ&uGRN+J}&F_|@ zBy1N4<;`o4@W6aOZlplTjgT}8bkogCM|a}I#<}g3V5uSU$;Tvt1w_5yN3kSorCQ z4gAtjdMp=JVfW%7KTj?5#tjcJXc>I@@K&C^{!zwCA%2&$c<0a*r-Um!YiN`U%q}H{ zlxhF~4UtJiK~%1KY&&C41uM1f0Sd(Q;Ah9?FibOm?Kp`Y%^xx)svSlrX={GgniDFmeK-G@RPzjo+a#ci zQ`7y04VQ4WZX;Ud0*Zm~KsJsk9$l8pN-@R_ruu`?Gv{^c-%>TC9!aMO;%i#xlgQIa)TUpmI+49Pb=H zNL<5wVE>aiZRl}1v9N)6?>~i4o;fSqyK=lVc8seN2H%)i%^OGd$*%lP`co79UEd0p z7vduaxALbFazT2Dq@nCuNz0sLVhNge4Lp>%;Z|eHQCu}7>nfHgDvIaXd~tjm=fv|I zE5vxTY)NKn9d8;q#Dzni{C@Tn=EDneWA73-PYklNYo2xG2xi~l;6H5Kd?s&v>7|U_ z{~L~ER70i&)Pv1<@{`#$JPO$g=REs)y!DzFbMeJbXM0ahe*BaF=6KE^Y)RmN|0U~9 zP|zm+B4XRjti~M(fMq2Jp{_T08uH8PX;RNklbVCG`Eb}!F{P0OPsFI|kBypZ|Dol6 z9?bM{``m!uS1@s$u*^CZFBzPYw3FoDP7Lcst43wSu&G!@IX_WgG9T44Ca0z5WP3Qw zzn|zKVz_#|6q9?F`x%NaqoouRURf{dog*2|%H@4Cnkm?FZp`7U6I;kerg>IsSvOl1 zIXfo2ee`tP$Rt-LJ${vm>1$U_$kS7KE>CCl-lZO*p&YLmn3XdUMdnKhUG!8?i>zyC z-ZKPIYyn#oPhqqeW(7!_u8tQ{a^La*e_R~Y|6Ykn*|T)47$zNFmJ8Ag^hg|Q`S7E9 z>s>p!d`A+;D~P9&>Jjpq?R&qkMH*9+x_VUslSG%uegE|%4&M74R;}veC%F~I<~)ss zEMG{yv`ZR0X_(dL-)b8E{U-mK2dVyeV9KPOWUdyn2;?{9n z)rKl5tE>xdwE`VAt2^QMi>vt4(kd-@2&ThLhj;3ou@$z&R&>ZLiVeJBWDn;hmq{5> zeR*%18F5%C#Ps&%1TS9g%9Fcu+&H?KUSpDNw(7A$3iS-ij-_Y!?PqhyLK^R}MpT8zXqtd=#rb8H(G@%Yvm4{}+2h)1QsmWZpCy~KryW!`!4R4rRsxo+(g zVK1iNni`Odg6kRTsDWiVghgwkw8!y^XxLC9hD*V<`OmpwR8d1blBOfFVas;C=(wXxgw6^Af`n$62>^0!}N*VB^@j{?N4dh zs0}aMfg;-x6Wd}tl1^45A2CaVXmf3*6lp~ft9DA4)geX-;?Wb7^TWLR*Z`*{7kEZjmc5IEJW!~n828#`3a-sU#UyIFl)dWhui8wm%0Mhs zn0aImJ8yh7AIN6-x9|N@^LA9M>Qz`RDXaJ*wR{M)nk}TEKr;*?k+4Fzv7Yxi20E_X z8VW@JQITdAr}!&9ZLiTFkesYI)L?x2WIX}fc;F25xiD0k9x7kMqkeB|{-K5uRZ;A^ z08Y@5xDqy83@X()X+%q&$&_nzxR?N3EJ^9%Y_ANOE_;d*jyv$O-bH=u>TygB$qy$t z>CbZ_FLMm;Urck>>b-0;Z2jEqpv=s6vn5*Q%E5iCa%|?xmOijJAaSG28J6n2XR_=m z&t5gg4Qpn(Wn!~FRuXxM2M=drnjkD^87954Mc%jOD5r$Wd~tDrtO}R)AJJF$6va`4 zUrw*pZ_Gz!YpkRe2Gf<0thkCL9=}dM}AxKj#mR?Bk)w4^y(EnCf*7Bs&@S zxq4JuMh6L)@>*r6b&jwv0l4Y05}%()d^TvmT(U)m>aRE9%Rg_X5UCFZ+#)rpmjLRQ zN6@X>LDs5)TVLbOs6n_bzPvLd;LEK3%ef{V5H>t)fr4u>XjNMr3+iGcY)dZin!yuv zsm&M0x6qxM5lghV-y#|YyZK1T%kx!(Ev_DoIy|p%ttRhru zbM&eNqyb7{`%T_Eap@!ruPM#=NV;lsSJ z&z8a1itb++CK)@<4TD+UvHwhcs8Btf-@aiF+l+4Bx_33NTQ$$B@DL9cEbLgG9uuY= z3tK82Dy4Zd=8? zNi7tj`kAZh837SnR18t^YU|FJ=|}}f)T~IC;mJfXCSRCXC!e2KC8Mq@VJ{;8c=QxG zSm@z5CpOCmCRRzoGv%?I$V=DklKz_~f8OZIy~qlIu3^mK}Cfez6i0OFZN=H-1D9?%K^m zj~t{Fj$l^p_>H8VlT$MEFMtkc4Jr%h)zn8;>2w$H3dvgLJdHdqKZU7P%UyeJpz`I1611B)8YG6swmvDR@9$0UyR^7pYoH0A0o;%# zhuNzwIxC)`MKwfF;-;%b*TO;RwaPLaDzogw)e0@iyH-ySG8`=x2jt@uL!8|`%LQFC zq{?YNeC!kk(ntBo(4u~8e7k&eF~aIdUTw9c+j8~UgGabJy(}LcJ(EWr4;k5Xs)}Wk zOvEs%ql14>G-wJTdvvC(`M+1qoYfkcR5zanPQD-*K!QmCqJi}$TBF;mP*Fol zDn!K5qGwCma#>}0I$pA*Vpg~)J;(ZRk=2nL#lj#?beg9|RDZkFEqOP@FXp>7V!JY$ z?a~EV;jW##<=f*sxOLgU>gh>?dbnO=p5xDl3g*0vZ^Um~O1E;IIxed?33sEds*U*l zuJQzGL*Jfk$*O7y!U))of{JGeir`fIy;xeJqJw~|hJdYgUge(_HWvfp|FC|jpad-= z9jUb1DhO`rDSAFlQ&j+8{YD|fB~o4ON!X}RRyb4^RYy)*=V|2_h`$@xxNS*$F{tBhtG?z^U(Sz@4Wi9OTtL~@dMO3l z%NmHR7T>D|m^P}M^fd$cINzZ;2^6QX=4%EKRhONHZ@@*hmiAn&3A@#49(m8yvKnIG z5i?y)S{1o8wW8|T{5q48CC?*nC{_S3rW!oWr6XOVb0B@Q3M4+kD@{VxNk${zWTJJb zLptbp8k3~Pa3LK=LJ54A=41um84zT#v@VibM@se6f`txn^x!^hzfkJ;Bfqyy{79G< zO9+9pwMD(sfte#dtZw70HvL)E2R$DEUZn~aZK|quY-j?(}A72{(oTpjO@?}x`zOx3enP%{+b^u%Wv2ua^=KsDvE3ZFT zMmi<``R8BIasH?^RG$m#){)JsYKlt2@*1VL`Xt?IErhj2RJ1xAp2(}-HktJ;Jv#Ze zTEfQKToS<|q3?7EUV0KF#pDbS(1-QulptNjFmv4W2U@iP*vb+xbT z0{c<51Kg>lrX(kEc>0)hjk`w8*3@34Z7@)SWia)*QtO*r+K83Zlc99+vjN-AXgzs* zDyaEs*YjvAE>7AbFEm)e4p3*L?Q!4oNrIpr^;z3AD6{W4VL{qQ9_fH@@lUFo@tW4&=Dw+K{eJMarkers With Custom Icons
    -

    Using GeoJSON with Leaflet

    -

    Blah Blah Blah. GeoJSON. Blah Blah Blah.

    +

    Using GeoJSON with Leaflet

    +

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.


    Layer Groups and Layers Control

    diff --git a/examples/geojson-example.html b/examples/geojson-example.html index f9747d6de7c..238c12f9b5f 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -42,7 +42,6 @@ opacity: 1, fillOpacity: 0.8 } ); - } } ); diff --git a/examples/geojson.html b/examples/geojson.html index 0b88f66411f..37962c9aad0 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -44,6 +44,79 @@

    Using GeoJSON with Leaflet

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    +
    + + + +

    View example →

    About GeoJSON

    @@ -52,7 +125,7 @@

    About GeoJSON

    GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
    -

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    +

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    The GeoJSON layer

    @@ -62,13 +135,14 @@

    The GeoJSON layer

    map.addLayer( geojson_layer );
    -

    This creates an empty GeoJSON layer that we can easily add vectors to.

    +

    This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

    var a_geojson_feature = {
         "type": "Feature",
         "properties": {
             "name": "Coors Field",
    -        "amenity": "Baseball Stadium"
    +        "amenity": "Baseball Stadium",
    +        "popup_content": "This is where the Rockies play!"
         },
         "geometry": {
             "type": "Point",
    @@ -84,7 +158,8 @@ 

    The GeoJSON layer

    "type": "Feature", "properties": { "name": "Coors Field", - "amenity": "Baseball Stadium" + "amenity": "Baseball Stadium", + "popup_content": "This is where the Rockies play!" }, "geometry": { "type": "Point", @@ -132,13 +207,34 @@

    Styling Features

    "popup_content": "This is the 16th street free bus ..." } };
    + +

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer ( e.layer ) in our featureparse event listener.

    geojson_layer.on( "featureparse", function ( e ) {
     	if ( e.properties && e.properties.style && e.layer.setStyle ) {
     	    // The setStyle method isn't available for Points. More on that later ...
     		e.layer.setStyle( e.properties.style );
     	}
    -} );
    +} );
    + +

    Styling Points

    + +

    Points are handled differently than LineStrings and Polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

    + +
    var geojson_layer = new L.GeoJSON( null, {
    +    pointToLayer: function ( latlng ) {
    +        return new L.CircleMarker( latlng, {
    +            radius: 8,
    +            fillColor: "#ff7800",
    +            color: "#000",
    +            weight: 1,
    +            opacity: 1,
    +            fillOpacity: 0.8
    +        } );
    +    }
    +} );
    + +

    View the example page to see how to use custom markers.


    From fc96f08dfa6f345848ed02e2690168a8eacdb3b3 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Wed, 28 Sep 2011 09:24:36 -0600 Subject: [PATCH 060/816] GeoJSON examples complete. --- examples/geojson-example.html | 25 ++++++++++++++++++++++--- examples/geojson.html | 16 ++++++++++++++-- examples/sample-geojson.js | 25 +++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 238c12f9b5f..9076fb929a2 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -53,32 +53,51 @@ } } ); + var light_rail_geojson_layer = new L.GeoJSON(); + geojson_layer.on( "featureparse", function( e ) { var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if ( e.geometryType == "Point" ) { + popup_content += "

    This GeoJSON Point has been transformed into a CircleMarker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + } if ( e.properties && e.properties.popup_content ) { popup_content += e.properties.popup_content; } e.layer.bindPopup( popup_content ); - if ( e.properties && e.properties.style ) { + if ( e.properties && e.properties.style && e.layer.setStyle ) { e.layer.setStyle( e.properties.style ); } } ); another_geojson_layer.on( "featureparse", function ( e ) { var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popup_content += "

    This GeoJSON Point has been transformed into a custom Marker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + if ( e.properties && e.properties.popup_content ) { + popup_content += e.properties.popup_content; + } + e.layer.bindPopup( popup_content ); + } ); + + light_rail_geojson_layer.on( "featureparse", function ( e ) { + var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popup_content += "

    This is the default look of a GeoJSON Point.

    "; if ( e.properties && e.properties.popup_content ) { popup_content += e.properties.popup_content; } e.layer.bindPopup( popup_content ); } ); - map.addLayer( geojson_layer ).addLayer( another_geojson_layer ); + map.addLayer( geojson_layer ) + .addLayer( another_geojson_layer ) + .addLayer( light_rail_geojson_layer ); geojson_layer.addGeoJSON( free_bus ); geojson_layer.addGeoJSON( bicycle_rental ); geojson_layer.addGeoJSON( campus ); - another_geojson_layer.addGeoJSON( coors_field ); + another_geojson_layer.addGeoJSON( coors_field ); + + light_rail_geojson_layer.addGeoJSON( light_rail_stop ); diff --git a/examples/geojson.html b/examples/geojson.html index 37962c9aad0..37aea9986c4 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -212,7 +212,7 @@

    Styling Features

    geojson_layer.on( "featureparse", function ( e ) {
     	if ( e.properties && e.properties.style && e.layer.setStyle ) {
    -	    // The setStyle method isn't available for Points. More on that later ...
    +	    // The setStyle method isn't available for Points. More on that below ...
     		e.layer.setStyle( e.properties.style );
     	}
     } );
    @@ -221,6 +221,8 @@

    Styling Points

    Points are handled differently than LineStrings and Polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

    +

    Here we're using a CircleMarker:

    +
    var geojson_layer = new L.GeoJSON( null, {
         pointToLayer: function ( latlng ) {
             return new L.CircleMarker( latlng, {
    @@ -234,7 +236,17 @@ 

    Styling Points

    } } );
    -

    View the example page to see how to use custom markers.

    +

    And here's an example of using a custom Marker:

    + +
    var geojson_layer = new L.GeoJSON( null, {
    +    pointToLayer: function ( latlng ) {
    +        return new L.Marker( latlng, {
    +            icon: new MyCustomIcon()
    +        } );
    +    }
    +} );
    + +

    View the example page to view in detail what all is possible with the GeoJSON layer.


    diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index f96f8b4fc51..a5564a1cf37 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -193,6 +193,31 @@ var free_bus = { "id": 1 }; +var light_rail_stop = { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "popup_content": "18th & California Light Rail Stop" + }, + "geometry": { + "type": "Point", + "coordinates": [-104.98999178409576, 39.74683938093904] + } + },{ + "type": "Feature", + "properties": { + "popup_content": "20th & Welton Light Rail Stop" + }, + "geometry": { + "type": "Point", + "coordinates": [-104.98689115047453, 39.747924136466565] + } + } + ] +}; + var bicycle_rental = { "type": "FeatureCollection", "features": [ From e71e42fd3e1ec422d929826b916d6b30ef3932ab Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 29 Sep 2011 08:30:48 -0600 Subject: [PATCH 061/816] Changing JavaScript coding convention. --- examples/geojson-example.html | 86 ++++++++++++------------ examples/geojson.html | 122 +++++++++++++++++----------------- examples/sample-geojson.js | 32 ++++----- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 9076fb929a2..1924bcba9cf 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -32,72 +32,72 @@ popupAnchor: new L.Point(2, -32) }); - var geojson_layer = new L.GeoJSON( null, { - pointToLayer: function ( latlng ) { - return new L.CircleMarker( latlng, { + var geojsonLayer = new L.GeoJSON(null, { + pointToLayer: function (latlng){ + return new L.CircleMarker(latlng, { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, opacity: 1, fillOpacity: 0.8 - } ); + }); } - } ); + }); - var another_geojson_layer = new L.GeoJSON( coors_field, { - pointToLayer: function ( latlng ) { - return new L.Marker( latlng, { + var anotherGeojsonLayer = new L.GeoJSON(coorsField, { + pointToLayer: function (latlng){ + return new L.Marker(latlng, { icon: new BaseballIcon() - } ); + }); } - } ); + }); - var light_rail_geojson_layer = new L.GeoJSON(); + var lightRailGeojsonLayer = new L.GeoJSON(); - geojson_layer.on( "featureparse", function( e ) { - var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - if ( e.geometryType == "Point" ) { - popup_content += "

    This GeoJSON Point has been transformed into a CircleMarker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + geojsonLayer.on("featureparse", function(e){ + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if (e.geometryType == "Point"){ + popupContent += "

    This GeoJSON Point has been transformed into a CircleMarker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; } - if ( e.properties && e.properties.popup_content ) { - popup_content += e.properties.popup_content; + if (e.properties && e.properties.popupContent){ + popupContent += e.properties.popupContent; } - e.layer.bindPopup( popup_content ); - if ( e.properties && e.properties.style && e.layer.setStyle ) { - e.layer.setStyle( e.properties.style ); + e.layer.bindPopup(popupContent); + if (e.properties && e.properties.style && e.layer.setStyle){ + e.layer.setStyle(e.properties.style); } - } ); + }); - another_geojson_layer.on( "featureparse", function ( e ) { - var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - popup_content += "

    This GeoJSON Point has been transformed into a custom Marker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; - if ( e.properties && e.properties.popup_content ) { - popup_content += e.properties.popup_content; + anotherGeojsonLayer.on("featureparse", function (e){ + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popupContent += "

    This GeoJSON Point has been transformed into a custom Marker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + if (e.properties && e.properties.popupContent){ + popupContent += e.properties.popupContent; } - e.layer.bindPopup( popup_content ); - } ); + e.layer.bindPopup(popupContent); + }); - light_rail_geojson_layer.on( "featureparse", function ( e ) { - var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - popup_content += "

    This is the default look of a GeoJSON Point.

    "; - if ( e.properties && e.properties.popup_content ) { - popup_content += e.properties.popup_content; + lightRailGeojsonLayer.on("featureparse", function (e){ + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popupContent += "

    This is the default look of a GeoJSON Point.

    "; + if (e.properties && e.properties.popupContent){ + popupContent += e.properties.popupContent; } - e.layer.bindPopup( popup_content ); - } ); + e.layer.bindPopup(popupContent); + }); - map.addLayer( geojson_layer ) - .addLayer( another_geojson_layer ) - .addLayer( light_rail_geojson_layer ); + map.addLayer(geojsonLayer) + .addLayer(anotherGeojsonLayer) + .addLayer(lightRailGeojsonLayer); - geojson_layer.addGeoJSON( free_bus ); - geojson_layer.addGeoJSON( bicycle_rental ); - geojson_layer.addGeoJSON( campus ); + geojsonLayer.addGeoJSON(freeBus); + geojsonLayer.addGeoJSON(bicycleRental); + geojsonLayer.addGeoJSON(campus); - another_geojson_layer.addGeoJSON( coors_field ); + anotherGeojsonLayer.addGeoJSON(coorsField); - light_rail_geojson_layer.addGeoJSON( light_rail_stop ); + lightRailGeojsonLayer.addGeoJSON(lightRailStop); diff --git a/examples/geojson.html b/examples/geojson.html index 37aea9986c4..65aec629e93 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -66,54 +66,54 @@

    Using GeoJSON with Leaflet

    popupAnchor: new L.Point(2, -32) }); - var geojson_layer = new L.GeoJSON( null, { - pointToLayer: function ( latlng ) { - return new L.CircleMarker( latlng, { + var geojsonLayer = new L.GeoJSON(null, { + pointToLayer: function (latlng){ + return new L.CircleMarker(latlng, { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, opacity: 1, fillOpacity: 0.8 - } ); + }); } - } ); + }); - var another_geojson_layer = new L.GeoJSON( coors_field, { - pointToLayer: function ( latlng ) { - return new L.Marker( latlng, { + var anotherGeojsonLayer = new L.GeoJSON(coorsField, { + pointToLayer: function (latlng){ + return new L.Marker(latlng, { icon: new BaseballIcon() - } ); + }); } - } ); + }); - geojson_layer.on( "featureparse", function( e ) { - var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - if ( e.properties && e.properties.popup_content ) { - popup_content += e.properties.popup_content; + geojsonLayer.on("featureparse", function(e){ + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if (e.properties && e.properties.popupContent){ + popupContent += e.properties.popupContent; } - e.layer.bindPopup( popup_content ); - if ( e.properties && e.properties.style ) { - e.layer.setStyle( e.properties.style ); + e.layer.bindPopup(popupContent); + if (e.properties && e.properties.style){ + e.layer.setStyle(e.properties.style); } - } ); + }); - another_geojson_layer.on( "featureparse", function ( e ) { - var popup_content = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - if ( e.properties && e.properties.popup_content ) { - popup_content += e.properties.popup_content; + anotherGeojsonLayer.on("featureparse", function (e){ + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if (e.properties && e.properties.popupContent){ + popupContent += e.properties.popupContent; } - e.layer.bindPopup( popup_content ); - } ); + e.layer.bindPopup(popupContent); + }); - map.addLayer( geojson_layer ).addLayer( another_geojson_layer ); + map.addLayer(geojsonLayer).addLayer(anotherGeojsonLayer); - geojson_layer.addGeoJSON( free_bus ); - geojson_layer.addGeoJSON( bicycle_rental ); - geojson_layer.addGeoJSON( campus ); + geojsonLayer.addGeoJSON(freeBus); + geojsonLayer.addGeoJSON(bicycleRental); + geojsonLayer.addGeoJSON(campus); - another_geojson_layer.addGeoJSON( coors_field ); + anotherGeojsonLayer.addGeoJSON(coorsField); @@ -131,18 +131,18 @@

    The GeoJSON layer

    GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

    -
    var geojson_layer = new L.GeoJSON();
    +		
    var geojsonLayer = new L.GeoJSON();
     
    -map.addLayer( geojson_layer );
    +map.addLayer(geojsonLayer);

    This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

    -
    var a_geojson_feature = {
    +        
    var geojsonFeature = {
         "type": "Feature",
         "properties": {
             "name": "Coors Field",
             "amenity": "Baseball Stadium",
    -        "popup_content": "This is where the Rockies play!"
    +        "popupContent": "This is where the Rockies play!"
         },
         "geometry": {
             "type": "Point",
    @@ -150,16 +150,16 @@ 

    The GeoJSON layer

    } }; -geojson_layer.addGeoJSON( a_geojson_feature );
    +geojsonLayer.addGeoJSON(geojsonFeature);

    We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

    -
    var a_geojson_feature = {
    +        
    var geojsonFeature = {
         "type": "Feature",
         "properties": {
             "name": "Coors Field",
             "amenity": "Baseball Stadium",
    -        "popup_content": "This is where the Rockies play!"
    +        "popupContent": "This is where the Rockies play!"
         },
         "geometry": {
             "type": "Point",
    @@ -167,25 +167,25 @@ 

    The GeoJSON layer

    } }; -var geojson_layer = new L.GeoJSON( a_geojson_feature ); +var geojsonLayer = new L.GeoJSON(geojsonFeature); -map.addLayer( geojson_layer );
    +map.addLayer(geojsonLayer);

    Popups

    -

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popup_content" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    +

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    -
    geojson_layer.on( "featureparse", function ( e ) {
    -    if ( e.properties && e.properties.popup_content ) {
    -        e.layer.bindPopup( e.properties.popup_content );
    +        
    geojsonLayer.on("featureparse", function (e){
    +    if (e.properties && e.properties.popupContent){
    +        e.layer.bindPopup(e.properties.popupContent);
         }
    -} );
    +});

    Styling Features

    We can also listen to the featureparse event to style our LineString and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

    -
    var free_bus = {
    +		
    var freeBus = {
         "type": "Feature",
         "geometry": {
             "type": "LineString",
    @@ -204,18 +204,18 @@ 

    Styling Features

    "weight": 4, "opacity": 0.9 }, - "popup_content": "This is the 16th street free bus ..." + "popupContent": "This is the 16th street free bus ..." } };
    -

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer ( e.layer ) in our featureparse event listener.

    +

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

    -
    geojson_layer.on( "featureparse", function ( e ) {
    -	if ( e.properties && e.properties.style && e.layer.setStyle ) {
    +		
    geojsonLayer.on("featureparse", function (e){
    +	if (e.properties && e.properties.style && e.layer.setStyle){
     	    // The setStyle method isn't available for Points. More on that below ...
    -		e.layer.setStyle( e.properties.style );
    +		e.layer.setStyle(e.properties.style);
     	}
    -} );
    +});

    Styling Points

    @@ -223,28 +223,28 @@

    Styling Points

    Here we're using a CircleMarker:

    -
    var geojson_layer = new L.GeoJSON( null, {
    -    pointToLayer: function ( latlng ) {
    -        return new L.CircleMarker( latlng, {
    +        
    var geojsonLayer = new L.GeoJSON(null, {
    +    pointToLayer: function (latlng){
    +        return new L.CircleMarker(latlng, {
                 radius: 8,
                 fillColor: "#ff7800",
                 color: "#000",
                 weight: 1,
                 opacity: 1,
                 fillOpacity: 0.8
    -        } );
    +        });
         }
    -} );
    +});

    And here's an example of using a custom Marker:

    -
    var geojson_layer = new L.GeoJSON( null, {
    -    pointToLayer: function ( latlng ) {
    -        return new L.Marker( latlng, {
    +        
    var geojsonLayer = new L.GeoJSON(null, {
    +    pointToLayer: function (latlng){
    +        return new L.Marker(latlng, {
                 icon: new MyCustomIcon()
    -        } );
    +        });
         }
    -} );
    +});

    View the example page to view in detail what all is possible with the GeoJSON layer.

    @@ -265,7 +265,7 @@

    Styling Points

    _gaq.push([ '_setAccount', 'UA-4147697-4' ]); _gaq.push([ '_trackPageview' ]); - (function() { + (function(){ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index a5564a1cf37..131a7d6372b 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -1,4 +1,4 @@ -var free_bus = { +var freeBus = { "type": "Feature", "geometry": { "type": "LineString", @@ -188,18 +188,18 @@ var free_bus = { weight: 4, opacity: 0.9 }, - "popup_content": "This is the 16th street free bus in Denver, a good way to cross town." + "popupContent": "This is the 16th street free bus in Denver, a good way to cross town." }, "id": 1 }; -var light_rail_stop = { +var lightRailStop = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { - "popup_content": "18th & California Light Rail Stop" + "popupContent": "18th & California Light Rail Stop" }, "geometry": { "type": "Point", @@ -208,7 +208,7 @@ var light_rail_stop = { },{ "type": "Feature", "properties": { - "popup_content": "20th & Welton Light Rail Stop" + "popupContent": "20th & Welton Light Rail Stop" }, "geometry": { "type": "Point", @@ -218,7 +218,7 @@ var light_rail_stop = { ] }; -var bicycle_rental = { +var bicycleRental = { "type": "FeatureCollection", "features": [ { @@ -231,7 +231,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 51 }, @@ -245,7 +245,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 52 }, @@ -259,7 +259,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 54 }, @@ -273,7 +273,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 55 }, @@ -287,7 +287,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 57 }, @@ -301,7 +301,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 58 }, @@ -315,7 +315,7 @@ var bicycle_rental = { }, "type": "Feature", "properties": { - "popup_content": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" + "popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!" }, "id": 74 } @@ -325,7 +325,7 @@ var bicycle_rental = { var campus = { "type": "Feature", "properties": { - "popup_content": "This is the Auraria West Campus", + "popupContent": "This is the Auraria West Campus", "style": { weight: 2, color: "#999", @@ -380,10 +380,10 @@ var campus = { } }; -var coors_field = { +var coorsField = { "type": "Feature", "properties": { - "popup_content": "Coors Field" + "popupContent": "Coors Field" }, "geometry": { "type": "Point", From b22102841d85ed377232b68fbc460efd5a29796d Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 30 Sep 2011 13:34:06 +0300 Subject: [PATCH 062/816] Minor geojson example edits --- examples/geojson-example.html | 157 +++++++------- examples/geojson.html | 385 +++++++++++++++++----------------- 2 files changed, 266 insertions(+), 276 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 1924bcba9cf..26e0a2f6322 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -6,8 +6,8 @@ - - + + @@ -20,83 +20,82 @@ cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}); - map.setView(new L.LatLng(39.74738794765598, -105.00002861022949), 14) - .addLayer(cloudmade); - - var BaseballIcon = L.Icon.extend({ - iconUrl: 'baseball-marker.png', - shadowUrl: null, - iconSize: new L.Point(32, 37), - shadowSize: null, - iconAnchor: new L.Point(14, 37), - popupAnchor: new L.Point(2, -32) - }); - - var geojsonLayer = new L.GeoJSON(null, { - pointToLayer: function (latlng){ - return new L.CircleMarker(latlng, { - radius: 8, - fillColor: "#ff7800", - color: "#000", - weight: 1, - opacity: 1, - fillOpacity: 0.8 - }); - } - }); - - var anotherGeojsonLayer = new L.GeoJSON(coorsField, { - pointToLayer: function (latlng){ - return new L.Marker(latlng, { - icon: new BaseballIcon() - }); - } - }); - - var lightRailGeojsonLayer = new L.GeoJSON(); - - geojsonLayer.on("featureparse", function(e){ - var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - if (e.geometryType == "Point"){ - popupContent += "

    This GeoJSON Point has been transformed into a CircleMarker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; - } - if (e.properties && e.properties.popupContent){ - popupContent += e.properties.popupContent; - } - e.layer.bindPopup(popupContent); - if (e.properties && e.properties.style && e.layer.setStyle){ - e.layer.setStyle(e.properties.style); - } - }); - - anotherGeojsonLayer.on("featureparse", function (e){ - var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - popupContent += "

    This GeoJSON Point has been transformed into a custom Marker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; - if (e.properties && e.properties.popupContent){ - popupContent += e.properties.popupContent; - } - e.layer.bindPopup(popupContent); - }); - - lightRailGeojsonLayer.on("featureparse", function (e){ - var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; - popupContent += "

    This is the default look of a GeoJSON Point.

    "; - if (e.properties && e.properties.popupContent){ - popupContent += e.properties.popupContent; - } - e.layer.bindPopup(popupContent); - }); - - map.addLayer(geojsonLayer) - .addLayer(anotherGeojsonLayer) - .addLayer(lightRailGeojsonLayer); - - geojsonLayer.addGeoJSON(freeBus); - geojsonLayer.addGeoJSON(bicycleRental); - geojsonLayer.addGeoJSON(campus); - - anotherGeojsonLayer.addGeoJSON(coorsField); - + map.setView(new L.LatLng(39.747, -105), 14).addLayer(cloudmade); + + var BaseballIcon = L.Icon.extend({ + iconUrl: 'baseball-marker.png', + shadowUrl: null, + iconSize: new L.Point(32, 37), + shadowSize: null, + iconAnchor: new L.Point(14, 37), + popupAnchor: new L.Point(2, -32) + }); + + var geojsonLayer = new L.GeoJSON(null, { + pointToLayer: function (latlng){ + return new L.CircleMarker(latlng, { + radius: 8, + fillColor: "#ff7800", + color: "#000", + weight: 1, + opacity: 1, + fillOpacity: 0.8 + }); + } + }); + + var anotherGeojsonLayer = new L.GeoJSON(coorsField, { + pointToLayer: function (latlng){ + return new L.Marker(latlng, { + icon: new BaseballIcon() + }); + } + }); + + var lightRailGeojsonLayer = new L.GeoJSON(); + + geojsonLayer.on("featureparse", function (e) { + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + if (e.geometryType == "Point") { + popupContent += "

    This GeoJSON Point has been transformed into a CircleMarker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + } + if (e.properties && e.properties.popupContent) { + popupContent += e.properties.popupContent; + } + e.layer.bindPopup(popupContent); + if (e.properties && e.properties.style && e.layer.setStyle) { + e.layer.setStyle(e.properties.style); + } + }); + + anotherGeojsonLayer.on("featureparse", function (e) { + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popupContent += "

    This GeoJSON Point has been transformed into a custom Marker by passing a pointToLayer function in the GeoJSON options when instantiating the GeoJSON layer. View source for details.

    "; + if (e.properties && e.properties.popupContent) { + popupContent += e.properties.popupContent; + } + e.layer.bindPopup(popupContent); + }); + + lightRailGeojsonLayer.on("featureparse", function (e) { + var popupContent = "

    I started out as a GeoJSON " + e.geometryType + ", but now I'm a Leaflet vector!

    "; + popupContent += "

    This is the default look of a GeoJSON Point.

    "; + if (e.properties && e.properties.popupContent) { + popupContent += e.properties.popupContent; + } + e.layer.bindPopup(popupContent); + }); + + map.addLayer(geojsonLayer) + .addLayer(anotherGeojsonLayer) + .addLayer(lightRailGeojsonLayer); + + geojsonLayer.addGeoJSON(freeBus); + geojsonLayer.addGeoJSON(bicycleRental); + geojsonLayer.addGeoJSON(campus); + + anotherGeojsonLayer.addGeoJSON(coorsField); + lightRailGeojsonLayer.addGeoJSON(lightRailStop); diff --git a/examples/geojson.html b/examples/geojson.html index 65aec629e93..9be65cf6b34 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -42,211 +42,202 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    ← Back to the list of examples

    Using GeoJSON with Leaflet

    -

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    +

    GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    -
    - - - - -

    View example →

    +
    + + + + +

    View example on a separate page →

    + +

    About GeoJSON

    + +

    According to http://geojson.org:

    + +
    GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
    + +

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    -

    About GeoJSON

    - -

    According to http://geojson.org:

    - -
    GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
    - -

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    -

    The GeoJSON layer

    GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

    -
    var geojsonLayer = new L.GeoJSON();
    -
    -map.addLayer(geojsonLayer);
    - -

    This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

    - -
    var geojsonFeature = {
    -    "type": "Feature",
    -    "properties": {
    -        "name": "Coors Field",
    -        "amenity": "Baseball Stadium",
    -        "popupContent": "This is where the Rockies play!"
    -    },
    -    "geometry": {
    -        "type": "Point",
    -        "coordinates": [-104.99404, 39.75621]
    -    }
    -};
    -
    -geojsonLayer.addGeoJSON(geojsonFeature);
    - -

    We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

    - -
    var geojsonFeature = {
    -    "type": "Feature",
    -    "properties": {
    -        "name": "Coors Field",
    -        "amenity": "Baseball Stadium",
    -        "popupContent": "This is where the Rockies play!"
    -    },
    -    "geometry": {
    -        "type": "Point",
    -        "coordinates": [-104.99404, 39.75621]
    -    }
    -};
    -        
    -var geojsonLayer = new L.GeoJSON(geojsonFeature);
    -
    -map.addLayer(geojsonLayer);
    - -

    Popups

    - -

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    - -
    geojsonLayer.on("featureparse", function (e){
    -    if (e.properties && e.properties.popupContent){
    -        e.layer.bindPopup(e.properties.popupContent);
    -    }
    -});
    - +
    var geojsonLayer = new L.GeoJSON();
    +
    +map.addLayer(geojsonLayer);
    + +

    This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

    + +
    var geojsonFeature = {
    +    "type": "Feature",
    +    "properties": {
    +        "name": "Coors Field",
    +        "amenity": "Baseball Stadium",
    +        "popupContent": "This is where the Rockies play!"
    +    },
    +    "geometry": {
    +        "type": "Point",
    +        "coordinates": [-104.99404, 39.75621]
    +    }
    +};
    +
    +geojsonLayer.addGeoJSON(geojsonFeature);
    + +

    We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

    + +
    var geojsonLayer = new L.GeoJSON(geojsonFeature);
    +
    +map.addLayer(geojsonLayer);
    + +

    Popups

    + +

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    + +
    geojsonLayer.on("featureparse", function (e) {
    +    if (e.properties && e.properties.popupContent){
    +        e.layer.bindPopup(e.properties.popupContent);
    +    }
    +});
    + +

    Make sure to do this before adding GeoJSON objects through the addGeoJSON method.

    +

    Styling Features

    -

    We can also listen to the featureparse event to style our LineString and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

    - -
    var freeBus = {
    -    "type": "Feature",
    -    "geometry": {
    -        "type": "LineString",
    -        "coordinates": [
    -            [-104.98726, 39.74136],
    -            [-104.98720, 39.74132],
    -            [-104.98715, 39.74127],
    -            [-104.98713, 39.74117],
    -            [-104.98712, 39.74106], ...
    -        ]
    -    },
    -    "properties": {
    -        "name": "16th Street Free Bus",
    -        "style": {
    -            "color": "#004070",
    -            "weight": 4,
    -            "opacity": 0.9
    -        },
    -        "popupContent": "This is the 16th street free bus ..."
    -    }
    -};
    - -

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

    - -
    geojsonLayer.on("featureparse", function (e){
    -	if (e.properties && e.properties.style && e.layer.setStyle){
    -	    // The setStyle method isn't available for Points. More on that below ...
    -		e.layer.setStyle(e.properties.style);
    -	}
    -});
    - -

    Styling Points

    - -

    Points are handled differently than LineStrings and Polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

    - -

    Here we're using a CircleMarker:

    - -
    var geojsonLayer = new L.GeoJSON(null, {
    -    pointToLayer: function (latlng){
    -        return new L.CircleMarker(latlng, {
    -            radius: 8,
    -            fillColor: "#ff7800",
    -            color: "#000",
    -            weight: 1,
    -            opacity: 1,
    -            fillOpacity: 0.8
    -        });
    -    }
    -});
    - -

    And here's an example of using a custom Marker:

    - -
    var geojsonLayer = new L.GeoJSON(null, {
    -    pointToLayer: function (latlng){
    -        return new L.Marker(latlng, {
    -            icon: new MyCustomIcon()
    -        });
    -    }
    -});
    - -

    View the example page to view in detail what all is possible with the GeoJSON layer.

    +

    We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

    + +
    var freeBus = {
    +    "type": "Feature",
    +    "geometry": {
    +        "type": "LineString",
    +        "coordinates": [
    +            [-104.98726, 39.74136],
    +            [-104.98720, 39.74132],
    +            [-104.98715, 39.74127],
    +            [-104.98713, 39.74117],
    +            [-104.98712, 39.74106], ...
    +        ]
    +    },
    +    "properties": {
    +        "name": "16th Street Free Bus",
    +        "style": {
    +            "color": "#004070",
    +            "weight": 4,
    +            "opacity": 0.9
    +        },
    +        "popupContent": "This is the 16th street free bus ..."
    +    }
    +};
    + +

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

    + +
    geojsonLayer.on("featureparse", function (e){
    +	if (e.properties && e.properties.style && e.layer.setStyle){
    +	    // The setStyle method isn't available for Points. More on that below ...
    +		e.layer.setStyle(e.properties.style);
    +	}
    +});
    + +

    Styling Points

    + +

    Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

    + +

    Here we're using a CircleMarker:

    + +
    var geojsonMarkerOptions = {
    +	radius: 8,
    +	fillColor: "#ff7800",
    +	color: "#000",
    +	weight: 1,
    +	opacity: 1,
    +	fillOpacity: 0.8
    +};
    +
    +var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
    +    pointToLayer: function (latlng) {
    +        return new L.CircleMarker(latlng, geojsonMarkerOptions);
    +    }
    +});
    + +

    And here's an example of using a custom Marker:

    + +
    var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
    +    pointToLayer: function (latlng) {
    +        return new L.Marker(latlng, {
    +            icon: new MyCustomIcon()
    +        });
    +    }
    +});
    + +

    View the example page to see in detail what is possible with the GeoJSON layer.


    From 7fc9ff1202fd13021fad2f4b32a417f181ecdeff Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 4 Oct 2011 00:38:27 -0600 Subject: [PATCH 063/816] Adding Path clickable option documentation. --- reference.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference.html b/reference.html index d4c23192407..a4b6cb2c4d8 100644 --- a/reference.html +++ b/reference.html @@ -1262,6 +1262,12 @@

    Options

    Number 0.2 Fill opacity. + + + clickable + Boolean + true + If false, the vector will not emit mouse events and will act as a part of the underlying map. From 3cfe5d78977a0ffb9a58b0a78e6e7253ecf86d31 Mon Sep 17 00:00:00 2001 From: mourner Date: Wed, 5 Oct 2011 16:27:02 +0300 Subject: [PATCH 064/816] update docs for locate-related methods --- reference.html | 196 ++++++++++++++++++++++++++++++------------------- 1 file changed, 121 insertions(+), 75 deletions(-) diff --git a/reference.html b/reference.html index a4b6cb2c4d8..877e61d402c 100644 --- a/reference.html +++ b/reference.html @@ -287,7 +287,7 @@

    Options

    Boolean depends Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. - + closePopupOnClick Boolean @@ -560,18 +560,19 @@

    Methods that modify map state

    Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - locate( <Object> options? ) + locate( <Locate optionsoptions? ) + this + Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details. + + + locateAndSetView( <Number> maxZoom, <Locate optionsoptions?) this - Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. Options are PositionOptions from the W3C Geolocation API. + Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. - locateAndSetView( <Number> maxZoom ) + stopLocate() this - The same as locate method, but it automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). You can optionally specify the maximum zoom of the view. + Stops watching location previously initiated by map.locate({watch: true}). @@ -602,11 +603,11 @@

    Methods that get map state

    getMaxZoom() Number Returns the maximum zoom level of the map. - - - getBounds() - LatLngBounds - Returns the LatLngBounds of the current map view. + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the current map view. getBoundsZoom( <LatLngBounds> bounds ) @@ -746,8 +747,53 @@

    Other methods

    Returns an object with different map panes (to render overlays in). - - + +

    Locate options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionTypeDefaultDescription
    watchBooleanfalseIf true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.
    setViewBooleanfalseIf true, automatically sets the map view to the user location with respect to detection accuracy.
    maxZoomNumberInfinityThe maximum zoom for automatic view setting when using `setView` option.
    timeoutNumber10000Number of millisecond to wait for a response from geolocation before firing a locationerror event.
    maximumAgeNumber0Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
    enableHighAccuracyBooleanfalseEnables high accuracy, see description in the W3C spec.

    L.Marker

    @@ -1262,12 +1308,12 @@

    Options

    Number 0.2 Fill opacity. - - - clickable - Boolean - true - If false, the vector will not emit mouse events and will act as a part of the underlying map. + + + clickable + Boolean + true + If false, the vector will not emit mouse events and will act as a part of the underlying map. @@ -1332,16 +1378,16 @@

    Methods

    bindPopup( <String> htmlContent, <Popup optionsoptions? ) this Binds a popup with a particular HTML content to a click on this path. - - - setStyle( <Path optionsobject) - this - Changes the appearance of a Path based on the options in the Path options object. - - - getBounds() - LatLngBounds - Returns the LatLngBounds of the path. + + + setStyle( <Path optionsobject) + this + Changes the appearance of a Path based on the options in the Path options object. + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the path. @@ -1417,21 +1463,21 @@

    Methods

    setLatLngs( <LatLng[]> latlngs ) this Replaces all the points in the polyline with the given array of geographical points. - - - getLatLngs() - LatLng[] - Returns an array of the points in the path. + + + getLatLngs() + LatLng[] + Returns an array of the points in the path. spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLnglatlng1?, <LatLnglatlng2?, … ) LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). - - - getBounds() - LatLngBounds - Returns the LatLngBounds of the polyline. + + + getBounds() + LatLngBounds + Returns the LatLngBounds of the polyline. @@ -1512,23 +1558,23 @@

    Constructor

    L.Circle( <LatLnglatlng, <Number> radius, <Path optionsoptions? ) Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. - - -

    Methods

    - - - - - - - - - - - - -
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle to a new location.
    - + + +

    Methods

    + + + + + + + + + + + + +
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle to a new location.
    +

    L.CircleMarker

    @@ -1546,21 +1592,21 @@

    Constructor

    L.CircleMarker( <LatLnglatlng, <Path optionsoptions? ) Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object. - + -

    Methods

    - - - - - - - - - - - - +

    Methods

    + +
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle marker to a new location.
    + + + + + + + + + +
    MethodReturnsDescription
    setLatLng( <LatLnglatlng )thisSets the position of a circle marker to a new location.
    @@ -1682,7 +1728,7 @@

    Events

    Fired when the user double-clicks (or double-taps) on the group. - +

    L.GeoJSON

    @@ -2511,4 +2557,4 @@

    IHandler

    })(); - + From d0d6b0815e9d7904cd93da49ab225dca98c70585 Mon Sep 17 00:00:00 2001 From: mourner Date: Wed, 5 Oct 2011 16:29:36 +0300 Subject: [PATCH 065/816] docs minor cleanup --- reference.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference.html b/reference.html index 877e61d402c..55c5894b349 100644 --- a/reference.html +++ b/reference.html @@ -560,12 +560,12 @@

    Methods that modify map state

    Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - locate( <Locate optionsoptions? ) + locate( <Locate optionsoptions? ) this Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details. - locateAndSetView( <Number> maxZoom, <Locate optionsoptions?) + locateAndSetView( <Number> maxZoom?, <Locate optionsoptions?) this Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. @@ -1374,17 +1374,17 @@

    Methods

    Returns Description - + bindPopup( <String> htmlContent, <Popup optionsoptions? ) this Binds a popup with a particular HTML content to a click on this path. - + setStyle( <Path optionsobject) this Changes the appearance of a Path based on the options in the Path options object. - + getBounds() LatLngBounds Returns the LatLngBounds of the path. @@ -1663,7 +1663,7 @@

    Methods

    -

    L.FeatureGroup

    +

    L.FeatureGroup

    Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

    From 3974c6ce58886f8ecd6228931be3da841d749fb5 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 13 Oct 2011 14:31:50 -0400 Subject: [PATCH 066/816] Layers Control example. --- examples/layers-control-example.html | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 examples/layers-control-example.html diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html new file mode 100644 index 00000000000..d852b2d6322 --- /dev/null +++ b/examples/layers-control-example.html @@ -0,0 +1,45 @@ + + + + Leaflet Layers Control Example + + + + + + +
    + + + + + \ No newline at end of file From 9050757253a02062a58d54753e5f4730640a657d Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 13 Oct 2011 19:08:21 -0400 Subject: [PATCH 067/816] Adding Layers Control example page and image to link from main examples page. --- docs/images/layers-control.png | Bin 0 -> 20262 bytes examples.html | 5 +- examples/layers-control-example.html | 6 +- examples/layers-control.html | 146 +++++++++++++++++++++++++++ 4 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 docs/images/layers-control.png create mode 100644 examples/layers-control.html diff --git a/docs/images/layers-control.png b/docs/images/layers-control.png new file mode 100644 index 0000000000000000000000000000000000000000..4da42b2e21a87ddad7562b650b604b0101cb927d GIT binary patch literal 20262 zcmXt8V{jzg7M$3&jol<0+qSKZZQHhOY;4=+CfV4w?Kj_#SE)&=CaIY_C+GI*)7=pY za^eWExUc{K06|hhL<#sa4*0Nvh6H|3zh=S(0APhJgoPC(g@uXj9qmjltW5v__q7~l zH;trcOup@B6C^dEm7DrB>i_^LSrzmcvSuN2BETRR8C767Bpg-^9Rnp>LUkx`5mq86 zd@rB6%}g*dTq{adhvSN9qqNz_^ZN4gefhoXIQ#fx#$y)A9|e^%;i%9Oz^N3%!?i*b zCoeHH-t7;HA+ZBajC?dXUpm_CBWD(l`(X{7&f3zxzQLFkPHA=dw2_x0xA#y7Y~wr5P+5Pqzx>v|yr ztRKjxFbAaBX<1}w631XNGw=Wa?(1Ct7YBd*@zKHVk?FDZ^}}%Cm(`6ODIdx0_E%Rl zC^!IFZuWXj@9=O5%zhN4&ZXC?TpO^a1~A`#)n#6X$=8DY>-iex!SNwLm|LJQ#zTM) z3kP>eVOY@3upha9!tFrEk@+6MnszesqCmnyHbJ($#}{h>Zu>oEm7(xOp+S{pej_pPp$>3 zdD6Pi_X-3w3Q=R;6(HbyPZx~~mjFOEV`1`m1^|+JU*iO5KmgNe#rpt2*9o>xSu&Q) z2s8j7k{|H1P7n&dAHAv%F}t6js}Bp*08&H%p1h9-SqSpLA0M^=J5>-zrH^X`ytxhx zHy(iQD3M7_?l-GC@~@?2gV6oij#9;4OZAjF>6%BeF}JF*%??5$qqRi$HrB z5pLv2zSEpD3zDvXYN6E}ZWAG|e@kKMob-u{Gr%V@*2sU35z#by)j%gYOjJKY1DA3X z)96rxRV|Lyh(Lqg6$7s?*WenO95l)w?E?CDF!F$PV0^r|hKz=A8N~%z6KV&vI!sV7 z;{X+DQki@cg(vFkkh>vQeY}QP73CEPAxSR9Zz@DIy(9^8#PP%fIam^kcqU0WNh^tU z3A$qCV!nA~i)JsFrna;4&AR4G;y z{zLFTc}zkX`4x)O<+=Z$E5f<*v?OivT@~n+!^+WETrw%9voM7xi|L9M|7Kd4Sv;H5 zpE`HIYz7gEru|Kuw>p73Jw6S3aDzt(MF<*|Fr>z@!tuf>#csu+&yXpBSV+qlQ(;(U z!pksAM@qL-)%f}J(;FjU0yTvzMJ>fQ<+wsc)k&3q(W3%RrBW5C^0%5#iI{4m!hSi- zKg`O-ast)Pa<-ZoB{!uwg;_oEQ?!5hjyc4WT7R zHL!D9t8`gI?S|J28CQsRJXd-z8D(Lo3ezgn1k;=&hiMSRk@}q*&ed$G8Il=<88138 zI)1wPCCh5lYTs)1HP5x4HN#8COU%pjwQCpq9Dy9#oJTGju4fmR4z>=(j*yOZm)SGE z1*3D1Q<%qzN5s?3Iq^rEhoVQUv+JenIU;rj7HGD39BW1nqnoLCqZ6xii?+F&;N3Em zN%M|`A@ia+$s(#Y%BwK5eO7lYKGP~Ye8Vc1Et3r^9s@%QruE{X;^BjyAJfTJnWi0c zO$*LbQ)9FnRV!8F7qOg+*;cs*J*!>oA2A_+M6-vbqS&HFQ`b_xCm~X0Q=hBS)%esr z)E?EAt0b3n&S}qWmej2k@YJ*5v$(P*Tgs}ls)t;&Y_`$&(Bpp0|9DikU1PlXxPZOL zynwvqd@^{Vc(Qq#C78lTC0OEi=Js}UcA0Xuw(mMG-enmqA1WU_RX4*kD{#uWXT>U! zj-NzLb4|liwkeG)waxRKOgY58>X>g{cr425%-X14wfVO>#XIa%`7Zk_3vXO^koQ{f z;pSOm&tYmmr!=c{;6DDC{5U+B@BoUiw^oye4lmr(k>| ze4u%rd0{;zJ*3;bJ!HO1z8StyAGz<`Z8j!=xSDFX{}^!bdlBO-&WBU;2!oOdYgvoj7AP~8F4VQGQ=CP?*w{moynYi zkg1aDY*cf&QP_@kbUHJc>&BzWsu}Oi5t5FY*1&%lL@cC0k1c;#YAZ{Cb{Cu#A}`ug z7*nWN-`Xa{lX#S)mh!~0$?YTjW*#ap<}$(zBdBHt~Ew_Ud%Mj$s`lGgs84RHJ~1DMMdI z*OqCE z+G>73u~PJ^?5oOZUh2f!j`q~$^cKAzJ#5z2wxn7oF3%;-i_dMVo;7=GrMfKz7ypLd zAXMYs#vJ15*+^|U7kFAe#!fd)PfUZc8n9k!PqkF7-xaVGJ$dH%=}xMBR#&$6tWvHm z^=`U(-6IAOU~q3;Ctq|m)3~c!b&L8u+Rk4EZpPsn;&t>M`EIs}yU7pd#(Dkmf_f6Y zKDTtXv)-uf?QMXuQDTcBl;E;I%<{Ke%eu^TYqr<=i8vs5*iW@x;_bDsa8fWcxG^}r zo#EH|2z@T$K{LrzEmWRuTZ(0zRpU6e!cn?Ss$_1pKFao@;glr>I0H$R7(_xAN5 zFloQkxHLCMj-U5m#)ikU%twZmuA*+Ynec2bKbG^AOsn4W`2E&#obFAR{R8Q<;W|aD zbTw}cueh)M=dMJpw%xhO^W>#EPmS|~>^b+`^@87yZn*R$IzV z{5Fb?#~0V9ODs3oE13;l&p7wmkDj&9GpIMDGry*&o(4u2Hg4qOKVa-rJIo>X~()>$dBT?a^+c4C)VoFNOQLH>1(gzw*y~ z$KGEb^v}Wf@BW+=C_q*TX(%l&0{H&#E5Exm3HS_*y@aL{004*f-vb1YnT-v663SUp zRupO-76B6lvgT-e82}&#NQwxmxUXI4y1A>UzWMfQm&_K2ktZvF!N{J<*13s-sGHFF z*L3tYS8ck`S#37!*Al~?8LEQ^m|%#42zp)@3xL8{B#l3`Kl}Fbn_k&7XP_&%ZR#F- z97&oU^*rZ#&9onTZ@;q|nu@*uhWEF(uGM4w9>yklB01$|tKGYo{{EmjQilg%-khH= zFFW*vXEZPQvePP$^uGMjPtOQH!CGzkW{cihe$y+judnxMjE45@C0bluL)*8(P(*+E{CaT<{evL_4yn(UkuO3TZ;X>jzI#hWBwleg@bckQ z(13f*Z`wz)USHu!*TdI_-@55c!^F&7P+|G8@ohzK8alY^Pt3AeRxCjd8ua&HAz*ka z-UP?C6)%uD-)JLB&st z%uosP0ky0c(p?4~1O$zCZ_Zzt94NDV&-j?rdcjbkTM)I|F?A)+Ai|Ux&u?xEXy+yS zYgRR)zP@}PzWh~cG(3dzd*E;5SI245b1ZbHpd=J{Zl-c?;OESkzGA{uR?g8Bm*E#fJPS$Aea2Bf)QCrjE@Lb&lWOhP*(y%-1WRFPCa%SA|3TB zRPQ!OU~W1R2XQ>M7LjhSp#h`qE7EGmnaiQL0v53p?T3X0$9=X_A3&%;p|SJ@s}f<@ z6|Q$Xj!ZmO0DYK}JEUjgeBE*H*(N3`*;)++1^BKqlxXQ0hTDo9_@UI1#*M3)7eSIO zbW-W{|6*;<(-{Ey)Ubzcmyy+3?8=f3jE;_uWnEqPCKMFdOx_$y3-fiBua5W?Wqp-) z(*mPSJRkM5kKmvzvQc`Yw3&)$-2Tr`-hqwsoM1tr@W9vSaJbRGSnbAJZ?&bUT!f9u zAWe|yl3)A5-}LV5`%A_eA0^3de-t`U0HC0(EbQUoaXU^4Ez|%bQePjb7j|}b#xe+Q z@ad-5Pw)?&Py8_+6%X{^Q)0)J_0I`Vl=SQ_}%eftkh-oeO- z3|M~=QWOz%h^seGwybIN2oVicRVHioYM4KC<%8dj@F)q(=ONqI?6&eEBKQ#^(17Q& zML5c&2y)3la>=*rIl3I2^73-pNJF#~-Fc|5lR`9zlXn9xEnK=!&mXQAYXPC5kj`UQ z0zOf1LW?R4PTo(HS$`rbrS@D_AY9m#}QUmS0xn7g5T z%Ea;hD?<@^gXHNa%>;GJrQ^EbJ3h+c{L{s7tljoxc}SN4mevh1EO0N*Pb!#EZi42df*Mw^X}7 z(8mcOgR3m63970(U;M3)V902rBS31k=V3~kk(|oq#j~6806TW$hf8zG^Uuc&Ec|h6 zq$(RSc`#71*8I}rh+x`v!<8*Zg^Py=geBnVE?l`gT+WxOWa-91=`3QZ$C18mqgSoP z^7wp!CySYwkZRNU6<)X!y&(DXzNxr^J4cT8cNeyv-#zOUt~axs#5EGAL0&8PthGB% z?W`xk^M(h~1kGd?ymMisA1&x@Tt5S|h+^>IZl6&ce`tu_uYv1#`QfsQ-J8k)%27D- zJ`+bn;b~Kz#wQb*93BXt_otBc%g_=F=&->#s6wMrHPw|=N(V31O+8St>)xs=+O|zw zVBsVZ(Xq5qhk_}O;}aDZxU#y;$4R-$_a*p9y7^f}c=S!38;|cbb>)Uzv()x)b_Y+= z7f_@`0!l32LZTg|nVRWW!8vS!9aCaar$Kw;+3o$UN7z^5f_Hmd&}t;0g@TJ=*M$a6 zj9gDU)|BrJv$c5(LMh*oZP#@x_HTK4^!eGI10INRN#n^9$E}q%-;(Jo>5PEl($b>B zLQu6zR)+!d?pXboIqGU_?&g0l7aAz`U6$E*L(YW zuWk1u+z#(Htwk*@YFJaii&a)3#i$vpwawQqx&GipZWx{SXcYa;eBX;vR7>7Kn^Z`R zzEG@6okTx3&6}Az=qm3A7Sy$fiGZR@Q$lZFsaphn$^f=cY6OB?%z{kfYsaj1PGjZH5 z6Z0}GWjihZ#UBqqg0FTv?KTYk5?FsP634hU5R0g>P)(okw5)#J((+)uF46GR5^8aZ z>zTFY)Rj+^{(=b(Vn6|!M2r_53NIP2u*)0$5Y6H|b_!5cP1-{{OnB;w!$?X^4Mo6X z+lhU@9=fUOZ`%*XGr*LArUnU8Og2cNErV;n?aS=#x4JV}nzYL=tAj>BKyY}=1%!i& z60r^fa7`ctiKjl_EwjD8)mOYZ!ehk!UBbxReJo&pQ<8_SgsY*fh}~+Aqmx zIT3z!o_wBB=%NtcD=2)$nCbQ_(a<#mKOO>yD>t0je@E4uL7UFHUW0>eKW0YQJc#KS z*aI+VNii#y&4$Y}x^3?PUiOY#*gER=tmta_j#a$iOBzAKP4{fizk2K*i#E#hnN54x z&~P$vpus`o$zgzeD2vTzVB%W+_D=QOV{jyfnx6hR9slnT=&qZW!$P)A+e2uhLQUrF zR-nnp<}rU7k?c!@;QN;j#8jmt`FbZTw%Dn*;F5v9<6@e1Qk3F2*CZi zr~6~PH1BqXU>yJu4GFRTQ(OofK3Qyb{U5W(B-pUG7o1KnI{{44fqk7%7l$~ty))t! zh(-Mi;nUh|l-jz9Pc98%O{W_XTOC`o<0Di(Hk!1U8r5o%-9VN!zH9$C@sD&Fbv2R_ zITnk#EIA_xxKOg_JR{7p`RV2X*Jx0^25oX~uH5fhtY^MEvj^GJ7z-cYsF83i+|e{2 zRN{DP*S$*N?fE1ty?o{wo}gUs4;W;{jhLZJ*P@07)CyEVY|4t~O5;YYxs?-=)^%AJ zeC(fRLgr%=qD2P-1F!eDYhcTB*{9EnlFgC7K0D^!FcQk5^Z7Htv%RifUrq+w0seRM zK5ZX&+w%cnhY#bWM4*6A(|HkC2r%dC&u0>JScBa?QD{go_rqo!cek0Wm(et7hs!1l z@_32o4JWEIJf4SnxLL)x-0qW9?eB1VYCz>;sx^k>Pnwp3f@W#T7%S}pg>cje;;7-k zjyEn2V?5(T>LGC(QCzFyI@~;;iV8}K0@Qz9dC?cB;2^*{xNSH=;e*h8eg#`7u>M(f zsZNBr#`F`pf2JL%X5S2rz>@zmL2%IkC#sdU?9cYgjF3#6G z>l(xXq?v`x`?Rp6;HWoyE$nqAp1fagX}x;~%5tH==^|GPMhrT3sf;q8J}8AP0`4Xd zFiI3UTPhHZ08Nk*_(K(5A)p%ZS5!pQ3k?2F?m>b!KTH@$s0pb#^ zc{rRLt$;w#eE8s(RJQMg1v)(B4-k16Asjr2=3t|>m^r))$BvU-aiWsTtd=No=<}jyrcA^ehgs{v?Wk-8zZ7OmK#vsYC&_B!D9E zUWui<^No%i->N1gqej@kR^N#Or}JKf>DgaFG1o`fvt`z9n33~GQq+grI+UV1t7TVs zB2LI=R#tSxupein{lIg<03d<{ffTJ@9~r*RHp~#PYab4X=f@WC)Z$7>PM#Of^OiYZ zt`Zft;YFvIx1J}r6@*Em*jgU#u)$$eQCD9U8Ew?6*68)+CG`4W+|YXQnrJ+(gN#Yf zkPVDz@p8SD<~H41c;*W!v6wcuCfmirQ~Y$w3f9}x+h+uFJ9p2wg%|5Dvo^mW-4lb^ zQh!|IfZ!M9-S~@-qugF2%|j`k@7CkLwSN5WJh>d&mgaCkQn}URgZCo=I!lJ~f)ih$ zLRO$ec_1Ov)A@W2V=xR!nw-Jo_^F!ZdH>b=Yy}ET9yhWgC}pK{4=?&;nE>lI3rHe4 z=oC1qYv(4AtphP$QC1eg%+z#X|F+MX4cMw=6s#Bsw(Rrs^EagLvHB+R~`k8f&C1 zaW)X(a#I=^X)kZNT8`BC7*3I zQ|D^+{Qmu0QhMzNJBcSP7(okNm_mlG)0moG0|kWmyzh@h%V>2TK_&aWasoMIO|J7V z&*vY(VzhbHy9P zM1QcXx6?j5-)G2eiAZq1?;`OH;~_+n3B*yG3ltm1^NB`ohNR>+-n2IqI~#C6a4Pg*1T|5FSEvIfyix1$RkyF4DJ@f_?8gWq9>YK5HUFe{fP$!#oYjuCgI; zbbS4QqqlVBhY=eUX+>j8x6_a3jz-dFjy7mE54Gr54MFQdUfWzA<>E^$U`K%lCx!;C z)#`)=Yj_tjp}Vqyiq$GS4}3iNSC0lRxMS=XxfKj44@OHVouoR_R?Id?ZqSw^N9Fsn z3*~#1V&>p+9f6&}8jOcQ501JAo~qkmAbTk`waSIny6sFO$9>82Z*j5SfZOJltD<7S zw6Q=wj}OoXTuzap^IKX{lNehhX_vj>+5UWUMd!=U=`%<`ArS(X<0hwBxwAY~5nPr+ z>Qb--k$=Hw#96X+TGbs?zc*Y9dqLs_K+#nNb2@(|5X7waMyDH}6$9~ftJ}-rTljgw z!o$eI`->BrTCiwG9CI#uGuOx6Wj(9S@h+w9AyInw);${3Flw1mPDxY|IYNXQH3A6# zBVJ@hAdDFw@yXH=KBX2LLkGyrnhH||va4>=I4 zP`MZh=>}%|zHoVx_d9s9Q{G?xmc8I)x)7$hz>}x(79-nxopNHWV6$4^xfuaqkW~>O5NLJuPsXA-yh{X^p20kM0y96Bc7k^r)ctKaL%o0MRd~W z!!K@h?M)xp-*-<{JPPO#I5;>8su-rL!D|Y1BB=Xfikk6t+sc7WQ!EF^$5i`nnb5Nq zH7v$|Oa#$~j4b1+Bh9U?hrT!Opbiu;ZLhot(A5ftb0tUvX~%BFyxqMAnW;~-{rNXP zsfN^|^XO>B_^;1vdl4IlqibGuQD8#^L^vG&5_df=X@`$%I=rtWEtKw;_wr(90YGiL zFEPue+#hbkP$ER~Ei97)J`FY@yB_A5WvzA3*=;QEkafHU5j36$BimBFE+5%`H!_W=%ooEwyOP4vGcH}Zr4vQeDpRO*7!u6vGAEl0xLP7H8zk8-o>L8012C|; z@5q_TcEx%%mu%$WDPx*}%s#azm2rxEl1am8!*`Y-K9F>i?dF?$0G2uSEQJ&X-al{c z4mFA`;;Qqw=Vi%gCs?aX4lYxylL4sMnVXyUohTNKU%DoZ?i;kOPs?@Ygd!33Po@Fc z>M4&D!OCSiqZM0=wH6crJvR6UD(wB=eqqg2le-sC9+NW_-^0T+_rnQ{?9^1TPS>kp zBD-!3>92a^U5VhDjx)=S{T6Kv)d6^aU$@O`kE?eg2EdoWpsAeGs`<^|-8#)`fWNj~ zZxCVI^=~eX-~H05w5E#a7Dri)>G=+-E_AcsAIeL*Ve9KqbkKjv0s68FV}|uZ1cme& zED^Bs)P>xs`~ue(@9}z@x0F}fuh5}!gt0VKdi?aDV#V3-*WO&g(+3ltq^BM)`5u#``T^ubaQZNc$$K}5#0Aq=MW6T+c+-c(QlL5tNrseq+LA%~D(1J9LhXN)mO-lo_azty;4+XwcTJR@JRq7k^{6+JF@Q{0R%^ zRj?f~cr!A!OwCM|gzdku+jr$d;e6IMcd}TDjKpuxPmCNW$S>Pv4639fhmQFaM2&1> zY%;e)66E5969HNvKL@DNYKA?;fST)+C&`eZ{I|4RP%syDI@>KEjp-}+n!`oLOoo?7 zuOU#H=gXB^trHV8>}5ZJb4-elNTf{EG;vQ3s~lMAmqDTgUz51IPG`NEOD@! znWKY8ZKVw6!bj}le3zxwX^OwXxf6G8a1jxJ!Cv%Chd|?_eTBEOWZS#Aukl|^hzw%& z^@l)(uuSvxptX?>ont|8adBbDnzja#fJjn9##?F{nkXpIvpeAa0TdklJ_fIE*DFgL zgdahW{q4yEyEgD?-)$+by5KZEW^0LIKvh&lb#>`Z6%j;+3iJVdwOARe4xbSFBeBDJ z-%soh*Xq!M=s>&yb~`Z{E5t(H3(X`Z9$(h;57>8vfdfgbz3SHOks^7XAcIfOp#!Pi z^tb#Fn12m;6@}C)s;Z)yCH+9YgAGp!tHrN{VQeZTFJJl!ceH?KH#_hMR$55i%nmA* zAK`hOOz_}x2usU%gAs%8L}GH}S{P|b-~JitQ00rsx>&Xa?k#_+DAbxO{ymT|t>-rr|m)Yj0&%>7vlO`>B zmW(}@u0zbi`MtqZdcFHje;D~OCt)?w>n^ASZ!@NIVm;UbdtY0`S zPESG}Zhb)dSkR%Ao zXgSxXPC};ldyo$Qu}Dn={g3Ih)4u~`J#YzSRZRFTQ1eVT;*3)LBroQBUi#Gn-{1` zNV^(VdO>wJy&~v1_LCDbo3gNa`XEDqY~{md!PI3W+Rk0tYNM`eRa%%bF)`V1x-1)f ze|>Uzzc3sg9vbWoMF6qfHCe_Oa=3-W=%l8Qx+95`Tyn3nROSzn+P6R28`dsxeTzx* zDWn!uOm6#BP*qJNhY_2mf9nJYqVF%y^~Q~xfg_`f8b~HeJeMzdl(Mz_as6YGfEr`o zVes$xo`jtptAY01(mo4Zt3gmIwMLZxC?%s-U*SpMgVK-3a?k}C{_6#EF3=|zRc8AI zb_AX%#;Qa&NH`3sprr(I6%nNZRZPO@;U{%C)o=5!V5KY@Zp=gmLK91-g1S27kdP3` zxH&IA#v^UJQobJ@&S$~DlDJq=cpt3D-`J^IfTM@?w|J__paZ;Q;$Ej@AxbAikwqsc z(q0mkgZ=sWIq*sYji)Sz@yiHb^GZe$a3Hx!`|W|_<#si^J;D<%HVlVi$YT^j9$p4d z*w3u}Td>#HhtcEC*m}JO0Wl0L2ofn^*gCMV0uYNRA)Ub$>(o`RSpd6 zO_;QBTVErFS&x~^8Tr;`uzAeVzj2~aL{|i21b~{1ENIPrA{ud#j!T2;t(&b4@1%c} za40<+g{5TB{*ESq5>RR0U)6nGC{{U`OjFv2EkhkiT3#WAfq~Ivx6KD0BuEZ>jo1wq$N(M0i0jwTZU z&6b6L#CK0Tg@Q);oDSWKYrgjzxE{U~?&WE?+CzM~f702v>o`2EV9S?K(XMs6(F2#R z_?(>0n(E?i?O5NhvolLFkXOCW`6RdIlpSKlBLm*T{QCL?;R0kAAfJo~Ld`7U-wh6j z7Q07Yr>y^*SyDfFI1u;>camk-)2}DCF^D-QL&AzrBok$Rxo5FlLY7=&Vcfc&kdpF8J~wa3<18&2 zMHJ=n@li!rchlF5VLxA8Rkh!+zVFa+n6=7Ca(!-|kunM9&!0c;PtC_SS%p!GJ7*w8 z%4tB#ug2(f%zd)d%ng)LLxIkR4<(Doo69sQJw4K|G&syC3c}`0a=%$diZScchz~sv z0xKdIV3&ym1OJvfGB5xPYGlwv_m{fPqBJHk{ixD1;iKlRX=WVXil5gT%tM3A=qtf& zw4J&b=W+LEUcTau!CH!Pd~R;+)n+FdH#1ryd4YHw;fbTPpmQ^JZB6R|Xzsva(fW@Y2NFYT zG`KTD`!AdZFPuhGexeM!vy{?KroYc{11-!D+DRZuu;;+PJqTCJLIBDH>8w_mPZwK3 zR`0(f!b=49i~1iBS7V!5@#?D#DQfaO31B^+Lx-(LMv1)tQ_i-0-t-qEG14E`tTY-u zSv{YxVt~GlJJWyWp*@#@8%O@JlrvXO-TEc)-G)1zj)3Lww`LPwU|AtR1Om4PZK^w} zy-}bgU8?5d@ng$s!GC^LdAiZ>lsw-j3t&ILeEKplPfSi4)NAOoWz{=;dUELg`f$26 zq9=|jb7}0pC@EM#}8PCfwjfT+qp2J zz5QAKk!vU!;aFC@pF}SHs1gFQb%@NZy+KLhaiX?ih}5gSMD)DhJa?V0qH3;eKu>yN zV&bOs{dzQWaUd<)@c&tWN<}?&sJQhQpxIbdQ-cUJ&fgCw>u>I7>&>2Rjg5`O@z{vT$iT9eYDY_ne1geTRqMF%HQo->G&ubDfc9ec*u6W? zN{@|p7Pxt#?lkpEYl|x79o^;bZ>Ww$U zAFtGB>uGE@YvAfquivrHve1tfA`&9<~pMFw=5eA*R!@11C(|A$t>n1WhxcN<;!Ai3e zRSZ5WY=HuFWZ_Py$)x?wj$m;~$=(C=Y_uG%VzFHsUC`uV;U7KUh+8Z@8K-R@^;z!d zT{7{)qcIeGYMMb&G^)MJ)y9O>OsUGAZ^A+G==}EUo+x{25g^=RGg_hp)e@k!3+{lX*SS4D zB_(7UkKJ&fSTZ>+O*|$h=D#AD7#k~;%H^2vhavzkFOcUBmN6RHAFY}RM~Kv!?+R(q zVm4@1H+d{jCKK^Uu(GnsW^cm?oCbJqJiI7fRDijvRjzpV3BPaT-}bhH8qMa3(RX(z zL>tdP9On)~9On?EeY#%I^-C6sD;1UU@mVrzlYZ9u^2VwV*h-2qzWo3igSTY|YD(oN zqpVRgylS(7n61@{tHP(rzl?4+XlD2IS3%C^$j-9RE`A6A6bR z2#bnBRBN>-x?ZgWB>z+SIPG~qNx{++k&=SNM}%^8bYgTqVbJRJAbYyl46^9_XURW?EU|%_ME~k>c2MVaM^bor%k@Txx}Fb)x{eEl&*vjQ zkOL8V9-tum=XgEM9q0K4(qn$3?T^NdM$Pg|JMq8xyI!wB3IfqEkluVS)W!W|Zj`}d zPozrolQ&VOaNiLUt(J)Wk{)c~Z8z+$S)4APEzup+gDf36uQV2l zAS!uqGj#683up(H^WcKKym-)P5FxKuArOs$Ug@iDr;>>Yg~q~Pps2KR>6)yrqJMBQ zht1MZWYY$sztd_sEDr1+sPV%k(SG%@OQ+4hO|RE^3?kKW&)@EDaHexwArg8Vkm#@& zpxXAFnnvUBLHm85FlTc;kz22~K*;ldvhY6N(Tq(@_3>l+1USv`5-sF;z|JJYUu^c^ z*iC!joi9}j=kbM%w@faz&<(XzQ(_A)s!)<{cU*QhP^F5-M=x{@XA*mKtHNmT< zsPedEtp}5 zM6t{A`m(|XiYWMUR0BXWfDRLwW75sq1Ckv+gTKViW8(qD(D;a9`&G`syoM(Rx;^lY z0VUt~^?I^Uc!G(3{rJK9Y+l#SoX0!q(1<}rs}AViLK3$f3!ay3n%6(?zEEazZs<9D z8Ix9c2CdrBN-Q*ykp*O8eOS^Q^2YZ#vKYph`C>Z1 z{vq|(1=7^CfwHQqdhhx7&}v;!bK3)O%75j0pHkSH81L^z(Fc}@=|2$4mOU(Ini()h zgZn>x45>eNM2{TB4tz8Ww;hdGkxViv>6ZU%6qk2CUqYZ%6ch7=e7xG^ep@vTq@66b zzy$)@7vJ->`&;|z%V)%bxyTywzxPc~4F*PRpj?a*re-9$y6il-xGan=0v-s$E0Phc zfsutBCoJ}jPD(177`v3p&=z_&bIK*A-k4N3dGr1$p4X(0OrraO1`bSUi7J*sK>dU+ z46kXo7;}PVd3|;pQ0^f}+j2*0V45lpoj0(w&J<)pM=X*a#V@1Xc|FeiL!U-F@}B1n zq?#QDGo5w|n#ZxD4R$@lZM#%E`Z0KaC@7pKR>S68usoNx^6O2-OHS!xlyIhk`*+{{^3DCxOZkP-iwKB?Sij{{2&tNE~u(s>2<= z106Lw(~g3YXOSmQ#W(-avc6-xR#lU>CGHBFU#b%`P?&3-Ame^}-)@}h9}lY*h#HX_ z1n4*)&uMcil|#RIXK<@;)Dw00_^|5h3yPtKPs$8)E3D{_Llkd>~aDO=20>jF7Llld_nS9;! zQgoFw1NJRMj+3KC6gBlv+G3E;D1nBMFa$yo_6>X9t#npAzphhLV_-22m6+T;TP)@o z49(YrtXNc)e-wNPU&w$bh@?uACT&h}9y=FExWv2gru6?+i5c7lb|7LWm>_F#KJGy} z6CV3DGd5|&L1IqXnc^%(r?f<}2r!TcR8@d8;ZGGctjqOQ4seORdRntqK*OI%?C5N9 zx+Cu>P?|zW*|cR}y>#6~V7)THd3b+`IHgzkYi(4i3W=OIrQ=iWY(rB zV~+&%wOe)AafpMgEE~B{#c;?lz5l`&S>VD1{vASitZJMsJg@BpMrL&8tx3%@M@EWO zA=y>d8qNM21uNEUNpif{R`M(k!U*LgjuUd-!N|j8;?Vj_`2jx;kP3G)uU5V`AnQiJ zNis8+3>*X$$qo=+^Xnm_tOEo2E<9{KOf&QeS zL4k*y>-KtX3s^wzTee=6VffMH36FZFNze|$LQIea#i&cqs4f>JX@v?GY?kjHJ~Hx+a^02~S}4lm z+YpT@x8m0=wo!WO!%4?!TiK`wb_y>#t`)Qu3PbE#12rYLh13-Mb-Y2M%!+a|*1ei{ zK<+B9gXvtkMB^XB)!geHxVHkq!BDU)#+GI3WV9xz%MRBj5WbrZZSa2#+F+zuk`gYa-s!GoXjtjx^MV`meZ zvG9n&U|qL;n7=By{b|H?W>#mcRlKZr>p0>qp|hGK1@+5{H26B|fu`qtLMv z-nFq-f7}2v3S3}cB6)owwJgJ>MHb1Yb?5riy*~AAo2xDr&{3tG#Fx%nFzuCe+wg?S zaT?)tzrSR^UCBH>IhqQSWGDz?g%i!_o}0@RmuorKQf@Mt0*Y!sTF~37etq~%hpp(g zV{J0sEAH|||C~ih1V`blL4+0ytjn@FfMH{+F9s&;tl98{Ly}A(tpe(1)ZUR~)n`cG+SHI8lxvDqLKRVmcIWUW?3H!i$!a3pagz|Q=SMyA-qEYAr8j_ z=+{qQL~zjLIg%vhR_!uJU5H9kgaQd@uZkyOR8i;I3&_q@$OMsKqaOx%LWGW***ZGP zLWRT*t8K38`q>fDNSE<9pFs8qp0v_&=-{t-Ynz&sXmr_jFsUAyrVx^tMQRb}^*N zrONH0M6vo33v_AsFCuj#78u@sMwe^|!Tj_@fFk<1LR4_{FEU9gdElNLg+uF{cyi@+ zEjB)5_%(UsMZKB5RE3|Q?5cm1+gg8jW2xhDh*0(nS?_jkX}#4GB7fM7lYT95cWGZMIcYEV#?yiR&~0CRx*lS$`W+12&v!_5T{eu*w+Dgl(NP?W@`HO1kCE&Q6_>We z+LL>{>{Ra9k4Pd=m|H<$63~Dynu@)v51}FLclH;k+t{f9@cJ2f*>i zt-}(`E4%Lpo&XKX-+f5&6M^smE6+E;^YLsLxRzJ9D}Nn;I>C|SiY|P=$p+}l0P?pQn7KUJ|dxs!B&+ebs zyb(N}FC%>kAZJz(v$Ll;IXdoHXeucyzji-wkD|@;3cA5}q8K%Z)p75UB*dCp$3sMz z2$o>A%I&y(K`uhVUh!QX>@4?Q7e)NJ<2R1(GEc6+_NKWCU3S>incR&Me<) zbml)VMwB!GQx_uf<%@Eyjark#F>!k>gmFSLbVe)@#_Zz?E6T!-i2U9l6&MBg!0UG3 zIfbfo22x{#xJJhE_Yeim1t%hQ9EMKgBD>0-(Tkkx-J|bL7_8s+B<)2#l+%zbzp$f7 z7nhg!-|%X}n1@5ebG?HJJ0AF=&v_yH?HRUAd56a~gKUML=X0B0Iw?-HRuCXI;qvPe zX+hW_&OeaJ8Gj6JfUd9or1_*N`NY<$cZA^o+*p8a7k(M^x0+jD1p6wn*fd;^oJu5~ z^Lpp+=a1|i_*YrFH$hV)LX2!K+i0+lmS17nMBX>Tda^eeLSY;zrs$ztYxlrx> zQzlTiq2G@B3YYcT>LUI^<&1mG?(&11K&j%TM*C_Ar!)sdzNj?Ae=$`-$`oV<7p{e; z8L|!;xmsHaMRqqFmn6#A)L#M}91|SntB$CmWPnl|1eCM_G|E^^Bqn}Owe9>*_n4>B z&oDfpZ%nl}KahpQKH5$9foprEC+NE$zAq^PNkf1J;z8Ps8`a@fcduh8Yz}<@Vf!Pa z^Tj`uD@eC&1*r{X?LRmGcOO1e9CA&HbaJ$bGepC$BhfMG@%~jG`LM~ozBjO}o6j#I zhNgA>HD`S|nZzm6ahY6yD6AZJ5T=V$eO5K4m?XTf*grPChOq=>F%!6ud3(o2U))2U zoEB~?!nIfKXn1EW`fJJMZD$je$gm+m2~E37e<4&g4J|qyS;C+HfXr_tj#eBJ-;~>U zJQ(9$tssa7kLnSB__4<`d67UwFf3Q++Nr3i1b%gf)>1N!Be&%OwG7QIbe5WwSj0<%03LT*Wh&5DhmBz;=4-j`KsOA1;of z+I_RC4I-Dkapy_ac;Qt9NDG}PHpE1c!P8X@SN5kkguD`nh%f&{7fKZ#_c{{@8&dh!C0VN2(#`Xl7_G$1cE7ZD{4(IRn|>kB9l2{JTL zd!qo3hw%Gf#>BL(<^r=MNDv@kVfmMsv;94sGWHbQbLZV~I-O`}XfT@Q={S-kQL;QZ z0bc;QS9gObNbz&?2%k5WJC6V{S`_w}IF4VU zwfjE>W906nyH`C(IbCuw^U0YgC@7%D#>QwGkeElI(XXSGG^{PMk%<`nvmgmg_f`Sq zOmV`Mkpi|8WI-mCqZz;?(S)4r9IB)m2%-Q%67=>_5+mkux9wL<+Zcn}3JDinbRoa- z${Q#sC_rOlBkM_y45{QeL4eY89LGN!oraDFqkmyGnE?XAT3GiriTgd+WGnj&G35WM zw*87}?!&BW+0spaxCxO+1U{b+;cz%8Tl)RSV9e&|pWx~v*~{9zW&@tU5-<+Cld zG|@ZoSIqHY66IC^kYe6?Y_r*tvB2$OBioBX3n3xQOp+wQZnuL3LP!l8SDt8k6H$hu zDr~V>;EiU%pjMummg=|via8EU%M5cMKy462)RN%T4ko!hlQ2Gk>~=d?Ks0wDnvyoM zAR!WoBwFzko!i?C`ZKCzzhc^tNhV}V$6F@(r`+CjK`mNS3Q>+HmRmz-rHKTDm2i`s z%E!{K_R2`VVp^R*O+*GES%hW6JHC7wj%hO@F-bXrRxz;xZh!!UqAO24`cu&qbh75M zUA5t(Pd-9wYHG9d7^@q%)wW+TKMh9sDf9CFn3tj`$VksX1PbayZipntS0sfMbhdXy zPiHqQU%4E9zyE(Kt^Y6erI$>KS0jo2W#e}V96@}g_^B|)Sv~%&3$d`|OL!IE(eyXW z>{I->q}O;}yI~#g-MyD(Sx&}Z{N!!>71MNlj2OMHIvH~PQsQ?Bdm{bR82$HfIE)L= zzW`w=j5S9#kX5wAkI`78EK3HB=rn|8&z(&+n~hXe{n^|0D~6inV>V(0w4KxDSaaYU zH%8MmWM*gKytB{87yFm6s%b2ca5Q%giF|V27~Z~P2XEWHjm>8BzpQQlE{tI{;AEeV z_d1DLKaA&1a{i>(5zxGTcCvS(di=9t{C+>qI^!(3(Lh_>JIErM2^=l|7*a#jFQt$& zgf#lcKmS1%i>0Mx)W4YfIbMt*JciQK)5+)clDod1%w{tQqDY#i#ou~3G!XSSZs$8* zq{VDDlg(x$lgUJ}1fu$RFMdn$jE@zW{ZB#$k2~RdU`sirKQEoP1)^sOuOnT6c-mm z6h*xE?z?cgT=8;P4yO|t85x}5VG$(>6U_37StTg3T3$OcQ5-V{hKNT=k`M?4aLv`% z@HIDHi}LP=Dch0>1~Y*usD>~sYY;x#JC7DFTF6tTOd+4om&lO*Tkq$`V)Q{uNlD?a zmo7yp9HwipyDpCT^y81QdDAAGcE%YL3I=)4o;{S6osHjIdMRFb_F0ZZA`m5src9fL z8Lzy;ilR_jS{g=;8G~hCe@&XI@`Ot+q15zr96WFUxw*MqR#F0DCWq6BC5spHz!OiT z>LW+s^ZBrE?_L@^ZX9>X&u?-+LZSrSk}q{D8`iGHJ9Fk>?6`5b{jR%EUt5a>^X6f~#EH1$?z?g5&>6c%kQ>RWi^PF>V&UxqIx~WsiB+D?FOxV74 zEBf{CPp*^{TKd&j=-j0Xswyi90Cw)!0h`SRlgWgXl$6BOG9=!8_uUV+737bmvEA)T z3~;O%Q50Da1d5dlpkOe_eGB_y?q}~&s+@v?l%5>XBGClatRc;uii5sGy!FryI{lQ> zU`+S+bKZ|J@wc7~Ns6_d40W`A%ysmMqbLdwJn=+)`tirKYsU@{5sw}_mLlOW3VQcO zMrJ0y{pK6qw`UJ!W@VwUu#i?RU(Rb*ug0JuLulZ@fmr_Ccf5YxIvO!*6n3cGgg z!b#)CahEP#C=!XF^3Wmb)w?(6=H+3_rcLyl%Pzx??b~_Ru3coc+0d_le?-Dz^eQOe zg!p!*y1F{;U!4Od8Ag_6mL!P+fq38{+iW&`_St7NW5(-vdF)dhVTJUfwjv2=P`rH0 zvU}*o=`V2KzI`c{{`P0j=_3dND~f`$vNAeSRRtDI%&d^zYDMqf1+ZGJ&@|1MRphv` zacG*xHk%EiC{iF0fZc9qMTy4j`+UBr7XlH7LLstRt-N!`4yvrIf#+64uS87TseYxx_SjmdssXZy06f=r( zNe&zd*U*~%>o9Tr1kx>Ab(M|)00c})L_t*UKiB=}zXbvTG&D5eNL3X_OjlMvOS>TVS-vGojlNu{V8@780f&f)j;cz<9 zr?3!#KmcB^7wH)p=+(P7JdKTr)xBtv<&;{f6qqavelpt@8BWqJA?{y^X=rG`B@-?| zabqc!`VT-Br1*^o)F2H^?+d$T#kTF+^z5xaYuktjzMw)!yi6t40r)~1G}frJI*8IE zelUsp!T-{J)3cC-qALmMC7{Bg5TWHdqd%%`LTjdYW1+J4n(vPX)53R*Sf!Zm-MVAs z&=LGa$r2ERcx{Ym35^Ur-h`cff_0?Xpjgx0b|5CuAJw}+psZ7pCD zCc{rMK0=ZU8to`8c^Ceqm{!gHg20-l@rCDJh#l3tIS|d{!H95OZfm!NWCDT^iP1VKwJ~z*xvPUupMop z+D=KGl(|1EJG+^got>G7#bN=Yu&t5x6z=G`-$Jj&I15~U*0LB33%-IZdV~-Nf*yv$A%x@L;;aWL9Q6BrOsCV@a?hur>wPfm?uojOJ@kR^Uog9f zV>_^H3$f07x{T(Ew&P(n4^h{5z3+Mow7loF%S2;=cM=P}FMarkers With Custom Icons

    Using GeoJSON with Leaflet

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.


    - -

    Layer Groups and Layers Control

    + + +

    Layer Groups and Layers Control

    A tutorial on how to manage groups of layers and use the layer switching control.


    diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html index d852b2d6322..f0b2aa84fed 100644 --- a/examples/layers-control-example.html +++ b/examples/layers-control-example.html @@ -28,16 +28,16 @@ map.setView(new L.LatLng(39.7346, -104.9894), 10).addLayer(minimal).addLayer(motorways); - baseMaps = { + var baseMaps = { "Minimal": minimal, "Night View": midnightCommander }; - overlayMaps = { + var overlayMaps = { "Motorways": motorways }; - layersControl = new L.Control.Layers(baseMaps, overlayMaps); + var layersControl = new L.Control.Layers(baseMaps, overlayMaps); map.addControl(layersControl); diff --git a/examples/layers-control.html b/examples/layers-control.html new file mode 100644 index 00000000000..022e7e0f1c7 --- /dev/null +++ b/examples/layers-control.html @@ -0,0 +1,146 @@ + + + + Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Layers Control Example + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Leaflet

    +

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    + + + +

    ← Back to the list of examples

    +

    Layers Control

    + +

    This guide will show to add a simple layers control to your map that will control the visibility of base maps and overlays.

    + +
    + + +

    View example on a separate page →

    + +

    The first steps are to create a map and some layers, and to add at least one of those layers to the map. The minimal and midnightCommander layers will be our base layers and motorways will be an overlay. Only one base layer should be added but multiple overlays can be added initially.

    + +
    var map = new L.Map('map');
    +		
    +var minimalUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/22677/256/{z}/{x}/{y}.png',
    +	minimalAttribution = 'Minimal Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    +	minimal = new L.TileLayer(minimalUrl, {maxZoom: 18, attribution: minimalAttribution});
    +			
    +var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/999/256/{z}/{x}/{y}.png',
    +	midnightCommanderAttribution = 'Night View Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    +	midnightCommander = new L.TileLayer(midnightCommanderUrl, {maxZoom: 18, attribution: midnightCommanderAttribution});
    +			
    +var motorwaysUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/46561/256/{z}/{x}/{y}.png',
    +	motorwaysAttribution = 'Motorways Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    +	motorways = new L.TileLayer(motorwaysUrl, {maxZoom: 18, attribution: motorwaysAttribution});
    +		
    +map.setView(new L.LatLng(39.7346, -104.9894), 10).addLayer(minimal).addLayer(motorways);
    + +

    Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are very simple objects with simple key/value pairs. The key is what sets the text for the layer in the control ( "Night View" ). The corresponding value is just a reference to the layer ( midnightCommander ).

    + +
    var baseMaps = {
    +	"Minimal": minimal,
    +	"Night View": midnightCommander
    +};
    +		
    +var overlayMaps = {
    +    "Motorways": motorways
    +};
    + + +

    Now, all that's left to do is to create a Layers Control and add it to the map. The first parameter passed when creating the layers control is the base layers object. The second, and optional, parameter is the overlays object.

    + +
    var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
    +		
    +map.addControl(layersControl);
    + +
    + +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +
    + + Fork me on GitHub + + + + + + \ No newline at end of file From e6e3e9bfc43f632a09d45ed2298559ca12694276 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 13 Oct 2011 19:17:22 -0400 Subject: [PATCH 068/816] Added a sentence about base layers being mutually exclusive. --- examples/layers-control.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/layers-control.html b/examples/layers-control.html index 022e7e0f1c7..972c30ae326 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -42,7 +42,7 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    ← Back to the list of examples

    Layers Control

    -

    This guide will show to add a simple layers control to your map that will control the visibility of base maps and overlays.

    +

    This guide will show to add a simple layers control to your map that will control the visibility of base maps and overlays. Base layers are mutually exclusive, so only one is visble at a time while any number of overlays can be visible at any given time.

    - \ No newline at end of file diff --git a/examples/layers-control.html b/examples/layers-control.html index 972c30ae326..b0dba4ced4d 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -45,7 +45,27 @@

    Layers Control

    This guide will show to add a simple layers control to your map that will control the visibility of base maps and overlays. Base layers are mutually exclusive, so only one is visble at a time while any number of overlays can be visible at any given time.

    -

    View example on a separate page →

    -

    The first steps are to create a map and some layers, and to add at least one of those layers to the map. The minimal and midnightCommander layers will be our base layers and motorways will be an overlay. Only one base layer should be added but multiple overlays can be added initially.

    +

    The first steps are to create a map and some layers, and to add at least one of those layers to the map. The minimal and midnightCommander layers will be our base layers. citiesLayer and motorways will be overlays. Only one base layer should be added but multiple overlays can be added initially. The citiesLayer is a LayerGroup which makes it very easy to add lots of markers, linestrings or polygons to the map and easily remove all of them by unchecking the layer in the layers control.

    var map = new L.Map('map');
     		
    @@ -93,8 +122,11 @@ 

    Layers Control

    var motorwaysUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/46561/256/{z}/{x}/{y}.png', motorwaysAttribution = 'Motorways Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', motorways = new L.TileLayer(motorwaysUrl, {maxZoom: 18, attribution: motorwaysAttribution}); + +var citiesLayer = new L.LayerGroup(); +// Create some markers. Add them to citiesLayer. View source to see in detail. -map.setView(new L.LatLng(39.7346, -104.9894), 10).addLayer(minimal).addLayer(motorways);
    +map.setView(new L.LatLng(39.7346, -104.9894), 10).addLayer(minimal).addLayer(motorways).addLayer(citiesLayer);

    Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are very simple objects with simple key/value pairs. The key is what sets the text for the layer in the control ( "Night View" ). The corresponding value is just a reference to the layer ( midnightCommander ).

    @@ -104,7 +136,8 @@

    Layers Control

    }; var overlayMaps = { - "Motorways": motorways + "Motorways": motorways, + "Cities": citiesLayer }; From 39f90699f7e424183d0f5bdecd21bcabce24e956 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 27 Oct 2011 16:37:48 +0300 Subject: [PATCH 072/816] clean up and rewrite the layers example --- examples/layers-control-example.html | 96 +++++-------- examples/layers-control.html | 203 ++++++++++++++------------- 2 files changed, 145 insertions(+), 154 deletions(-) diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html index fe46f9e05f6..9532d7e8e72 100644 --- a/examples/layers-control-example.html +++ b/examples/layers-control-example.html @@ -11,64 +11,46 @@
    - \ No newline at end of file diff --git a/examples/layers-control.html b/examples/layers-control.html index b0dba4ced4d..3a77747d6e6 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -40,113 +40,122 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    ← Back to the list of examples

    -

    Layers Control

    +

    Layer Groups and Layers Control

    -

    This guide will show to add a simple layers control to your map that will control the visibility of base maps and overlays. Base layers are mutually exclusive, so only one is visble at a time while any number of overlays can be visible at any given time.

    +

    This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

    -

    View example on a separate page →

    + +

    Layer Groups

    + +

    Lets suppose you have a bunch of layers you want to combine into a group to handle them as one in your code:

    + +
    var littletonMarker = new L.Marker(new L.LatLng(39.61, -105.02)).bindPopup("This is Littleton, CO."),
    +	denverMarker = new L.Marker(new L.LatLng(39.74, -104.99)).bindPopup("This is Denver, CO."),
    +	auroraMarker = new L.Marker(new L.LatLng(39.73, -104.8)).bindPopup("This is Aurora, CO."),
    +	goldenMarker = new L.Marker(new L.LatLng(39.77, -105.23)).bindPopup("This is Golden, CO.");
    + +

    Instead of adding them directly to the map, you can do the following, using the LayerGroup class:

    + +
    var citiesLayer = new L.LayerGroup();
    +
    +citiesLayer.addLayer(littletonMarker)
    +           .addLayer(denverMarker)
    +           .addLayer(auroraMarker)
    +           .addLayer(goldenMarker);
    +
    +map.addLayer(citiesLayer);
    + +

    Easy enough! Now you have citiesLayer that combines your city markers into one layer you can add or remove from the map at once.

    + +

    Layers Control

    + +

    Leaflet has a nice little control that allows your users control what layers they want to see on your map. In addition to showing you how to use it, we'll show another handy use for layer groups.

    + +

    There are two types of layers — base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays — all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off — a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map:

    + +
    var cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
    +	cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution};
    +
    +var minimalUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/22677/256/{z}/{x}/{y}.png',
    +	minimal = new L.TileLayer(minimalUrl, cloudmadeOptions);
    +
    +var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/999/256/{z}/{x}/{y}.png',
    +	midnightCommander = new L.TileLayer(midnightCommanderUrl, cloudmadeOptions);
    +
    +var motorwaysUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/46561/256/{z}/{x}/{y}.png',
    +	motorways = new L.TileLayer(motorwaysUrl, cloudmadeOptions);
    +
    +var map = new L.Map('map', {
    +	center: new L.LatLng(39.73, -104.99),
    +	zoom: 10,
    +	layers: [minimal, motorways, citiesLayer]
    +});
    + +

    Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. midnightCommander).

    -

    The first steps are to create a map and some layers, and to add at least one of those layers to the map. The minimal and midnightCommander layers will be our base layers. citiesLayer and motorways will be overlays. Only one base layer should be added but multiple overlays can be added initially. The citiesLayer is a LayerGroup which makes it very easy to add lots of markers, linestrings or polygons to the map and easily remove all of them by unchecking the layer in the layers control.

    - -
    var map = new L.Map('map');
    -		
    -var minimalUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/22677/256/{z}/{x}/{y}.png',
    -	minimalAttribution = 'Minimal Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    -	minimal = new L.TileLayer(minimalUrl, {maxZoom: 18, attribution: minimalAttribution});
    -			
    -var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/999/256/{z}/{x}/{y}.png',
    -	midnightCommanderAttribution = 'Night View Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    -	midnightCommander = new L.TileLayer(midnightCommanderUrl, {maxZoom: 18, attribution: midnightCommanderAttribution});
    -			
    -var motorwaysUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/46561/256/{z}/{x}/{y}.png',
    -	motorwaysAttribution = 'Motorways Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    -	motorways = new L.TileLayer(motorwaysUrl, {maxZoom: 18, attribution: motorwaysAttribution});
    -
    -var citiesLayer = new L.LayerGroup();
    -// Create some markers. Add them to citiesLayer. View source to see in detail.
    -		
    -map.setView(new L.LatLng(39.7346, -104.9894), 10).addLayer(minimal).addLayer(motorways).addLayer(citiesLayer);
    +
    var baseMaps = {
    +	"Minimal": minimal,
    +	"Night View": midnightCommander
    +};
     		
    -		

    Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are very simple objects with simple key/value pairs. The key is what sets the text for the layer in the control ( "Night View" ). The corresponding value is just a reference to the layer ( midnightCommander ).

    - -
    var baseMaps = {
    -	"Minimal": minimal,
    -	"Night View": midnightCommander
    -};
    -		
    -var overlayMaps = {
    -    "Motorways": motorways,
    -    "Cities": citiesLayer
    +var overlayMaps = {
    +    "Motorways": motorways,
    +    "Cities": citiesLayer
     };
    - - -

    Now, all that's left to do is to create a Layers Control and add it to the map. The first parameter passed when creating the layers control is the base layers object. The second, and optional, parameter is the overlays object.

    - -
    var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
    -		
    -map.addControl(layersControl);
    + +

    Now, all that's left to do is to create a Layers Control and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional — for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing null as the first argument.

    + +
    var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
    +		
    +map.addControl(layersControl);
    + +

    Now lets view the result on a separate page →

    +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    From e38ca2cc06bf5c09fd2cc78045161fb971b41347 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 27 Oct 2011 17:30:57 +0300 Subject: [PATCH 073/816] make layers control example simpler --- examples/layers-control.html | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/examples/layers-control.html b/examples/layers-control.html index 3a77747d6e6..9201a3fa67a 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -59,16 +59,12 @@

    Layer Groups and Layers Control

    citiesLayer.addLayer(goldenMarker); var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', - cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution}; + cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution}, + cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png'; - var minimalUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/22677/256/{z}/{x}/{y}.png', - minimal = new L.TileLayer(minimalUrl, cloudmadeOptions); - - var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/999/256/{z}/{x}/{y}.png', - midnightCommander = new L.TileLayer(midnightCommanderUrl, cloudmadeOptions); - - var motorwaysUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/46561/256/{z}/{x}/{y}.png', - motorways = new L.TileLayer(motorwaysUrl, cloudmadeOptions); + var minimal = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 22677}), + midnightCommander = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 999}), + motorways = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 46561}); var map = new L.Map('map', {center: new L.LatLng(39.73, -104.99), zoom: 10, layers: [minimal, motorways, citiesLayer]}); @@ -117,17 +113,13 @@

    Layers Control

    There are two types of layers — base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays — all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off — a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map:

    -
    var cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
    +		
    var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/{styleId}/256/{z}/{x}/{y}.png',
    +	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
     	cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution};
     
    -var minimalUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/22677/256/{z}/{x}/{y}.png',
    -	minimal = new L.TileLayer(minimalUrl, cloudmadeOptions);
    -
    -var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/999/256/{z}/{x}/{y}.png',
    -	midnightCommander = new L.TileLayer(midnightCommanderUrl, cloudmadeOptions);
    -
    -var motorwaysUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/46561/256/{z}/{x}/{y}.png',
    -	motorways = new L.TileLayer(motorwaysUrl, cloudmadeOptions);
    +var minimal = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 22677}),
    +	midnightCommander = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 999}),
    +	motorways = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 46561});
     
     var map = new L.Map('map', {
     	center: new L.LatLng(39.73, -104.99),
    
    From 9a456b14e338fbd6cb69551f9d956bc28226287b Mon Sep 17 00:00:00 2001
    From: mourner 
    Date: Thu, 27 Oct 2011 17:39:05 +0300
    Subject: [PATCH 074/816] cleanup
    
    ---
     examples/layers-control-example.html | 14 +++++---------
     1 file changed, 5 insertions(+), 9 deletions(-)
    
    diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html
    index 9532d7e8e72..59846036411 100644
    --- a/examples/layers-control-example.html
    +++ b/examples/layers-control-example.html
    @@ -25,16 +25,12 @@
     		citiesLayer.addLayer(goldenMarker);
     
     		var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    -			cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution};
    +				cloudmadeOptions = {maxZoom: 18, attribution: cloudmadeAttribution},
    +				cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png';
     
    -		var minimalUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/22677/256/{z}/{x}/{y}.png',
    -			minimal = new L.TileLayer(minimalUrl, cloudmadeOptions);
    -
    -		var midnightCommanderUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/999/256/{z}/{x}/{y}.png',
    -			midnightCommander = new L.TileLayer(midnightCommanderUrl, cloudmadeOptions);
    -
    -		var motorwaysUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/46561/256/{z}/{x}/{y}.png',
    -			motorways = new L.TileLayer(motorwaysUrl, cloudmadeOptions);
    +		var minimal = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 22677}),
    +			midnightCommander = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 999}),
    +			motorways = new L.TileLayer(cloudmadeUrl, cloudmadeOptions, {styleId: 46561});
     
     		var map = new L.Map('map', {center: new L.LatLng(39.73, -104.99), zoom: 10, layers: [minimal, motorways, citiesLayer]});
     
    
    From d432e562b53185f97004d6eeccbd5b77cac6c4d2 Mon Sep 17 00:00:00 2001
    From: mourner 
    Date: Fri, 28 Oct 2011 15:18:03 +0300
    Subject: [PATCH 075/816] compatibility notice
    
    ---
     examples/layers-control.html | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/examples/layers-control.html b/examples/layers-control.html
    index 9201a3fa67a..285bdf59d9c 100644
    --- a/examples/layers-control.html
    +++ b/examples/layers-control.html
    @@ -43,6 +43,7 @@ 

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    Layer Groups and Layers Control

    This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

    +

    Note: this only works in the latest (master) version of Leaflet.

    + + +

    +

    Download Leaflet

    - +

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

    Download Leaflet 0.2.1 (zip, stable)
    Download Leaflet master (zip, development version)

    - +

    View Changelog

    - -

    - - - - - -

    - +

    Including Leaflet on your page

    Place the contents of the dist folder somewhere in your directory tree and include it in the head section of your HTML with the following code:

    -
    <!-- Leaflet CSS --> 
    +		
    <!-- Leaflet CSS -->
     <link rel="stylesheet" href="<path_to_dist>/leaflet.css" />
     <!--[if lte IE 8]><link rel="stylesheet" href="<path_to_dist>/leaflet.ie.css" /><![endif]-->
     
     <!-- Leaflet JavaScript -->
     <script src="<path_to_dist>/leaflet.js"></script>
    - +

    Building a custom version of Leaflet

    Open build/build.html page from the download package, check the components you want to see in your build and then follow the instructions there.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/examples.html b/examples.html index 8f54c81438d..3bc6ef7256a 100644 --- a/examples.html +++ b/examples.html @@ -2,11 +2,11 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Examples - + - + - + @@ -28,37 +28,40 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - -

    Leaflet examples

    - -

    Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers.

    - +

    + + + - + - - + +

    - + +

    Leaflet examples

    + +

    Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers.

    +
    - +

    Leaflet Quick Start Guide

    A simple step-by-step guide that will quickly get you started with Leaflet basics, including setting up a Leaflet map (with CloudMade tiles) on your page, working with markers, polylines and popups, and dealing with events.

    - +
    - +

    Leaflet on Mobile

    In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

    @@ -67,13 +70,13 @@

    Leaflet on Mobile

    Markers With Custom Icons

    In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map.

    -
    - - -

    Using GeoJSON with Leaflet

    -

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.


    - + + +

    Using GeoJSON with Leaflet

    +

    In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    +
    +

    Layer Groups and Layers Control

    A tutorial on how to manage groups of layers and use the layer switching control.

    @@ -92,18 +95,18 @@

    OOP in Leaflet


    More examples coming soon!

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/features.html b/features.html index 8c038f371c7..89d6c2af830 100644 --- a/features.html +++ b/features.html @@ -2,11 +2,11 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Features - + - + - + @@ -28,29 +28,32 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - -

    Leaflet features

    - -

    Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being flexible enough to be easily extended by writing third-party plugins.

    - +

    + + + - + - - + +

    +

    Leaflet features

    + +

    Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being flexible enough to be easily extended by writing third-party plugins.

    +

    Available map layers

    @@ -65,8 +68,8 @@

    Available map layers

  • KML
  • GeoRSS
  • - -

    Interaction features

    + +

    Interaction features

    On desktop browsers

    • Drag panning
    • @@ -81,8 +84,8 @@

      On mobile browsers (iOS, Android)

    • Double tap zoom
    • Panning inertia
    -
    - +
    +

    Visual features

      @@ -92,7 +95,7 @@

      Visual features

    • Tile and popup fade animation
    • Very nice default design for markers and popups
    - +

    Customization features

    • Pure CSS3 popups and controls for easy restyling
    • @@ -108,9 +111,9 @@

      Performance features

    • Clever tricks to make panning and zooming really smooth
    • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
    • Modular build system allows you to reduce the size of the library by leaving out the code you don't need
    • -
    +
    - +

    Map controls

      @@ -120,7 +123,7 @@

      Map controls

    • Layer switcher
    - +

    Browser support

    On desktop

      @@ -142,22 +145,22 @@

      On mobile

    - +

    If you find some feature really missing in Leaflet, please submit it to the issue tracker.

    * Grayed out features are in the roadmap and coming soon.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/index.html b/index.html index 891b5c58147..2c490029b70 100644 --- a/index.html +++ b/index.html @@ -2,21 +2,21 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - + - + - + - + - + @@ -29,46 +29,51 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - - -

    Leaflet is a modern, lightweight BSD-licensed JavaScript library for making tile-based interactive maps for both desktop and mobile web browsers, developed by CloudMade to form the core of its next generation JavaScript API.

    -

    It is built from the ground up to work efficiently and smoothly on both platforms, utilizing cutting-edge technologies included in HTML5. Its top priorities are usability, performance, small size, A-grade browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand. Find out more on the features page.

    - + +

    + + + - + + - - + +

    - + + +

    Leaflet is a modern, lightweight BSD-licensed JavaScript library for making tile-based interactive maps for both desktop and mobile web browsers, developed by CloudMade to form the core of its next generation JavaScript API.

    +

    It is built from the ground up to work efficiently and smoothly on both platforms, utilizing cutting-edge technologies included in HTML5. Its top priorities are usability, performance, small size, A-grade browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand. Find out more on the features page.

    +

    Basic usage example

    - +

    Here we create a map with a CloudMade tile layer, add a marker and bind a popup with some text to it:

    // create a CloudMade tile layer
     var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
    @@ -92,14 +97,14 @@ 

    Basic usage example

    Contributing to Leaflet

    The project is hosted on GitHub, waiting for your contributions — just send your pull requests to Vladimir Agafonkin (Leaflet maintainer). Let's make the best library for maps that can possibly exist!

    -

    You can also help the project a lot by reporting bugs and discussing features on the issues page or tweeting to @LeafletJS. - +

    You can also help the project a lot by reporting bugs and discussing features on the issues page or tweeting to @LeafletJS. +


    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + - \ No newline at end of file + diff --git a/reference.html b/reference.html index 539b766b72a..f659a2f9f84 100644 --- a/reference.html +++ b/reference.html @@ -2,9 +2,9 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Documentation - + - + @@ -26,17 +26,30 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - + +

    + + + + + + + + +

    + +
    +

    Map

    @@ -140,32 +153,23 @@

    Interfaces

  • IProjection
  • ICRS
  • - +

    Misc

    - -
    -

    - - - - - -

    L.Map

    - +

    The central class of the API — it is used to create a map on a page and manipulate it.

    - +

    Usage example

    - -
    // initialize the map on the "map" div with a given center and zoom 
    +
    +		
    // initialize the map on the "map" div with a given center and zoom
     var map = new L.Map('map', {
    -	center: new L.LatLng(51.505, -0.09), 
    +	center: new L.LatLng(51.505, -0.09),
     	zoom: 13
     });
     
    @@ -175,9 +179,9 @@ 

    Usage example

    // add the CloudMade layer to the map map.addLayer(cloudmade);
    - +

    Constructor

    - + @@ -188,9 +192,9 @@

    Constructor

    Constructor Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
    - +

    Options

    - + @@ -295,17 +299,17 @@

    Options

    Option Set it to false if you don't want popups to close when user clicks the map.
    - +

    Properties

    - +

    Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

    - +
    map.doubleClickZoom.disable();
    - +

    You can also access default map controls like attribution control through map properties:

    - +
    map.attributionControl.addAttribution("Earthquake data &copy; GeoNames");
    - + @@ -343,12 +347,12 @@

    Properties

    Property Attribution control.
    - - + +

    Events

    - +

    You can subscribe to the following events using these methods.

    - + @@ -445,12 +449,12 @@

    Events

    Event PopupEvent Fired when a popup is closed (using closePopup method).
    - - + +

    Projections

    - +

    You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

    - + @@ -469,12 +473,12 @@

    Projections

    CRS EPSG:4326 (Mercator), used by some map providers.
    - - + +

    Map panes

    - +

    An object literal that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

    - + @@ -517,11 +521,11 @@

    Map panes

    Property Pane for popups.
    - - - + + +

    Methods that modify map state

    - + @@ -586,7 +590,7 @@

    Methods that modify map state

    Method

    Methods that get map state

    - + @@ -644,9 +648,9 @@

    Methods that get map state

    Method Returns an object for accessing different panes of the map (tile pane, marker pane, etc.).
    - +

    Methods for layers and controls

    - + @@ -658,7 +662,7 @@

    Methods for layers and controls

    - + @@ -680,10 +684,10 @@

    Methods for layers and controls

    addLayer( <ILayer> layer ) this Removes the given layer from the map.
    openPopup( <Popuppopup ) this Removes the given control from the map.
    - - + +

    Conversion methods

    - + @@ -736,9 +740,9 @@

    Conversion methods

    Method Projects the given pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
    - +

    Other methods

    - + @@ -803,18 +807,18 @@

    Locate options

    Method Enables high accuracy, see description in the W3C spec.
    - - + +

    L.Marker

    - +

    Used to put markers on the map.

    - +

    Usage example

    var marker = new L.Marker(latlng);
     map.addLayer(marker);
    - +

    Constructor

    - + @@ -825,9 +829,9 @@

    Constructor

    Constructor Instantiates a Marker object given a geographical point and optionally an options object.
    - +

    Options

    - + @@ -854,11 +858,11 @@

    Options

    Option Whether the marker is draggable with mouse/touch or not.
    - +

    Events

    - +

    You can subscribe to the following events using these methods.

    - + @@ -891,9 +895,9 @@

    Events

    Event Fired when the user stops dragging the marker.
    - +

    Methods

    - + @@ -921,13 +925,13 @@

    Methods

    Method Opens the popup previously bound by the bindPopup method.
    - +

    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 IHandler methods). Example:

    - +
    marker.dragging.disable();
    - + @@ -940,27 +944,27 @@

    Interaction handlers

    Property Marker dragging handler (by both mouse and touch).
    - - - + + + - +

    Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.

    - +

    Usage example

    If you want to just bind a popup to marker click and then open it, it's really easy:

    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:

    -
    var popupContent = '<p>Hello world!<br />This is a nice popup.</p>', 
    +		
    var popupContent = '<p>Hello world!<br />This is a nice popup.</p>',
     	popup = new L.Popup();
     
     popup.setLatLng(latlng);
     popup.setContent(popupContent);
     
     map.openPopup(popup);
    - +

    Constructor

    - + @@ -971,9 +975,9 @@

    Constructor

    Constructor Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.
    - + - + @@ -1006,9 +1010,9 @@
    Option The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays.
    - +

    Methods

    - + @@ -1026,20 +1030,20 @@

    Methods

    Method Sets the HTML content of the popup.
    - - - + + +

    L.TileLayer

    - +

    Used to load and display tile layers on the map, implements ILayer interface.

    - +

    Usage example

    - +
    var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
     	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
    - +

    Constructor

    - + @@ -1050,14 +1054,14 @@

    Constructor

    Constructor Instantiates a tile layer object given a URL template and optionally an options object.
    - +

    URL template

    A string of the following form:

    'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'
    -

    {s} means one of the randomly chosen subdomains (their range is specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

    +

    {s} means one of the randomly chosen subdomains (their range is specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

    Options

    - + @@ -1070,7 +1074,7 @@

    Options

    - + @@ -1120,24 +1124,24 @@

    Options

    Option Number 0 Minimum zoom number.
    maxZoom Number If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false.
    - - - + + +

    L.TileLayer.WMS

    - +

    Used to display WMS services as tile layers on the map. Extends TileLayer, implements ILayer interface.

    - +

    Usage example

    - +
    var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
     	layers: 'nexrad-n0r-900913',
     	format: 'image/png',
     	transparent: true,
     	attribution: "Weather data © 2011 IEM Nexrad"
     });
    - +

    Constructor

    - + @@ -1148,11 +1152,11 @@

    Constructor

    Constructor Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
    - +

    Options

    - +

    Includes all TileLayer options and additionally:

    - + @@ -1165,7 +1169,7 @@

    Options

    - + @@ -1191,24 +1195,24 @@

    Options

    Option String - (required) Comma-separated list of WMS layers to show.
    styles String Version of the WMS service to use.
    - - - + + +

    L.TileLayer.Canvas

    - +

    Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer, implements ILayer interface.

    - +

    Usage example

    - +
    var canvasTiles = new L.TileLayer.Canvas();
    -		
    +
     canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
     	var ctx = canvas.getContext('2d');
     	// draw something on the tile canvas
     }
    - +

    Constructor

    - + @@ -1219,9 +1223,9 @@

    Constructor

    Constructor Instantiates a Canvas tile layer object given an options object (optionally).
    - +

    Methods

    - + @@ -1237,20 +1241,20 @@

    Methods

    L.ImageOverlay

    - +

    Used to load and display a single image over specific bounds of the map, implements ILayer interface.

    - +

    Usage example

    - +
    var imageBounds = new L.LatLngBounds(
     		new L.LatLng(40.712216,-74.22655),
     		new L.LatLng(40.773941,-74.12544));
    -		
    +
     var image = new L.ImageOverlay(
     		"http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg", imageBounds);
    - +

    Constructor

    - +
    Method
    @@ -1261,13 +1265,13 @@

    Constructor

    Constructor Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
    - - + +

    L.Path

    An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly. - +

    Options

    @@ -1325,11 +1329,11 @@

    Options

    If false, the vector will not emit mouse events and will act as a part of the underlying map.
    - +

    Events

    - +

    You can subscribe to the following events using these methods.

    - + @@ -1347,7 +1351,7 @@

    Events

    Event Fired when the user double-clicks (or double-taps) the object.
    - +

    Constants

    @@ -1375,7 +1379,7 @@

    Constants

    How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
    - +

    Methods

    @@ -1398,13 +1402,13 @@

    Methods

    -
    LatLngBounds Returns the LatLngBounds of the path.
    - - + + +

    L.Polyline

    - +

    A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    - +

    Usage example

    // create a red polyline from an arrays of LatLng points
     var polyline = new L.Polyline(latlngs, {color: 'red'});
    @@ -1414,9 +1418,9 @@ 

    Usage example

    // add the polyline to the map map.addLayer(polyline);
    - +

    Constructor

    - + @@ -1427,11 +1431,11 @@

    Constructor

    Constructor Instantiates a polyline object given an array of geographical points and optionally an options object.
    - +

    Options

    - +

    You can use Path options and additionally the following options:

    - + @@ -1451,12 +1455,12 @@

    Options

    -
    Option false Disabled polyline clipping.
    +

    Methods

    - +

    You can use Path methods and additionally the following methods:

    - + @@ -1489,15 +1493,15 @@

    Methods

    Method Returns the LatLngBounds of the polyline.
    - - - + + +

    L.MultiPolyline

    - +

    Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

    - +

    Constructor

    - + @@ -1508,15 +1512,15 @@

    Constructor

    Constructor Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
    - - - + + +

    L.Polygon

    - +

    A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

    - +

    Constructor

    - + @@ -1527,17 +1531,17 @@

    Constructor

    Constructor Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
    - +

    Polygon the same options and methods as Polyline.

    - - - + + +

    L.MultiPolygon

    - +

    Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

    - +

    Constructor

    - + @@ -1548,16 +1552,16 @@

    Constructor

    Constructor Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
    - - - - + + + +

    L.Circle

    - +

    A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

    - +

    Constructor

    - + @@ -1568,9 +1572,9 @@

    Constructor

    Constructor Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
    - +

    Methods

    - + @@ -1583,15 +1587,15 @@

    Methods

    Method Sets the position of a circle to a new location.
    - - - + + +

    L.CircleMarker

    - +

    A circle of a fixed size with radius specified in pixels. Extends Circe. Use Map#addLayer to add it to the map.

    - +

    Constructor

    - + @@ -1602,9 +1606,9 @@

    Constructor

    Constructor Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
    - +

    Methods

    - + @@ -1617,23 +1621,23 @@

    Methods

    Method Sets the position of a circle marker to a new location.
    - - - + + +

    L.LayerGroup

    - +

    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. Implements ILayer interface.

    - +
    var group = new L.LayerGroup();
     
     group.addLayer(marker1);
     group.addLayer(marker2);
     group.addLayer(polyline);
    -		
    +
     map.addLayer(group);
    - +

    Constructor

    - + @@ -1644,9 +1648,9 @@

    Constructor

    Constructor Create a layer group, optionally given an initial set of layers.
    - +

    Methods

    - + @@ -1669,25 +1673,25 @@

    Methods

    Method Removes all the layers from the group.
    - - - + + +

    L.FeatureGroup

    - +

    Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

    - +
    var group = new L.FeatureGroup([marker1, marker2, polyline]);
     
     group.bindPopup('Hello world!');
     
    -group.on('click', function() { 
    -	alert('Clicked on a group!'); 
    +group.on('click', function() {
    +	alert('Clicked on a group!');
     });
    -		
    +
     map.addLayer(group);
    - +

    Constructor

    - + @@ -1698,11 +1702,11 @@

    Constructor

    Constructor Create a layer group, optionally given an initial set of layers.
    - +

    Methods

    - +

    Has all LayerGroup methods and additionally:

    - + @@ -1715,11 +1719,11 @@

    Methods

    Method Binds a popup with a particular HTML content to a click on any layer from the group.
    - +

    Events

    - +

    You can subscribe to the following events using these methods.

    - + @@ -1737,23 +1741,23 @@

    Events

    Event Fired when the user double-clicks (or double-taps) on the group.
    - - + +

    L.GeoJSON

    - +

    Represents a GeoJSON layer. Allows you to parse GeoJSON data and display on the map. Extends LayerGroup.

    - +
    var geojson = new L.GeoJSON();
     
     geojson.on('featureparse', function(e) {
     	// do something with e.layer depending on e.properties
     });
     geojson.addGeoJSON(geojsonObj);
    -		
    +
     map.addLayer(geojson);
    - +

    Constructor

    - + @@ -1764,9 +1768,9 @@

    Constructor

    Constructor Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it with addGeoJSON method) and an options object.
    - +

    Options

    - + @@ -1781,12 +1785,12 @@

    Options

    Option Function of the form (LatLng)->ILayer that will be used for creating layers for GeoJSON points (if not specified, markers will be created).
    - - + +

    Events

    - +

    You can subscribe to the following events using these methods.

    - + @@ -1799,11 +1803,11 @@

    Events

    Event Fired before an object converted from a GeoJSON feature is added to the map. This event can be used to add interaction or change styling of objects depending on feature properties.
    - - - + + +

    Methods

    - + @@ -1816,9 +1820,9 @@

    Methods

    Method Adds a GeoJSON object to the layer.
    - +

    Static methods

    - + @@ -1841,17 +1845,17 @@

    Static methods

    Method Creates a multidimensional array of LatLng objects 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).
    - - - - + + + +

    L.LatLng

    - +

    Represents a geographical point with a certain latitude and longitude.

    var latlng = new L.LatLng(50.5, 30.5);
    - +

    Constructor

    - + @@ -1862,9 +1866,9 @@

    Constructor

    Constructor Creates a LatLng object with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument.
    - +

    Properties

    - + @@ -1882,9 +1886,9 @@

    Properties

    Property Longitude in degrees.
    - +

    Methods

    - + @@ -1902,9 +1906,9 @@

    Methods

    Method Returns a string representation of the point (for debugging purposes).
    - +

    Constants

    - + @@ -1931,19 +1935,19 @@

    Constants

    Constant Max margin of error for the equality check.
    - - - - + + + +

    L.LatLngBounds

    - +

    Represents a rectangular geographical area on a map.

    var southWest = new L.LatLng(40.712,-74.227),
     	northEast = new L.LatLng(40.774,-74.125),
     	bounds = new L.LatLngBounds(southWest, northEast);
    - +

    Constructor

    - + @@ -1958,9 +1962,9 @@

    Constructor

    Constructor 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.
    - +

    Methods

    - + @@ -2008,16 +2012,16 @@

    Methods

    Method Returns true if the rectangle contains the given point.
    - - - + + +

    L.Point

    - +

    Represents a point with x and y coordinates in pixels. - +

    Constructor

    - + @@ -2100,16 +2104,16 @@

    Methods

    Constructor
    - +

    L.Bounds

    - +

    Represents a rectangular area in pixel coordinates.

    var p1 = new L.Point(10, 10),
     	p2 = new L.Point(40, 60),
     	bounds = new L.Bounds(p1, p2);
    - +

    Constructor

    - + @@ -2124,9 +2128,9 @@

    Constructor

    Constructor Creates a Bounds object defined by the points it contains.
    - +

    Properties

    - + @@ -2144,9 +2148,9 @@

    Properties

    Property The bottom right corner of the rectangle.
    - +

    Methods

    - + @@ -2174,12 +2178,12 @@

    Methods

    Method Returns true if the rectangle contains the given point.
    - - + +

    L.Icon

    - +

    Represents an icon to provide when creating a marker. If you want to create your own icon, you need to extend this class like this:

    - +
    var MyIcon = L.Icon.extend({
     	iconUrl: 'my-icon.png',
     	shadowUrl: 'my-icon-shadow.png',
    @@ -2194,7 +2198,7 @@ 

    L.Icon

    var marker = new L.Marker(marker, {icon: icon});

    Properties

    - + @@ -2232,9 +2236,9 @@

    Properties

    Property The point from which the marker popup opens, relative to the anchor point.
    - +

    Constructor

    - + @@ -2245,13 +2249,13 @@

    Constructor

    Constructor Creates an icon instance. You can optionally pass an iconUrl that will replace the default one (useful for creating many similar markers that only differ in the icon image).
    - - - + + +

    L.Control.Zoom

    - +

    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 to false. Implements IControl interface.

    - +

    Constructor

    @@ -2263,13 +2267,13 @@

    Constructor

    Creates a zoom control.
    - - - + + +

    L.Control.Attribution

    - +

    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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Implements IControl interface.

    - +

    Constructor

    @@ -2281,7 +2285,7 @@

    Constructor

    Creates an attribution control.
    - +

    Methods

    @@ -2305,19 +2309,19 @@

    Methods

    Removes an attribution text.
    - - + +

    Events methods

    - +

    A set of methods shared between event-powered classes (like Map). 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 'fire' event).

    Example

    - +
    map.on('click', function(e) {
     	alert(e.latlng);
     });
    - +

    Methods

    @@ -2364,17 +2368,17 @@

    Methods

    Event objects

    - +

    Event object is an object that you recieve as an argument in a listener function when some event is fired, containing useful information about that event. For example:

    - +
    map.on('click', function(e) {
     	alert(e.latlng); // e is an event object (MouseEvent in this case)
    -});
    - +}); +

    Event

    - +

    The base event object. All other event objects contain these properties too.

    - +
    @@ -2392,9 +2396,9 @@

    Event

    property The object that fired the event.
    - +

    MouseEvent

    - + @@ -2412,9 +2416,9 @@

    MouseEvent

    property Pixel coordinates of the point where the mouse event occured relative to the map layer.
    - +

    LocationEvent

    - + @@ -2437,9 +2441,9 @@

    LocationEvent

    property Accuracy of location in meters.
    - +

    ErrorEvent

    - + @@ -2457,7 +2461,7 @@

    ErrorEvent

    property Error code (if applicable).
    - +

    LayerEvent

    @@ -2474,7 +2478,7 @@

    LayerEvent

    GeoJSON event

    - + @@ -2502,7 +2506,7 @@

    GeoJSON event

    property GeoJSON ID of the feature (if present).
    - + @@ -2520,12 +2524,12 @@ - - + +

    IHandler

    An interface implemented by interaction handlers.

    - +
    @@ -2550,18 +2554,18 @@

    IHandler

    Method
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + -

    Here we create a map with a CloudMade tile layer, add a marker and bind a popup with some text to it:

    -
    // create a CloudMade tile layer
    -var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
    -	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
    -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
    -
    -// initialize the map on the "map" div
    +		

    Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

    +
    // initialize the map on the "map" div
     var map = new L.Map('map');
     
    -// set the map view to a given center and zoom and add the CloudMade layer
    -map.setView(new L.LatLng(51.505, -0.09), 13).addLayer(cloudmade);
    +// create a CloudMade tile layer (or use other provider of your choice)
    +var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png', {
    +	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
    +	maxZoom: 18
    +});
    +
    +// add the CloudMade layer to the map set the view to a given center and zoom
    +map.addLayer(cloudmade).setView(new L.LatLng(51.505, -0.09), 13);
     
     // create a marker in the given location and add it to the map
     var marker = new L.Marker(new L.LatLng(51.5, -0.09));
    @@ -97,7 +98,7 @@ 

    Basic usage example

    Contributing to Leaflet

    The project is hosted on GitHub, waiting for your contributions — just send your pull requests to Vladimir Agafonkin (Leaflet maintainer). Let's make the best library for maps that can possibly exist!

    -

    You can also help the project a lot by reporting bugs and discussing features on the issues page or tweeting to @LeafletJS. +

    You can also help the project a lot by reporting bugs and discussing features on the issues page, tweeting to @LeafletJS or joining the Leaflet mailing list.


    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    diff --git a/reference.html b/reference.html index ddfcd59a7b3..fcbfc238ba9 100644 --- a/reference.html +++ b/reference.html @@ -1,4 +1,5 @@ + Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Documentation From 3466fb95c6adf4ba4bf56eeb4a31cf6879446c19 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 14 Feb 2012 17:02:29 +0200 Subject: [PATCH 086/816] better mobile look of the pages --- download.html | 2 + examples.html | 2 + examples/custom-icons-example.html | 20 ++-- examples/custom-icons.html | 84 +++++++------- examples/geojson-example.html | 36 +++--- examples/geojson.html | 100 ++++++++--------- examples/layers-control-example.html | 6 +- examples/layers-control.html | 60 +++++----- examples/mobile-example.html | 26 ++--- examples/mobile.html | 78 ++++++------- examples/quick-start-example.html | 38 ++++--- examples/quick-start.html | 158 ++++++++++++++------------- features.html | 2 + index.html | 6 +- reference.html | 2 + 15 files changed, 323 insertions(+), 297 deletions(-) diff --git a/download.html b/download.html index 50e7c785601..39229bb42bb 100644 --- a/download.html +++ b/download.html @@ -7,6 +7,8 @@ + + diff --git a/examples.html b/examples.html index 3bc6ef7256a..7268fa45946 100644 --- a/examples.html +++ b/examples.html @@ -7,6 +7,8 @@ + + diff --git a/examples/custom-icons-example.html b/examples/custom-icons-example.html index 98699e8001e..8fdbd2d02b8 100644 --- a/examples/custom-icons-example.html +++ b/examples/custom-icons-example.html @@ -3,7 +3,9 @@ Leaflet Quick Start Guide Example - + + + @@ -13,13 +15,13 @@ - \ No newline at end of file + diff --git a/examples/custom-icons.html b/examples/custom-icons.html index 9f82a3a1dd9..90e7d3e5775 100644 --- a/examples/custom-icons.html +++ b/examples/custom-icons.html @@ -2,11 +2,13 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Markers With Custom Icons Example - + - + - + + + @@ -28,33 +30,33 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - +

    ← Back to the list of examples

    Markers With Custom Icons

    - +

    In this example, you'll learn how to easily define your own icons for use by the markers you put on the map.

    - +
    - + - +

    View example on a separate page →

    - +

    Preparing the images

    - +

    To make a custom icon, we usually need two images — the actual icon image and the image of its shadow. For this example, we took the Leaflet logo and created four images out of it — 3 leaf images of different colors and one shadow image for the three:

    - +

    - +

    The white area in the images is actually transparent, and they are saved in the PNG24 format. Notice there's some excessive area on the left of the shadow image — its cropped in such way that if you align the icon and the shadow images on top of each other, the top left corners are in the same spot.

    - +

    Defining an icon class

    - +

    The default marker icons in Leaflet are defined by the L.Icon class. Its instance (new L.Icon()) is then set by default in the L.Marker options. So how do we define our own icon class? Inherit from L.Icon! It's really easy in Leaflet:

    - +
    var LeafIcon = L.Icon.extend({
     	iconUrl: '../docs/images/leaf-green.png',
     	shadowUrl: '../docs/images/leaf-shadow.png',
    @@ -108,23 +110,23 @@ 

    Defining an icon class

    });

    Now we've defined a green leaf icon class. The iconSize and shadowSize properties are the sizes of the corresponding images in pixels, the iconAnchor property is the coordinates of the "tip" of our icon, and the popupAnchor property points to a point from which a marker popup would open relative to the iconAnchor point.

    - +

    Using icons in markers

    To use our newly created icon class in a marker, we need to create an instance of that class and pass it to the marker constructor in the options:

    - +
    var greenIcon = new LeafIcon(),
     	marker = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon});
    - +

    Awesome, it works! But what about the orange and the red ones? You could repeat the whole process above for each of them, but there's a much easier way. Notice that these icons would have the same properties except for one — the iconUrl. Because it's a frequent case, the L.Icon constructor has an optional argument — an iconUrl to replace the defined one. Let's see:

    - +
    var greenIcon = new LeafIcon(),
     	redIcon = new LeafIcon('../docs/images/leaf-red.png'),
     	orangeIcon = new LeafIcon('../docs/images/leaf-orange.png');
     
    - +

    Now we can use all the three icons:

    - +
    var marker1 = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}),
     	marker2 = new L.Marker(new L.LatLng(51.495, -0.083), {icon: redIcon}),
     	marker3 = new L.Marker(new L.LatLng(51.49, -0.1), {icon: orangeIcon});
    @@ -134,20 +136,20 @@ 

    Using icons in markers

    marker3.bindPopup("I am an orange leaf."); map.addLayer(marker1).addLayer(marker2).addLayer(marker3);
    - +

    That's all. Now take a look at the full example, the L.Icon docs, or browse other examples.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 26e0a2f6322..81f8c3a73e4 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -2,10 +2,12 @@ Leaflet GeoJSON example - + + + - + @@ -15,13 +17,13 @@ - \ No newline at end of file + diff --git a/examples/geojson.html b/examples/geojson.html index 9be65cf6b34..b8848ec450c 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -2,11 +2,13 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Leaflet on Mobile Example - + + + - + - + @@ -28,35 +30,35 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - +

    ← Back to the list of examples

    Using GeoJSON with Leaflet

    - +

    GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

    - +
    - + - +

    View example on a separate page →

    - +

    About GeoJSON

    According to http://geojson.org:

    - +
    GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
    - +

    Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

    - +

    The GeoJSON layer

    - +

    GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

    - +
    var geojsonLayer = new L.GeoJSON();
     
     map.addLayer(geojsonLayer);

    This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

    - +
    var geojsonFeature = {
         "type": "Feature",
         "properties": {
    @@ -151,17 +153,17 @@ 

    The GeoJSON layer

    }; geojsonLayer.addGeoJSON(geojsonFeature);
    - +

    We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

    - +
    var geojsonLayer = new L.GeoJSON(geojsonFeature);
     
     map.addLayer(geojsonLayer);

    Popups

    - +

    We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

    - +
    geojsonLayer.on("featureparse", function (e) {
         if (e.properties && e.properties.popupContent){
             e.layer.bindPopup(e.properties.popupContent);
    @@ -173,7 +175,7 @@ 

    Popups

    Styling Features

    We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

    - +
    var freeBus = {
         "type": "Feature",
         "geometry": {
    @@ -198,7 +200,7 @@ 

    Styling Features

    };

    To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

    - +
    geojsonLayer.on("featureparse", function (e){
     	if (e.properties && e.properties.style && e.layer.setStyle){
     	    // The setStyle method isn't available for Points. More on that below ...
    @@ -207,11 +209,11 @@ 

    Styling Features

    });

    Styling Points

    - +

    Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

    - +

    Here we're using a CircleMarker:

    - +
    var geojsonMarkerOptions = {
     	radius: 8,
     	fillColor: "#ff7800",
    @@ -228,7 +230,7 @@ 

    Styling Points

    });

    And here's an example of using a custom Marker:

    - +
    var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
         pointToLayer: function (latlng) {
             return new L.Marker(latlng, {
    @@ -238,18 +240,18 @@ 

    Styling Points

    });

    View the example page to see in detail what is possible with the GeoJSON layer.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html index 59846036411..9c96e62d561 100644 --- a/examples/layers-control-example.html +++ b/examples/layers-control-example.html @@ -3,7 +3,9 @@ Leaflet Layers Control Example - + + + @@ -49,4 +51,4 @@ map.addControl(layersControl); - \ No newline at end of file + diff --git a/examples/layers-control.html b/examples/layers-control.html index 285bdf59d9c..082edee1b26 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -2,11 +2,13 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Layers Control Example - + - + - + + + @@ -28,23 +30,23 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - +

    ← Back to the list of examples

    Layer Groups and Layers Control

    - +

    This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

    Note: this only works in the latest (master) version of Leaflet.

    - +
    - +

    View example on a separate page →

    Layer Groups

    @@ -129,37 +131,37 @@

    Layers Control

    });

    Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. midnightCommander).

    - +
    var baseMaps = {
     	"Minimal": minimal,
     	"Night View": midnightCommander
     };
    -		
    +
     var overlayMaps = {
         "Motorways": motorways,
         "Cities": citiesLayer
     };
    - +

    Now, all that's left to do is to create a Layers Control and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional — for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing null as the first argument.

    - +
    var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
    -		
    +
     map.addControl(layersControl);

    Now lets view the result on a separate page →


    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/examples/mobile-example.html b/examples/mobile-example.html index 3bd91670c4b..345f0b7fb6c 100644 --- a/examples/mobile-example.html +++ b/examples/mobile-example.html @@ -2,12 +2,12 @@ Leaflet mobile example - - - + + + - + +
    - \ No newline at end of file + diff --git a/examples/mobile.html b/examples/mobile.html index 4fc6065b1b7..f2cf2cf6559 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -2,11 +2,11 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Leaflet on Mobile Example - + - + - + @@ -28,28 +28,28 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - +

    ← Back to the list of examples

    Leaflet on Mobile

    - +

    In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

    - +

    View example →

    - +

    Preparing the page

    - +

    First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

    - +
    body {
     	padding: 0;
     	margin: 0;
    @@ -58,66 +58,66 @@ 

    Preparing the page

    height: 100%; }
    -

    Also, we need to tell the mobile browser to disable scaling of the page and set it to its actual size by placing the following line in the head section:

    - -
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    - +

    Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section:

    + +
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    +

    Initializing the map

    - +

    We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

    - +
    var map = new L.Map('map');
    -	
    +
     var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
     	cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
     	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
     
     map.addLayer(cloudmade);
    - +

    Geolocation

    - +

    Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

    - +
    map.locateAndSetView(16);
    - +

    Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

    - +
    map.on('locationfound', onLocationFound);
    -		
    +
     function onLocationFound(e) {
     	var radius = e.accuracy / 2;
     
     	var marker = new L.Marker(e.latlng);
     	map.addLayer(marker);
     	marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
    -	
    +
     	var circle = new L.Circle(e.latlng, radius);
    -	map.addLayer(circle);	
    +	map.addLayer(circle);
     }

    Excellent! But it would also be nice to show an error message if the geolocation failed:

    - +
    map.on('locationerror', onLocationError);
    -		
    +
     function onLocationError(e) {
     	alert(e.message);
     }

    Now the example is complete — try it on your mobile phone: View the full example →

    - +

    Next steps would be to take a look at the detailed documentation and browse other examples.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/examples/quick-start-example.html b/examples/quick-start-example.html index 65b2501fe1b..85ccdd70d7b 100644 --- a/examples/quick-start-example.html +++ b/examples/quick-start-example.html @@ -3,7 +3,9 @@ Leaflet Quick Start Guide Example - + + + @@ -13,50 +15,50 @@ - \ No newline at end of file + diff --git a/examples/quick-start.html b/examples/quick-start.html index cb4f16cd068..d56eafcc62b 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -2,11 +2,13 @@ Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Quick Start Guide - + - + - + + + @@ -28,101 +30,101 @@

    Leaflet

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    - + - +

    ← Back to the list of examples

    Leaflet Quick Start Guide

    - +

    This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events.

    - +
    - +

    View example on a separate page →

    - +

    Preparing your page

    - +

    Before writing any code for the map, you need to do the following preparation steps on your page:

    - +
    1. Include Leaflet CSS files in the head section of your document:
      <link rel="stylesheet" href="leaflet/leaflet.css" />
       <!--[if lte IE 8]><link rel="stylesheet" href="leaflet/leaflet.ie.css" /><![endif]-->
    2. - +
    3. Include Leaflet JavaScript file somewhere on the page (preferably before body close tag):
      <script src="leaflet/leaflet.js"></script>
    4. - +
    5. Put a div element with a certain id where you want your map to be and make sure it has defined width and height:
      <div id="map" style="height: 200px"></div> <!-- width equals available horizontal space by default -->
    - +

    Now you're ready to initialize the map and do some stuff with it.

    - - + +

    Setting up the map

    - +
    - +

    Let's create a map instance, set its view to the center of London and add a pretty CloudMade tile layer to it. First we'll initialize the map:

    - +
    var map = new L.Map('map');

    By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls.

    @@ -141,40 +143,40 @@

    Setting up the map

    Make sure this code is below both the map div and leaflet.js inclusion, or in a window.load or document.ready event handler.

    Markers, circles and polygons

    - +

    Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker:

    - +
    var markerLocation = new L.LatLng(51.5, -0.09);
     
     var marker = new L.Marker(markerLocation);
     map.addLayer(marker);

    Adding a circle is the same (except for specifying the radius in meters), but lets configure it by passing options as a third argument when creating the object (the second argument is the radius in pixels):

    - +
    var circleLocation = new L.LatLng(51.508, -0.11),
     	circleOptions = {
    -		color: 'red', 
    -		fillColor: '#f03', 
    +		color: 'red',
    +		fillColor: '#f03',
     		fillOpacity: 0.5
     	};
    -	
    +
     var circle = new L.Circle(circleLocation, 500, circleOptions);
     map.addLayer(circle);
    @@ -189,94 +191,94 @@

    Markers, circles and polygons

    Working with popups

    - +
    - +

    Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this:

    - +
    marker.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
     circle.bindPopup("I am a circle.");
     polygon.bindPopup("I am a polygon.");
    - +

    Try clicking on our objects. The bindPopup method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the openPopup method (for markers only) immediately opens the attached popup.

    - +

    You can also use popups as layers (when you need something more than attching a popup to an object):

    - +
    var popup = new L.Popup();
     
     popup.setLatLng(new L.LatLng(51.5, -0.09));
     popup.setContent("I am a standalone popup.");
    -		
    +
     map.openPopup(popup);
    - +

    Here we use openPopup instead of addLayer because it handles automatic closing of a previously opened popup when opening a new one which is good for usability.

    - - + +

    Dealing with events

    - +

    Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction:

    map.on('click', onMapClick);
    -		
    +
     function onMapClick(e) {
     	alert("You clicked the map at " + e.latlng);
     }
    - +

    Each object has its own set of events — see documentation for details. The first argument of the listener function is an event object — it contains useful information about the event that happened. For example, map click event object (e in the example above) has latlng property which is a location at which the click occured.

    - +

    Lets improve our example by using a popup instead of an alert and formatting the location string:

    - +
    map.on('click', onMapClick);
    -		
    +
     var popup = new L.Popup();
    -		
    +
     function onMapClick(e) {
     	var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
    -			
    +
     	popup.setLatLng(e.latlng);
     	popup.setContent("You clicked the map at " + latlngStr);
    -	
    +
     	map.openPopup(popup);
     }

    Try clicking on the map and you will see the coordinates in a popup. View the full example →

    Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed documentation or other examples.

    - +
    - +

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    - + Fork me on GitHub - + + - \ No newline at end of file + diff --git a/features.html b/features.html index 765822ab2d7..0925503230f 100644 --- a/features.html +++ b/features.html @@ -7,6 +7,8 @@ + + diff --git a/index.html b/index.html index ef6413f2116..2942334bd7e 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,8 @@ + + @@ -55,8 +57,8 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    -

    Leaflet is a modern, lightweight open-source JavaScript library for making tile-based interactive maps for both desktop and mobile web browsers, developed by CloudMade to form the core of its next generation JavaScript API. Weighting just about 21kb of gzipped JS code, it still has all the features you will ever need for you web mapping needs while providing a fast, smooth, pleasant user experience.

    -

    It is built from the ground up to work efficiently and smoothly on both desktop and mobile platforms like iOS and Android, utilizing cutting-edge technologies included in HTML5 and CSS3, focusing on usability, performance, small size, A-grade browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.

    +

    Leaflet is a modern, lightweight open-source JavaScript library for interactive maps for desktop and mobile web browsers, developed by CloudMade to form the core of its next generation JavaScript API. Weighting just about 21kb of gzipped JS code, it still has all the features you will ever need for you web mapping needs while providing a fast, smooth, pleasant user experience.

    +

    It is built from the ground up to work efficiently and smoothly on both desktop and mobile platforms like iOS and Android, utilizing cutting-edge technologies included in HTML5 and CSS3, focusing on usability, performance, small size, A-grade browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.

    Basic usage example

    diff --git a/reference.html b/reference.html index fcbfc238ba9..d9f90bb882a 100644 --- a/reference.html +++ b/reference.html @@ -6,6 +6,8 @@ + + From 9ba1fcc2ca00cb4f69b86f65e26822da86adf652 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 14 Feb 2012 17:27:47 +0200 Subject: [PATCH 087/816] update download link to 0.3.1 --- download.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.html b/download.html index 39229bb42bb..02846b947a6 100644 --- a/download.html +++ b/download.html @@ -57,7 +57,7 @@

    Download Leaflet

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

    - Download Leaflet 0.3 (zip, stable)
    + Download Leaflet 0.3.1 (zip, stable, 14.02.2012)
    Download Leaflet master (zip, development version)

    From 66aa85a970c6ff0d1f2cfaf5ec7d4165047a1dda Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 14 Feb 2012 11:05:42 -0700 Subject: [PATCH 088/816] Happy New Year\! --- download.html | 2 +- examples.html | 2 +- features.html | 2 +- index.html | 2 +- reference.html | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/download.html b/download.html index 02846b947a6..9b1432a08ac 100644 --- a/download.html +++ b/download.html @@ -79,7 +79,7 @@

    Building a custom version of Leaflet


    -

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +

    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    Fork me on GitHub diff --git a/examples.html b/examples.html index 7268fa45946..8319d88b416 100644 --- a/examples.html +++ b/examples.html @@ -100,7 +100,7 @@

    OOP in Leaflet


    -

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +

    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    Fork me on GitHub diff --git a/features.html b/features.html index 0925503230f..b72fe816c29 100644 --- a/features.html +++ b/features.html @@ -154,7 +154,7 @@

    On mobile


    -

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +

    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    Fork me on GitHub diff --git a/index.html b/index.html index 2942334bd7e..8b0a84562f6 100644 --- a/index.html +++ b/index.html @@ -103,7 +103,7 @@

    Contributing to Leaflet

    You can also help the project a lot by reporting bugs and discussing features on the issues page, tweeting to @LeafletJS or joining the Leaflet mailing list.


    -

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +

    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    Fork me on GitHub diff --git a/reference.html b/reference.html index d9f90bb882a..e883b7698d9 100644 --- a/reference.html +++ b/reference.html @@ -1146,7 +1146,7 @@

    Usage example

    layers: 'nexrad-n0r-900913', format: 'image/png', transparent: true, - attribution: "Weather data © 2011 IEM Nexrad" + attribution: "Weather data © 2012 IEM Nexrad" });

    Constructor

    @@ -2668,7 +2668,7 @@

    IHandler


    -

    © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

    +

    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    Fork me on GitHub From e2200764a4977ea18017a4b14be082e17d947fd0 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Tue, 14 Feb 2012 11:09:26 -0700 Subject: [PATCH 089/816] Adding LatLngBounds equals method documentation. --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index e883b7698d9..54ed7a4b017 100644 --- a/reference.html +++ b/reference.html @@ -2034,6 +2034,11 @@

    Methods

    intersects( <LatLngBoundsotherBounds ) Boolean Returns true if the rectangle intersects the given bounds. + + + equals( <LatLngBoundsotherBounds ) + Boolean + Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. From a7968ba2366e4be4bc9641b16e76be7cbae6ec20 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 16 Feb 2012 22:38:41 -0700 Subject: [PATCH 090/816] Documenting LatLngBounds.toBBoxString method. Closes #414. --- reference.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/reference.html b/reference.html index 54ed7a4b017..f4c1f1ce4cf 100644 --- a/reference.html +++ b/reference.html @@ -2034,11 +2034,16 @@

    Methods

    intersects( <LatLngBoundsotherBounds ) Boolean Returns true if the rectangle intersects the given bounds. - - - equals( <LatLngBoundsotherBounds ) - Boolean - Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. + + + equals( <LatLngBoundsotherBounds ) + Boolean + Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. + + + 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. From 4a3444c810e9671f8b6900060b9d5180293db939 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 16 Feb 2012 22:51:54 -0700 Subject: [PATCH 091/816] Documenting setRadius method for Circle and CircleMarker. Addresses #349. --- reference.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index f4c1f1ce4cf..7d179bc9a29 100644 --- a/reference.html +++ b/reference.html @@ -1600,13 +1600,18 @@

    Methods

    this Sets the position of a circle to a new location. + + setRadius( <Number> radius ) + this + Sets the radius of a circle. Units are in meters. +

    L.CircleMarker

    -

    A circle of a fixed size with radius specified in pixels. Extends Circe. Use Map#addLayer to add it to the map.

    +

    A circle of a fixed size with radius specified in pixels. Extends Circle. Use Map#addLayer to add it to the map.

    Constructor

    @@ -1634,6 +1639,11 @@

    Methods

    this Sets the position of a circle marker to a new location. + + setRadius( <Number> radius ) + this + Sets the radius of a circle marker. Units are in meters. + From b89daef135a3bf4b1f361e9f54e13ce76c8be872 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Fri, 17 Feb 2012 07:06:32 -0700 Subject: [PATCH 092/816] Pixels for unit of radius in CircleMarker. --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 7d179bc9a29..815ab94a236 100644 --- a/reference.html +++ b/reference.html @@ -1642,7 +1642,7 @@

    Methods

    setRadius( <Number> radius ) this - Sets the radius of a circle marker. Units are in meters. + Sets the radius of a circle marker. Units are in pixels. From a9f5a4a1ac206ee843523edb5c9d1650eb8fe572 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 21 Feb 2012 17:14:40 +0200 Subject: [PATCH 093/816] Add UserVoice widget to all pages --- download.html | 9 +++++++++ examples.html | 9 +++++++++ examples/custom-icons.html | 9 +++++++++ examples/geojson.html | 9 +++++++++ examples/layers-control.html | 9 +++++++++ examples/mobile.html | 9 +++++++++ examples/quick-start.html | 9 +++++++++ features.html | 9 +++++++++ index.html | 9 +++++++++ reference.html | 9 +++++++++ 10 files changed, 90 insertions(+) diff --git a/download.html b/download.html index 9b1432a08ac..0484b10d611 100644 --- a/download.html +++ b/download.html @@ -105,5 +105,14 @@

    Building a custom version of Leaflet

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples.html b/examples.html index 8319d88b416..c1e47d2471c 100644 --- a/examples.html +++ b/examples.html @@ -126,5 +126,14 @@

    OOP in Leaflet

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples/custom-icons.html b/examples/custom-icons.html index 90e7d3e5775..bc2de538c75 100644 --- a/examples/custom-icons.html +++ b/examples/custom-icons.html @@ -167,5 +167,14 @@

    Using icons in markers

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples/geojson.html b/examples/geojson.html index b8848ec450c..e2bc16d172d 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -269,5 +269,14 @@

    Styling Points

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples/layers-control.html b/examples/layers-control.html index 082edee1b26..6e3fbc1aa89 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -179,5 +179,14 @@

    Layers Control

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples/mobile.html b/examples/mobile.html index f2cf2cf6559..02c32bb2379 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -135,5 +135,14 @@

    Geolocation

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/examples/quick-start.html b/examples/quick-start.html index d56eafcc62b..a9b6554d26c 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -296,5 +296,14 @@

    Dealing with events

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/features.html b/features.html index b72fe816c29..6994a7b7340 100644 --- a/features.html +++ b/features.html @@ -180,6 +180,15 @@

    On mobile

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/index.html b/index.html index 8b0a84562f6..7de25d66ff9 100644 --- a/index.html +++ b/index.html @@ -129,6 +129,15 @@

    Contributing to Leaflet

    s.parentNode.insertBefore(ga, s); })(); + + diff --git a/reference.html b/reference.html index 815ab94a236..19b834df0f4 100644 --- a/reference.html +++ b/reference.html @@ -2714,5 +2714,14 @@

    IHandler

    s.parentNode.insertBefore(ga, s); })(); + + From caf5ac938c63ee9c0731c2b25be9a27ecca85fae Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 21 Feb 2012 17:27:15 +0200 Subject: [PATCH 094/816] Change some links on the main page --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 7de25d66ff9..b584ab44cf2 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,7 @@

    Basic usage example

    Contributing to Leaflet

    The project is hosted on GitHub, waiting for your contributions — just send your pull requests to Vladimir Agafonkin (Leaflet maintainer). Let's make the best library for maps that can possibly exist!

    -

    You can also help the project a lot by reporting bugs and discussing features on the issues page, tweeting to @LeafletJS or joining the Leaflet mailing list. +

    You can also help the project a lot by reporting bugs on the GitHub issues page, showing your support for your favorite feature suggestions on Leaflet UserVoice page, tweeting to @LeafletJS or joining the Leaflet mailing list.


    © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

    From 4e496be4ce86814e9ee0184f52b48ae8c6407431 Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 25 Feb 2012 12:18:00 +0200 Subject: [PATCH 095/816] add CDN links on the download page --- download.html | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/download.html b/download.html index 0484b10d611..1931cb4e91e 100644 --- a/download.html +++ b/download.html @@ -52,28 +52,31 @@

    A Modern, Lightweight Open-Source JavaScript Library for Interac

    + +

    Using a hosted version of Leaflet

    + +

    The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the head section of your HTML:

    +
    <link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
    +<!--[if lte IE 8]>
    +	<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
    +<![endif]-->
    +
    +<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
    + +

    Download Leaflet

    -

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system.

    +

    Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system. The production files (included the same way as in the code above) are in the dist folder.

    - Download Leaflet 0.3.1 (zip, stable, 14.02.2012)
    - Download Leaflet master (zip, development version) + Download Leaflet 0.3.1 stable (February 14, 2012)
    + Download Leaflet 0.4 master (in-progress version)

    View Changelog

    -

    Including Leaflet on your page

    -

    Place the contents of the dist folder somewhere in your directory tree and include it in the head section of your HTML with the following code:

    -
    <!-- Leaflet CSS -->
    -<link rel="stylesheet" href="<path_to_dist>/leaflet.css" />
    -<!--[if lte IE 8]><link rel="stylesheet" href="<path_to_dist>/leaflet.ie.css" /><![endif]-->
    -
    -<!-- Leaflet JavaScript -->
    -<script src="<path_to_dist>/leaflet.js"></script>
    -

    Building a custom version of Leaflet

    Open build/build.html page from the download package, check the components you want to see in your build and then follow the instructions there.

    From f0e2e02ebaad2f92f42eed6f8a6d739333fa3ce7 Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 25 Feb 2012 12:46:14 +0200 Subject: [PATCH 096/816] update features page --- docs/css/screen.css | 4 ++++ features.html | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 6006b2ea4a4..45ea124ea84 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -251,3 +251,7 @@ h3 span { font-size: 12px; color: #777; } + +.last ul { + margin-right: 0; +} \ No newline at end of file diff --git a/features.html b/features.html index 6994a7b7340..28d82c09eed 100644 --- a/features.html +++ b/features.html @@ -61,14 +61,12 @@

    Leaflet features

    Available map layers

    • Tile layers
    • -
    • Polylines, polygons, circles
    • +
    • Vector layers: polylines, polygons, circles, circle markers
    • Markers
    • Popups
    • Image overlays
    • WMS layers
    • GeoJSON
    • -
    • KML
    • -
    • GeoRSS

    Interaction features

    @@ -84,7 +82,11 @@

    On mobile browsers (iOS, Android)

  • Touch-drag panning
  • Multi-touch zoom (iOS only)
  • Double tap zoom
  • + +

    Other features

    +
    • Panning inertia
    • +
    • Vector layers editing
    @@ -95,7 +97,7 @@

    Visual features

  • Zooming animation on modern browsers (except IE)
  • Smooth continuous zoom on iOS
  • Tile and popup fade animation
  • -
  • Very nice default design for markers and popups
  • +
  • Very nice default design for markers, popups and other map controls
  • Customization features

    @@ -109,10 +111,10 @@

    Customization features

    Performance features

      -
    • Hardware acceleration on iOS makes it feel as smooth as native apps
    • +
    • Hardware acceleration on iOS (and other modern browsers) makes it feel as smooth as native apps
    • Clever tricks to make panning and zooming really smooth
    • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
    • -
    • Modular build system allows you to reduce the size of the library by leaving out the code you don't need
    • +
    • Modular design and a build system allow you to reduce the size of the library by leaving out the code you don't need
    @@ -121,9 +123,8 @@

    Map controls

    • Zoom buttons
    • Attribution
    • -
    • Zoom slider
    • Layer switcher
    • - +
    • Scale

    Browser support

    @@ -140,15 +141,14 @@

    On mobile

    • Safari for iOS 3/4/5+
    • WebKit for Android 2.2+, 3.1+, 4+
    • -
    • webOS browser
    • -
    • Blackberry 6+
    • +
    • Other webkit-based browsers (webOS, Blackberry 6+, etc.)
    • Windows Phone 7
    • Firefox for Android
    -

    If you find some feature really missing in Leaflet, please submit it to the issue tracker.

    +

    If you find some feature really missing in Leaflet, please vote for it on the Leaflet UserVoice page.

    * Grayed out features are in the roadmap and coming soon.

    From d76a0d7a5fe211c5c5fff9c911e74891701b7b19 Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 25 Feb 2012 13:03:29 +0200 Subject: [PATCH 097/816] update quick start example --- examples/quick-start.html | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/examples/quick-start.html b/examples/quick-start.html index a9b6554d26c..8590eb8da4e 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -49,7 +49,7 @@

    Leaflet Quick Start Guide

    -

    Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

    +

    Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

    // initialize the map on the "map" div
     var map = new L.Map('map');
     
    -// create a CloudMade tile layer (or use other provider of your choice)
    -var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png', {
    +// create a CloudMade tile layer with style #997 (or use other provider of your choice)
    +var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/[your-API-key]/997/256/{z}/{x}/{y}.png', {
     	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
     	maxZoom: 18
     });
    diff --git a/reference.html b/reference.html
    index 340378cb9b5..c82dcad8e1a 100644
    --- a/reference.html
    +++ b/reference.html
    @@ -1,7 +1,7 @@
     
     
     
    -	Leaflet - a modern, lightweight JavaScript library for interactive maps by CloudMade - Documentation
    +	Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Documentation
     
     	
     
    @@ -27,12 +27,12 @@
     
     	

    Leaflet

    -

    A Modern, Lightweight Open-Source JavaScript Library for Interactive Maps by CloudMade

    +

    An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

    ← Back to the list of examples

    diff --git a/examples/mobile.html b/examples/mobile.html index bb71e3c6f82..13fc3231b73 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -35,8 +35,8 @@

    An Open-Source JavaScript Library for Mobile-Friendly Interactiv
  • Tutorials
  • Documentation
  • Download
  • -
  • -
  • GitHub Repo
  • +
  • +
  • GitHub
  • ← Back to the list of examples

    diff --git a/examples/quick-start.html b/examples/quick-start.html index 4d60233a429..eda71280298 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -37,8 +37,8 @@

    An Open-Source JavaScript Library for Mobile-Friendly Interactiv
  • Tutorials
  • Documentation
  • Download
  • -
  • -
  • GitHub Repo
  • +
  • +
  • GitHub
  • ← Back to the list of examples

    diff --git a/features.html b/features.html index 68fb654d591..6798a48c255 100644 --- a/features.html +++ b/features.html @@ -37,20 +37,33 @@

    An Open-Source JavaScript Library for Mobile-Friendly Interactiv
  • Tutorials
  • Documentation
  • Download
  • -
  • -
  • GitHub Repo
  • +
  • +
  • GitHub
  • -

    - - +

    Leaflet features

    diff --git a/index.html b/index.html index 20cc2620d5a..2e15674c66e 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,13 @@ Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade + + + + @@ -39,26 +43,38 @@

    An Open-Source JavaScript Library for Mobile-Friendly Interactiv
  • Tutorials
  • Documentation
  • Download
  • -
  • -
  • GitHub Repo
  • +
  • +
  • GitHub
  • -

    - - +

    -

    Leaflet is a modern, lightweight open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of CloudMade with a team of dedicated contributors. Weighing just about 25 KB of gzipped JS code, it still has all the features most developers ever need for online maps, while providing a fast, pleasant user experience.

    -

    It is built from the ground up to work efficiently and smoothly on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, A-grade browser support and an easy-to-use API with convention over configuration. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.

    +

    Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of CloudMade with a team of dedicated contributors. Weighing just about 25 KB of gzipped JS code, it still has all the features most developers ever need for online maps, while providing a smooth, pleasant user experience.

    +

    It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, A-grade browser support and a simple API with convention over configuration. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.

    Basic usage example

    @@ -77,20 +93,20 @@

    Basic usage example

    Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

    -
    // initialize the map on the "map" div, set the view to a given place and zoom
    -var map = L.map('map')
    -	.setView([51.505, -0.09], 13);
     
    -// add a CloudMade tile layer with style #997 (or use other provider of your choice)
    +		
    +		
    +		
    // create a map in the "map" div, set the view to a given place and zoom
    +var map = L.map('map').setView([51.505, -0.09], 13);
    +
    +// add a CloudMade tile layer with style #997
     L.tileLayer('http://{s}.tile.cloudmade.com/[API-key]/997/256/{z}/{x}/{y}.png', {
    -	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
    +	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
     }).addTo(map);
     
     // add a marker in the given location, attach some popup content to it and open the popup
    -L.marker([51.5, -0.09])
    -	.addTo(map)
    -	.bindPopup("A pretty CSS3 popup.<br />Easily customizable.")
    -	.openPopup();
    +L.marker([51.5, -0.09]).addTo(map) + .bindPopup('A pretty CSS3 popup. <br> Easily customizable.').openPopup();

    DOM utility

    @@ -3174,8 +3174,169 @@

    L.Browser

    +

    L.Util

    +

    Utility functions.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MethodReturnsDescription
    extend(<Object> src)ObjectMerge src properties into dest
    bind(<Function> fn, <Object> obj)FunctionReturn a function which calls function fn with scope obj.
    stamp(<Object> obj)StringApplies a unique key to the object and returns that key.
    requestAnimFrame()
    cancelAnimFrame()
    limitExecByInterval(<Function> fn, <Number> time, <??> context)
    falseFn()FunctionReturns a function which always returns false.
    formatNum(<Number> num, <Number> digits)NumberReturns the number num rounded to digits decimals.
    splitWords(<String> str)String[]Splits the string on spaces and returns the array of parts.
    setOptions(<Object> obj, <Object> options)ObjectSet the options in options in obj, return the options of obj afterwards.
    getParamString(<Object> obj)StringConvert a map in to a parameter string.
    template(<String> str, <Object> data)StringApplies the values of the data map to a template like "{a}, {b}, {c}".
    emptyImageUrlStringString containing a base64 encoded empty gif image.
    + +

    L.DomUtil

    +

    Utility functions to work with the DOM tree.

    - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MethodReturnsDescription
    get(<String> id)HTMLElementReturns an element reference by its id.
    getStyle(<HTMLElement> el, <String> style)StringReturns the value for a certain style attribute on an element.
    getViewportOffset(<HTMLElement> el)PointReturns the offset to the viewport for the requested element.
    create(<String> tagName, <String> className, <HTMLElement> container)HTMLElementCreates an element with tagName, sets the className and appends it to container.
    disableTextSelection()-
    enableTextSelection()-
    hasClass(<HTMLElement> el, <String> name)BooleanReturns true if the element has name in the class attribute.
    addClass(<HTMLElement> el, <String> name)-Adds name to the elements class attribute.
    removeClass(<HTMLElement> el, <String> name)-Removes name from the elements class attribute.
    setOpacity(<HTMLElement> el, <Number> value)-Set the opacity of element.
    testProp(<String[]> props)mixed
    getTranslateString(<Point> point)StringReturns a CSS translate string to move by the offset provided requested point.
    getScaleString(<Number> scale, <Point> origin)StringReturns a CSS scale string to scale
    setPosition(<HTMLElement> el, <Point> origin, <Boolean> disable3D?)-
    getPosition(<HTMLElement> el)PointReturns the point for an element positioned by setPosition().
    +

    IHandler

    An interface implemented by interaction handlers.

    From 10adb5a7d00ac49578311149f21a29c7f167c41d Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Tue, 10 Jul 2012 23:30:39 +0200 Subject: [PATCH 137/816] Fixing (I think most) documentation issues mentioned in #793 + some other small changes. --- reference.html | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/reference.html b/reference.html index dc0b76e57d9..0a839b787b6 100644 --- a/reference.html +++ b/reference.html @@ -3183,9 +3183,9 @@

    L.Util

    Description - extend(<Object> src) + extend(<Object> dest, <Object> src...) Object - Merge src properties into dest + Merge the properties of (multiple) src object properties into dest and returns dest. bind(<Function> fn, <Object> obj) @@ -3197,6 +3197,9 @@

    L.Util

    String Applies a unique key to the object and returns that key. + - limitExecByInterval(<Function> fn, <Number> time, <??> context) - - + limitExecByInterval(<Function> fn, <Number> time, <Object> context) + Function + Returns a wrapper around a function that makes sure it's called not more often than a certain interval, but as fast as possible otherwise. falseFn() Function - Returns a function which always returns false. + Returns a function which always returns false. formatNum(<Number> num, <Number> digits) Number - Returns the number num rounded to digits decimals. + Returns the number num rounded to digits decimals. splitWords(<String> str) @@ -3231,17 +3235,17 @@

    L.Util

    setOptions(<Object> obj, <Object> options) Object - Set the options in options in obj, return the options of obj afterwards. + Set the options in options in obj, return the options of obj afterwards. getParamString(<Object> obj) String - Convert a map in to a parameter string. + Convert a map in to a parameter string, including a question mark symbol. Example: {a: "foo", b: "bar"} translates to ?a=foo&b=bar. template(<String> str, <Object> data) String - Applies the values of the data map to a template like "{a}, {b}, {c}". + Applies the values of the data map to a template like "{a}, {b}, {c}". @@ -3278,42 +3282,42 @@

    L.DomUtil

    create(<String> tagName, <String> className, <HTMLElement> container) HTMLElement - Creates an element with tagName, sets the className and appends it to container. + Creates an element with tagName, sets the className and appends it to container. disableTextSelection() - - + Make sure text cannot be selected, for example during dragging. enableTextSelection() - - + Makes text selection possible again. hasClass(<HTMLElement> el, <String> name) Boolean - Returns true if the element has name in the class attribute. + Returns true if the element has name in the class attribute. addClass(<HTMLElement> el, <String> name) - - Adds name to the elements class attribute. + Adds name to the elements class attribute. removeClass(<HTMLElement> el, <String> name) - - Removes name from the elements class attribute. + Removes name from the elements class attribute. setOpacity(<HTMLElement> el, <Number> value) - - Set the opacity of element. + Set the opacity of an element. testProp(<String[]> props) mixed - + Goes through the array 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. getTranslateString(<Point> point) @@ -3323,17 +3327,17 @@

    L.DomUtil

    getScaleString(<Number> scale, <Point> origin) String - Returns a CSS scale string to scale + Returns a CSS scale string to scale an element. - setPosition(<HTMLElement> el, <Point> origin, <Boolean> disable3D?) + setPosition(<HTMLElement> el, <Point> point, <Boolean> disable3D?) - - + Sets the position of an element to position point. Uses CSS transformations if disable3D is true. getPosition(<HTMLElement> el) Point - Returns the point for an element positioned by setPosition(). + Returns the point for an element positioned by setPosition(). Note that it does not work on elements not previously positioned with setPosition() From fe3ef98c49a7b453e55fc047528919adc0454e58 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Jul 2012 11:53:01 +0300 Subject: [PATCH 138/816] minor updates to #793 --- reference.html | 69 ++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/reference.html b/reference.html index 0a839b787b6..b5f5f3d24a1 100644 --- a/reference.html +++ b/reference.html @@ -3255,8 +3255,10 @@

    L.Util

    +

    L.DomUtil

    -

    Utility functions to work with the DOM tree.

    + +

    Utility functions to work with the DOM tree, used by Leaflet internally.

    @@ -3265,29 +3267,29 @@

    L.DomUtil

    - + - + - - - + + + - + - - - + + + - + @@ -3295,51 +3297,52 @@

    L.DomUtil

    - - - + + + - + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - +
    Description
    get(<String> id)get( <String or HTMLElement> id ) HTMLElementReturns an element reference by its id.Returns an element with the given id if a string was passed, or just returns the element if it was passed directly.
    getStyle(<HTMLElement> el, <String> style)StringReturns the value for a certain style attribute on an element.getStyle( <HTMLElement> el, <String> style )StringReturns the value for a certain style attribute on an element, including computed values or values set through CSS.
    getViewportOffset(<HTMLElement> el)getViewportOffset( <HTMLElement> el ) Point Returns the offset to the viewport for the requested element.
    create(<String> tagName, <String> className, <HTMLElement> container)HTMLElementCreates an element with tagName, sets the className and appends it to container.create( <String> tagName, <String> className, <HTMLElement> container? )HTMLElementCreates an element with tagName, sets the className, and optionally appends it to container element.
    disableTextSelection() -Make sure text cannot be selected, for example during dragging.Makes sure text cannot be selected, for example during dragging.
    enableTextSelection() Makes text selection possible again.
    hasClass(<HTMLElement> el, <String> name)BooleanReturns true if the element has name in the class attribute.hasClass( <HTMLElement> el, <String> name )BooleanReturns true if the element class attribute contains name.
    addClass(<HTMLElement> el, <String> name)addClass( <HTMLElement> el, <String> name ) -Adds name to the elements class attribute.Adds name to the element's class attribute.
    removeClass(<HTMLElement> el, <String> name)removeClass( <HTMLElement> el, <String> name ) -Removes name from the elements class attribute.Removes name from the element's class attribute.
    setOpacity(<HTMLElement> el, <Number> value)setOpacity( <HTMLElement> el, <Number> value ) -Set the opacity of an element.Set the opacity of an element (including old IE support). Value must be from 0 to 1.
    testProp(<String[]> props)mixedGoes through the array 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.testProp( <String[]> props )String or falseGoes 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.
    getTranslateString(<Point> point)StringReturns a CSS translate string to move by the offset provided requested point.getTranslateString( <Point> point )StringReturns a CSS transform string to move an element by the offset provided in the given point.
    getScaleString(<Number> scale, <Point> origin)StringReturns a CSS scale string to scale an element.getScaleString( <Number> scale, <Point> origin )StringReturns a CSS transform string to scale an element (with the given scale origin).
    setPosition(<HTMLElement> el, <Point> point, <Boolean> disable3D?)setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? ) -Sets the position of an element to position point. Uses CSS transformations if disable3D is true.Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true.
    getPosition(<HTMLElement> el)getPosition( <HTMLElement> el ) PointReturns the point for an element positioned by setPosition(). Note that it does not work on elements not previously positioned with setPosition()Returns the coordinates of an element previously positioned with setPosition.
    +

    IHandler

    An interface implemented by interaction handlers.

    From 97f5bcc9d0c4b434fdcced074d42c3e9c355c3bc Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Jul 2012 14:33:56 +0300 Subject: [PATCH 139/816] update highlight.js to latest version --- docs/css/screen.css | 19 ++++ docs/highlight/LICENSE | 24 ++++ docs/highlight/highlight.pack.js | 2 +- docs/highlight/styles/ascetic.css | 44 ------- docs/highlight/styles/brown_paper.css | 103 ----------------- docs/highlight/styles/brown_papersq.png | Bin 18198 -> 0 bytes docs/highlight/styles/dark.css | 100 ---------------- docs/highlight/styles/default.css | 52 ++++++--- docs/highlight/styles/far.css | 114 ------------------- docs/highlight/styles/github.css | 20 +++- docs/highlight/styles/idea.css | 117 ------------------- docs/highlight/styles/ir_black.css | 102 ----------------- docs/highlight/styles/magula.css | 117 ------------------- docs/highlight/styles/school_book.css | 109 ------------------ docs/highlight/styles/school_book.png | Bin 486 -> 0 bytes docs/highlight/styles/sunburst.css | 145 ------------------------ docs/highlight/styles/vs.css | 79 ------------- docs/highlight/styles/zenburn.css | 112 ------------------ 18 files changed, 93 insertions(+), 1166 deletions(-) create mode 100644 docs/highlight/LICENSE delete mode 100644 docs/highlight/styles/ascetic.css delete mode 100644 docs/highlight/styles/brown_paper.css delete mode 100644 docs/highlight/styles/brown_papersq.png delete mode 100644 docs/highlight/styles/dark.css delete mode 100644 docs/highlight/styles/far.css delete mode 100644 docs/highlight/styles/idea.css delete mode 100644 docs/highlight/styles/ir_black.css delete mode 100644 docs/highlight/styles/magula.css delete mode 100644 docs/highlight/styles/school_book.css delete mode 100644 docs/highlight/styles/school_book.png delete mode 100644 docs/highlight/styles/sunburst.css delete mode 100644 docs/highlight/styles/vs.css delete mode 100644 docs/highlight/styles/zenburn.css diff --git a/docs/css/screen.css b/docs/css/screen.css index bb265084f06..72c001303a9 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -274,4 +274,23 @@ h3 a { .twitter-follow-button { margin-left: -9px; +} + +table td { + color: #666; +} +table td:first-child { + color: #777; +} +table td:last-child { + color: black; +} + +table td code i { + color: black; +} + +table td code b { + color: black; + font-weight: normal; } \ No newline at end of file diff --git a/docs/highlight/LICENSE b/docs/highlight/LICENSE new file mode 100644 index 00000000000..422deb7350f --- /dev/null +++ b/docs/highlight/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2006, Ivan Sagalaev +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of highlight.js nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS AND 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. diff --git a/docs/highlight/highlight.pack.js b/docs/highlight/highlight.pack.js index 076cfecc736..d1532b30d48 100644 --- a/docs/highlight/highlight.pack.js +++ b/docs/highlight/highlight.pack.js @@ -1 +1 @@ -var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(/"}while(x.length||y.length){var u=t().splice(0,1)[0];v+=l(w.substr(q,u.offset-q));q=u.offset;if(u.event=="start"){v+=r(u.node);s.push(u.node)}else{if(u.event=="stop"){var p=s.length;do{p--;var o=s[p];v+=("")}while(o!=u.node);s.splice(p,1);while(p'+l(K[0])+""}else{M+=l(K[0])}O=N.lR.lastIndex;K=N.lR.exec(L)}M+=l(L.substr(O,L.length-O));return M}function J(r,L){if(L.sL&&d[L.sL]){var K=f(L.sL,r);s+=K.keyword_count;return K.value}else{return E(r,L)}}function H(L,r){var K=L.cN?'':"";if(L.rB){p+=K;L.buffer=""}else{if(L.eB){p+=l(r)+K;L.buffer=""}else{p+=K;L.buffer=r}}B.push(L);A+=L.r}function D(N,K,P){var Q=B[B.length-1];if(P){p+=J(Q.buffer+N,Q);return false}var L=y(K,Q);if(L){p+=J(Q.buffer+N,Q);H(L,K);return L.rB}var r=v(B.length-1,K);if(r){var M=Q.cN?"":"";if(Q.rE){p+=J(Q.buffer+N,Q)+M}else{if(Q.eE){p+=J(Q.buffer+N,Q)+M+l(K)}else{p+=J(Q.buffer+N+K,Q)+M}}while(r>1){M=B[B.length-2].cN?"":"";p+=M;r--;B.length--}var O=B[B.length-1];B.length--;B[B.length-1].buffer="";if(O.starts){H(O.starts,"")}return Q.rE}if(w(K,Q)){throw"Illegal"}}var G=d[I];var B=[G.dM];var A=0;var s=0;var p="";try{var u=0;G.dM.buffer="";do{var x=q(C,u);var t=D(x[0],x[1],x[2]);u+=x[0].length;if(!t){u+=x[1].length}}while(!x[2]);if(B.length>1){throw"Illegal"}return{language:I,r:A,keyword_count:s,value:p}}catch(F){if(F=="Illegal"){return{language:null,r:0,keyword_count:0,value:l(C)}}else{throw F}}}function h(){function o(t,s,u){if(t.compiled){return}if(!u){t.bR=c(s,t.b?t.b:"\\B|\\b");if(!t.e&&!t.eW){t.e="\\B|\\b"}if(t.e){t.eR=c(s,t.e)}}if(t.i){t.iR=c(s,t.i)}if(t.r==undefined){t.r=1}if(t.k){t.lR=c(s,t.l||hljs.IR,true)}for(var r in t.k){if(!t.k.hasOwnProperty(r)){continue}if(t.k[r] instanceof Object){t.kG=t.k}else{t.kG={keyword:t.k}}break}if(!t.c){t.c=[]}t.compiled=true;for(var q=0;qx.keyword_count+x.r){x=u}if(u.keyword_count+u.r>w.keyword_count+w.r){x=w;w=u}}}var s=t.className;if(!s.match(w.language)){s=s?(s+" "+w.language):w.language}var o=b(t);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=k(o,b(q),A)}if(y){w.value=w.value.replace(/^((<[^>]+>|\t)+)/gm,function(B,E,D,C){return E.replace(/\t/g,y)})}if(p){w.value=w.value.replace(/\n/g,"
    ")}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){var q=t.parentNode;var v=document.createElement("div");v.innerHTML="
    "+w.value+"
    ";t=v.firstChild.firstChild;v.firstChild.cN=q.cN;q.parentNode.replaceChild(v.firstChild,q)}else{t.innerHTML=w.value}t.className=s;t.dataset={};t.dataset.result={language:w.language,kw:w.keyword_count,re:w.r};if(x&&x.language){t.dataset.second_best={language:x.language,kw:x.keyword_count,re:x.r}}}function j(){if(j.called){return}j.called=true;e();var q=document.getElementsByTagName("pre");for(var o=0;o|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(o,r){var q={};for(var p in o){q[p]=o[p]}if(r){for(var p in r){q[p]=r[p]}}return q}}();hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/.*?[^\\\\/]/[gim]*"}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@font-face",l:"[a-z-]+",k:{"font-face":1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"",rE:true,sL:"css"}},{cN:"tag",b:"",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",c:[{cN:"title",b:"[^ />]+"},a]}]}}}(); \ No newline at end of file +var hljs=new function(){function m(p){return p.replace(/&/gm,"&").replace(/"}while(y.length||w.length){var v=u().splice(0,1)[0];z+=m(x.substr(q,v.offset-q));q=v.offset;if(v.event=="start"){z+=t(v.node);s.push(v.node)}else{if(v.event=="stop"){var p,r=s.length;do{r--;p=s[r];z+=("")}while(p!=v.node);s.splice(r,1);while(r'+N[0]+""}else{r+=N[0]}P=Q.lR.lastIndex;N=Q.lR.exec(M)}return r+M.substr(P)}function B(M,N){var r;if(N.sL==""){r=g(M)}else{r=d(N.sL,M)}if(N.r>0){y+=r.keyword_count;C+=r.r}return''+r.value+""}function K(r,M){if(M.sL&&e[M.sL]||M.sL==""){return B(r,M)}else{return G(r,M)}}function J(N,r){var M=N.cN?'':"";if(N.rB){z+=M;N.buffer=""}else{if(N.eB){z+=m(r)+M;N.buffer=""}else{z+=M;N.buffer=r}}p.push(N);C+=N.r}function H(O,N,R){var S=p[p.length-1];if(R){z+=K(S.buffer+O,S);return false}var Q=s(N,S);if(Q){z+=K(S.buffer+O,S);J(Q,N);return Q.rB}var M=w(p.length-1,N);if(M){var P=S.cN?"":"";if(S.rE){z+=K(S.buffer+O,S)+P}else{if(S.eE){z+=K(S.buffer+O,S)+P+m(N)}else{z+=K(S.buffer+O+N,S)+P}}while(M>1){P=p[p.length-2].cN?"":"";z+=P;M--;p.length--}var r=p[p.length-1];p.length--;p[p.length-1].buffer="";if(r.starts){J(r.starts,"")}return S.rE}if(x(N,S)){throw"Illegal"}}var F=e[D];var p=[F.dM];var C=0;var y=0;var z="";try{var t,v=0;F.dM.buffer="";do{t=q(E,v);var u=H(t[0],t[1],t[2]);v+=t[0].length;if(!u){v+=t[1].length}}while(!t[2]);return{r:C,keyword_count:y,value:z,language:D}}catch(I){if(I=="Illegal"){return{r:0,keyword_count:0,value:m(E)}}else{throw I}}}function g(t){var p={keyword_count:0,r:0,value:m(t)};var r=p;for(var q in e){if(!e.hasOwnProperty(q)){continue}var s=d(q,t);s.language=q;if(s.keyword_count+s.r>r.keyword_count+r.r){r=s}if(s.keyword_count+s.r>p.keyword_count+p.r){r=p;p=s}}if(r.language){p.second_best=r}return p}function i(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"
    ")}return r}function n(t,w,r){var x=h(t,r);var v=a(t);var y,s;if(v=="no-highlight"){return}if(v){y=d(v,x)}else{y=g(x);v=y.language}var q=c(t);if(q.length){s=document.createElement("pre");s.innerHTML=y.value;y.value=k(q,c(s),x)}y.value=i(y.value,w,r);var u=t.className;if(!u.match("(\\s|^)(language-)?"+v+"(\\s|$)")){u=u?(u+" "+v):v}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){s=t.parentNode;var p=document.createElement("div");p.innerHTML="
    "+y.value+"
    ";t=p.firstChild.firstChild;p.firstChild.cN=s.cN;s.parentNode.replaceChild(p.firstChild,s)}else{t.innerHTML=y.value}t.className=u;t.result={language:v,kw:y.keyword_count,re:y.r};if(y.second_best){t.second_best={language:y.second_best.language,kw:y.second_best.keyword_count,re:y.second_best.r}}}function o(){if(o.called){return}o.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(r,s){var p={};for(var q in r){p[q]=r[q]}if(s){for(var q in s){p[q]=s[q]}}return p}}();hljs.LANGUAGES.javascript=function(a){return{dM:{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",c:[{b:"\\\\/"}]}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}}(hljs);hljs.LANGUAGES.css=function(a){var b={cN:"function",b:a.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[a.NM,a.ASM,a.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:"import page media charset",c:[b,a.ASM,a.QSM,a.NM]},{cN:"tag",b:a.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[b,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",c:[{cN:"title",b:"[^ />]+"},b]}]}}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{dM:{c:d,k:e,i:"\\S"}}}(hljs); \ No newline at end of file diff --git a/docs/highlight/styles/ascetic.css b/docs/highlight/styles/ascetic.css deleted file mode 100644 index 9faef268768..00000000000 --- a/docs/highlight/styles/ascetic.css +++ /dev/null @@ -1,44 +0,0 @@ -/* - -Original style from softwaremaniacs.org (c) Ivan Sagalaev - -*/ - -pre code { - display: block; padding: 0.5em; - background: white; color: black; -} - -pre .string, -pre .tag .value, -pre .filter .argument, -pre .addition, -pre .change, -pre .apache .tag, -pre .apache .cbracket, -pre .nginx .built_in, -pre .tex .formula { - color: #888; -} - -pre .comment, -pre .template_comment, -pre .shebang, -pre .doctype, -pre .pi, -pre .javadoc, -pre .deletion, -pre .apache .sqbracket { - color: #CCC; -} - -pre .keyword, -pre .tag .title, -pre .ini .title, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .apache .tag, -pre .tex .command { - font-weight: bold; -} diff --git a/docs/highlight/styles/brown_paper.css b/docs/highlight/styles/brown_paper.css deleted file mode 100644 index 8cd343a0ee4..00000000000 --- a/docs/highlight/styles/brown_paper.css +++ /dev/null @@ -1,103 +0,0 @@ -/* - -Brown Paper style from goldblog.com.ua (c) Zaripov Yura - -*/ - -pre code { - display: block; padding: 0.5em; - background:#b7a68e url(./brown_papersq.png); -} - -pre .keyword, -pre .literal, -pre .change, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .tex .special { - color:#005599; - font-weight:bold; -} - -pre code, -pre .ruby .subst, -pre .tag .keyword { - color: #363C69; -} - -pre .string, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .tag .value, -pre .css .rules .value, -pre .preprocessor, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .ruby .instancevar, -pre .ruby .class .parent, -pre .built_in, -pre .sql .aggregate, -pre .django .template_tag, -pre .django .variable, -pre .smalltalk .class, -pre .javadoc, -pre .ruby .string, -pre .django .filter .argument, -pre .smalltalk .localvars, -pre .smalltalk .array, -pre .attr_selector, -pre .pseudo, -pre .addition, -pre .stream, -pre .envvar, -pre .apache .tag, -pre .apache .cbracket, -pre .tex .number { - color: #2C009F; -} - -pre .comment, -pre .java .annotation, -pre .python .decorator, -pre .template_comment, -pre .pi, -pre .doctype, -pre .deletion, -pre .shebang, -pre .apache .sqbracket, -pre .nginx .built_in, -pre .tex .formula { - color: #802022; -} - -pre .keyword, -pre .literal, -pre .css .id, -pre .phpdoc, -pre .function .title, -pre .class .title, -pre .vbscript .built_in, -pre .sql .aggregate, -pre .rsl .built_in, -pre .smalltalk .class, -pre .xml .tag .title, -pre .diff .header, -pre .chunk, -pre .winutils, -pre .bash .variable, -pre .lisp .title, -pre .apache .tag, -pre .tex .command { - font-weight: bold; -} - -pre .html .css, -pre .html .javascript, -pre .html .vbscript, -pre .tex .formula { - opacity: 0.8; -} diff --git a/docs/highlight/styles/brown_papersq.png b/docs/highlight/styles/brown_papersq.png deleted file mode 100644 index 3813903dbf9fa7b1fb5bd11d9534c06667d9056f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18198 zcmZsCRajhYlWil7yGw9LaCaw2kl^kP!M%at?m>cka0u>ctf6s&e8CzTLSrGMaSIUS zWM7q;>fa~s$OpT> zFLY-GO$7j;Wl{{7eE9cF?XPU&ukYpLA870A2vBhFvU6lq^RRVx)N{0T2=eQ4J41(5=2G+8;)w1ZEPMkbF2bGnazV|OLZz2Hb@=WyXBX0)f+0o;fWze0N{t<*y ztIiNnZC{LRA&k!$ZY8RSSkRr34SfzyO1FQ1#+`5DKBGKIaW*#IpS|)H)0b)RO)vVT zdmZs``V5~Rd=7^niGNRi-KohFdl7;cLNt=6H%jET$<@@a?HPC}DI+UeV-R$j(|Cgb zovyEp&h`&JS~h*u+dsTgScW2zDVr4f~DH;Zx@cQhlKiyzUik!{j?26_bcGl3n zz;xi(8ENgs!;6LMT9?9^)|SgIm+Xu<9pAn@Jwvr@j|kU$Ps<;yJK|Ptilz{)cF~50 z>3}X}-GE2L$gd5vToUcA;ufTe+vCmq6y;EHLIF1Y)!*mMIk7Ufz`-6@{%j+0t}5by-kjAimHgt*AfoWQ3<}2%HH1G)X=gxwsGTnqo!jS zPp^mHU)Wdo9i$J93f_cGL~o081HVh2MIfFb&r#24&zMhy4-B`@-M4wqKeV5e3rOCk zzfxnXb=ed%7QxZsGFZ!Bk=ojIqXM0lz`=t&N`(ieb`uT$vaWG--x!ps=kokELG7^v z+{LRR;H>H{+#Sy9)~}T-X{s*WDIF9ko?!YOUrBL6c1UTt%|c-C%-R`h{*D&-?xTv6%U;Fy)q@zD7n;Mm&VTYo!f>`4|^@IrUrWqi<2` zIK=%8Y>k7_cJFc62Fm1dsu5V%^D!kOF(oA;3duw z%pO09{DvbtIv+U1{6MQ8Wq|e~4(8RFaZSiu$ z|CJ~BTvRLdM64V`xYr`XpzSoka%-H{0)Ro-jT6+} zT18|CY&T<`K}73~WMQMkzj<-{e`EjOV2Ch(n321C+#16;>MjIhblly|M?Br0UERMA z8yIvk9sVuv0~h)1=S{wY{&V6fDi@0c8|@S!>h`gR_^u~(f!y=uu=3o8U2>$VV-mwV zeJKl8K*mz%0O$3!XmmqEd#rW!>oY?U<|?CBsX=UMCSrinA}B9GA5MTUzn%ILQD=}Q z^-qc}to5D!{UYEBFfSF{7{}5#I2`7!9Xcs|{e!rTVYvNetFc@43N$#e!DM_Y#5_4V z3P*)qJyw97IJGZYj53iEQKK~Zk6QE|wnDAQ6e%ci7WM9yX{3Voy>2v7-{dW*|+Zvy7%^(o^DMc&%_Tp}4@Jo%0Bs7ObY$K2QS=1v19slY*WwV!8B05I;*7gc| zC}iWT!ocL=zoXCa-*EVkQZPGoFVou4>|(ng{&T`5ns(d;`0IWRE4$3aCE zX={pif)xfKL2J&CwL-rbsVhFX~Ast|24AzGCb$6bP zzjP96&p17?0`zA}Cr(1{- zBWmAc^Tih%c@PSpJD39Rtvbpc27|&`W}18q&trP3z4xp%4^t5T!T})zWON*!hQ+0C zGnKXI-(t5+$xcN_*!vy^Ebcn(`}3GQ=EjrR)jEu#)a!Qo+uU^L6Sf!vtQo@-)YCH_ zIkq!}#RQ?#H9Na)c>fA?i%F=AwN>+%6IHG_6~07@;tNMw)pj-py?fm5OAkUXC)Brp z)eG?cTAV-ODy=aRrlcS^!0S!95GOO@_zy6Yr~oZODHiWB(rYDHVW+oP+iSHanvW_2 zD+33#kuvw;P&BQf8OM-`63t1%h)cdnm8}>fIrS=425~>gpk!*nOPF^FRJ!}0{NO(e z1ANE&sU_mPMS;Pw9^8F*v5!k1Dr?=^%?eWij0f~to7y`V{K(<#9fgxsh1qZ}irc;t zApc;fE}TBG^?-(ZYfC3hk)rzA9||a50&`5$fOMODInB^CQQz-%|FVW(Me6cd&RQ!Em*`8(cOiTV*}I0^ zkh9#bz+b`^Achh+t!T{E%m*7Spr8X*#NFvrNeQKR9N#NYImXo$orFW}S#|kp!g) zC|mslRtj z{<(wk5heSmNTLQPjVu+tu`Ax0<Jp<3;sv=x5%C^te-lbQRUIA>ktvMAj}|$FYU$Qp}=T~;pv%9btR=dxklUy zkR9E*9e)3CPHhghYGI4o&yB<6Ek^@&s6_$^hHm%y;$mG#6s2Gj@yUh|7NNvbZ*-CiW>(`$PB*?kxl)}lSZKB^Wx?u%oy%PiU;Ucb|V z|JbtHI`e>wDu43V9mbmTz-O*hsj=x3p@_52uHWdv$KHWXIJ?hAN_O+SE^)}7#rG|6 z_BKM`Ghwpm2fNaI-XM&&0MIfLw+nk~2$Q9!(m1H({sIm*PjV$tD(vHzF8J^I z$5d)V3#P=#{X0~lkvdz*hO?2|P39$67m%BB>cJ;P&i?e>f6oD0A_x(fXnlhN8_iy~ z=8_i6_?scR{Q@F{<_+s`6F0?)4q>Y!TZURG@z1Xg(XF|Uq<7M}+x3!5CKzKPU%EBw zWsc%dMB{e=rbNFynyQz;$Wk>xdNDkRB!r}hPlheoBDRi4NdE0U68C8T=FwmB)E|du zu(3Ry^ER}qt8o=s^t;)ka7?Rw9BkK-AbMm!5YyN{n8j%4(FS=#^NXNFzOKvDh-fh_ ztrMuN#+;}%O*fdC_O-zikI?cL4FkQFbMJ&%;LsLdp2pU1z81byeDrcnfVfSPjd&Tx z0uTNCRa&zYgwCK{AP>=r8Sx{G=0I#zQ4SAF*CLY5@Ge_3>$_ebR&z8QuoP^G_nMbA zR!J5=NfW+bA;6g4yh|56J$}zRiUEt*T!NqU4MM$Ik(YO5ElC z3I>TTR5(&RS-e$~mJ610i3Tb|O!%oihx2Dou=SDi zY8QGbi&iMst0x9N)(Qw|m<=v9=H$h=d9q7_RC$8&xiTCpO(nAT)09jNd*kDz)xA=d zA>mDJMEO}wm=z8%##p8Epux^Z?6*hT+bBf^Yw~9wh1mOBI2*B_&;n6YqN$_sLi+`r zN+}oUEH%!)UEZO0kGwoV{fV0125Liy{XQRjOG;ll15xL$5w(ynu*BE#Y!uUbJlqhC z*)p9Akd=!p3VXT;Mo_Zvej_{xJkq)x&0<&B)@Utjud|co5aPb~dM)3OKXKmRzZ}RD zt~hR#D>70m`e$6d9RY-q2@W6QANld%IvZ*VmwpbdVCzWDJ`&UO%hC*(c9AJ; z8qe|b;=knC|ZRghL9-j+JpIpBjS zLIz{G#rkZ%K&UOs1pgA;bi1JjfXryT;9AV*AdF1(P;A$V^MMS0X10gTzoNjJBTB;U z#kJ5|QkG?|zHY}$^ddtj_$wAkIcd;Wk|&B6^`fnOL3uIPj@Z+b!gftAC_YE@sh~EY z@awBver>U-j(pBMf%*W;OI?#3J3yRO&^PqFHW`#yr|%#0rDM+^ZV zw!IXpiDk0Qo5iL_mNZlA`+m>mgyn-Z9( z1VK4OJry2Iq?o90-NhDNVAP3Niev{MJh~PQ7M5U9?Ob1#H}q=Dgn%~Ng=3b;7jX>n zADv=?=pgaOIN2G2JCr_(7k0YF#OlE0c}by4_|pb-iJ-CYzLbWwHs2A)ZY;uuYwbQMUa1ed5)1G+DXr$;MC*sQ-N@4$xD327+bTrT^ z?kmr?X}=Lu2xf7X5|gkw#k>FEC139#QtL*Y>C)kvvqB=d;fVQ8{+;RhP-)is9rX&jj-Ik zT00%|O4wv`6`(M(&W*hs2A z?qIa9QPvO>*ssTM+$((GcA1>?(C1jm10t6@Dy(k%HtIN+5d!Bk;~J%32ZhcKu$-i2gOM1Ek)Av0js<&PBErK4 zp0BqauJ^Yy7bnHdyGOO!FbWP*qG)O@I>y%wAIOX9eD)7R>ow6xlYRy-h|ZmQaLshv zm7r7H)>I5~>_i>NDSv6k)mCwZu$9K6)JGn#ni#>O5}3aMrYt7e67}_&zNlt_@b&$n z)VO|sK6qnt57(FA0!{d&$}h!DdNgOgYMn=8${CJ>S2YIAe zYh9atd77_K6soYC+WALnJL7SxqnE#(+1G`m^0I56gta@e+L0z>IRG+?>DS@Oe-NlQ z-mQ)F{=7b($L)X@jB5Ot*D*>ceMR8793ItK-tTO`iAnNm-xzYn0#;&=gXJYz8KmnUBrL#cb@ELwnkp?O zZZ{8tSRklRk}8Ts29G>v-&z?qob#qYSe!ek zt^r`X2W(J?(qxhOf%h#^?8D`^&MPbuUE9s z$80u<1iU&&+mQB<4bZeyBaOB}$!d@`^f4+iXS3;h>rXP~*FRrr)Wki^(q)&EwAMt?71xOWwtXa8UsY(_;C*7d*d9Z z-#(@Mu>`+6lrEC|=E^q^u&A=e+P9|#`hdP0Rg9`gUbNqm@!-Gg-V6vL;!*U<4ZtIa zv@cWy_^m4cV=F@sv3lCwx|?r%lb?NGQobaW&#Mi<9dngpq({-uy?xwAR&#MBUtybddE z1Ka>|_TRpK@#mBE#M;ka;RDR*2pXmP#YHG|5qh#YgXDUPD*cs3)>>Co@wnbArjo;_^QGnuQGdUSqu6AMPxBHbW99c9gHFZ*u&-M5cS}n@d z@wWUbV?X7y#NTCaqV_t*)w+Vzpte?L^08$=xiju5lCZ4~#~@34qa{rJM!{y~Tqe5H z-`N}U;ZKj9jnYas%EXCD=*$|XC$h{m@?;&T(uT--QOR_H^PcjyAP~pc&dS&v#J%KN zK|)APC-pnC;EKdibKx8O+Pqef? zY3J^)uf~;VDge4m$gh`Aj{?OYnES!Tftm1kjZwLB-5soBf8q9RaPk~e{SqHq+Gh(R z<}KbtcWaoIC!do+k`h}5s~QzJ&#Ro?TzU_eO^xAgvNoX&oKS7|-8Lm;%2@BRKwb9H4rRICqXPIQLdOMGtG>0(Kh}5xDzW z<`R5ub7|^ov6hX(i^R_d6ZdLQ5t}vu@?2|ueBl^W!CoR=LZ1Urel(cC{`jK##xJ5Z zW6m&PFV^e{7~mrz4!xy@n!O%C(vIRG0g>FrE1t+=n3;z9D!vWHCUjqMi*QAc4!hId zk9MAo2%jf}g*lzYPM7_RYQxo3rJR%jUCd5FoBmmSn@QTM@?QERM*E-uEb}GD!7+W4 z;ucS;Fa1*ZgF9U&8>R&|tjy3FH;93-Kpof^^nCm9kp4U+SFqwi@6}>$jo4)7x?L*p z5eHsG=We;aDoq*x+H6v7x39;dP<1mgK0fQuG+#L+=2<$z#m5Z5 zCEto{j1wIIxQ(7>!yi2iRgQS~c_6N5JHqo=$`q=PD?Y@90#727stD}1n!C~qy z1q^LAqT}jq4r2TFIf&-|vYu|DXI}0>^}2ev5jUXZCM+ZOWL>l4t}d2Pur%y+XM$j(Cc126Ww7ST~4S;g=2q8j3!|OoWynEtKkuUjZ>k za%azP+sS^P^KJ=|`TAdnlNkRHqn@0nFWdFeMoI4-_sH22UA`hq_xA?B;_u;ixDrx%9ajWMqLgzfYCofw8KF`gO zWh92d@!_T((;rc7)Y0;~o3^0R^ALS8opgP}hX%hpsuO^eo@L^`#d1RJD{m2kN6wGw z5T;|y=;jNZl}W2j;Bc$yGn_%Ti(Jtk4%` zDK5cCl`%fdh(p%F! zN4;@Huf@ukLx1k|0(qt;@&Xiw=4#8cVPcfFDX~atn}9jl7(Tz#p-Q|4F%ywo(jlv# z%qISsaHlw>1|(CS*2KqRSCP8NF(6NfJ>HP|lV`v4llSyqeD!0%X_1> zg{vvN5D0m~n!O3#;}}s;n>z%iE0e^EX_%IQaWRp4yx4LOzqV3T+W(;k{udVh!#EJ} zgnXu%H1P~HO=bwcbt57%T)u4QT05g9BA!O6PoHP#DPg-80&W|M33F=n@!{4j6>-=9 zl9KJP6S3H+U>;T?}#WA z_O%upq*IdOTe9b~q#{Y}07vk515LC)Il|+Aa$f}Tcr-&vQOIH)UZ$6& z36g&<+>7?MFwXUe`uwpa`gVyIwLJn~p1QK-H&X5vGa};Wdy^Q_m|$Lgl*a(g9EO{h z##w%7(g(SjboyvXP~vP72(|N1)ZI{XNa-&bPjF54D`q-}^mUm=DGk7I_a#t~zNU)> zJD=vyGTVi2y}*&qMByXD3Tn-Wj|5S#f( z1uWJ`3RnO6rh+Yy?c=B~PUJ?nV_{w6l7FulT#(2M_~r)HsCX+L?$5L39mEvBSU`8$ zYq&EhHXoxg(J-om_c-fe@=~3q#OG#^kYLhMnV)y;ZF6Gqz_mr2P zugbL0xc8{kyxRcLC?m)K&Yj$%)>_B@og|1@e~QPf=dh!p2dBQAtX$a~q4}AI9ArA; za(4@-P0mv5dlML~u;DO#U*_mx8yZv31rn3O5F4pLW;#xXKA<~u3@cMIw&h)_VR
    G3S-EN>9CM!{YB*|;6wg-K3V?)eR((z#1 zHyX+Us~H@9)~!8`K-#ZDU>v8HpiaQ|@=VU5MgT@ehzQ(1nZ!M0ZDk{Fb`>pCb0vQE z`gX@ZK}6S!(-($v3w8-+L6Xs~;@WTrR}q42gH9p2ncZYDab8*`#p8jbS&H9$DTx{1 z|8L)r+}X3oIp6b9dN^fZsl0TpRK4NW^TVGZOit8~r*qM+QL3pd7G0|~C`PHxw2PM3 z->n8iEh)LU)Je%r7nEt|D%&F&(={XI*19z_HKI38aE6Cfm-buU7W|=mo3gMA57~g` z7aBx4OS&(O5w@W;2pO@ZVyG;2^F+2cYshx%M2*M@%;(4quYc}>z1WX(9ccb&>8#{j zE=VlFg+&2-xsr%AY_}ciz4+<$^}2TO2e)byPmJl?+aOU7{UVx$=ZNQDTQLxsh}+(_ zak-NBw`v4=+Ydp_L=w^J1&NT$-AbEUuj%8LN7nJzt^APyl$(ght>;(o{)xCqf8IX6 zq`a-CyPq$UOPJN(oo>$gX?v65Y$GnIq7Fq?=??};kY4#Na69k#iG|Wd|{Tt z&uFLgaDQ4)`{9^3rX|Bg zNY8N2w1??HVsq#}Xk&RcmoQBacog;CZ%I-HU?7dT+nZRo?h7BQd5Yrv%sI0rPF^Sk^9@l-_4``bwK!A z5Ud{#8B%fMPHat04G9kj%j5>0maQK}jQTzGC!2<9FicZ-#V^ZaC)A?QK9EelA!nP) z+Z2DqYAqTsfZ9k1CW9+h;Uao59}OnJ9>r}xs&nHlM5^Y58T*TkM80zn8=UE2e8u{j zpH(Cv<_IWBdh<6_f1={d7#R|wGLcIoegMU>82VZLrcn;{FuCmF59Tpu7qQ5TEj5`AFXQxx{XS6|0N# z3g?J^0RDM8_l@3M4G0f^O03>$S#_it3cdG%7HWo_Xb-<{a&XHHzW`(2t54<~-m{AO)J~7AhPI zbkz9A9Eq!7aijhY%^=rG`j6?w^hb13^_LKf!X*}jaV$GaXvsies~+H0T#v%OcveHN zw6t*A@XdVfqJIPsPwPO4;>%M4C+{dTVU{cOk`3puW6b36K2&z%>btSk&&H>Z;<`p> z`FMTMiHw&wOXcQ$-Y{pG@3aN}s_>;# zeQ6GDsqIMA?iz{B1XzIIegeu-#qL_ZBH|eh`L{~J(A{bH*vND8W}io(WZ9s;;m3qZ zElXp!ru)Ht+yJJ|dfvRtcX?~Pn_nW{zZbM5z3mB?Hbf_|+7ZC-9yVjR&7mnNul4vE z%KEK*b1~tReV{kNh2E=&iwgU8w0kYs3c1o6m;*fZfrF-g?1!~+<-`f!Dj8+i7NJUI zcZj}vt?|8iHQ3TdM;gn(X(Vidn!cd{^x{>dX&Vt^`^_3pu?t)#>x|K0cW=egSMl9#+mqq-8|RdMP1Dw zx^5}L#|i6)ERW8LBjm}wD6@3$`!cXl0aV*W>(xz)J2m+v|RNGEXIA%XWv z$Hx$v!@W5LfaU7iEY}no2e;*F&dh{F;<$?``JyH&l3RVjA{xC=Rq{ z6}dLQKK(BW4N!Y)Mzd3h)PX8L3OR6JX82vsk%|<`y{3G<99ycR8(ZD;4@=k|d zx1nPOrARPmMi86c#Qn^1g5RVk00)%LY3fdvDm`_|D|ZP>a4hmnJmTiqc40*eItZ0G z(Cfxe`6oWB{4L&V2-lf)Dz{MkXQ(A{E}?e1cWU;s-J?xBbGBUgebeTI{+k+LT|P=A z;GHDn*981}=hBJAGXPX?iXEu)RoZN2kKn)}Yp)=+)%`(=Hk2z^Csu^a+hNSE9<}O4 zW9BhF843QW<{+N^4NZ(+Ohu0L$qp9AhpJ?UbX8~fibx(>f3CRh|ZH~FPW;%L4 z2Jfb`#^2zr=0rNvM5{6`q6x-M;QJ8B$W1lwJwBT6OTa+L|E?*68NnD-d zqirI@#!DTk6=nvBq1t|F2a57+*JomCoPO&bkNHd&fq@7CoA#=ogI@ER;^g6MTjnNJpU8$17lkcby!fn#Y^cf59qs4;WjW9@I`pu+^=!$XvlzSp zHl-BP6qCLifc*pwQ8vDfUY0lgjC>>zTLL$6VLQBKH2U4M(&?%A718nspPj%tmUBw+ z#X>LH_#p;`9!I5vv6@cVh1b)~bHTXz;!@s>4omWjec#A;((g=Fq_p{u1|<#I-D{h1 zr%{sZ%zv+3T?)s{c78c|r6Ez1kf5OuRJ<^!_`!;|HxG;mZiSf=CdVqy^)Fpf= zR6<3YrraF!c1|tIJ#;9sg<)`+=a+cw8*6)$-yV3w_=*W`MB#~zjz6^LYX4eVoTxdI zc3h_Bc-v+z^z5>e3vEp)brfA?bQ>r1^-8x`-ATBNL)99$& z;rXG-!IBn08OxyuZoj`hcQ)a@7O5;d=o7$6_hSTJ z;(^Dr%6p+QhE473G62?L^T{&S2^UB8^~fFHE0@wP^b_T#h%rn7^=(?yQf+N!)<~#c zB&mh#W%khdZrGJgs@ixb%h?ad2HG&$G8+QXR6zbUk;$(r4F#>F^1>Br!mAfDkRR@D z!K|#|oQjAh)DlY~3|CG`+4@opGIM z^i^Z4rXu>d*NVXngpKKI2U_*K}S3_}=T|7q^w`XB` z2D5mfvT(`vMwh8DGJql?=LI15;DsNI&n^nhYwgI&-{a#V-{;<=cJWiZ5HEkDY(4jD zc2?xCALMIz@)_iwDG(vRJQ8kP7xC8|N5n z-mb8AOpEdA->ZPnh_c<&o3Jg+X;AwynF(`1Ihpp9xt|hy zu7!?dLSahdVg=JpZk#xq{L7i0Y3(N`w+}g zn}vYJKK$VH`HhCBK)g%Cw8flu&$)8+Ef5m{+5}|bRYsP&t~Jk0TLEENO=yT3nrvyfYKk*n#uYjkyI9wC{A(mO8ae&B%;9#dTh)|_V0}&D>^xO(UZ2e z2{_|CZ)7#U(3yWf5i9##7`c79OX{6Y8(moRVE~tW6|XopYg$JLlxm|Q3X{o#=h{Lt zyCavxXR*2;2qGJ^XJ;nKfb^TpVwPUUM{br*(tWeRu{4Id4v!3gY2#K~T^)u_Zer}E zn_7xjY>yK@ouN|9;O0P^ZRT#CcRfGYf%F#Vs;VRb^a|0p^Z(QZ;v z_h#9VcRfJ+!d^?N=4N?P&mP&Il_OwCQMpD;0zHfk@ay$}8TVzgO~mUpV_LitM@Q8z z?9S+w#)-R7Wlo;vsZz9D@#pj>8Cxn}a*?q4(u0!Y^j5C?U$fc+Q?CL`w3ANg?&_1 z?FycB-DhP^mg2^y?@lqA_P>^f{|QRaU~igN=blSkS9CZwMjy&9MHhfv%{2!{eynf` z$pvnj!j!PJ^$UUrQOmKo@@YFMK}y`iI9Na(F-H2m)K^;G@|^OUI0RWuw$|>Zi>>4v zq8|c(foEJT-K`qR-DS&5P&JlKeXe6o?f)$qE9Lfsl2!ik}0GeaVk8W1YV42f9! zrDpRi_q@-CcyuXkqt%*k_=Sc09&?96Tu==56A9)J#}xMwb)PC2fO#x-Caabw>Rn0y z{HI2_IqLYwp=X|p=?Np~=954+Ml?kfMhR7O0xujiI*!b{uTA~|{_q>bBp z=-{T8<|tDq3CTI;lW2D@h@1>&cH*BDa_y{)8j?pQ@ST4-bycb_leaSjIqXOg!I-dI zwNUCuLgX|9CoCb|R&9g{#A6D$#nUq#?A;pr8AdUx?+Mg??0rWBc7w@CmP8$GxdE}e zzHzq~`$CYEEw*mQui5d*E?e~uhB&}WX3EcR8?CKn>HfFzpYY*7uYx^#J!@o8sI_T# z<9>7j4!UEiu=RQ98@44ed!uGToSby}kzEY$x!v2ihKXiyj2);!CRiFr>vI6V7wV&~ zpF$-W<*Q*jZKoda1CDyKwXd4AY%8NW?9?a@Yy}T{I z8l%pzl#*N&hVTtVAK9|*u$h3nx1=6hC?%PgdUH$1 zgU4B#9LvX`-GA_Cqken?Okqp8ZYE~ymacnbL{jExU#!eyp{f&~&7KrUZ(@I$| z*^;qz>W?cO%fU+}`r^A}yw+(=Jny@=CHlQvYr*sZn~Mq?a}U+deU_vMDx=p%_S zeq4>UTvg|Ns%zPo!tKDK1jo!MHXs5k!B@$&Iw30U0NMQkIcpzN?DYb2*ymZtS+0tL z|7ZN81f&h|3Gcxa1-K}FIu}UC&Q5;*yA>^uZA?ny{4)}sFcUL|IrhZMoeaaeLpX1W z;w-j*w2UV02#G(CdabMIPx^&kQ$y&xwe3xF%dn^Zx=-2>R>1)!wONiAju(G&X}wa&e3M9e@y*jUOnq=Da;aeY3U?)V#0wlC4b>zD zYg41RpwFSrtQS5)@i*U(!g@ZK3qpF#ekkwhzv36}MIRhhvDIX_{kvF-w-i!URUy&1 zZ(GVLd13Rxa`n}=54^&rT5t6b{-~*ny>~1i9TpVYZ!wNEQFHytZc3QlVJihZ*&r<0 z+pVZ@C%9pIE7QsXE_Wp;lEw)G|JA?Qr?Kw4JQlq%?zBMH%3 zQ6JVx`e*&{{{B6UR&7EDCoSR>Ia4d+4zz1c4JkkrJzYuTQJ&qreUvcDtG1l9xOB(^ zrc~7sn*MO0arcJ>5^dNJY0Dd`dhvNp0zvzsHa0TO=<$99GqoAfRNXiNXf(!*IEnmP zr8tbeCb^b*$m_VvC6g&*bjtGqCpo-Ox`{)A5lw;yGH&b+sGu3`p#9`TQsPue)fUR< z&`V+$NVA8gzWIS^yrU#20h!!^9m?LW?#vpgS2M(T!&ts|UtGu)ibm12hjYQH3>Qh9 z&4Gq1i{aI05C~XPmovUh_g2b!EvwQ{JyK_xNk>x&ulaux-hYGOKQD&wmOXCwH|wi# z>ZA;Hh-sqvZJyfmPTTsim;OTNb>l5w$r>9)Wr+8Y$ptx_kA@kv@KugIc@7s51}<>$GYQ56)Ki`;R>$*#5fm%=a3oHXA{2r ze(gE^q7@6M#NOKDk?lQ!5v+|OS})<3Q$-XinH=iC%oZ$K*8mR&EYajonfKIB3qJw` zEh)zGw95_xD1yBg7v#8+sMaF^CW02x=1c30XZN3`1|S3xsHPU&%AtideyTVxW^pmN zC+CEKwcWLdiPK%WA><$Zk_5~1-n5;YlQ3aqhz90Q0Xyfxt(2@|0?VzodBvU=`;yT2 z97iv%rVlOZAzEh~-1FWqO$aNkyaLq>*<|?mOs(GR3FT392W{moZ;HD&I)GzNjoj|$ z6#h>D!~{G0fG#7m_{NwN;WBo+FBYH&u^ak!z=N*W+uPe4om4A>NYVy$G_k2Ag|NAO z1wvW{1B!~LGZRF@(ZG@sG?88UFOlrO7R5%3$!Z0a^39~K+xO1U`7jU^5z(@hy;s>te8_ua9x0Q zn(l}+Nj+K~g&_``wy#um;Qzq?f&T;l2mTNIANW7;|84Ov|JCpRS8NUz9_W9coCNv_ z?xl52VVa7r#b5F5PRa<1$EH=S_IdUhr^0@&t!&FBRvJ)_Pg&>TFXt z;Him`;9z20Fs(B_&VW(!)c3M{jzBor(F1Dq}caD#skevw=^xy`W{jSaVH-|RF^ zSxJ<1s$c_lG4y9pCj12Kt805nHipE(fmI(remtK}i2v8umpU5=fE&6Kz!tKfD5{zY zco!fp1V_e}JZR%cv(4G}(kNtwr>75|O)au*I`|}b#FsjqhIe!NJ-zeaOcKF`RqzgX zM*JenjN>g8sc(CV9npdUo7l-3T~TbOt`ob-!+y>EHiCg>^;n^+rmplETdVk@A`cVT zA1`NM{`03FQ?x4Ad8O#s9fGCv7?9O}iuG`+X$PzYMAI#+5>jAk1=DDL4Zw~OY#s>1 zQelFQX}adIQepTSq~Q#Jb(w>Y{qR)gW)Aw04L6*=W|uYVCY8oiUWoVZpBMokVRv`n z|G@u&{{#OA{tx^g_&@OfZSgOE^Xp%o&t1c5t;L4bTyJavWpxv!`N2~II|QWnuI)Ob zYv3~hzdJ|?XBxHj0LyR7#yX)CPY)MQMfjp;JB;mJUhwT5L@?^+5I~?-#K5{H_o>s$tlw9%!2JAO% zwPewi-QXC{!xhKIj#2sjTTl)0}n}@N`7N{W=1DLw7kpe!!Zsa-=pa8*m(NH%XbHdb1Xf#@^W+ z0!Yl(Z&WF*q+t}rJ+X~J$AAkhsNVDQV?(l=i7Q)eikH_fxBDBC;`#gl3*YY74ymO- zu^WR8?-b)qS)xc+#&MP};#uWZXjqxtS8$~83O9k&BTMF?%87MjbR|K3ytK zDO-8yV;5vhR^p`+p+(ZmL}s%bYB1U6cA4RPB%6{$xxo07C&85m{tx^g_&@M};Qzq? jf&T;l-xmM>p8x{@D(Mktb)u`N00000NkvXXu0mjf(?NUb diff --git a/docs/highlight/styles/dark.css b/docs/highlight/styles/dark.css deleted file mode 100644 index a5ad0ae46ea..00000000000 --- a/docs/highlight/styles/dark.css +++ /dev/null @@ -1,100 +0,0 @@ -/* - -Dark style from softwaremaniacs.org (c) Ivan Sagalaev - -*/ - -pre code { - display: block; padding: 0.5em; - background: #444; -} - -pre .keyword, -pre .literal, -pre .change, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .tex .special { - color: white; -} - -pre code, -pre .ruby .subst { - color: #DDD; -} - -pre .string, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .tag .value, -pre .css .rules .value, -pre .preprocessor, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .ruby .instancevar, -pre .ruby .class .parent, -pre .built_in, -pre .sql .aggregate, -pre .django .template_tag, -pre .django .variable, -pre .smalltalk .class, -pre .javadoc, -pre .ruby .string, -pre .django .filter .argument, -pre .smalltalk .localvars, -pre .smalltalk .array, -pre .attr_selector, -pre .pseudo, -pre .addition, -pre .stream, -pre .envvar, -pre .apache .tag, -pre .apache .cbracket, -pre .tex .command { - color: #D88; -} - -pre .comment, -pre .java .annotation, -pre .python .decorator, -pre .template_comment, -pre .pi, -pre .doctype, -pre .deletion, -pre .shebang, -pre .apache .sqbracket, -pre .tex .formula { - color: #777; -} - -pre .keyword, -pre .literal, -pre .css .id, -pre .phpdoc, -pre .function .title, -pre .class .title, -pre .vbscript .built_in, -pre .sql .aggregate, -pre .rsl .built_in, -pre .smalltalk .class, -pre .xml .tag .title, -pre .diff .header, -pre .chunk, -pre .winutils, -pre .bash .variable, -pre .lisp .title, -pre .apache .tag, -pre .tex .special { - font-weight: bold; -} - -pre .html .css, -pre .html .javascript, -pre .html .vbscript, -pre .tex .formula { - opacity: 0.5; -} diff --git a/docs/highlight/styles/default.css b/docs/highlight/styles/default.css index e9b18e55727..8717dd4ced3 100644 --- a/docs/highlight/styles/default.css +++ b/docs/highlight/styles/default.css @@ -1,4 +1,4 @@ -/* +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev @@ -12,7 +12,8 @@ pre code { pre code, pre .ruby .subst, pre .tag .title, -pre .lisp .title { +pre .lisp .title, +pre .nginx .title { color: black; } @@ -40,7 +41,9 @@ pre .bash .variable, pre .apache .tag, pre .apache .cbracket, pre .tex .command, -pre .tex .special { +pre .tex .special, +pre .erlang_repl .function_or_atom, +pre .markdown .header { color: #800; } @@ -48,7 +51,8 @@ pre .comment, pre .annotation, pre .template_comment, pre .diff .header, -pre .chunk { +pre .chunk, +pre .markdown .blockquote { color: #888; } @@ -58,7 +62,10 @@ pre .regexp, pre .literal, pre .smalltalk .symbol, pre .smalltalk .char, -pre .change { +pre .go .constant, +pre .change, +pre .markdown .bullet, +pre .markdown .link_url { color: #080; } @@ -79,14 +86,12 @@ pre .envvar, pre .shebang, pre .apache .sqbracket, pre .nginx .built_in, -pre .tex .formula { - color: #88F; -} - -pre .javadoctag, -pre .phpdoc, -pre .yardoctag { - font-weight: bold; +pre .tex .formula, +pre .erlang_repl .reserved, +pre .input_number, +pre .markdown .link_label, +pre .vhdl .attribute { + color: #88F } pre .keyword, @@ -95,21 +100,34 @@ pre .phpdoc, pre .title, pre .built_in, pre .aggregate, +pre .css .tag, +pre .javadoctag, +pre .phpdoc, +pre .yardoctag, pre .smalltalk .class, pre .winutils, pre .bash .variable, pre .apache .tag, -pre .tex .command { +pre .go .typename, +pre .tex .command, +pre .markdown .strong, +pre .request, +pre .status { font-weight: bold; } +pre .markdown .emphasis { + font-style: italic; +} + pre .nginx .built_in { font-weight: normal; } -pre .html .css, -pre .html .javascript, -pre .html .vbscript, +pre .coffeescript .javascript, +pre .xml .css, +pre .xml .javascript, +pre .xml .vbscript, pre .tex .formula { opacity: 0.5; } diff --git a/docs/highlight/styles/far.css b/docs/highlight/styles/far.css deleted file mode 100644 index bb16fb3cc07..00000000000 --- a/docs/highlight/styles/far.css +++ /dev/null @@ -1,114 +0,0 @@ -/* - -FAR Style (c) MajestiC - -*/ - -pre code { - display: block; padding: 0.5em; - background: #000080; -} - -pre code, -.ruby .subst { - color: #0FF; -} - -pre .string, -pre .ruby .string, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .tag .value, -pre .css .rules .value, -pre .css .rules .value .number, -pre .preprocessor, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .built_in, -pre .sql .aggregate, -pre .django .template_tag, -pre .django .variable, -pre .smalltalk .class, -pre .addition, -pre .apache .tag, -pre .apache .cbracket, -pre .tex .command { - color: #FF0; -} - -pre .keyword, -pre .css .id, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .vbscript .built_in, -pre .sql .aggregate, -pre .rsl .built_in, -pre .smalltalk .class, -pre .xml .tag .title, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .change, -pre .envvar, -pre .bash .variable, -pre .tex .special { - color: #FFF; -} - -pre .comment, -pre .phpdoc, -pre .javadoc, -pre .java .annotation, -pre .template_comment, -pre .deletion, -pre .apache .sqbracket, -pre .tex .formula { - color: #888; -} - -pre .number, -pre .date, -pre .regexp, -pre .literal, -pre .smalltalk .symbol, -pre .smalltalk .char { - color: #0F0; -} - -pre .python .decorator, -pre .django .filter .argument, -pre .smalltalk .localvars, -pre .smalltalk .array, -pre .attr_selector, -pre .pseudo, -pre .xml .pi, -pre .diff .header, -pre .chunk, -pre .shebang, -pre .nginx .built_in { - color: #008080; -} - -pre .keyword, -pre .css .id, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .vbscript .built_in, -pre .sql .aggregate, -pre .rsl .built_in, -pre .smalltalk .class, -pre .xml .tag .title, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .apache .tag, -pre .nginx .built_in, -pre .tex .command, -pre .tex .special { - font-weight: bold; -} diff --git a/docs/highlight/styles/github.css b/docs/highlight/styles/github.css index 7fcc57889f6..a4f7deb78e4 100644 --- a/docs/highlight/styles/github.css +++ b/docs/highlight/styles/github.css @@ -23,17 +23,20 @@ pre .css .rule .keyword, pre .winutils, pre .javascript .title, pre .lisp .title, -pre .subst { +pre .nginx .title, +pre .subst, +pre .request, +pre .status { color: #000; font-weight: bold } -pre .number, +code .number, pre .hexcolor { color: #40a070 } -pre .string, +code .string, pre .tag .value, pre .phpdoc, pre .tex .formula { @@ -53,15 +56,19 @@ pre .subst { } pre .class .title, +pre .haskell .type, +pre .vhdl .literal, pre .tex .command { color: #458; font-weight: bold } +code .literal { + color: #333; +} pre .tag, -pre .css .keyword, -pre .html .keyword, pre .tag .title, +pre .rules .property, pre .django .tag .keyword { color: #000080; font-weight: normal @@ -88,7 +95,8 @@ pre .ruby .symbol .string, pre .ruby .symbol .keyword, pre .ruby .symbol .keymethods, pre .lisp .keyword, -pre .tex .special { +pre .tex .special, +pre .input_number { color: #990073 } diff --git a/docs/highlight/styles/idea.css b/docs/highlight/styles/idea.css deleted file mode 100644 index 68ab1420cfd..00000000000 --- a/docs/highlight/styles/idea.css +++ /dev/null @@ -1,117 +0,0 @@ -/* - -Intellij Idea-like styling (c) Vasily Polovnyov - -*/ - -pre code { - display: block; padding: 0.5em; - color: #000; - background: #fff; -} - -pre .subst, -pre .title { - font-weight: normal; - color: #000; -} - -pre .comment, -pre .template_comment, -pre .javadoc, -pre .diff .header { - color: #808080; - font-style: italic; -} - -pre .annotation, -pre .decorator, -pre .preprocessor, -pre .doctype, -pre .pi, -pre .chunk, -pre .shebang, -pre .apache .cbracket { - color: #808000; -} - -pre .tag, -pre .pi { - background: #efefef; -} - -pre .tag .title, -pre .id, -pre .attr_selector, -pre .pseudo, -pre .literal, -pre .keyword, -pre .hexcolor, -pre .css .function, -pre .ini .title, -pre .css .class, -pre .list .title, -pre .tex .command { - font-weight: bold; - color: #000080; -} - -pre .attribute, -pre .rules .keyword, -pre .number, -pre .date, -pre .regexp, -pre .tex .special { - font-weight: bold; - color: #0000ff; -} - -pre .number, -pre .regexp { - font-weight: normal; -} - -pre .string, -pre .value, -pre .filter .argument, -pre .css .function .params, -pre .apache .tag { - color: #008000; - font-weight: bold; -} - -pre .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .char, -pre .tex .formula { - color: #000; - background: #d0eded; - font-style: italic; -} - -pre .phpdoc, -pre .yardoctag, -pre .javadoctag { - text-decoration: underline; -} - -pre .variable, -pre .envvar, -pre .apache .sqbracket, -pre .nginx .built_in { - color: #660e7a; -} - -pre .addition { - background: #baeeba; -} - -pre .deletion { - background: #ffc8bd; -} - -pre .diff .change { - background: #bccff9; -} diff --git a/docs/highlight/styles/ir_black.css b/docs/highlight/styles/ir_black.css deleted file mode 100644 index 8b6f0775536..00000000000 --- a/docs/highlight/styles/ir_black.css +++ /dev/null @@ -1,102 +0,0 @@ -/* - IR_Black style (c) Vasily Mikhailitchenko -*/ - -pre code { - display: block; padding: 0.5em; - background: #000; color: #f8f8f8; -} - -pre .shebang, -pre .comment, -pre .template_comment, -pre .javadoc { - color: #7c7c7c; -} - -pre .keyword, -pre .tag, -pre .ruby .function .keyword, -pre .tex .command { - color: #96CBFE; -} - -pre .function .keyword, -pre .sub .keyword, -pre .method, -pre .list .title { - color: #FFFFB6; -} - -pre .string, -pre .tag .value, -pre .cdata, -pre .filter .argument, -pre .attr_selector, -pre .apache .cbracket, -pre .date { - color: #A8FF60; -} - -pre .subst { - color: #DAEFA3; -} - -pre .regexp { - color: #E9C062; -} - -pre .function .title, -pre .sub .identifier, -pre .pi, -pre .decorator, -pre .ini .title, -pre .tex .special { - color: #FFFFB6; -} - -pre .class .title, -pre .constant, -pre .smalltalk .class, -pre .javadoctag, -pre .yardoctag, -pre .phpdoc, -pre .nginx .built_in { - color: #FFFFB6; -} - -pre .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .number, -pre .variable, -pre .vbscript, -pre .literal { - color: #C6C5FE; -} - -pre .css .keyword { - color: #96CBFE; -} - -pre .css .rule .keyword, -pre .css .id { - color: #FFFFB6; -} - -pre .css .class { - color: #FFF; -} - -pre .hexcolor { - color: #C6C5FE; -} - -pre .number { - color:#FF73FD; -} - -pre .tex .formula { - opacity: 0.7; -} diff --git a/docs/highlight/styles/magula.css b/docs/highlight/styles/magula.css deleted file mode 100644 index 0f235e80fc2..00000000000 --- a/docs/highlight/styles/magula.css +++ /dev/null @@ -1,117 +0,0 @@ -/* -Description: Magula style for highligh.js -Author: Ruslan Keba -Website: http://rukeba.com/ -Version: 1.0 -Date: 2009-01-03 -Music: Aphex Twin / Xtal -*/ - -pre code { - display: block; padding: 0.5em; - background-color: #f4f4f4; -} - -pre code, -pre .ruby .subst, -pre .lisp .title { - color: black; -} - -pre .string, -pre .title, -pre .parent, -pre .tag .value, -pre .rules .value, -pre .rules .value .number, -pre .preprocessor, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .instancevar, -pre .aggregate, -pre .template_tag, -pre .django .variable, -pre .smalltalk .class, -pre .addition, -pre .flow, -pre .stream, -pre .bash .variable, -pre .apache .cbracket { - color: #050; -} - -pre .comment, -pre .annotation, -pre .template_comment, -pre .diff .header, -pre .chunk { - color: #777; -} - -pre .number, -pre .date, -pre .regexp, -pre .literal, -pre .smalltalk .symbol, -pre .smalltalk .char, -pre .change, -pre .tex .special { - color: #800; -} - -pre .label, -pre .javadoc, -pre .ruby .string, -pre .decorator, -pre .filter .argument, -pre .localvars, -pre .array, -pre .attr_selector, -pre .pseudo, -pre .pi, -pre .doctype, -pre .deletion, -pre .envvar, -pre .shebang, -pre .apache .sqbracket, -pre .nginx .built_in, -pre .tex .formula { - color: #00e; -} - -pre .keyword, -pre .id, -pre .phpdoc, -pre .title, -pre .built_in, -pre .aggregate, -pre .smalltalk .class, -pre .winutils, -pre .bash .variable, -pre .apache .tag, -pre .xml .tag, -pre .xml .title, -pre .tex .command { - font-weight: bold; - color: navy; -} - -pre .nginx .built_in { - font-weight: normal; -} - -pre .html .css, -pre .html .javascript, -pre .html .vbscript, -pre .tex .formula { - opacity: 0.5; -} - -/* --- */ -pre .apache .tag { - font-weight: bold; - color: blue; -} - diff --git a/docs/highlight/styles/school_book.css b/docs/highlight/styles/school_book.css deleted file mode 100644 index 54e8937cb08..00000000000 --- a/docs/highlight/styles/school_book.css +++ /dev/null @@ -1,109 +0,0 @@ -/* - -School Book style from goldblog.com.ua (c) Zaripov Yura - -*/ - -pre code { - display: block; padding: 15px 0.5em 0.5em 30px; - font-size: 11px !important; - line-height:16px !important; -} - -pre{ - background:#f6f6ae url(./school_book.png); - border-top: solid 2px #d2e8b9; - border-bottom: solid 1px #d2e8b9; -} - -pre .keyword, -pre .literal, -pre .change, -pre .winutils, -pre .flow, -pre .lisp .title, -pre .tex .special { - color:#005599; - font-weight:bold; -} - -pre code, -pre .ruby .subst, -pre .tag .keyword { - color: #3E5915; -} - -pre .string, -pre .function .title, -pre .class .title, -pre .ini .title, -pre .tag .value, -pre .css .rules .value, -pre .preprocessor, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .ruby .instancevar, -pre .ruby .class .parent, -pre .built_in, -pre .sql .aggregate, -pre .django .template_tag, -pre .django .variable, -pre .smalltalk .class, -pre .javadoc, -pre .ruby .string, -pre .django .filter .argument, -pre .smalltalk .localvars, -pre .smalltalk .array, -pre .attr_selector, -pre .pseudo, -pre .addition, -pre .stream, -pre .envvar, -pre .apache .tag, -pre .apache .cbracket, -pre .nginx .built_in, -pre .tex .command { - color: #2C009F; -} - -pre .comment, -pre .java .annotation, -pre .python .decorator, -pre .template_comment, -pre .pi, -pre .doctype, -pre .deletion, -pre .shebang, -pre .apache .sqbracket { - color: #E60415; -} - -pre .keyword, -pre .literal, -pre .css .id, -pre .phpdoc, -pre .function .title, -pre .class .title, -pre .vbscript .built_in, -pre .sql .aggregate, -pre .rsl .built_in, -pre .smalltalk .class, -pre .xml .tag .title, -pre .diff .header, -pre .chunk, -pre .winutils, -pre .bash .variable, -pre .lisp .title, -pre .apache .tag, -pre .tex .command { - font-weight: bold; -} - -pre .html .css, -pre .html .javascript, -pre .html .vbscript, -pre .tex .formula { - opacity: 0.5; -} diff --git a/docs/highlight/styles/school_book.png b/docs/highlight/styles/school_book.png deleted file mode 100644 index 956e9790a0e2c079b3d568348ff3accd1d9cac30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 486 zcmeAS@N?(olHy`uVBq!ia0y~yV7?7x3vjRjNjAS6Ga$v1?&#~tz_9*=IcwKTAYZb? zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD0|R4)r;B4q#jQ7Ycl#YS5MfK$ z?b^fh#qmaEhFDxvyThwfhdfkOPApt1lr{NA;Vr%uzxJuVIyzm(ed_8_-0$LLU})H&o5Re&aDemE>EG#(|F^t9_pa-H z_Mf?rMVrs}-M?S|?ZdY@c6s41zy8~}@a{v&#Ea7V)wJ$+#K|u$5UvWCdFLwGac}6w{_s*=8A6L7Rfc|9gboFyt I=akR{0OLZ+qyPW_ diff --git a/docs/highlight/styles/sunburst.css b/docs/highlight/styles/sunburst.css deleted file mode 100644 index c07aaaf70ba..00000000000 --- a/docs/highlight/styles/sunburst.css +++ /dev/null @@ -1,145 +0,0 @@ -/* - -Sunburst-like style (c) Vasily Polovnyov - -*/ - -pre code { - display: block; padding: 0.5em; - font: 1em / 1.3em 'Lucida Console', 'courier new', monospace; - background: #000; color: #f8f8f8; -} - -pre .comment, -pre .template_comment, -pre .javadoc { - color: #aeaeae; - font-style: italic; -} - -pre .keyword, -pre .ruby .function .keyword { - color: #E28964; -} - -pre .function .keyword, -pre .sub .keyword, -pre .method, -pre .list .title { - color: #99CF50; -} - -pre .string, -pre .tag .value, -pre .cdata, -pre .filter .argument, -pre .attr_selector, -pre .apache .cbracket, -pre .date, -pre .tex .command { - color: #65B042; -} - -pre .subst { - color: #DAEFA3; -} - -pre .regexp { - color: #E9C062; -} - -pre .function .title, -pre .sub .identifier, -pre .pi, -pre .tag, -pre .tag .keyword, -pre .decorator, -pre .ini .title, -pre .shebang { - color: #89BDFF; -} - -pre .class .title, -pre .smalltalk .class, -pre .javadoctag, -pre .yardoctag, -pre .phpdoc { - text-decoration: underline; -} - -pre .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .number { - color: #3387CC; -} - -pre .params, -pre .variable { - color: #3E87E3; -} - -pre .css .keyword, -pre .pseudo, -pre .tex .special { - color: #CDA869; -} - -pre .css .class { - color: #9B703F; -} - -pre .rules .keyword { - color: #C5AF75; -} - -pre .rules .value { - color: #CF6A4C; -} - -pre .css .id { - color: #8B98AB; -} - -pre .annotation, -pre .apache .sqbracket, -pre .nginx .built_in { - color: #9B859D; -} - -pre .preprocessor { - color: #8996A8; -} - -pre .hexcolor, -pre .css .value .number { - color: #DD7B3B; -} - -pre .css .function { - color: #DAD085; -} - -pre .diff .header, -pre .chunk, -pre .tex .formula { - background-color: #0E2231; - color: #F8F8F8; - font-style: italic; -} - -pre .diff .change { - background-color: #4A410D; - color: #F8F8F8; -} - -pre .addition { - background-color: #253B22; - color: #F8F8F8; -} - -pre .deletion { - background-color: #420E09; - color: #F8F8F8; -} diff --git a/docs/highlight/styles/vs.css b/docs/highlight/styles/vs.css deleted file mode 100644 index a5c8be8614c..00000000000 --- a/docs/highlight/styles/vs.css +++ /dev/null @@ -1,79 +0,0 @@ -/* - -Visual Studio-like style based on original C# coloring by Jason Diamond - -*/ -pre code { - display: block; padding: 0.5em; -} - -pre .comment, -pre .annotation, -pre .template_comment, -pre .diff .header, -pre .chunk, -pre .apache .cbracket { - color: rgb(0, 128, 0); -} - -pre .keyword, -pre .id, -pre .title, -pre .built_in, -pre .aggregate, -pre .smalltalk .class, -pre .winutils, -pre .bash .variable, -pre .tex .command { - color: rgb(0, 0, 255); -} - -pre .string, -pre .title, -pre .parent, -pre .tag .value, -pre .rules .value, -pre .rules .value .number, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .instancevar, -pre .aggregate, -pre .template_tag, -pre .django .variable, -pre .addition, -pre .flow, -pre .stream, -pre .apache .tag, -pre .date, -pre .tex .formula { - color: rgb(163, 21, 21); -} - -pre .ruby .string, -pre .decorator, -pre .filter .argument, -pre .localvars, -pre .array, -pre .attr_selector, -pre .pseudo, -pre .pi, -pre .doctype, -pre .deletion, -pre .envvar, -pre .shebang, -pre .preprocessor, -pre .userType, -pre .apache .sqbracket, -pre .nginx .built_in, -pre .tex .special { - color: rgb(43, 145, 175); -} - -pre .phpdoc, -pre .javadoc, -pre .xmlDocTag { - color: rgb(128, 128, 128); -} - diff --git a/docs/highlight/styles/zenburn.css b/docs/highlight/styles/zenburn.css deleted file mode 100644 index cac08b587ec..00000000000 --- a/docs/highlight/styles/zenburn.css +++ /dev/null @@ -1,112 +0,0 @@ -/* - -Zenburn style from voldmar.ru (c) Vladimir Epifanov -based on dark.css by Ivan Sagalaev - -*/ - -pre code { - display: block; padding: 0.5em; - background: #3F3F3F; - color: #DCDCDC; -} - -pre .keyword, -pre .tag, -pre .django .tag, -pre .django .keyword, -pre .css .class, -pre .css .id, -pre .lisp .title { - color: #E3CEAB; -} - -pre .django .template_tag, -pre .django .variable, -pre .django .filter .argument { - color: #DCDCDC; -} - -pre .number, -pre .date { - color: #8CD0D3; -} - -pre .dos .envvar, -pre .dos .stream, -pre .variable, -pre .apache .sqbracket { - color: #EFDCBC; -} - -pre .dos .flow, -pre .diff .change, -pre .python .exception, -pre .python .built_in, -pre .literal, -pre .tex .special { - color: #EFEFAF; -} - -pre .diff .chunk, -pre .ruby .subst { - color: #8F8F8F; -} - -pre .dos .keyword, -pre .python .decorator, -pre .class .title, -pre .function .title, -pre .ini .title, -pre .diff .header, -pre .ruby .class .parent, -pre .apache .tag, -pre .nginx .built_in, -pre .tex .command { - color: #efef8f; -} - -pre .dos .winutils, -pre .ruby .symbol, -pre .ruby .symbol .string, -pre .ruby .symbol .keyword, -pre .ruby .symbol .keymethods, -pre .ruby .string, -pre .ruby .instancevar { - color: #DCA3A3; -} - -pre .diff .deletion, -pre .string, -pre .tag .value, -pre .preprocessor, -pre .built_in, -pre .sql .aggregate, -pre .javadoc, -pre .smalltalk .class, -pre .smalltalk .localvars, -pre .smalltalk .array, -pre .css .rules .value, -pre .attr_selector, -pre .pseudo, -pre .apache .cbracket, -pre .tex .formula { - color: #CC9393; -} - -pre .shebang, -pre .diff .addition, -pre .comment, -pre .java .annotation, -pre .template_comment, -pre .pi, -pre .doctype { - color: #7F9F7F; -} - -pre .html .css, -pre .html .javascript, -pre .tex .formula { - opacity: 0.5; -} - From 3b625cef8fbd91566895fc9704d2b5743ff1a6c2 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Jul 2012 14:34:39 +0300 Subject: [PATCH 140/816] lots of styling and some corrections to #793 --- reference.html | 946 +++++++++++++++++++++++++------------------------ 1 file changed, 491 insertions(+), 455 deletions(-) diff --git a/reference.html b/reference.html index b5f5f3d24a1..cb89d284748 100644 --- a/reference.html +++ b/reference.html @@ -211,7 +211,7 @@

    Constructor

    Description - L.Map( <HTMLElement|String> id, <Map options> options? ) + L.Map( <HTMLElement|String> id, <Map options> options? ) Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below. @@ -226,123 +226,123 @@

    Options

    Description - center + center LatLng - null + null Initial geographical center of the map. - zoom + zoom Number - null + null Initial map zoom. - layers + layers ILayer[] [] Layers that will be added to the map initially. - minZoom + minZoom Number - 0 + 0 Minimum zoom level of the map. Overrides any minZoom set on map layers. - maxZoom + maxZoom Number - 18 + 18 Maximum zoom level of the map. This overrides any maxZoom set on map layers. - maxBounds + maxBounds LatLngBounds - null + null When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back when he tries to pan outside the view, and also not allowing to zoom out to a view that's larger than the given bounds (depending on the map size). To set the restriction dynamically, use setMaxBounds method - crs + crs CRS L.CRS.EPSG3857 Coordinate Reference System to use. Don't change this if you're not sure what it means. - dragging + dragging Boolean - true + true Whether the map be draggable with mouse/touch or not. - touchZoom + touchZoom Boolean - true + true Whether the map can be zoomed by touch-dragging with two fingers. - scrollWheelZoom + scrollWheelZoom Boolean - true + true Whether the map can be zoomed by using the mouse wheel. - doubleClickZoom + doubleClickZoom Boolean - true + true Whether the map can be zoomed in by double clicking on it. - boxZoom + boxZoom Boolean - true + true Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift. - zoomControl + zoomControl Boolean - true + true Whether the zoom control is added to the map by default. - attributionControl + attributionControl Boolean - true + true Whether the attribution control is added to the map by default. - trackResize + trackResize Boolean - true + true Whether the map automatically handles browser window resize to update itself. - fadeAnimation + fadeAnimation Boolean depends Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. - zoomAnimation + zoomAnimation Boolean depends Whether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. - markerZoomAnimation + markerZoomAnimation Boolean depends Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android. - closePopupOnClick + closePopupOnClick Boolean - true + true Set it to false if you don't want popups to close when user clicks the map. - worldCopyJump + worldCopyJump Boolean - true + true With this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there. @@ -359,122 +359,122 @@

    Events

    Description - click + click MouseEvent Fired when the user clicks (or taps) the map. - dblclick + dblclick MouseEvent Fired when the user double-clicks (or double-taps) the map. - mousedown + mousedown MouseEvent Fired when the user pushes the mouse button on the map. - mouseenter + mouseenter MouseEvent Fired when the mouse enters the map. - mouseleave + mouseleave MouseEvent Fired when the mouse leaves the map. - mousemove + mousemove MouseEvent Fired while the mouse moves over the map. - contextmenu + contextmenu MouseEvent Fired when the user pushes the right mouse button on the map. - preclick + preclick MouseEvent Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running). - load + load Event Fired when the map is initialized (when its center and zoom are set for the first time). - viewreset + viewreset Event Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays. - movestart + movestart Event Fired when the view of the map starts changing (e.g. user starts dragging the map). - move + move Event Fired on any movement of the map view. - moveend + moveend Event Fired when the view of the map ends changed (e.g. user stopped dragging the map). - dragstart + dragstart Event Fired when the user starts dragging the map. - drag + drag Event Fired repeatedly while the user drags the map. - dragend + dragend Event Fired when the user stops dragging the map. - zoomstart + zoomstart Event Fired when the map zoom is about to change (e.g. before zoom animation). - zoomend + zoomend Event Fired when the map zoom changes. - layeradd + layeradd LayerEvent Fired when a new layer is added to the map. - layerremove + layerremove LayerEvent Fired when some layer is removed from the map. - locationfound + locationfound LocationEvent Fired when geolocation (using locate or locateAndSetView method) went successfully. - locationerror + locationerror ErrorEvent Fired when geolocation (using locate or locateAndSetView method) failed. - popupopen + popupopen PopupEvent Fired when a popup is opened (using openPopup method). - popupclose + popupclose PopupEvent Fired when a popup is closed (using closePopup method). @@ -490,74 +490,74 @@

    Methods that modify map state

    Description - setView( <LatLng> center, <Number> zoom, <Boolean>forceReset? ) + setView( <LatLng> center, <Number> zoom, <Boolean>forceReset? ) this Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). - setZoom( <Number> zoom ) + setZoom( <Number> zoom ) this Sets the zoom of the map. - zoomIn() + zoomIn() this Increases the zoom of the map by 1. - zoomOut() + zoomOut() this Decreases the zoom of the map by 1. - fitBounds( <LatLngBounds> bounds ) + fitBounds( <LatLngBounds> bounds ) this Sets a map view that contains the given geographical bounds with the maximum zoom level possible. - fitWorld() + fitWorld() this Sets a map view that mostly contains the whole world with the maximum zoom level possible. - panTo( <LatLng> latlng ) + panTo( <LatLng> latlng ) this Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. - panInsideBounds( <LatLngBounds> bounds ) + panInsideBounds( <LatLngBounds> bounds ) this Pans the map to the closest view that would lie inside the given bounds (if it's not already). - panBy( <Point> point) + panBy( <Point> point ) this Pans the map by a given number of pixels (animated). - invalidateSize() + invalidateSize() this Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - setMaxBounds( <LatLngBounds> bounds ) + setMaxBounds( <LatLngBounds> bounds ) this Restricts the map view to the given bounds (see map maxBounds option). - locate( <Locate options> options? ) + locate( <Locate options> options? ) this Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details. - locateAndSetView( <Number> maxZoom?, <Locate options> options? ) + locateAndSetView( <Number> maxZoom?, <Locate options> options? ) this - Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. + Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. - stopLocate() + stopLocate() this - Stops watching location previously initiated by map.locate({watch: true}). + Stops watching location previously initiated by map.locate({watch: true}). @@ -570,47 +570,47 @@

    Methods that get map state

    Description - getCenter() + getCenter() LatLng Returns the geographical center of the map view. - getZoom() + getZoom() Number Returns the current zoom of the map view. - getMinZoom() + getMinZoom() Number Returns the minimum zoom level of the map. - getMaxZoom() + getMaxZoom() Number Returns the maximum zoom level of the map. - getBounds() + getBounds() LatLngBounds Returns the LatLngBounds of the current map view. - getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? ) + getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? ) Number Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety. - getSize() + getSize() Point Returns the current size of the map container. - getPixelBounds() + getPixelBounds() Bounds Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations). - getPixelOrigin() + getPixelOrigin() Point Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations). @@ -620,38 +620,38 @@

    Methods for layers and controls

    - + - + - + - + - + - + - + @@ -667,47 +667,47 @@

    Conversion methods

    - + - + - + - + - + - + - + - + - + @@ -722,12 +722,12 @@

    Other methods

    - + - + @@ -743,39 +743,39 @@

    Locate options

    - + - - + + - + - - + + - + - + - + - + - + - + - + - +
    addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? )addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? ) this Adds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers).
    removeLayer( <ILayer> layer )removeLayer( <ILayer> layer ) this Removes the given layer from the map.
    hasLayer( <ILayer> layer )hasLayer( <ILayer> layer ) Boolean Returns true if the given layer is currently added to the map.
    openPopup( <Popup> popup )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).
    closePopup()closePopup() this Closes the popup opened with openPopup.
    addControl( <IControl> control )addControl( <IControl> control ) this Adds the given control to the map.
    removeControl( <IControl> control )removeControl( <IControl> control ) this Removes the given control from the map.
    Description
    latLngToLayerPoint( <LatLng> latlng )latLngToLayerPoint( <LatLng> latlng ) Point Returns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map).
    layerPointToLatLng( <Point> point )layerPointToLatLng( <Point> point ) LatLng Returns the geographical coordinates of a given map layer point.
    mouseEventToContainerPoint( <MouseEvent> event )mouseEventToContainerPoint( <MouseEvent> event ) Point Returns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.
    mouseEventToLayerPoint( <MouseEvent> event )mouseEventToLayerPoint( <MouseEvent> event ) Point Returns the pixel coordinates of a mouse click relative to the map layer given its event object.
    mouseEventToLatLng( <MouseEvent> event )mouseEventToLatLng( <MouseEvent> event ) LatLng Returns the geographical coordinates of the point the mouse clicked on given the click's event object.
    containerPointToLayerPoint( <Point> point )containerPointToLayerPoint( <Point> point ) Point Converts the point relative to the map container to a point relative to the map layer.
    layerPointToContainerPoint( <Point> point )layerPointToContainerPoint( <Point> point ) Point Converts the point relative to the map layer to a point relative to the map container.
    project( <LatLng> latlng, <Number> zoom? )project( <LatLng> latlng, <Number> zoom? ) Point Projects the given geographical coordinates to pixel coordinates for the given zoom level (current zoom level by default).
    unproject( <Point> point, <Number> zoom? )unproject( <Point> point, <Number> zoom? ) LatLng Projects the given pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
    Description
    getContainer()getContainer() HTMLElement Returns the container element of the map.
    getPanes()getPanes() MapPanes Returns an object with different map panes (to render overlays in).
    Description
    watchwatch BooleanfalseIf true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.falseIf true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.
    setViewsetView BooleanfalseIf true, automatically sets the map view to the user location with respect to detection accuracy.falseIf true, automatically sets the map view to the user location with respect to detection accuracy.
    maxZoommaxZoom NumberInfinityInfinity The maximum zoom for automatic view setting when using `setView` option.
    timeouttimeout Number1000010000 Number of millisecond to wait for a response from geolocation before firing a locationerror event.
    maximumAgemaximumAge Number00 Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
    enableHighAccuracyenableHighAccuracy Booleanfalsefalse Enables high accuracy, see description in the W3C spec.
    @@ -798,37 +798,37 @@

    Properties

    Description - dragging + dragging IHandler Map dragging handler (by both mouse and touch). - touchZoom + touchZoom IHandler Touch zoom handler. - doubleClickZoom + doubleClickZoom IHandler Double click zoom handler. - scrollWheelZoom + scrollWheelZoom IHandler Scroll wheel zoom handler. - boxZoom + boxZoom IHandler Box (shift-drag with mouse) zoom handler. - zoomControl + zoomControl Control.Zoom Zoom control. - attributionControl + attributionControl Control.Attribution Attribution control. @@ -869,37 +869,37 @@

    Map panes

    Description - mapPane + mapPane HTMLElement Pane that contains all other map panes. - tilePane + tilePane HTMLElement Pane for tile layers. - objectsPane + objectsPane HTMLElement Pane that contains all the panes except tile pane. - shadowPane + shadowPane HTMLElement Pane for overlay shadows (e.g. marker shadows). - overlayPane + overlayPane HTMLElement Pane for overlays like polylines and polygons. - markerPane + markerPane HTMLElement Pane for marker icons. - popupPane + popupPane HTMLElement Pane for popups. @@ -922,7 +922,7 @@

    Constructor

    Description - L.Marker( <LatLng> latlng, <Marker options> options? ) + L.Marker( <LatLng> latlng, <Marker options> options? ) Instantiates a Marker object given a geographical point and optionally an options object. @@ -937,33 +937,33 @@

    Options

    Description - icon + icon L.Icon L.Icon Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. - clickable + clickable Boolean - true - If false, the marker will not emit mouse events and will act as a part of the underlying map. + true + If false, the marker will not emit mouse events and will act as a part of the underlying map. - draggable + draggable Boolean - false + false Whether the marker is draggable with mouse/touch or not. - title + title String - + '' Text for the browser tooltip that appear on marker hover (no tooltip by default). - zIndexOffset + zIndexOffset Number - 0 + 0 By default, marker images zIndex is set automatically based on its latitude. You 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). @@ -979,42 +979,42 @@

    Events

    Description - click + click MouseEvent Fired when the user clicks (or taps) the marker. - dblclick + dblclick MouseEvent Fired when the user double-clicks (or double-taps) the marker. - mousedown + mousedown MouseEvent Fired when the user pushes the mouse button on the marker. - mouseover + mouseover MouseEvent Fired when the mouse enters the marker. - mouseout + mouseout MouseEvent Fired when the mouse leaves the marker. - dragstart + dragstart Event Fired when the user starts dragging the marker. - drag + drag Event Fired repeatedly while the user drags the marker. - dragend + dragend Event Fired when the user stops dragging the marker. @@ -1029,42 +1029,42 @@

    Methods

    Description - getLatLng() + getLatLng() LatLng Returns the current geographical position of the marker. - setLatLng( <LatLng> latlng ) + setLatLng( <LatLng> latlng ) this Changes the marker position to the given point. - setIcon( <Icon> icon ) + setIcon( <Icon> icon ) this Changes the marker icon. - setZIndexOffset( <Number> offset ) + setZIndexOffset( <Number> offset ) this Changes the zIndex offset of the marker. - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( <String> htmlContent, <Popup options> options? ) this Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method. - unbindPopup() + unbindPopup() this Unbinds the popup previously bound to the marker with bindPopup. - openPopup() + openPopup() this Opens the popup previously bound by the bindPopup method. - closePopup() + closePopup() this Closes the bound popup of the marker if it's opened. @@ -1084,7 +1084,7 @@

    Interaction handlers

    dragging - IHandler + IHandler Marker dragging handler (by both mouse and touch). @@ -1115,7 +1115,7 @@

    Constructor

    Description - L.Popup( <Popup options> options?, <object> source? ) + L.Popup( <Popup options> options?, <object> source? ) Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers. @@ -1130,39 +1130,39 @@ Description - maxWidth + maxWidth Number - 300 + 300 Max width of the popup. - maxWidth + maxWidth Number - 50 + 50 Min width of the popup. - autoPan + autoPan Boolean - true - Set it to false if you don't want the map to do panning animation to fit the opened popup. + true + Set it to false if you don't want the map to do panning animation to fit the opened popup. - closeButton + closeButton Boolean - true + true Controls the presense of a close button in the popup. - offset + offset Point - Point(0, 0) + Point(0, 0) The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays. - autoPanPadding + autoPanPadding Point - Point(5, 5) + Point(5, 5) The margin between the popup and the edges of the map view after autopanning was performed. @@ -1176,12 +1176,12 @@

    Methods

    Description - setLatLng( <LatLng> latlng ) + setLatLng( <LatLng> latlng ) this Sets the geographical point where the popup will open. - setContent( <String> htmlContent ) + setContent( <String> htmlContent ) this Sets the HTML content of the popup. @@ -1206,7 +1206,7 @@

    Constructor

    Description - L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) + L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) Instantiates a tile layer object given a URL template and optionally an options object. @@ -1233,93 +1233,93 @@

    Options

    Description - minZoom + minZoom Number - 0 + 0 Minimum zoom number. - maxZoom + maxZoom Number - 18 + 18 Maximum zoom number. - tileSize + tileSize Number - 256 + 256 Tile size (width and height in pixels, assuming tiles are square). - subdomains + subdomains String or String[] - 'abc' + 'abc' Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings. - errorTileUrl + errorTileUrl String - '' + '' URL to the tile image to show in place of the tile that failed to load. - attribution + attribution String - '' + '' e.g. "© CloudMade" — the string used by the attribution control, describes the layer data. - scheme - String - 'xyz' - Either 'xyz' or 'tms', affects tile numbering (TMS servers use inverse Y axis numbering). + tms + Boolean + false + If true, inverses Y axis numbering for tiles (turn this on for TMS services). - continuousWorld + continuousWorld Boolean - false + false If set to true, the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps). - noWrap + noWrap Boolean - false + false If set to true, the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating. - zoomOffset + zoomOffset Number - 0 + 0 The zoom number used in tile URLs will be offset with this value. - zoomReverse + zoomReverse Boolean - false + false If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom) - opacity + opacity Number - 1.0 + 1.0 The opacity of the tile layer. - unloadInvisibleTiles + unloadInvisibleTiles Boolean depends If true, all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false. - updateWhenIdle + updateWhenIdle Boolean depends If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false. - reuseTiles + reuseTiles Boolean - false + false If true, all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed. @@ -1333,12 +1333,12 @@

    Methods

    Description - setOpacity( <Number> opacity ) + setOpacity( <Number> opacity ) this Changes the opacity of the tile layer. - redraw() + redraw() - Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas @@ -1367,7 +1367,7 @@

    Constructor

    Description - L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) + L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object. @@ -1384,33 +1384,33 @@

    Options

    Description - layers + layers String - - + '' (required) Comma-separated list of WMS layers to show. - styles + styles String - + '' Comma-separated list of WMS styles. - format + format String - image/jpeg - WMS image format (use 'image/png' for layers with transparency). + 'image/jpeg' + WMS image format (use 'image/png' for layers with transparency). - transparent + transparent Boolean - false - If true, the WMS service will return images with transparency. + false + If true, the WMS service will return images with transparency. - version + version String - 1.1.1 + '1.1.1' Version of the WMS service to use. @@ -1438,7 +1438,7 @@

    Constructor

    Description - L.TileLayer.Canvas( <TileLayer options> options? ) + L.TileLayer.Canvas( <TileLayer options> options? ) Instantiates a Canvas tile layer object given an options object (optionally). @@ -1452,12 +1452,12 @@

    Methods

    Description - drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom ) + drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom ) this You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom. - redraw() + redraw() - Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas @@ -1485,7 +1485,7 @@

    Constructor

    Description - L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) + L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to. @@ -1505,52 +1505,52 @@

    Options

    Description - stroke + stroke Boolean - true + true Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles. - color + color String - '#03f' + '#03f' Stroke color. - weight + weight Number - 5 + 5 Stroke width in pixels. - opacity + opacity Number - 0.5 + 0.5 Stroke opacity. - fill + fill Boolean depends Whether to fill the path with color. Set it to false to disable filling on polygons or circles. - fillColor + fillColor String same as color Fill color. - fillOpacity + fillOpacity Number - 0.2 + 0.2 Fill opacity. - clickable + clickable Boolean - true - If false, the vector will not emit mouse events and will act as a part of the underlying map. + true + If false, the vector will not emit mouse events and will act as a part of the underlying map. @@ -1565,27 +1565,27 @@

    Events

    Description - click + click MouseEvent Fired when the user clicks (or taps) the object. - dblclick + dblclick MouseEvent Fired when the user double-clicks (or double-taps) the object. - mousedown + mousedown MouseEvent Fired when the user pushes the mouse button on the object. - mouseover + mouseover MouseEvent Fired when the mouse enters the object. - mouseout + mouseout MouseEvent Fired when the mouse leaves the object. @@ -1615,12 +1615,12 @@

    Constants

    L.Path.CANVAS Boolean depends - True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow. + True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow. L.Path.CLIP_PADDING Number - 0.5 for SVG
    0.02 for VML + 0.5 for SVG
    0.02 for VML How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance. @@ -1633,17 +1633,17 @@

    Methods

    Description - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( <String> htmlContent, <Popup options> options? ) this Binds a popup with a particular HTML content to a click on this path. - setStyle( <Path options> object ) + setStyle( <Path options> object ) this Changes the appearance of a Path based on the options in the Path options object. - getBounds() + getBounds() LatLngBounds Returns the LatLngBounds of the path. @@ -1672,7 +1672,7 @@

    Constructor

    Description - L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) + L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) Instantiates a polyline object given an array of geographical points and optionally an options object. @@ -1689,15 +1689,15 @@

    Options

    Description - smoothFactor + smoothFactor Number - 1.0 + 1.0 How much to simplify the polyline on each zoom level. More means better performance and smoother look, and less means more accurate representation. - noClip + noClip Boolean - false + false Disabled polyline clipping. @@ -1713,27 +1713,27 @@

    Methods

    Description - addLatLng( <LatLng> latlng ) + addLatLng( <LatLng> latlng ) this Adds a given point to the polyline. - setLatLngs( <LatLng[]> latlngs ) + setLatLngs( <LatLng[]> latlngs ) this Replaces all the points in the polyline with the given array of geographical points. - getLatLngs() + getLatLngs() LatLng[] Returns an array of the points in the path. - spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng1?, <LatLng> latlng2?, … ) + spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng1?, <LatLng> latlng2?, … ) LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). - getBounds() + getBounds() LatLngBounds Returns the LatLngBounds of the polyline. @@ -1753,7 +1753,7 @@

    Constructor

    Description - L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) + L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object. @@ -1772,7 +1772,7 @@

    Constructor

    Description - L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) + L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside. @@ -1793,7 +1793,7 @@

    Constructor

    Description - L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) + L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline). @@ -1828,7 +1828,7 @@

    Constructor

    Description - L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) + L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) Instantiates a rectangle object with the given geographical bounds and optionally an options object. @@ -1844,7 +1844,7 @@

    Methods

    Description - setBounds( <LatLngBounds> bounds ) + setBounds( <LatLngBounds> bounds ) this Redraws the rectangle with the passed bounds. @@ -1863,7 +1863,7 @@

    Constructor

    Description - L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) + L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. @@ -1877,22 +1877,22 @@

    Methods

    Description - getLatLng() + getLatLng() LatLng Returns the current geographical position of the circle. - getRadius() + getRadius() Number Returns the current radius of a circle. Units are in meters. - setLatLng( <LatLng> latlng ) + setLatLng( <LatLng> latlng ) this Sets the position of a circle to a new location. - setRadius( <Number> radius ) + setRadius( <Number> radius ) this Sets the radius of a circle. Units are in meters. @@ -1912,7 +1912,7 @@

    Constructor

    Description - L.CircleMarker( <LatLng> latlng, <Path options> options? ) + L.CircleMarker( <LatLng> latlng, <Path options> options? ) Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object. @@ -1926,12 +1926,12 @@

    Methods

    Description - setLatLng( <LatLng> latlng ) + setLatLng( <LatLng> latlng ) this Sets the position of a circle marker to a new location. - setRadius( <Number> radius ) + setRadius( <Number> radius ) this Sets the radius of a circle marker. Units are in pixels. @@ -1959,7 +1959,7 @@

    Constructor

    Description - L.LayerGroup( <ILayer[]> layers? ) + L.LayerGroup( <ILayer[]> layers? ) Create a layer group, optionally given an initial set of layers. @@ -1973,17 +1973,17 @@

    Methods

    Description - addLayer( <ILayer> layer ) + addLayer( <ILayer> layer ) this Adds a given layer to the group. - removeLayer( <ILayer> layer ) + removeLayer( <ILayer> layer ) this Removes a given layer from the group. - clearLayers() + clearLayers() this Removes all the layers from the group. @@ -2013,7 +2013,7 @@

    Constructor

    Description - L.FeatureGroup( <IFeature[]> layers? ) + L.FeatureGroup( <IFeature[]> layers? ) Create a layer group, optionally given an initial set of layers. @@ -2029,12 +2029,12 @@

    Methods

    Description - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( <String> htmlContent, <Popup options> options? ) this Binds a popup with a particular HTML content to a click on any layer from the group. - getBounds() + getBounds() LatLngBounds Returns the LatLngBounds of the Feature Group. @@ -2051,22 +2051,22 @@

    Events

    Description - click + click MouseEvent Fired when the user clicks (or taps) the group. - dblclick + dblclick MouseEvent Fired when the user double-clicks (or double-taps) the group. - mouseover + mouseover MouseEvent Fired when the mouse enters the group. - mouseout + mouseout MouseEvent Fired when the mouse leaves the group. @@ -2094,7 +2094,7 @@

    Constructor

    Description - L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) + L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it with addGeoJSON method) and an options object. @@ -2109,9 +2109,9 @@

    Options

    Description - pointToLayer + pointToLayer Function - null + null Function of the form (LatLng) -> ILayer that will be used for creating layers for GeoJSON points (if not specified, markers will be created). @@ -2128,7 +2128,7 @@

    Events

    Description - featureparse + featureparse GeoJSONEvent Fired before an object converted from a GeoJSON feature is added to the map. This event can be used to add interaction or change styling of objects depending on feature properties. @@ -2145,7 +2145,7 @@

    Methods

    Description - addGeoJSON( <Object> geojson ) + addGeoJSON( <Object> geojson ) Boolean Adds a GeoJSON object to the layer. @@ -2160,17 +2160,17 @@

    Static methods

    Description - geometryToLayer( <Object> geojson, <Function> pointToLayer? ) + geometryToLayer( <Object> geojson, <Function> pointToLayer? ) ILayer Creates a layer from a given GeoJSON geometry. - coordsToLatlng( <Array> coords, <Boolean> reverse? ) + coordsToLatlng( <Array> coords, <Boolean> reverse? ) LatLng Creates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude). - coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? ) + coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? ) Array Creates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude). @@ -2192,7 +2192,7 @@

    Constructor

    Description - L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) + L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) Creates an object representing a geographical point with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument. @@ -2206,12 +2206,12 @@

    Properties

    Description - lat + lat Number Latitude in degrees. - lng + lng Number Longitude in degrees. @@ -2226,17 +2226,17 @@

    Methods

    Description - distanceTo( <LatLng> otherLatlng ) + distanceTo( <LatLng> otherLatlng ) Number Returns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia - equals( <LatLng> otherLatlng ) + equals( <LatLng> otherLatlng ) Boolean - Returns true if the given LatLng point is at the same position (within a small margin of error). + Returns true if the given LatLng point is at the same position (within a small margin of error). - toString() + toString() String Returns a string representation of the point (for debugging purposes). @@ -2252,21 +2252,21 @@

    Constants

    Description - DEG_TO_RAD + DEG_TO_RAD Number - Math.PI / 180 + Math.PI / 180 A multiplier for converting degrees into radians. - RAD_TO_DEG + RAD_TO_DEG Number - 180 / Math.PI + 180 / Math.PI A multiplier for converting radians into degrees. - MAX_MARGIN + MAX_MARGIN Number - 1.0E-9 + 1.0E-9 Max margin of error for the equality check. @@ -2289,11 +2289,11 @@

    Constructor

    Description - L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) + L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle. - L.LatLngBounds( <LatLng[]> latlngs ) + L.LatLngBounds( <LatLng[]> latlngs ) 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. @@ -2307,57 +2307,57 @@

    Methods

    Description - extend( <LatLng|LatLngBounds> latlng ) + extend( <LatLng|LatLngBounds> latlng ) this Extends the bounds to contain the given point or bounds. - getSouthWest() + getSouthWest() LatLng Returns the south-west point of the bounds. - getNorthEast() + getNorthEast() LatLng Returns the north-east point of the bounds. - getNorthWest() + getNorthWest() LatLng Returns the north-west point of the bounds. - getSouthEast() + getSouthEast() LatLng Returns the south-east point of the bounds. - getCenter() + getCenter() LatLng Returns the center point of the bounds. - contains( <LatLngBounds> otherBounds ) + contains( <LatLngBounds> otherBounds ) Boolean Returns true if the rectangle contains the given one. - contains( <LatLng> latlng ) + contains( <LatLng> latlng ) Boolean Returns true if the rectangle contains the given point. - intersects( <LatLngBounds> otherBounds ) + intersects( <LatLngBounds> otherBounds ) Boolean Returns true if the rectangle intersects the given bounds. - equals( <LatLngBounds> otherBounds ) + equals( <LatLngBounds> otherBounds ) Boolean Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. - toBBoxString() + 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. @@ -2378,7 +2378,7 @@

    Constructor

    Description - L.Point( <Number> x, <Number> y, <Boolean> round? ) + L.Point( <Number> x, <Number> y, <Boolean> round? ) Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values. @@ -2392,12 +2392,12 @@

    Properties

    Description - x + x Number The x coordinate. - y + y Number The y coordinate. @@ -2412,42 +2412,42 @@

    Methods

    Description - add( <Point> otherPoint ) + add( <Point> otherPoint ) Point Returns the result of addition of the current and the given points. - subtract( <Point> otherPoint ) + subtract( <Point> otherPoint ) Point Returns the result of subtraction of the given point from the current. - multiplyBy( <Number> number ) + multiplyBy( <Number> number ) Point Returns the result of multiplication of the current point by the given number. - divideBy( <Number> number, <Boolean> round? ) + divideBy( <Number> number, <Boolean> round? ) Point Returns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result. - distanceTo( <Point> otherPoint ) + distanceTo( <Point> otherPoint ) Number Returns the distance between the current and the given points. - clone() + clone() Point Returns a copy of the current point. - round() + round() Point Returns a copy of the current point with rounded coordinates. - toString() + toString() String Returns a string representation of the point for debugging purposes. @@ -2470,11 +2470,11 @@

    Constructor

    Description - L.Bounds( <Point> topLeft, <Point> bottomRight ) + L.Bounds( <Point> topLeft, <Point> bottomRight ) Creates a Bounds object from two coordinates (usually top-left and bottom-right corners). - L.LatLngBounds( <Point[]> points ) + L.LatLngBounds( <Point[]> points ) Creates a Bounds object defined by the points it contains. @@ -2488,12 +2488,12 @@

    Properties

    Description - min + min Point The top left corner of the rectangle. - max + max Point The bottom right corner of the rectangle. @@ -2508,27 +2508,27 @@

    Methods

    Description - extend( <Point> point ) + extend( <Point> point ) - Extends the bounds to contain the given point. - getCenter() + getCenter() Point Returns the center point of the bounds. - contains( <Bounds> otherBounds ) + contains( <Bounds> otherBounds ) Boolean Returns true if the rectangle contains the given one. - contains( <Point> point ) + contains( <Point> point ) Boolean Returns true if the rectangle contains the given point. - intersects( <Bounds> otherBounds ) + intersects( <Bounds> otherBounds ) Boolean Returns true if the rectangle intersects the given bounds. @@ -2560,7 +2560,7 @@

    Constructor

    Description - L.Icon( <Icon properties> props ) + L.Icon( <Icon properties> props ) Creates an icon instance with the given properties. @@ -2574,37 +2574,37 @@

    Properties

    Description - iconUrl + iconUrl String (required) The URL to the icon image (absolute or relative to your script path). - iconSize + iconSize Point Size of the icon image in pixels. - iconAnchor + iconAnchor Point 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. - shadowUrl + shadowUrl String The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created. - shadowSize + shadowSize Point Size of the shadow image in pixels. - shadowOffset + shadowOffset Point Position of the shadow relative to the icon ((0, 0) by default) - popupAnchor + popupAnchor Point The point from which the marker popup opens, relative to the anchor point. @@ -2623,7 +2623,7 @@

    Constructor

    Description - L.Control.Zoom() + L.Control.Zoom() Creates a zoom control. @@ -2641,7 +2641,7 @@

    Constructor

    Description - L.Control.Attribution() + L.Control.Attribution() Creates an attribution control. @@ -2654,17 +2654,17 @@

    Methods

    Description - setPrefix( <String> prefix ) + setPrefix( <String> prefix ) - Sets the string before the attributions ("Powered by Leaflet" by default). - addAttribution( <String> text ) + addAttribution( <String> text ) - Adds an attribution text (e.g. "Vector data &copy; CloudMade"). - removeAttribution( <String> text ) + removeAttribution( <String> text ) - Removes an attribution text. @@ -2696,7 +2696,7 @@

    Constructor

    Description - L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? ) + L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? ) Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. @@ -2709,17 +2709,17 @@

    Methods

    Description - addBaseLayer( <ILayer> layer, <String> name ) + addBaseLayer( <ILayer> layer, <String> name ) this Adds a base layer (radio button entry) with the given name to the control. - addOverlay( <ILayer> layer, <String> name ) + addOverlay( <ILayer> layer, <String> name ) this Adds an overlay (checkbox entry) with the given name to the control. - removeLayer( <ILayer> layer ) + removeLayer( <ILayer> layer ) this Remove the given layer from the control. @@ -2735,10 +2735,10 @@

    Options

    Description - collapsed + collapsed Boolean - true - If true, the control will be collapsed into an icon and expanded on mouse hover or touch. + true + If true, the control will be collapsed into an icon and expanded on mouse hover or touch. @@ -2756,7 +2756,7 @@

    Layer Config

    Events methods

    -

    A set of methods shared between event-powered classes (like Map). 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 'fire' event).

    +

    A set of methods shared between event-powered classes (like Map). 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 'fire' event).

    Example

    @@ -2779,37 +2779,37 @@

    Methods

    Description - addEventListener( <String> type, <Function> fn, <Object> context? ) + addEventListener( <String> type, <Function> fn, <Object> context? ) 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). - removeEventListener( <String> type, <Function> fn, <Object> context? ) + removeEventListener( <String> type, <Function> fn, <Object> context? ) this Removes a previously added listener function. - on( … ) + on( … ) this Alias to addEventListener. - off( … ) + off( … ) this Alias to removeEventListener. - hasEventListeners( <String> type ) + hasEventListeners( <String> type ) Boolean - Returns true if a particular event type has some listeners attached to it. + Returns true if a particular event type has some listeners attached to it. - fireEvent( <String> type, <Object> data? ) + fireEvent( <String> type, <Object> data? ) 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. - fire( … ) + fire( … ) this Alias to fireEvent. @@ -2835,12 +2835,12 @@

    Event

    description - type + type String - The event type (e.g. "click"). + The event type (e.g. 'click'). - target + target Object The object that fired the event. @@ -2855,12 +2855,12 @@

    MouseEvent

    description - latlng + latlng LatLng The geographical point where the mouse event occured. - layerPoint + layerPoint Point Pixel coordinates of the point where the mouse event occured relative to the map layer. @@ -2875,17 +2875,17 @@

    LocationEvent

    description - latlng + latlng LatLng Detected geographical location of the user. - bounds + bounds LatLngBounds Geographical bounds of the area user is located in (with respect to the accuracy of location). - accuracy + accuracy Number Accuracy of location in meters. @@ -2900,12 +2900,12 @@

    ErrorEvent

    description - message + message String Error message. - code + code Number Error code (if applicable). @@ -2920,7 +2920,7 @@

    LayerEvent

    description - layer + layer ILayer The layer that was added or removed. @@ -2935,22 +2935,22 @@

    GeoJSON event

    description - layer + layer ILayer The layer for the GeoJSON feature that is being added to the map. - properties + properties Object GeoJSON properties of the feature. - geometryType + geometryType String GeoJSON geometry type of the feature. - id + id String GeoJSON ID of the feature (if present). @@ -2965,7 +2965,7 @@ description - popup + popup Popup The popup that was opened or closed. @@ -3028,7 +3028,7 @@

    Inheritance

    var a = new MyChildClass(); a.greet('Jason'); // alerts "Yo, bro Jason!"
    -

    Options

    +

    Options

    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:

    @@ -3086,7 +3086,7 @@

    Includes

    You can also do such includes in runtime with the include method:

    -
    MyClass.include(MyMixin);
    +
    MyClass.include(MyMixin);

    Statics

    @@ -3118,64 +3118,69 @@

    L.Browser

    description - ie + ie Boolean true for all old Internet Explorer versions (6-8). - ie6 + ie6 Boolean true for Internet Explorer 6. - webkit + webkit Boolean true for webkit-based browsers like Chrome and Safari (including mobile versions). - webkit3d + webkit3d Boolean true for webkit-based browsers that support CSS 3D transformations. - gecko + gecko Boolean true for Gecko-based browsers like Firefox and Mozilla. - opera + opera Boolean true for Opera. - android + android Boolean true for Android mobile browser. - mobile + mobile Boolean true for modern mobile browsers (including iOS Safari and different Android browsers). - mobileWebkit + mobileWebkit Boolean true for mobile webkit-based browsers. - mobileOpera + mobileOpera Boolean true for mobile Opera. - touch + touch Boolean true for all browsers on touch devices. +

    L.Util

    -

    Utility functions.

    + +

    Various utility functions, used by Leaflet internally.

    + +

    Methods

    + @@ -3183,83 +3188,94 @@

    L.Util

    - - - + + + - - - + + + - - + + - - - - + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - +
    Method Description
    extend(<Object> dest, <Object> src...)ObjectMerge the properties of (multiple) src object properties into dest and returns dest.extend( <Object> dest, <Object> src?.. )ObjectMerges the properties of the src object (or multiple objects) into dest object and returns the latter.
    bind(<Function> fn, <Object> obj)FunctionReturn a function which calls function fn with scope obj.bind( <Function> fn, <Object> obj )FunctionReturns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code).
    stamp(<Object> obj)Stringstamp( <Object> obj )String Applies a unique key to the object and returns that key.
    limitExecByInterval(<Function> fn, <Number> time, <Object> context)FunctionReturns a wrapper around a function that makes sure it's called not more often than a certain interval, but as fast as possible otherwise.limitExecByInterval( <Function> fn, <Number> time, <Object> context? )FunctionReturns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called.
    falseFn()FunctionfalseFn()Function Returns a function which always returns false.
    formatNum(<Number> num, <Number> digits)NumberformatNum( <Number> num, <Number> digits )Number Returns the number num rounded to digits decimals.
    splitWords(<String> str)String[]Splits the string on spaces and returns the array of parts.splitWords( <String> str )String[]Trims and splits the string on whitespace and returns the array of parts.
    setOptions(<Object> obj, <Object> options)ObjectSet the options in options in obj, return the options of obj afterwards.setOptions( <Object> obj, <Object> options )ObjectMerges the given properties to the options of the obj object, returning the resulting options. See Class options.
    getParamString(<Object> obj)StringConvert a map in to a parameter string, including a question mark symbol. Example: {a: "foo", b: "bar"} translates to ?a=foo&b=bar.getParamString( <Object> obj )StringConverts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} translates to '?a=foo&b=bar'.
    template(<String> str, <Object> data)StringApplies the values of the data map to a template like "{a}, {b}, {c}".template( <String> str, <Object> data )StringSimple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', ...} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'.
    + +

    Properties

    + + - - - + + + + + + + +
    emptyImageUrlStringString containing a base64 encoded empty gif image.PropertyTypeDescription
    emptyImageUrlStringData 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).
    +

    L.DomUtil

    Utility functions to work with the DOM tree, used by Leaflet internally.

    +

    Methods

    + @@ -3267,82 +3283,102 @@

    L.DomUtil

    - - + + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - +
    Method Description
    get( <String or HTMLElement> id )HTMLElementget( <String or HTMLElement> id )HTMLElement Returns an element with the given id if a string was passed, or just returns the element if it was passed directly.
    getStyle( <HTMLElement> el, <String> style )getStyle( <HTMLElement> el, <String> style ) String Returns the value for a certain style attribute on an element, including computed values or values set through CSS.
    getViewportOffset( <HTMLElement> el )PointgetViewportOffset( <HTMLElement> el )Point Returns the offset to the viewport for the requested element.
    create( <String> tagName, <String> className, <HTMLElement> container? )create( <String> tagName, <String> className, <HTMLElement> container? ) HTMLElement Creates an element with tagName, sets the className, and optionally appends it to container element.
    disableTextSelection()disableTextSelection() - Makes sure text cannot be selected, for example during dragging.
    enableTextSelection()enableTextSelection() - Makes text selection possible again.
    hasClass( <HTMLElement> el, <String> name )hasClass( <HTMLElement> el, <String> name ) Boolean Returns true if the element class attribute contains name.
    addClass( <HTMLElement> el, <String> name )addClass( <HTMLElement> el, <String> name ) - Adds name to the element's class attribute.
    removeClass( <HTMLElement> el, <String> name )removeClass( <HTMLElement> el, <String> name ) - Removes name from the element's class attribute.
    setOpacity( <HTMLElement> el, <Number> value )setOpacity( <HTMLElement> el, <Number> value ) - Set the opacity of an element (including old IE support). Value must be from 0 to 1.
    testProp( <String[]> props )String or falsetestProp( <String[]> props )String or 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.
    getTranslateString( <Point> point )getTranslateString( <Point> point ) StringReturns a CSS transform string to move an element by the offset provided in the given point.Returns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers.
    getScaleString( <Number> scale, <Point> origin )getScaleString( <Number> scale, <Point> origin ) String Returns a CSS transform string to scale an element (with the given scale origin).
    setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? )setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? ) - Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true.
    getPosition( <HTMLElement> el )getPosition( <HTMLElement> el ) Point Returns the coordinates of an element previously positioned with setPosition.
    +

    Properties

    + + + + + + + + + + + + + + + + + +
    PropertyTypeDescription
    TRANSITIONStringVendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit).
    TRANSFORMStringVendor-prefixed transform style name.
    +

    IHandler

    An interface implemented by interaction handlers.

    @@ -3354,19 +3390,19 @@

    IHandler

    Description - enable() + enable() - Enables the handler. - disable() + disable() - Disables the handler. - enabled() + enabled() Boolean - Returns true if the handler is enabled. + Returns true if the handler is enabled. From 8fd1ee8d53c01b3f10348991d4fbcc667a030bca Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Jul 2012 14:47:00 +0300 Subject: [PATCH 141/816] update docs toc --- reference.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/reference.html b/reference.html index cb89d284748..cf8db7c7d21 100644 --- a/reference.html +++ b/reference.html @@ -134,6 +134,7 @@

    Controls

  • Zoom
  • Attribution
  • Layers
  • +
  • Scale
  • @@ -147,8 +148,9 @@

    Utility

  • Class
  • Browser
  • Util
  • - +
  • Transformation
  • +
  • LineUtil
  • +
  • PolyUtil
  • DOM utility

    -

    Interfaces

    @@ -175,14 +173,14 @@

    Interfaces

    Misc


    -

    This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

    +

    This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.
    Grayed out things are not yet documented but planned to be.

    L.Map

    From a08d7bcb6ecaec4f244b1e7ea3cd2124ea714747 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Jul 2012 14:51:24 +0300 Subject: [PATCH 142/816] bring cdn links back! --- download.html | 10 +++++----- examples/quick-start.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/download.html b/download.html index 3cb5cbb6fce..5f98f239cb6 100644 --- a/download.html +++ b/download.html @@ -66,15 +66,15 @@

    Download Leaflet

    View Changelog

    -

    Including Leaflet on your web page

    +

    Using a hosted version of Leaflet

    -

    After downloading Leaflet and extracting the contents of the dist folder somewhere in your project directory, place this code in the head section of your HTML:

    -
    <link rel="stylesheet" href="[path-to-dist]/leaflet.css" />
    +		

    The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the head section of your HTML:

    +
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
     <!--[if lte IE 8]>
    -	<link rel="stylesheet" href="[path-to-dist]/leaflet.ie.css" />
    +	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
     <![endif]-->
     
    -<script src="[path-to-dist]/leaflet.js"></script>
    +<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>

    Building a custom version of Leaflet

    Open build/build.html page from the download package, check the components you want to see in your build and then follow the instructions there.

    diff --git a/examples/quick-start.html b/examples/quick-start.html index 4d60233a429..e7500df26ec 100644 --- a/examples/quick-start.html +++ b/examples/quick-start.html @@ -100,14 +100,14 @@

    Preparing your page

    1. Download Leaflet and put the contents of the dist folder somewhere in your project directory
    2. Include Leaflet CSS files in the head section of your document: -
      <link rel="stylesheet" href="[path-to-dist]/leaflet.css" />
      +			
      <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
       <!--[if lte IE 8]>
      -	<link rel="stylesheet" href="[path-to-dist]/leaflet.ie.css" />
      +	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
       <![endif]-->
    3. Include Leaflet JavaScript file somewhere on the page (preferably before body close tag): -
      <script src="[path-to-dist]/leaflet.js"></script>
    4. +
      <script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
       
       			
    5. Put a div element with a certain id where you want your map to be (making sure it has defined height):
      <div id="map" style="height: 200px"></div>
    6. From 5fec0c5c37b951e9d0d39851da5ef6df3930ae48 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 12 Jul 2012 01:00:34 +0300 Subject: [PATCH 143/816] more docs cleanup --- docs/css/screen.css | 4 +++- examples/custom-icons-example.html | 30 ++++++++++++------------------ reference.html | 12 ++++++------ 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 72c001303a9..14e29bd27db 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -100,7 +100,9 @@ th { background:/*#e5ecf9;*/ #f3f3f3; } th, td { - padding: 4px 5px; + padding: 6px 8px; + vertical-align: top; + line-height: 1.4; } diff --git a/examples/custom-icons-example.html b/examples/custom-icons-example.html index edac752f3ed..cb6c521a61f 100644 --- a/examples/custom-icons-example.html +++ b/examples/custom-icons-example.html @@ -14,22 +14,21 @@ diff --git a/reference.html b/reference.html index cf8db7c7d21..1fd4813dd46 100644 --- a/reference.html +++ b/reference.html @@ -262,7 +262,7 @@

      Options

      crs CRS - L.CRS.EPSG3857 + L.CRS.
      EPSG3857
      Coordinate Reference System to use. Don't change this if you're not sure what it means. @@ -488,7 +488,7 @@

      Methods that modify map state

      Description - setView( <LatLng> center, <Number> zoom, <Boolean>forceReset? ) + setView( <LatLng> center, <Number> zoom, <Boolean> forceReset? ) this Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). @@ -937,8 +937,8 @@

      Options

      icon L.Icon - L.Icon - Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. + * + Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default. clickable @@ -1726,7 +1726,7 @@

      Methods

      Returns an array of the points in the path. - spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng1?, <LatLng> latlng2?, … ) + spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng?, … ) LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). @@ -3247,7 +3247,7 @@

      Methods

      template( <String> str, <Object> data ) String - Simple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', ...} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. + Simple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', …} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. From 4994095ff2f99d9b1f546a29a3cb98d195a2cc74 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 12 Jul 2012 01:18:00 +0300 Subject: [PATCH 144/816] docs styling tweaks --- docs/css/screen.css | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 14e29bd27db..e293ea6ed02 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -95,15 +95,24 @@ pre code a:hover { table { border-collapse: collapse; + box-shadow: 0 3px 15px #f0f0f0; } th { - background:/*#e5ecf9;*/ #f3f3f3; + background-color: #f3f3f3; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#e7e7e7)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #f3f3f3, #e7e7e7); /* Chrome 10+, Saf5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, #f3f3f3, #e7e7e7); /* FF3.6+ */ + background-image: -o-linear-gradient(top, #f3f3f3, #e7e7e7); /* Opera 11.10+ */ + background-image: linear-gradient(to bottom, #f3f3f3, #e7e7e7); } th, td { padding: 6px 8px; vertical-align: top; - line-height: 1.4; + /*line-height: 1.4;*/ } +td { + /*border-right: 1px solid #eee;*/ +} .nav { From ec30171f4fc4106214630fc985b57a0a000dad7a Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 12 Jul 2012 01:21:04 +0300 Subject: [PATCH 145/816] minor tweaks --- docs/css/screen.css | 20 ++++++++++---------- reference.html | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index e293ea6ed02..b969a4456fd 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -87,23 +87,23 @@ code { -webkit-box-shadow: 0 0 15px #ddd; } pre code a { - text-decoration: none; - } + text-decoration: none; + } pre code a:hover { - text-decoration: underline; - } + text-decoration: underline; + } table { border-collapse: collapse; box-shadow: 0 3px 15px #f0f0f0; } th { - background-color: #f3f3f3; - background-image: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#e7e7e7)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(top, #f3f3f3, #e7e7e7); /* Chrome 10+, Saf5.1+, iOS 5+ */ - background-image: -moz-linear-gradient(top, #f3f3f3, #e7e7e7); /* FF3.6+ */ - background-image: -o-linear-gradient(top, #f3f3f3, #e7e7e7); /* Opera 11.10+ */ - background-image: linear-gradient(to bottom, #f3f3f3, #e7e7e7); + background-color: #f3f3f3; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#e7e7e7)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #f3f3f3, #e7e7e7); /* Chrome 10+, Saf5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, #f3f3f3, #e7e7e7); /* FF3.6+ */ + background-image: -o-linear-gradient(top, #f3f3f3, #e7e7e7); /* Opera 11.10+ */ + background-image: linear-gradient(to bottom, #f3f3f3, #e7e7e7); } th, td { padding: 6px 8px; diff --git a/reference.html b/reference.html index 1fd4813dd46..4aafc9ab2a8 100644 --- a/reference.html +++ b/reference.html @@ -220,7 +220,7 @@

      Options

      Option Type - Default value + Default Description @@ -931,7 +931,7 @@

      Options

      Option Type - Default value + Default Description @@ -1124,7 +1124,7 @@ Option Type - Default value + Default Description @@ -1227,7 +1227,7 @@

      Options

      Option Type - Default value + Default Description @@ -1378,7 +1378,7 @@

      Options

      Option Type - Default value + Default Description @@ -1499,7 +1499,7 @@

      Options

      Option Type - Default value + Default Description @@ -1683,7 +1683,7 @@

      Options

      Option Type - Default value + Default Description @@ -2103,7 +2103,7 @@

      Options

      Option Type - Default value + Default Description @@ -2729,7 +2729,7 @@

      Options

      Option Type - Default value + Default Description From 8769c43b3b4f78e729e87031e7b09040970c4d75 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 12 Jul 2012 01:29:44 +0300 Subject: [PATCH 146/816] fix link color on examples --- docs/css/screen.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index b969a4456fd..a048d491631 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -250,7 +250,7 @@ a.nodocs { h3 span { color: #888; } -h3 a { +h3.alt a { color: #888; } From 73cf121a2ab8ef207311e04c019181889d8fde73 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 12 Jul 2012 01:32:00 +0300 Subject: [PATCH 147/816] add missing heading in docs --- reference.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference.html b/reference.html index 4aafc9ab2a8..816ca8d88a7 100644 --- a/reference.html +++ b/reference.html @@ -203,6 +203,8 @@

      Usage example

      Constructor

      + + @@ -617,6 +619,11 @@

      Methods that get map state

      Methods for layers and controls

      Constructor
      + + + + + From eb9c1bfc4ffe18414c8b938bf7217f63b90b1bad Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 12 Jul 2012 11:22:58 +0300 Subject: [PATCH 148/816] tweak docs col widths to make it nicer --- docs/css/screen.css | 18 ++++- reference.html | 188 ++++++++++++++++++++++---------------------- 2 files changed, 111 insertions(+), 95 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index a048d491631..8fa47ea4b13 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -106,7 +106,7 @@ th { background-image: linear-gradient(to bottom, #f3f3f3, #e7e7e7); } th, td { - padding: 6px 8px; + padding: 8px 10px; vertical-align: top; /*line-height: 1.4;*/ } @@ -304,4 +304,20 @@ table td code i { table td code b { color: black; font-weight: normal; +} + +th.width250 { + width: 250px; +} +th.width200 { + width: 200px; +} +th.width300 { + width: 300px; +} +th.width100 { + width: 100px; +} +th.minwidth { + width: 1px; } \ No newline at end of file diff --git a/reference.html b/reference.html index 816ca8d88a7..455070408d9 100644 --- a/reference.html +++ b/reference.html @@ -207,7 +207,7 @@

      Constructor

      MethodReturnsDescription
      addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? ) this
      - + @@ -667,7 +667,7 @@

      Conversion methods

      ConstructorConstructor Description
      - + @@ -682,39 +682,39 @@

      Conversion methods

      - + - + - + - - - - + + + - - - + + + - + - + - + - + - + - +
      MethodMethod Returns Description
      Returns the geographical coordinates of a given map layer point.
      mouseEventToContainerPoint( <MouseEvent> event )containerPointToLayerPoint( <Point> point ) PointReturns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.Converts the point relative to the map container to a point relative to the map layer.
      mouseEventToLayerPoint( <MouseEvent> event )layerPointToContainerPoint( <Point> point ) PointReturns the pixel coordinates of a mouse click relative to the map layer given its event object. + Converts the point relative to the map layer to a point relative to the map container.
      mouseEventToLatLng( <MouseEvent> event )LatLngReturns the geographical coordinates of the point the mouse clicked on given the click's event object.project( <LatLng> latlng, <Number> zoom? )PointProjects the given geographical coordinates to absolute pixel coordinates for the given zoom level (current zoom level by default).
      containerPointToLayerPoint( <Point> point )PointConverts the point relative to the map container to a point relative to the map layer.unproject( <Point> point, <Number> zoom? )LatLngProjects the given absolute pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
      layerPointToContainerPoint( <Point> point )mouseEventToContainerPoint( <MouseEvent> event ) PointConverts the point relative to the map layer to a point relative to the map container.Returns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.
      project( <LatLng> latlng, <Number> zoom? )mouseEventToLayerPoint( <MouseEvent> event ) PointProjects the given geographical coordinates to pixel coordinates for the given zoom level (current zoom level by default).Returns the pixel coordinates of a mouse click relative to the map layer given its event object.
      unproject( <Point> point, <Number> zoom? )mouseEventToLatLng( <MouseEvent> event ) LatLngProjects the given pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).Returns the geographical coordinates of the point the mouse clicked on given the click's event object.
      @@ -798,8 +798,8 @@

      Properties

      - - + + @@ -869,8 +869,8 @@

      Map panes

      PropertyTypePropertyType Description
      - - + + @@ -923,7 +923,7 @@

      Constructor

      PropertyTypePropertyType Description
      - + @@ -979,8 +979,8 @@

      Events

      ConstructorConstructor Description
      - - + + @@ -1083,8 +1083,8 @@

      Interaction handlers

      EventDataEventData Description
      - - + + @@ -1176,8 +1176,8 @@

      Methods

      PropertyTypePropertyType Description
      - - + + @@ -1207,7 +1207,7 @@

      Constructor

      MethodReturnsMethodReturns Description
      - + @@ -1368,7 +1368,7 @@

      Constructor

      ConstructorConstructor Description
      - + @@ -1383,9 +1383,9 @@

      Options

      ConstructorConstructor Description
      - - - + + + @@ -1439,7 +1439,7 @@

      Constructor

      OptionTypeDefaultOptionTypeDefault Description
      - + @@ -1486,7 +1486,7 @@

      Constructor

      ConstructorConstructor Description
      - + @@ -1506,7 +1506,7 @@

      Options

      - + @@ -1565,8 +1565,8 @@

      Events

      ConstructorConstructor Description
      Option TypeDefaultDefault Description
      - - + + @@ -1596,7 +1596,7 @@

      Events

      EventDataEventData Description
      -

      Constants

      +

      Properties

      @@ -1633,7 +1633,7 @@

      Constants

      Methods

      Constant
      - + @@ -1673,7 +1673,7 @@

      Constructor

      MethodMethod Returns Description
      - + @@ -1713,7 +1713,7 @@

      Methods

      ConstructorConstructor Description
      - + @@ -1829,7 +1829,7 @@

      Constructor

      MethodMethod Returns Description
      - + @@ -1844,7 +1844,7 @@

      Methods

      ConstructorConstructor Description
      - + @@ -1877,8 +1877,8 @@

      Methods

      MethodMethod Returns Description
      - - + + @@ -1913,7 +1913,7 @@

      Constructor

      MethodReturnsMethodReturns Description
      - + @@ -1926,8 +1926,8 @@

      Methods

      ConstructorConstructor Description
      - - + + @@ -1960,7 +1960,7 @@

      Constructor

      MethodReturnsMethodReturns Description
      - + @@ -1973,8 +1973,8 @@

      Methods

      ConstructorConstructor Description
      - - + + @@ -2014,7 +2014,7 @@

      Constructor

      MethodReturnsMethodReturns Description
      - + @@ -2029,7 +2029,7 @@

      Methods

      ConstructorConstructor Description
      - + @@ -2051,8 +2051,8 @@

      Events

      MethodMethod Returns Description
      - - + + @@ -2145,8 +2145,8 @@

      Methods

      EventDataEventData Description
      - - + + @@ -2193,7 +2193,7 @@

      Constructor

      MethodReturnsMethodReturns Description
      - + @@ -2206,8 +2206,8 @@

      Properties

      ConstructorConstructor Description
      - - + + @@ -2251,9 +2251,9 @@

      Constants

      PropertyTypePropertyType Description
      - - - + + + @@ -2290,7 +2290,7 @@

      Constructor

      ConstantTypeValueConstantTypeValue Description
      - + @@ -2307,7 +2307,7 @@

      Methods

      ConstructorConstructor Description
      - + @@ -2364,7 +2364,7 @@

      Methods

      - +
      MethodMethod Returns Description
      toBBoxString() StringReturns 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.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.
      @@ -2379,7 +2379,7 @@

      Constructor

      - + @@ -2392,8 +2392,8 @@

      Properties

      ConstructorConstructor Description
      - - + + @@ -2471,7 +2471,7 @@

      Constructor

      PropertyTypePropertyType Description
      - + @@ -2488,8 +2488,8 @@

      Properties

      ConstructorConstructor Description
      - - + + @@ -2508,7 +2508,7 @@

      Methods

      PropertyTypePropertyType Description
      - + @@ -2561,7 +2561,7 @@

      Constructor

      MethodMethod Returns Description
      - + @@ -2624,7 +2624,7 @@

      L.Control.Zoom

      Constructor

      ConstructorConstructor Description
      - + @@ -2642,7 +2642,7 @@

      L.Control.Attribution

      Constructor

      ConstructorConstructor Description
      - + @@ -2835,8 +2835,8 @@

      Event

      ConstructorConstructor Description
      - - + + @@ -2855,7 +2855,7 @@

      MouseEvent

      propertytypepropertytype description
      - + @@ -2875,7 +2875,7 @@

      LocationEvent

      propertyproperty type description
      - + @@ -2900,8 +2900,8 @@

      ErrorEvent

      propertyproperty type description
      - - + + @@ -2920,8 +2920,8 @@

      LayerEvent

      propertytypepropertytype description
      - - + + @@ -2935,8 +2935,8 @@

      GeoJSON event

      propertytypepropertytype description
      - - + + @@ -2965,8 +2965,8 @@
      propertytypepropertytype description
      - - + + @@ -3118,8 +3118,8 @@

      L.Browser

      propertytypepropertytype description
      - - + + @@ -3390,8 +3390,8 @@

      IHandler

      propertytypepropertytype description
      - - + + From 20993a0cf69b19265fe2ac6678ddd73177e5801c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 12 Jul 2012 14:27:58 +0300 Subject: [PATCH 149/816] lots of docs updates regarding the new syntax --- docs/css/screen.css | 17 +++ docs/highlight/styles/github.css | 4 +- reference.html | 214 +++++++++++++++++++++++++------ 3 files changed, 194 insertions(+), 41 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 8fa47ea4b13..fea04c90ae8 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -320,4 +320,21 @@ th.width100 { } th.minwidth { width: 1px; +} + +table.factory-table { + width: 1px; +} + +table.factory-table td, table.factory-table th { + white-space: nowrap; + color: black; +} + +.factory-usage { + white-space: nowrap; +} + +.factory-usage code { + color: black; } \ No newline at end of file diff --git a/docs/highlight/styles/github.css b/docs/highlight/styles/github.css index a4f7deb78e4..dd05840d8de 100644 --- a/docs/highlight/styles/github.css +++ b/docs/highlight/styles/github.css @@ -10,7 +10,7 @@ pre code { background: #f8f8ff } -pre .comment, +code .comment, pre .template_comment, pre .diff .header, pre .javadoc { @@ -18,7 +18,7 @@ pre .javadoc { font-style: italic } -pre .keyword, +code .keyword, pre .css .rule .keyword, pre .winutils, pre .javascript .title, diff --git a/reference.html b/reference.html index 455070408d9..1d3122aed61 100644 --- a/reference.html +++ b/reference.html @@ -189,33 +189,32 @@

      L.Map

      Usage example

      // initialize the map on the "map" div with a given center and zoom
      -var map = new L.Map('map', {
      -	center: new L.LatLng(51.505, -0.09),
      +var map = L.map('map', {
      +	center: [51.505, -0.09],
       	zoom: 13
      -});
      -
      -// create a CloudMade tile layer
      -var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
      -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
      -
      -// add the CloudMade layer to the map
      -map.addLayer(cloudmade);
      - -

      Constructor

      +}); - +

      Constructor

      MethodReturnsMethodReturns Description
      - + + +
      ConstructorConstructorUsage Description
      L.Map( <HTMLElement|String> id, <Map options> options? ) + new L.Map()
      + L.map() +
      Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
      + + +

      Options

      @@ -924,10 +923,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Marker( <LatLng> latlng, <Marker options> options? ) + new L.Marker()
      + L.marker() +
      Instantiates a Marker object given a geographical point and optionally an options object.
      @@ -1117,10 +1121,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Popup( <Popup options> options?, <object> source? ) + new L.Popup()
      + L.popup() +
      Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.
      @@ -1200,18 +1209,25 @@

      L.TileLayer

      Usage example

      -
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
      -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
      +
      L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
      +	key: 'API-key',
      +	styleId: 997
      +}).addTo(map);

      Constructor

      + +
      ConstructorUsage Description
      L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) + new L.TileLayer()
      + L.tileLayer() +
      Instantiates a tile layer object given a URL template and optionally an options object.
      @@ -1226,7 +1242,7 @@

      URL template

      You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

      -
      new L.TileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
      +
      L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});

      Options

      @@ -1369,10 +1385,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) + new L.TileLayer.WMS()
      + L.tileLayer.wms() +
      Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
      @@ -1439,11 +1460,16 @@

      Constructor

      - + + +
      ConstructorConstructorUsage Description
      L.TileLayer.Canvas( <TileLayer options> options? ) + new L.TileLayer.Canvas()
      + L.tileLayer.canvas() +
      Instantiates a Canvas tile layer object given an options object (optionally).
      @@ -1452,7 +1478,7 @@

      Methods

      - + @@ -1475,22 +1501,25 @@

      L.ImageOverlay

      Usage example

      -
      var imageBounds = new L.LatLngBounds(
      -		new L.LatLng(40.712216,-74.22655),
      -		new L.LatLng(40.773941,-74.12544));
      +		
      var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
      +	imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
       
      -var image = new L.ImageOverlay(
      -		"http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg", imageBounds);
      +L.imageOverlay(imageUrl, imageBounds).addTo(map);

      Constructor

      MethodMethod Returns Description
      + +
      ConstructorUsage Description
      L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) + new L.ImageOverlay()
      + L.imageOverlay() +
      Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
      @@ -1661,23 +1690,25 @@

      L.Polyline

      Usage example

      // create a red polyline from an arrays of LatLng points
      -var polyline = new L.Polyline(latlngs, {color: 'red'});
      +var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
       
       // zoom the map to the polyline
      -map.fitBounds(new L.LatLngBounds(latlngs));
      -
      -// add the polyline to the map
      -map.addLayer(polyline);
      +map.fitBounds(polyline.getBounds());

      Constructor

      + +
      ConstructorUsage Description
      L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) + new L.Polyline()
      + L.polyline() +
      Instantiates a polyline object given an array of geographical points and optionally an options object.
      @@ -1755,10 +1786,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) + new L.MultiPolyline()
      + L.multiPolyline() +
      Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
      @@ -1774,10 +1810,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) + new L.Polygon()
      + L.polygon() +
      Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
      @@ -1795,10 +1836,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) + new L.MultiPolygon()
      + L.multiPolygon() +
      Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
      @@ -1830,10 +1876,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) + new L.Rectangle()
      + L.rectangle() +
      Instantiates a rectangle object with the given geographical bounds and optionally an options object.
      @@ -1865,10 +1916,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) + new L.Circle()
      + L.circle() +
      Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
      @@ -1914,10 +1970,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.CircleMarker( <LatLng> latlng, <Path options> options? ) + new L.CircleMarker()
      + L.circleMarker() +
      Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
      @@ -1961,10 +2022,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.LayerGroup( <ILayer[]> layers? ) + new L.LayerGroup()
      + L.layerGroup() +
      Create a layer group, optionally given an initial set of layers.
      @@ -2015,10 +2081,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.FeatureGroup( <IFeature[]> layers? ) + new L.FeatureGroup()
      + L.featureGroup() +
      Create a layer group, optionally given an initial set of layers.
      @@ -2096,10 +2167,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) + new L.GeoJSON()
      + L.geoJson() +
      Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it with addGeoJSON method) and an options object.
      @@ -2189,15 +2265,26 @@

      L.LatLng

      Represents a geographical point with a certain latitude and longitude.

      var latlng = new L.LatLng(50.5, 30.5);
      +

      All Leaflet methods that accept LatLng objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

      + +
      map.panTo([50, 30]);
      +map.panTo(new L.LatLng(50, 30));
      +

      Constructor

      + +
      ConstructorUsage Description
      L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) + new L.LatLng()
      + L.latLng()
      + L.latLng([]) +
      Creates an object representing a geographical point with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument.
      @@ -2282,23 +2369,40 @@

      Constants

      L.LatLngBounds

      Represents a rectangular geographical area on a map.

      -
      var southWest = new L.LatLng(40.712,-74.227),
      -	northEast = new L.LatLng(40.774,-74.125),
      +		
      var southWest = new L.LatLng(40.712, -74.227),
      +	northEast = new L.LatLng(40.774, -74.125),
       	bounds = new L.LatLngBounds(southWest, northEast);
      +

      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:

      + +
      map.fitBounds([
      +	[40.712, -74.227], 
      +	[40.774, -74.125]
      +]);
      +

      Constructor

      + + +
      ConstructorUsage Description
      L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) + new L.LatLngBounds()
      + L.latLngBounds()
      + L.latLngBounds([]) +
      Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.
      L.LatLngBounds( <LatLng[]> latlngs ) + new L.LatLngBounds()
      + L.latLngBounds() +
      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.
      @@ -2373,17 +2477,30 @@

      Methods

      L.Point

      -

      Represents a point with x and y coordinates in pixels. +

      Represents a point with x and y coordinates in pixels.

      + +
      var point = new 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:

      + +
      map.panBy([200, 300]);
      +map.panBy(new L.Point(200, 300));

      Constructor

      + +
      ConstructorUsage Description
      L.Point( <Number> x, <Number> y, <Boolean> round? ) + new L.Point()
      + L.point()
      + L.point([]) +
      Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
      @@ -2467,19 +2584,33 @@

      L.Bounds

      p2 = new L.Point(40, 60), bounds = new 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:

      + +
      otherBounds.intersects([[10, 10], [40, 60]]);
      +

      Constructor

      + + +
      ConstructorUsage Description
      L.Bounds( <Point> topLeft, <Point> bottomRight ) + new L.Bounds()
      + L.bounds()
      + L.bounds([]) +
      Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
      L.LatLngBounds( <Point[]> points ) + new L.Bounds()
      + L.bounds() +
      Creates a Bounds object defined by the points it contains.
      @@ -2544,16 +2675,16 @@

      L.Icon

      Represents an icon to provide when creating a marker.

      -
      var myIcon = new L.Icon({
      +		
      var myIcon = L.icon({
       	iconUrl: 'my-icon.png',
       	shadowUrl: 'my-icon-shadow.png',
      -	iconSize: new L.Point(38, 95),
      -	shadowSize: new L.Point(68, 95),
      -	iconAnchor: new L.Point(22, 94),
      -	popupAnchor: new L.Point(-3, -76)
      +	iconSize: [38, 95],
      +	shadowSize: [68, 95],
      +	iconAnchor: [22, 94],
      +	popupAnchor: [-3, -76]
       });
       
      -var marker = new L.Marker(marker, {icon: myIcon});
      +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.

      @@ -2562,10 +2693,15 @@

      Constructor

      + +
      ConstructorUsage Description
      L.Icon( <Icon properties> props ) + new L.Icon()
      + L.icon() +
      Creates an icon instance with the given properties.
      @@ -3125,7 +3261,7 @@

      L.Browser

      ie Boolean - true for all old Internet Explorer versions (6-8). + true for all Internet Explorer versions. ie6 From 82f389d9cc997e70681bb2f8501ddc6b1943548c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 12 Jul 2012 15:12:20 +0300 Subject: [PATCH 150/816] more docs updates, including new geojson reference --- reference.html | 134 +++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 82 deletions(-) diff --git a/reference.html b/reference.html index 1d3122aed61..37c808e196c 100644 --- a/reference.html +++ b/reference.html @@ -914,9 +914,7 @@

      L.Marker

      Used to put markers on the map.

      -

      Usage example

      -
      var marker = new L.Marker(latlng);
      -map.addLayer(marker);
      +
      L.marker([50.5, 30.5]).addTo(map);

      Constructor

      @@ -1108,11 +1106,9 @@

      Usage example

      If you want to just bind a popup to marker click and then open it, it's really easy:

      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:

      -
      var popupContent = '<p>Hello world!<br />This is a nice popup.</p>',
      -	popup = new L.Popup();
      -
      -popup.setLatLng(latlng);
      -popup.setContent(popupContent);
      +		
      var popup = L.popup()
      +	.setLatLng(latlng)
      +	.setContent('<p>Hello world!<br />This is a nice popup.</p>');
       
       map.openPopup(popup);
      @@ -1373,7 +1369,7 @@

      L.TileLayer.WMS

      Usage example

      -
      var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
      +		
      var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
       	layers: 'nexrad-n0r-900913',
       	format: 'image/png',
       	transparent: true,
      @@ -1449,7 +1445,7 @@ 

      L.TileLayer.Canvas

      Usage example

      -
      var canvasTiles = new L.TileLayer.Canvas();
      +		
      var canvasTiles = L.tileLayer.canvas();
       
       canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
       	var ctx = canvas.getContext('2d');
      @@ -1625,7 +1621,7 @@ 

      Events

      -

      Properties

      +

      Static properties

      @@ -1634,25 +1630,25 @@

      Properties

      - + - + - + - + @@ -1854,22 +1850,14 @@

      L.Rectangle

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      Usage example

      -
      // create an orange rectangle from a LatLngBounds
      -var bounds = new L.LatLngBounds(new L.LatLng(54.559322, -5.767822), new L.LatLng(56.1210604, -3.021240));
      -
      -// zoom the map to the rectangle
      -map.fitBounds(bounds);
      -
      -// create the rectangle
      -var rectangle = new L.Rectangle(bounds, {
      -	fillColor: "#ff7800",
      -	color: "#000000",
      -	opacity: 1,
      -	weight: 2
      -});
      +		
      // define rectangle geographical bounds
      +var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
      +
      +// create an orange rectangle
      +L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
       
      -// add the rectangle to the map
      -map.addLayer(rectangle);
      +// zoom the map to the rectangle bounds +map.fitBounds(bounds);

      Constructor

      @@ -1911,6 +1899,8 @@

      L.Circle

      A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      +
      L.circle([50.5, 30.5], 200).addTo(map);
      +

      Constructor

      Constant Description
      L.Path.SVGSVG Boolean depends True if SVG is used for vector rendering (true for most modern browsers).
      L.Path.VMLVML Boolean depends True if VML is used for vector rendering (IE 6-8).
      L.Path.CANVASCANVAS Boolean depends True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
      L.Path.CLIP_PADDINGCLIP_PADDING Number 0.5 for SVG
      0.02 for VML
      How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
      @@ -2009,13 +1999,9 @@

      L.LayerGroup

      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. Implements ILayer interface.

      -
      var group = new L.LayerGroup();
      -
      -group.addLayer(marker1);
      -group.addLayer(marker2);
      -group.addLayer(polyline);
      -
      -map.addLayer(group);
      +
      L.layerGroup([marker1, marker2])
      +	.addLayer(polyline)
      +	.addTo(map);

      Constructor

      @@ -2066,15 +2052,10 @@

      L.FeatureGroup

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

      -
      var group = new L.FeatureGroup([marker1, marker2, polyline]);
      -
      -group.bindPopup('Hello world!');
      -
      -group.on('click', function() {
      -	alert('Clicked on a group!');
      -});
      -
      -map.addLayer(group);
      +
      L.featureGroup([marker1, marker2, polyline])
      +	.bindPopup('Hello world!')
      +	.on('click', function() { alert('Clicked on a group!'); })
      +	.addTo(map);

      Constructor

      @@ -2151,16 +2132,16 @@

      Events

      L.GeoJSON

      -

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display on the map. Extends FeatureGroup.

      +

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.

      -
      var geojson = new L.GeoJSON();
      -
      -geojson.on('featureparse', function(e) {
      -	// do something with e.layer depending on e.properties
      -});
      -geojson.addGeoJSON(geojsonObj);
      -
      -map.addLayer(geojson);
      +
      L.geoJson(data, {
      +	style: function (feature) {
      +		return {color: feature.properties.color};
      +	},
      +	onEachFeature: function (feature, layer) {
      +		layer.bindPopup(feature.properties.description);
      +	}
      +}).addTo(map);

      Constructor

      @@ -2176,7 +2157,7 @@

      Constructor

      new L.GeoJSON()
      L.geoJson() - +
      Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it with addGeoJSON method) and an options object.Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.
      @@ -2185,38 +2166,27 @@

      Options

      - - - - - - + + -
      OptionTypeDefault Description
      pointToLayerFunctionnullFunction of the form (LatLng) -> ILayer that will be used for creating layers for GeoJSON points (if not specified, markers will be created).pointToLayer( <GeoJSON> featureData, <LatLng> latlng )Function that will be used for creating layers for GeoJSON points (if not specified, simple markers will be created).
      - - -

      Events

      - -

      You can subscribe to the following events using these methods.

      - - - - - - + + + - - - + + + + + + +
      EventDataDescription
      style( <GeoJSON> featureData )Function that will be used to get style options for vector layers created for GeoJSON features.
      featureparseGeoJSONEvent - Fired before an object converted from a GeoJSON feature is added to the map. This event can be used to add interaction or change styling of objects depending on feature properties.
      onEachFeature( <GeoJSON> featureData, <ILayer> layer )Function that will be called on each created feature layer. Useful for attaching events and popups to features.
      filter( <GeoJSON> featureData, <ILayer> layer )Function that will be used to decide whether to show a feature or not.
      -

      Methods

      @@ -2226,7 +2196,7 @@

      Methods

      - + @@ -2241,9 +2211,9 @@

      Static methods

      - + - + From 9df26ae7398c290845e57a87f830992671c94c44 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 12 Jul 2012 15:33:52 +0300 Subject: [PATCH 151/816] fix geojson example code so that it works --- debug/vector/geojson.html | 20 ++-- examples/geojson.html | 224 ++++++++++++++++++-------------------- 2 files changed, 113 insertions(+), 131 deletions(-) diff --git a/debug/vector/geojson.html b/debug/vector/geojson.html index c49708d5678..5033b8a8c07 100644 --- a/debug/vector/geojson.html +++ b/debug/vector/geojson.html @@ -18,17 +18,14 @@ diff --git a/examples/geojson.html b/examples/geojson.html index 0fcbbad3625..80ead7d2c85 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -50,74 +50,60 @@

      Using GeoJSON with Leaflet

      @@ -139,84 +125,84 @@

      The GeoJSON layer

      map.addLayer(geojsonLayer); -

      This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

      - -
      var geojsonFeature = {
      -    "type": "Feature",
      -    "properties": {
      -        "name": "Coors Field",
      -        "amenity": "Baseball Stadium",
      -        "popupContent": "This is where the Rockies play!"
      -    },
      -    "geometry": {
      -        "type": "Point",
      -        "coordinates": [-104.99404, 39.75621]
      -    }
      +		

      This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

      + +
      var geojsonFeature = {
      +	"type": "Feature",
      +	"properties": {
      +		"name": "Coors Field",
      +		"amenity": "Baseball Stadium",
      +		"popupContent": "This is where the Rockies play!"
      +	},
      +	"geometry": {
      +		"type": "Point",
      +		"coordinates": [-104.99404, 39.75621]
      +	}
       };
       
       geojsonLayer.addGeoJSON(geojsonFeature);
      -

      We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

      +

      We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

      -
      var geojsonLayer = new L.GeoJSON(geojsonFeature);
      +		
      var geojsonLayer = new L.GeoJSON(geojsonFeature);
       
       map.addLayer(geojsonLayer);
      -

      Popups

      +

      Popups

      -

      We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

      +

      We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

      -
      geojsonLayer.on("featureparse", function (e) {
      -    if (e.properties && e.properties.popupContent){
      -        e.layer.bindPopup(e.properties.popupContent);
      -    }
      +		
      geojsonLayer.on("featureparse", function (e) {
      +	if (e.properties && e.properties.popupContent){
      +		e.layer.bindPopup(e.properties.popupContent);
      +	}
       });

      Make sure to do this before adding GeoJSON objects through the addGeoJSON method.

      -

      Styling Features

      +

      Styling Features

      We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

      var freeBus = {
      -    "type": "Feature",
      -    "geometry": {
      -        "type": "LineString",
      -        "coordinates": [
      -            [-104.98726, 39.74136],
      -            [-104.98720, 39.74132],
      -            [-104.98715, 39.74127],
      -            [-104.98713, 39.74117],
      -            [-104.98712, 39.74106], ...
      -        ]
      -    },
      -    "properties": {
      -        "name": "16th Street Free Bus",
      -        "style": {
      -            "color": "#004070",
      -            "weight": 4,
      -            "opacity": 0.9
      -        },
      -        "popupContent": "This is the 16th street free bus ..."
      -    }
      +	"type": "Feature",
      +	"geometry": {
      +		"type": "LineString",
      +		"coordinates": [
      +			[-104.98726, 39.74136],
      +			[-104.98720, 39.74132],
      +			[-104.98715, 39.74127],
      +			[-104.98713, 39.74117],
      +			[-104.98712, 39.74106], ...
      +		]
      +	},
      +	"properties": {
      +		"name": "16th Street Free Bus",
      +		"style": {
      +			"color": "#004070",
      +			"weight": 4,
      +			"opacity": 0.9
      +		},
      +		"popupContent": "This is the 16th street free bus ..."
      +	}
       };
      -

      To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

      +

      To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

      geojsonLayer.on("featureparse", function (e){
       	if (e.properties && e.properties.style && e.layer.setStyle){
      -	    // The setStyle method isn't available for Points. More on that below ...
      +		// The setStyle method isn't available for Points. More on that below ...
       		e.layer.setStyle(e.properties.style);
       	}
       });
      -

      Styling Points

      +

      Styling Points

      -

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      +

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      -

      Here we're using a CircleMarker:

      +

      Here we're using a CircleMarker:

      -
      var geojsonMarkerOptions = {
      +		
      var geojsonMarkerOptions = {
       	radius: 8,
       	fillColor: "#ff7800",
       	color: "#000",
      @@ -226,22 +212,22 @@ 

      Styling Points

      }; var geojsonLayer = new L.GeoJSON(someGeojsonFeature, { - pointToLayer: function (latlng) { - return new L.CircleMarker(latlng, geojsonMarkerOptions); - } + pointToLayer: function (latlng) { + return new L.CircleMarker(latlng, geojsonMarkerOptions); + } });
      -

      And here's an example of using a custom Marker:

      +

      And here's an example of using a custom Marker:

      -
      var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
      -    pointToLayer: function (latlng) {
      -        return new L.Marker(latlng, {
      -            icon: new MyCustomIcon()
      -        });
      -    }
      +		
      var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
      +	pointToLayer: function (latlng) {
      +		return new L.Marker(latlng, {
      +			icon: new MyCustomIcon()
      +		});
      +	}
       });
      -

      View the example page to see in detail what is possible with the GeoJSON layer.

      +

      View the example page to see in detail what is possible with the GeoJSON layer.


      From 25a20644ab248a4462dfa2a45464e498cd9e89de Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 12 Jul 2012 16:05:49 +0300 Subject: [PATCH 152/816] more docs fixes --- examples/geojson.html | 2 +- reference.html | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/geojson.html b/examples/geojson.html index 80ead7d2c85..782becf74b9 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -62,7 +62,7 @@

      Using GeoJSON with Leaflet

      iconUrl: 'baseball-marker.png', iconSize: [32, 37], iconAnchor: [16, 37], - popupAnchor: new L.Point(0, -28) // TODO temporary until fixed + popupAnchor: [0, -28] }); function onEachFeature(feature, layer) { diff --git a/reference.html b/reference.html index 37c808e196c..3acfabb9274 100644 --- a/reference.html +++ b/reference.html @@ -1108,9 +1108,8 @@

      Usage example

      Path overlays like polylines also have a bindPopup method. Here's a more complicated way to open a popup on a map:

      var popup = L.popup()
       	.setLatLng(latlng)
      -	.setContent('<p>Hello world!<br />This is a nice popup.</p>');
      -
      -map.openPopup(popup);
      + .setContent('<p>Hello world!<br />This is a nice popup.</p>') + .openOn(map);

      Constructor

      From ebf491db8987b16eab41f0abc2d04c0912e5e276 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 13 Jul 2012 15:10:28 +0300 Subject: [PATCH 153/816] add last point polygon note, closes #684 --- reference.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference.html b/reference.html index 3acfabb9274..b1f33b682c6 100644 --- a/reference.html +++ b/reference.html @@ -1800,6 +1800,8 @@

      L.Polygon

      A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

      +

      Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

      +

      Constructor

      Description
      addGeoJSON( <Object> geojson )addData( <GeoJSON> data ) Boolean Adds a GeoJSON object to the layer.
      Description
      geometryToLayer( <Object> geojson, <Function> pointToLayer? )geometryToLayer( <GeoJSON> featureData, <Function> pointToLayer? ) ILayerCreates a layer from a given GeoJSON geometry.Creates a layer from a given GeoJSON feature.
      coordsToLatlng( <Array> coords, <Boolean> reverse? )
      From fc69e43ab5edc38920e94615f0355a4d57edc133 Mon Sep 17 00:00:00 2001 From: hayley Date: Sat, 14 Jul 2012 12:27:53 -0500 Subject: [PATCH 154/816] typo where maxWidth should've been minWidth --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index b1f33b682c6..29aa4118946 100644 --- a/reference.html +++ b/reference.html @@ -1145,7 +1145,7 @@ - + From 604c77419af484b24bdfc624ddc883c8ff867611 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 16 Jul 2012 20:21:00 +0300 Subject: [PATCH 155/816] initial jekyll conversion --- .gitignore | 3 +- _config.yml | 6 + _layouts/default.html | 164 + download.md | 34 + examples.md | 63 + examples/quick-start.md | 237 ++ features.html | 293 +- index.md | 68 + reference.html | 6581 +++++++++++++++++++-------------------- 9 files changed, 3908 insertions(+), 3541 deletions(-) create mode 100644 _config.yml create mode 100644 _layouts/default.html create mode 100644 download.md create mode 100644 examples.md create mode 100644 examples/quick-start.md create mode 100644 index.md diff --git a/.gitignore b/.gitignore index a363d3b2ba9..38c00bfe5d3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules tmp/**/* .idea .idea/**/* -*.iml \ No newline at end of file +*.iml +_site \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000000..78504620f11 --- /dev/null +++ b/_config.yml @@ -0,0 +1,6 @@ +exclude: build, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE + +markdown: kramdown + +kramdown: + entity_output: as_input \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 00000000000..7f8bc42aab9 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,164 @@ + + + + Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade + + + + + + + + + + + + + + {% capture root %}{% if page.root %}{{ page.root }}{% else %}{{ post.root }}{% endif %}{% endcapture %} + + + + + + + + + + + + + + + + + + + +
      +

      Leaflet

      +

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      + + + + + + + {{ content }} + +
      + +

      © 2012 CloudMade, Vladimir Agafonkin. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

      +
      + + Fork me on GitHub + + + + + + + + diff --git a/download.md b/download.md new file mode 100644 index 00000000000..ca56f53f67a --- /dev/null +++ b/download.md @@ -0,0 +1,34 @@ +--- +layout: default +title: Download +--- + +### Download Leaflet + +Besides the library itself, the download package contains full source +code, unit tests, files for debugging and a build system. The production +files (included the same way as in the code above) are in the `dist` +folder. + +[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012) +[Download Leaflet 0.4 master](http://github.com/CloudMade/Leaflet/zipball/master) (in-progress version) + +[View Changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md) + +### Using a hosted version of Leaflet + +The latest stable release of Leaflet is hosted on a CDN — to start using +it straight away, place this code in the `head` section of your HTML: + + + + + + +### Building a custom version of Leaflet + +Open `build/build.html` page from the download package, check the +components you want to see in your build and then follow the +instructions there. \ No newline at end of file diff --git a/examples.md b/examples.md new file mode 100644 index 00000000000..c6adc792655 --- /dev/null +++ b/examples.md @@ -0,0 +1,63 @@ +--- +layout: default +title: Tutorials +--- + +### Leaflet tutorials + +Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers. + +*** +[][1] + +### [Leaflet Quick Start Guide][1] + +A simple step-by-step guide that will quickly get you started with Leaflet basics, including setting up a Leaflet map (with CloudMade tiles) on your page, working with markers, polylines and popups, and dealing with events. + +*** +[][2] + +### [Leaflet on Mobile][2] + +In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location. + +*** +[][3] + +### [Markers With Custom Icons][3] + +In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map. + +*** +[][4] + +### [Using GeoJSON with Leaflet][4] + +In this example, you'll learn how to create and interact with map vectors created from [GeoJSON][5] objects. + +*** +[][6] + +### [Layer Groups and Layers Control][6] + +A tutorial on how to manage groups of layers and use the layer switching control. + +*** +### Custom Controls + +A brief tutorial on implementing custom map controls. + +*** +### Custom Overlays + +If markers, popups and vectors are not enough for you, here's a guide for creating your own map overlays (things to put on a map). + +*** +More examples coming soon! + + [1]: examples/quick-start.html + [2]: examples/mobile.html + [3]: examples/custom-icons.html + [4]: examples/geojson.html + [5]: http://geojson.org/ + [6]: examples/layers-control.html \ No newline at end of file diff --git a/examples/quick-start.md b/examples/quick-start.md new file mode 100644 index 00000000000..17d8eb0ec17 --- /dev/null +++ b/examples/quick-start.md @@ -0,0 +1,237 @@ +--- +layout: default +title: Quick Start Guide +root: ../ +--- + +[← Back to the list of examples](../examples.html) + + +### Leaflet Quick Start Guide + +This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events. + + +
      + +[View example on a separate page →](quick-start-example.html) + + +### Preparing your page + +Before writing any code for the map, you need to do the following preparation steps on your page: + + * Include Leaflet CSS files in the head section of your document: + + + + + * Include Leaflet JavaScript file somewhere on the page (preferably before body close tag): + + + + * Put a div element with a certain id where you want your map to be (making sure it has defined height): + +
      + +Now you're ready to initialize the map and do some stuff with it. + + +### Setting up the map + +
      + + +Let's create a map instance, set its view to the center of London and add a pretty CloudMade tile layer to it. First we'll initialize the map: + + var map = new L.Map('map'); + +By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls. + +Next we'll create a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at [CloudMade](http://cloudmade.com/register)), the attribution text and the maximum zoom level of the layer: + +
      var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/API-KEY/997/256/{z}/{x}/{y}.png', {
      +	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
      +	maxZoom: 18
      +});
      + +It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles, and it doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd recommend CloudMade though, it looks beautiful). + +Finally we'll set the map view to the center of London at 13th zoom level and add our tile layer (see the resulting map above): + + var london = new L.LatLng(51.505, -0.09); // geographical point (longitude and latitude) + map.setView(london, 13).addLayer(cloudmade); + +Make sure this code is below both the map div and leaflet.js inclusion, or in a window.load or document.ready event handler. + + +### Markers, circles and polygons + +
      + +Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker: + + var markerLocation = new L.LatLng(51.5, -0.09); + + var marker = new L.Marker(markerLocation); + map.addLayer(marker); + +Adding a circle is the same (except for specifying the radius in meters), but lets configure it by passing options as a third argument when creating the object (the second argument is the radius in pixels): + + var circleLocation = new L.LatLng(51.508, -0.11), + circleOptions = { + color: 'red', + fillColor: '#f03', + fillOpacity: 0.5 + }; + + var circle = new L.Circle(circleLocation, 500, circleOptions); + map.addLayer(circle); + +Add a polygon is easy too: + + L.polygon([[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]]).addTo(map); + + +### Working with popups + +
      + +Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this: + + marker.bindPopup("Hello world!
      I am a popup.").openPopup(); + circle.bindPopup("I am a circle."); + polygon.bindPopup("I am a polygon."); + +Try clicking on our objects. The bindPopup method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the openPopup method (for markers only) immediately opens the attached popup. + +You can also use popups as layers (when you need something more than attching a popup to an object): + + var popup = new L.Popup(); + + popup.setLatLng(new L.LatLng(51.5, -0.09)); + popup.setContent("I am a standalone popup."); + + map.openPopup(popup); + +Here we use openPopup instead of addLayer because it handles automatic closing of a previously opened popup when opening a new one which is good for usability. + + +### Dealing with events + +Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction: + + map.on('click', onMapClick); + + function onMapClick(e) { + alert("You clicked the map at " + e.latlng); + } + +Each object has its own set of events — see documentation for details. The first argument of the listener function is an event object — it contains useful information about the event that happened. For example, map click event object (e in the example above) has latlng property which is a location at which the click occured. + +Lets improve our example by using a popup instead of an alert and formatting the location string: + + map.on('click', onMapClick); + + var popup = new L.Popup(); + + function onMapClick(e) { + var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')'; + + popup.setLatLng(e.latlng); + popup.setContent("You clicked the map at " + latlngStr); + + map.openPopup(popup); + } + +Try clicking on the map and you will see the coordinates in a popup. View the full example → + +Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed documentation or other examples. + + + + + + + + \ No newline at end of file diff --git a/features.html b/features.html index 6798a48c255..bde35fc1055 100644 --- a/features.html +++ b/features.html @@ -1,208 +1,103 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Features - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - -
      - - - - +

      If you find some feature really missing in Leaflet, please vote for it on the Leaflet UserVoice page.

      \ No newline at end of file diff --git a/index.md b/index.md new file mode 100644 index 00000000000..ddb8e306699 --- /dev/null +++ b/index.md @@ -0,0 +1,68 @@ +--- +layout: default +--- + +Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 25 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. + +It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. + + +### Basic usage example + +
      + +Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it: + + + +
      // create a map in the "map" div, set the view to a given place and zoom
      +var map = L.map('map').setView([51.505, -0.09], 13);
      +
      +// add a CloudMade tile layer with style #997
      +L.tileLayer('http://{s}.tile.cloudmade.com/[API-key]/997/256/{z}/{x}/{y}.png', {
      +    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
      +}).addTo(map);
      +
      +// add a marker in the given location, attach some popup content to it and open the popup
      +L.marker([51.5, -0.09]).addTo(map)
      +    .bindPopup('A pretty CSS3 popup. <br> Easily customizable.').openPopup();
      + + +Check out the [examples](examples.html) section for more examples, or head straight to the [documentation](reference.html). + + +### Contributing to Leaflet + +The project is [hosted on GitHub][], waiting for your contributions --- just send your pull requests to [@mourner][] (Vladimir Agafonkin, Leaflet author and maintainer). Let’s make the best library for maps that can possibly exist! + +You can also help the project a lot by reporting bugs on the [GitHub issues page][], showing your support for your favorite feature suggestions on [Leaflet UserVoice page][], tweeting to [@LeafletJS][] or joining the [Leaflet mailing list][]. + + [Vladimir Agafonkin]: http://agafonkin.com/en + [CloudMade]: http://cloudmade.com + [contributors]: https://github.com/CloudMade/Leaflet/graphs/contributors + [features]: features.html + [A-grade]: http://developer.yahoo.com/yui/articles/gbs/ + [a simple API]: reference.html "Leaflet API reference" + [code of the library]: https://github.com/CloudMade/Leaflet + "Leaflet GitHub repository" + [hosted on GitHub]: http://github.com/CloudMade/Leaflet + [@mourner]: http://github.com/mourner + [GitHub issues page]: http://github.com/CloudMade/Leaflet/issues + [Leaflet UserVoice page]: http://leaflet.uservoice.com + [@LeafletJS]: http://twitter.com/LeafletJS + [Leaflet mailing list]: https://groups.google.com/group/leaflet-js + + + \ No newline at end of file diff --git a/reference.html b/reference.html index 29aa4118946..a65b87f694d 100644 --- a/reference.html +++ b/reference.html @@ -1,1857 +1,1798 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Documentation - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - -
      Max width of the popup.
      maxWidthminWidth Number 50 Min width of the popup.
      - - - - - - - - - - -
      ConstructorUsageDescription
      L.Map( <HTMLElement|String> id, <Map options> options? ) - new L.Map()
      - L.map() -
      Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
      - - - - -

      Options

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      centerLatLngnullInitial geographical center of the map.
      zoomNumbernullInitial map zoom.
      layersILayer[][]Layers that will be added to the map initially.
      minZoomNumber0Minimum zoom level of the map. Overrides any minZoom set on map layers.
      maxZoomNumber18Maximum zoom level of the map. This overrides any maxZoom set on map layers.
      maxBoundsLatLngBoundsnullWhen this option is set, the map restricts the view to the given geographical bounds, bouncing the user back when he tries to pan outside the view, and also not allowing to zoom out to a view that's larger than the given bounds (depending on the map size). To set the restriction dynamically, use setMaxBounds method
      crsCRSL.CRS.
      EPSG3857
      Coordinate Reference System to use. Don't change this if you're not sure what it means.
      draggingBooleantrueWhether the map be draggable with mouse/touch or not.
      touchZoomBooleantrueWhether the map can be zoomed by touch-dragging with two fingers.
      scrollWheelZoomBooleantrueWhether the map can be zoomed by using the mouse wheel.
      doubleClickZoomBooleantrueWhether the map can be zoomed in by double clicking on it.
      boxZoomBooleantrueWhether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
      zoomControlBooleantrueWhether the zoom control is added to the map by default.
      attributionControlBooleantrueWhether the attribution control is added to the map by default.
      trackResizeBooleantrueWhether the map automatically handles browser window resize to update itself.
      fadeAnimationBooleandependsWhether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      zoomAnimationBooleandependsWhether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      markerZoomAnimationBooleandependsWhether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      closePopupOnClickBooleantrueSet it to false if you don't want popups to close when user clicks the map.
      worldCopyJumpBooleantrueWith this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there.
      - - -

      Events

      - -

      You can subscribe to the following events using these methods.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      EventDataDescription
      clickMouseEvent - Fired when the user clicks (or taps) the map.
      dblclickMouseEvent - Fired when the user double-clicks (or double-taps) the map.
      mousedownMouseEvent - Fired when the user pushes the mouse button on the map.
      mouseenterMouseEvent - Fired when the mouse enters the map.
      mouseleaveMouseEvent - Fired when the mouse leaves the map.
      mousemoveMouseEvent - Fired while the mouse moves over the map.
      contextmenuMouseEvent - Fired when the user pushes the right mouse button on the map.
      preclickMouseEvent - Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running).
      loadEvent - Fired when the map is initialized (when its center and zoom are set for the first time).
      viewresetEvent - Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays.
      movestartEvent - Fired when the view of the map starts changing (e.g. user starts dragging the map).
      moveEvent - Fired on any movement of the map view.
      moveendEvent - Fired when the view of the map ends changed (e.g. user stopped dragging the map).
      dragstartEvent - Fired when the user starts dragging the map.
      dragEvent - Fired repeatedly while the user drags the map.
      dragendEvent - Fired when the user stops dragging the map.
      zoomstartEvent - Fired when the map zoom is about to change (e.g. before zoom animation).
      zoomendEvent - Fired when the map zoom changes.
      layeraddLayerEvent - Fired when a new layer is added to the map.
      layerremoveLayerEvent - Fired when some layer is removed from the map.
      locationfoundLocationEvent - Fired when geolocation (using locate or locateAndSetView method) went successfully.
      locationerrorErrorEvent - Fired when geolocation (using locate or locateAndSetView method) failed.
      popupopenPopupEvent - Fired when a popup is opened (using openPopup method).
      popupclosePopupEvent - Fired when a popup is closed (using closePopup method).
      - - -

      Methods that modify map state

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      setView( <LatLng> center, <Number> zoom, <Boolean> forceReset? )thisSets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default).
      setZoom( <Number> zoom )thisSets the zoom of the map.
      zoomIn()thisIncreases the zoom of the map by 1.
      zoomOut()thisDecreases the zoom of the map by 1.
      fitBounds( <LatLngBounds> bounds )thisSets a map view that contains the given geographical bounds with the maximum zoom level possible.
      fitWorld()thisSets a map view that mostly contains the whole world with the maximum zoom level possible.
      panTo( <LatLng> latlng )thisPans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.
      panInsideBounds( <LatLngBounds> bounds )thisPans the map to the closest view that would lie inside the given bounds (if it's not already).
      panBy( <Point> point )thisPans the map by a given number of pixels (animated).
      invalidateSize()thisChecks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically.
      setMaxBounds( <LatLngBounds> bounds )thisRestricts the map view to the given bounds (see map maxBounds option).
      locate( <Locate options> options? )thisTries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details.
      locateAndSetView( <Number> maxZoom?, <Locate options> options? )thisAutomatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});.
      stopLocate()thisStops watching location previously initiated by map.locate({watch: true}).
      - -

      Methods that get map state

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      getCenter()LatLngReturns the geographical center of the map view.
      getZoom()NumberReturns the current zoom of the map view.
      getMinZoom()NumberReturns the minimum zoom level of the map.
      getMaxZoom()NumberReturns the maximum zoom level of the map.
      getBounds()LatLngBoundsReturns the LatLngBounds of the current map view.
      getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? )NumberReturns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety.
      getSize()PointReturns the current size of the map container.
      getPixelBounds()BoundsReturns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).
      getPixelOrigin()PointReturns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).
      - -

      Methods for layers and controls

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? )thisAdds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers).
      removeLayer( <ILayer> layer )thisRemoves the given layer from the map.
      hasLayer( <ILayer> layer )BooleanReturns true if the given layer is currently added to the map.
      openPopup( <Popup> popup )thisOpens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).
      closePopup()thisCloses the popup opened with openPopup.
      addControl( <IControl> control )thisAdds the given control to the map.
      removeControl( <IControl> control )thisRemoves the given control from the map.
      - - -

      Conversion methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      latLngToLayerPoint( <LatLng> latlng )PointReturns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map).
      layerPointToLatLng( <Point> point )LatLngReturns the geographical coordinates of a given map layer point.
      containerPointToLayerPoint( <Point> point )PointConverts the point relative to the map container to a point relative to the map layer.
      layerPointToContainerPoint( <Point> point )PointConverts the point relative to the map layer to a point relative to the map container.
      project( <LatLng> latlng, <Number> zoom? )PointProjects the given geographical coordinates to absolute pixel coordinates for the given zoom level (current zoom level by default).
      unproject( <Point> point, <Number> zoom? )LatLngProjects the given absolute pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
      mouseEventToContainerPoint( <MouseEvent> event )PointReturns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.
      mouseEventToLayerPoint( <MouseEvent> event )PointReturns the pixel coordinates of a mouse click relative to the map layer given its event object. -
      mouseEventToLatLng( <MouseEvent> event )LatLngReturns the geographical coordinates of the point the mouse clicked on given the click's event object.
      - -

      Other methods

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      getContainer()HTMLElementReturns the container element of the map.
      getPanes()MapPanesReturns an object with different map panes (to render overlays in).
      - -

      Locate options

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      watchBooleanfalseIf true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.
      setViewBooleanfalseIf true, automatically sets the map view to the user location with respect to detection accuracy.
      maxZoomNumberInfinityThe maximum zoom for automatic view setting when using `setView` option.
      timeoutNumber10000Number of millisecond to wait for a response from geolocation before firing a locationerror event.
      maximumAgeNumber0Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
      enableHighAccuracyBooleanfalseEnables high accuracy, see description in the W3C spec.
      - - -

      Properties

      - -

      Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

      - -
      map.doubleClickZoom.disable();
      - -

      You can also access default map controls like attribution control through map properties:

      - -
      map.attributionControl.addAttribution("Earthquake data &copy; GeoNames");
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      draggingIHandlerMap dragging handler (by both mouse and touch).
      touchZoomIHandlerTouch zoom handler.
      doubleClickZoomIHandlerDouble click zoom handler.
      scrollWheelZoomIHandlerScroll wheel zoom handler.
      boxZoomIHandlerBox (shift-drag with mouse) zoom handler.
      zoomControlControl.ZoomZoom control.
      attributionControlControl.AttributionAttribution control.
      - -

      Projections

      - -

      You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

      - - - - - - - - - - - - - - - - - - -
      CRSData
      L.CRS.EPSG3857EPSG:3857 (Spherical Mercator), used by most of commercial map providers (CloudMade, Google, Yahoo, Bing, etc.).
      L.CRS.EPSG4326EPSG:4326 (Plate Carree), very popular among GIS enthusiasts.
      L.CRS.EPSG3395EPSG:3395 (True Mercator), used by some map providers.
      - - -

      Map panes

      - -

      An object literal (returned by map.getPanes) that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      mapPaneHTMLElementPane that contains all other map panes.
      tilePaneHTMLElementPane for tile layers.
      objectsPaneHTMLElementPane that contains all the panes except tile pane.
      shadowPaneHTMLElementPane for overlay shadows (e.g. marker shadows).
      overlayPaneHTMLElementPane for overlays like polylines and polygons.
      markerPaneHTMLElementPane for marker icons.
      popupPaneHTMLElementPane for popups.
      - - -

      L.Marker

      - -

      Used to put markers on the map.

      - -
      L.marker([50.5, 30.5]).addTo(map);
      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Marker( <LatLng> latlng, <Marker options> options? ) - new L.Marker()
      - L.marker() -
      Instantiates a Marker object given a geographical point and optionally an options object.
      - -

      Options

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      iconL.Icon*Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default.
      clickableBooleantrueIf false, the marker will not emit mouse events and will act as a part of the underlying map.
      draggableBooleanfalseWhether the marker is draggable with mouse/touch or not.
      titleString''Text for the browser tooltip that appear on marker hover (no tooltip by default).
      zIndexOffsetNumber0By default, marker images zIndex is set automatically based on its latitude. You 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).
      - -

      Events

      - -

      You can subscribe to the following events using these methods.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      EventDataDescription
      clickMouseEvent - Fired when the user clicks (or taps) the marker.
      dblclickMouseEvent - Fired when the user double-clicks (or double-taps) the marker.
      mousedownMouseEvent - Fired when the user pushes the mouse button on the marker.
      mouseoverMouseEvent - Fired when the mouse enters the marker.
      mouseoutMouseEvent - Fired when the mouse leaves the marker.
      dragstartEvent - Fired when the user starts dragging the marker.
      dragEvent - Fired repeatedly while the user drags the marker.
      dragendEvent - Fired when the user stops dragging the marker.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      getLatLng()LatLngReturns the current geographical position of the marker.
      setLatLng( <LatLng> latlng )thisChanges the marker position to the given point.
      setIcon( <Icon> icon )thisChanges the marker icon.
      setZIndexOffset( <Number> offset )thisChanges the zIndex offset of the marker.
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method.
      unbindPopup()thisUnbinds the popup previously bound to the marker with bindPopup.
      openPopup()thisOpens the popup previously bound by the bindPopup method.
      closePopup()thisCloses the bound popup of the marker if it's opened.
      - -

      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 IHandler methods). Example:

      - -
      marker.dragging.disable();
      - - - - - - - - - - - - -
      PropertyTypeDescription
      draggingIHandlerMarker dragging handler (by both mouse and touch).
      - - - - - -

      Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.

      - -

      Usage example

      -

      If you want to just bind a popup to marker click and then open it, it's really easy:

      -
      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:

      -
      var popup = L.popup()
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Map( <HTMLElement|String> id, <Map options> options? ) + new L.Map()
      + L.map() +
      Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
      + + + + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      centerLatLngnullInitial geographical center of the map.
      zoomNumbernullInitial map zoom.
      layersILayer[][]Layers that will be added to the map initially.
      minZoomNumber0Minimum zoom level of the map. Overrides any minZoom set on map layers.
      maxZoomNumber18Maximum zoom level of the map. This overrides any maxZoom set on map layers.
      maxBoundsLatLngBoundsnullWhen this option is set, the map restricts the view to the given geographical bounds, bouncing the user back when he tries to pan outside the view, and also not allowing to zoom out to a view that's larger than the given bounds (depending on the map size). To set the restriction dynamically, use setMaxBounds method
      crsCRSL.CRS.
      EPSG3857
      Coordinate Reference System to use. Don't change this if you're not sure what it means.
      draggingBooleantrueWhether the map be draggable with mouse/touch or not.
      touchZoomBooleantrueWhether the map can be zoomed by touch-dragging with two fingers.
      scrollWheelZoomBooleantrueWhether the map can be zoomed by using the mouse wheel.
      doubleClickZoomBooleantrueWhether the map can be zoomed in by double clicking on it.
      boxZoomBooleantrueWhether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
      zoomControlBooleantrueWhether the zoom control is added to the map by default.
      attributionControlBooleantrueWhether the attribution control is added to the map by default.
      trackResizeBooleantrueWhether the map automatically handles browser window resize to update itself.
      fadeAnimationBooleandependsWhether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      zoomAnimationBooleandependsWhether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      markerZoomAnimationBooleandependsWhether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      closePopupOnClickBooleantrueSet it to false if you don't want popups to close when user clicks the map.
      worldCopyJumpBooleantrueWith this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there.
      + + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      clickMouseEvent + Fired when the user clicks (or taps) the map.
      dblclickMouseEvent + Fired when the user double-clicks (or double-taps) the map.
      mousedownMouseEvent + Fired when the user pushes the mouse button on the map.
      mouseenterMouseEvent + Fired when the mouse enters the map.
      mouseleaveMouseEvent + Fired when the mouse leaves the map.
      mousemoveMouseEvent + Fired while the mouse moves over the map.
      contextmenuMouseEvent + Fired when the user pushes the right mouse button on the map.
      preclickMouseEvent + Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running).
      loadEvent + Fired when the map is initialized (when its center and zoom are set for the first time).
      viewresetEvent + Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays.
      movestartEvent + Fired when the view of the map starts changing (e.g. user starts dragging the map).
      moveEvent + Fired on any movement of the map view.
      moveendEvent + Fired when the view of the map ends changed (e.g. user stopped dragging the map).
      dragstartEvent + Fired when the user starts dragging the map.
      dragEvent + Fired repeatedly while the user drags the map.
      dragendEvent + Fired when the user stops dragging the map.
      zoomstartEvent + Fired when the map zoom is about to change (e.g. before zoom animation).
      zoomendEvent + Fired when the map zoom changes.
      layeraddLayerEvent + Fired when a new layer is added to the map.
      layerremoveLayerEvent + Fired when some layer is removed from the map.
      locationfoundLocationEvent + Fired when geolocation (using locate or locateAndSetView method) went successfully.
      locationerrorErrorEvent + Fired when geolocation (using locate or locateAndSetView method) failed.
      popupopenPopupEvent + Fired when a popup is opened (using openPopup method).
      popupclosePopupEvent + Fired when a popup is closed (using closePopup method).
      + + +

      Methods that modify map state

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setView( <LatLng> center, <Number> zoom, <Boolean> forceReset? )thisSets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default).
      setZoom( <Number> zoom )thisSets the zoom of the map.
      zoomIn()thisIncreases the zoom of the map by 1.
      zoomOut()thisDecreases the zoom of the map by 1.
      fitBounds( <LatLngBounds> bounds )thisSets a map view that contains the given geographical bounds with the maximum zoom level possible.
      fitWorld()thisSets a map view that mostly contains the whole world with the maximum zoom level possible.
      panTo( <LatLng> latlng )thisPans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one.
      panInsideBounds( <LatLngBounds> bounds )thisPans the map to the closest view that would lie inside the given bounds (if it's not already).
      panBy( <Point> point )thisPans the map by a given number of pixels (animated).
      invalidateSize()thisChecks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically.
      setMaxBounds( <LatLngBounds> bounds )thisRestricts the map view to the given bounds (see map maxBounds option).
      locate( <Locate options> options? )thisTries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details.
      locateAndSetView( <Number> maxZoom?, <Locate options> options? )thisAutomatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});.
      stopLocate()thisStops watching location previously initiated by map.locate({watch: true}).
      + +

      Methods that get map state

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      getCenter()LatLngReturns the geographical center of the map view.
      getZoom()NumberReturns the current zoom of the map view.
      getMinZoom()NumberReturns the minimum zoom level of the map.
      getMaxZoom()NumberReturns the maximum zoom level of the map.
      getBounds()LatLngBoundsReturns the LatLngBounds of the current map view.
      getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? )NumberReturns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety.
      getSize()PointReturns the current size of the map container.
      getPixelBounds()BoundsReturns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations).
      getPixelOrigin()PointReturns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations).
      + +

      Methods for layers and controls

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? )thisAdds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers).
      removeLayer( <ILayer> layer )thisRemoves the given layer from the map.
      hasLayer( <ILayer> layer )BooleanReturns true if the given layer is currently added to the map.
      openPopup( <Popup> popup )thisOpens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).
      closePopup()thisCloses the popup opened with openPopup.
      addControl( <IControl> control )thisAdds the given control to the map.
      removeControl( <IControl> control )thisRemoves the given control from the map.
      + + +

      Conversion methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      latLngToLayerPoint( <LatLng> latlng )PointReturns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map).
      layerPointToLatLng( <Point> point )LatLngReturns the geographical coordinates of a given map layer point.
      containerPointToLayerPoint( <Point> point )PointConverts the point relative to the map container to a point relative to the map layer.
      layerPointToContainerPoint( <Point> point )PointConverts the point relative to the map layer to a point relative to the map container.
      project( <LatLng> latlng, <Number> zoom? )PointProjects the given geographical coordinates to absolute pixel coordinates for the given zoom level (current zoom level by default).
      unproject( <Point> point, <Number> zoom? )LatLngProjects the given absolute pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default).
      mouseEventToContainerPoint( <MouseEvent> event )PointReturns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object.
      mouseEventToLayerPoint( <MouseEvent> event )PointReturns the pixel coordinates of a mouse click relative to the map layer given its event object. +
      mouseEventToLatLng( <MouseEvent> event )LatLngReturns the geographical coordinates of the point the mouse clicked on given the click's event object.
      + +

      Other methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      getContainer()HTMLElementReturns the container element of the map.
      getPanes()MapPanesReturns an object with different map panes (to render overlays in).
      + +

      Locate options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      watchBooleanfalseIf true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.
      setViewBooleanfalseIf true, automatically sets the map view to the user location with respect to detection accuracy.
      maxZoomNumberInfinityThe maximum zoom for automatic view setting when using `setView` option.
      timeoutNumber10000Number of millisecond to wait for a response from geolocation before firing a locationerror event.
      maximumAgeNumber0Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
      enableHighAccuracyBooleanfalseEnables high accuracy, see description in the W3C spec.
      + + +

      Properties

      + +

      Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

      + +
      map.doubleClickZoom.disable();
      + +

      You can also access default map controls like attribution control through map properties:

      + +
      map.attributionControl.addAttribution("Earthquake data &copy; GeoNames");
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      draggingIHandlerMap dragging handler (by both mouse and touch).
      touchZoomIHandlerTouch zoom handler.
      doubleClickZoomIHandlerDouble click zoom handler.
      scrollWheelZoomIHandlerScroll wheel zoom handler.
      boxZoomIHandlerBox (shift-drag with mouse) zoom handler.
      zoomControlControl.ZoomZoom control.
      attributionControlControl.AttributionAttribution control.
      + +

      Projections

      + +

      You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

      + + + + + + + + + + + + + + + + + + +
      CRSData
      L.CRS.EPSG3857EPSG:3857 (Spherical Mercator), used by most of commercial map providers (CloudMade, Google, Yahoo, Bing, etc.).
      L.CRS.EPSG4326EPSG:4326 (Plate Carree), very popular among GIS enthusiasts.
      L.CRS.EPSG3395EPSG:3395 (True Mercator), used by some map providers.
      + + +

      Map panes

      + +

      An object literal (returned by map.getPanes) that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      mapPaneHTMLElementPane that contains all other map panes.
      tilePaneHTMLElementPane for tile layers.
      objectsPaneHTMLElementPane that contains all the panes except tile pane.
      shadowPaneHTMLElementPane for overlay shadows (e.g. marker shadows).
      overlayPaneHTMLElementPane for overlays like polylines and polygons.
      markerPaneHTMLElementPane for marker icons.
      popupPaneHTMLElementPane for popups.
      + + +

      L.Marker

      + +

      Used to put markers on the map.

      + +
      L.marker([50.5, 30.5]).addTo(map);
      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Marker( <LatLng> latlng, <Marker options> options? ) + new L.Marker()
      + L.marker() +
      Instantiates a Marker object given a geographical point and optionally an options object.
      + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      iconL.Icon*Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default.
      clickableBooleantrueIf false, the marker will not emit mouse events and will act as a part of the underlying map.
      draggableBooleanfalseWhether the marker is draggable with mouse/touch or not.
      titleString''Text for the browser tooltip that appear on marker hover (no tooltip by default).
      zIndexOffsetNumber0By default, marker images zIndex is set automatically based on its latitude. You 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).
      + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      clickMouseEvent + Fired when the user clicks (or taps) the marker.
      dblclickMouseEvent + Fired when the user double-clicks (or double-taps) the marker.
      mousedownMouseEvent + Fired when the user pushes the mouse button on the marker.
      mouseoverMouseEvent + Fired when the mouse enters the marker.
      mouseoutMouseEvent + Fired when the mouse leaves the marker.
      dragstartEvent + Fired when the user starts dragging the marker.
      dragEvent + Fired repeatedly while the user drags the marker.
      dragendEvent + Fired when the user stops dragging the marker.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      getLatLng()LatLngReturns the current geographical position of the marker.
      setLatLng( <LatLng> latlng )thisChanges the marker position to the given point.
      setIcon( <Icon> icon )thisChanges the marker icon.
      setZIndexOffset( <Number> offset )thisChanges the zIndex offset of the marker.
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method.
      unbindPopup()thisUnbinds the popup previously bound to the marker with bindPopup.
      openPopup()thisOpens the popup previously bound by the bindPopup method.
      closePopup()thisCloses the bound popup of the marker if it's opened.
      + +

      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 IHandler methods). Example:

      + +
      marker.dragging.disable();
      + + + + + + + + + + + + +
      PropertyTypeDescription
      draggingIHandlerMarker dragging handler (by both mouse and touch).
      + + + + + +

      Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.

      + +

      Usage example

      +

      If you want to just bind a popup to marker click and then open it, it's really easy:

      +
      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:

      + +
      var popup = L.popup()
       	.setLatLng(latlng)
       	.setContent('<p>Hello world!<br />This is a nice popup.</p>')
       	.openOn(map);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Popup( <Popup options> options?, <object> source? ) - new L.Popup()
      - L.popup() -
      Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      maxWidthNumber300Max width of the popup.
      minWidthNumber50Min width of the popup.
      autoPanBooleantrueSet it to false if you don't want the map to do panning animation to fit the opened popup.
      closeButtonBooleantrueControls the presense of a close button in the popup.
      offsetPointPoint(0, 0)The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays.
      autoPanPaddingPointPoint(5, 5)The margin between the popup and the edges of the map view after autopanning was performed.
      - -

      Methods

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      setLatLng( <LatLng> latlng )thisSets the geographical point where the popup will open.
      setContent( <String> htmlContent )thisSets the HTML content of the popup.
      - - - -

      L.TileLayer

      - -

      Used to load and display tile layers on the map, implements ILayer interface.

      - -

      Usage example

      - -
      L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Popup( <Popup options> options?, <object> source? ) + new L.Popup()
      + L.popup() +
      Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      maxWidthNumber300Max width of the popup.
      minWidthNumber50Min width of the popup.
      autoPanBooleantrueSet it to false if you don't want the map to do panning animation to fit the opened popup.
      closeButtonBooleantrueControls the presense of a close button in the popup.
      offsetPointPoint(0, 0)The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays.
      autoPanPaddingPointPoint(5, 5)The margin between the popup and the edges of the map view after autopanning was performed.
      + +

      Methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setLatLng( <LatLng> latlng )thisSets the geographical point where the popup will open.
      setContent( <String> htmlContent )thisSets the HTML content of the popup.
      + + + +

      L.TileLayer

      + +

      Used to load and display tile layers on the map, implements ILayer interface.

      + +

      Usage example

      + +
      L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
       	key: 'API-key',
       	styleId: 997
       }).addTo(map);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) - new L.TileLayer()
      - L.tileLayer() -
      Instantiates a tile layer object given a URL template and optionally an options object.
      - -

      URL template

      - -

      A string of the following form:

      - -
      'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'
      - -

      {s} means one of the randomly chosen subdomains (their range is specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

      - -

      You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

      - -
      L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
      - -

      Options

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      minZoomNumber0Minimum zoom number.
      maxZoomNumber18Maximum zoom number.
      tileSizeNumber256Tile size (width and height in pixels, assuming tiles are square).
      subdomainsString or String[]'abc'Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
      errorTileUrlString''URL to the tile image to show in place of the tile that failed to load.
      attributionString''e.g. "© CloudMade" — the string used by the attribution control, describes the layer data.
      tmsBooleanfalseIf true, inverses Y axis numbering for tiles (turn this on for TMS services).
      continuousWorldBooleanfalseIf set to true, the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps).
      noWrapBooleanfalseIf set to true, the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating.
      zoomOffsetNumber0The zoom number used in tile URLs will be offset with this value.
      zoomReverseBooleanfalseIf set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
      opacityNumber1.0The opacity of the tile layer.
      unloadInvisibleTilesBooleandependsIf true, all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false.
      updateWhenIdleBooleandependsIf false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false.
      reuseTilesBooleanfalseIf true, all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed.
      - -

      Methods

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      setOpacity( <Number> opacity )thisChanges the opacity of the tile layer.
      redraw()-Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas
      - - - -

      L.TileLayer.WMS

      - -

      Used to display WMS services as tile layers on the map. Extends TileLayer, implements ILayer interface.

      - -

      Usage example

      - -
      var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) + new L.TileLayer()
      + L.tileLayer() +
      Instantiates a tile layer object given a URL template and optionally an options object.
      + +

      URL template

      + +

      A string of the following form:

      + +
      'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'
      + +

      {s} means one of the randomly chosen subdomains (their range is specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

      + +

      You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

      + +
      L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});
      + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      minZoomNumber0Minimum zoom number.
      maxZoomNumber18Maximum zoom number.
      tileSizeNumber256Tile size (width and height in pixels, assuming tiles are square).
      subdomainsString or String[]'abc'Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
      errorTileUrlString''URL to the tile image to show in place of the tile that failed to load.
      attributionString''e.g. "© CloudMade" — the string used by the attribution control, describes the layer data.
      tmsBooleanfalseIf true, inverses Y axis numbering for tiles (turn this on for TMS services).
      continuousWorldBooleanfalseIf set to true, the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps).
      noWrapBooleanfalseIf set to true, the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating.
      zoomOffsetNumber0The zoom number used in tile URLs will be offset with this value.
      zoomReverseBooleanfalseIf set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
      opacityNumber1.0The opacity of the tile layer.
      unloadInvisibleTilesBooleandependsIf true, all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false.
      updateWhenIdleBooleandependsIf false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false.
      reuseTilesBooleanfalseIf true, all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed.
      + +

      Methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setOpacity( <Number> opacity )thisChanges the opacity of the tile layer.
      redraw()-Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas
      + + + +

      L.TileLayer.WMS

      + +

      Used to display WMS services as tile layers on the map. Extends TileLayer, implements ILayer interface.

      + +

      Usage example

      + +
      var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
       	layers: 'nexrad-n0r-900913',
       	format: 'image/png',
       	transparent: true,
       	attribution: "Weather data © 2012 IEM Nexrad"
       });
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) - new L.TileLayer.WMS()
      - L.tileLayer.wms() -
      Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
      - -

      Options

      - -

      Includes all TileLayer options and additionally:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      layersString''(required) Comma-separated list of WMS layers to show.
      stylesString''Comma-separated list of WMS styles.
      formatString'image/jpeg'WMS image format (use 'image/png' for layers with transparency).
      transparentBooleanfalseIf true, the WMS service will return images with transparency.
      versionString'1.1.1'Version of the WMS service to use.
      - - - -

      L.TileLayer.Canvas

      - -

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer, implements ILayer interface.

      - -

      Usage example

      - -
      var canvasTiles = L.tileLayer.canvas();
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) + new L.TileLayer.WMS()
      + L.tileLayer.wms() +
      Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
      + +

      Options

      + +

      Includes all TileLayer options and additionally:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      layersString''(required) Comma-separated list of WMS layers to show.
      stylesString''Comma-separated list of WMS styles.
      formatString'image/jpeg'WMS image format (use 'image/png' for layers with transparency).
      transparentBooleanfalseIf true, the WMS service will return images with transparency.
      versionString'1.1.1'Version of the WMS service to use.
      + + + +

      L.TileLayer.Canvas

      + +

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer, implements ILayer interface.

      + +

      Usage example

      + +
      var canvasTiles = L.tileLayer.canvas();
       
       canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
       	var ctx = canvas.getContext('2d');
       	// draw something on the tile canvas
       }
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.TileLayer.Canvas( <TileLayer options> options? ) - new L.TileLayer.Canvas()
      - L.tileLayer.canvas() -
      Instantiates a Canvas tile layer object given an options object (optionally).
      - -

      Methods

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom )thisYou need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.
      redraw()-Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas
      - - -

      L.ImageOverlay

      - -

      Used to load and display a single image over specific bounds of the map, implements ILayer interface.

      - -

      Usage example

      - -
      var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.TileLayer.Canvas( <TileLayer options> options? ) + new L.TileLayer.Canvas()
      + L.tileLayer.canvas() +
      Instantiates a Canvas tile layer object given an options object (optionally).
      + +

      Methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom )thisYou need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.
      redraw()-Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas
      + + +

      L.ImageOverlay

      + +

      Used to load and display a single image over specific bounds of the map, implements ILayer interface.

      + +

      Usage example

      + +
      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);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) - new L.ImageOverlay()
      - L.imageOverlay() -
      Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
      - - - - -

      L.Path

      -

      An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly. - -

      Options

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      strokeBooleantrueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
      colorString'#03f'Stroke color.
      weightNumber5Stroke width in pixels.
      opacityNumber0.5Stroke opacity.
      fillBooleandependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
      fillColorStringsame as colorFill color.
      fillOpacityNumber0.2Fill opacity.
      clickableBooleantrueIf false, the vector will not emit mouse events and will act as a part of the underlying map.
      - -

      Events

      - -

      You can subscribe to the following events using these methods.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      EventDataDescription
      clickMouseEvent - Fired when the user clicks (or taps) the object.
      dblclickMouseEvent - Fired when the user double-clicks (or double-taps) the object.
      mousedownMouseEvent - Fired when the user pushes the mouse button on the object.
      mouseoverMouseEvent - Fired when the mouse enters the object.
      mouseoutMouseEvent - Fired when the mouse leaves the object.
      - -

      Static properties

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      ConstantTypeValueDescription
      SVGBooleandependsTrue if SVG is used for vector rendering (true for most modern browsers).
      VMLBooleandependsTrue if VML is used for vector rendering (IE 6-8).
      CANVASBooleandependsTrue if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
      CLIP_PADDINGNumber0.5 for SVG
      0.02 for VML
      How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on this path.
      setStyle( <Path options> object )thisChanges the appearance of a Path based on the options in the Path options object.
      getBounds()LatLngBoundsReturns the LatLngBounds of the path.
      - - -

      L.Polyline

      - -

      A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      - -

      Usage example

      -
      // create a red polyline from an arrays of LatLng points
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) + new L.ImageOverlay()
      + L.imageOverlay() +
      Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
      + + + + +

      L.Path

      +

      An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly. + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      strokeBooleantrueWhether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
      colorString'#03f'Stroke color.
      weightNumber5Stroke width in pixels.
      opacityNumber0.5Stroke opacity.
      fillBooleandependsWhether to fill the path with color. Set it to false to disable filling on polygons or circles.
      fillColorStringsame as colorFill color.
      fillOpacityNumber0.2Fill opacity.
      clickableBooleantrueIf false, the vector will not emit mouse events and will act as a part of the underlying map.
      + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      clickMouseEvent + Fired when the user clicks (or taps) the object.
      dblclickMouseEvent + Fired when the user double-clicks (or double-taps) the object.
      mousedownMouseEvent + Fired when the user pushes the mouse button on the object.
      mouseoverMouseEvent + Fired when the mouse enters the object.
      mouseoutMouseEvent + Fired when the mouse leaves the object.
      + +

      Static properties

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ConstantTypeValueDescription
      SVGBooleandependsTrue if SVG is used for vector rendering (true for most modern browsers).
      VMLBooleandependsTrue if VML is used for vector rendering (IE 6-8).
      CANVASBooleandependsTrue if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
      CLIP_PADDINGNumber0.5 for SVG
      0.02 for VML
      How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on this path.
      setStyle( <Path options> object )thisChanges the appearance of a Path based on the options in the Path options object.
      getBounds()LatLngBoundsReturns the LatLngBounds of the path.
      + + +

      L.Polyline

      + +

      A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      + +

      Usage example

      +
      // create a red polyline from an arrays of LatLng points
       var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
       
       // zoom the map to the polyline
       map.fitBounds(polyline.getBounds());
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) - new L.Polyline()
      - L.polyline() -
      Instantiates a polyline object given an array of geographical points and optionally an options object.
      - -

      Options

      - -

      You can use Path options and additionally the following options:

      - - - - - - - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      smoothFactorNumber1.0How much to simplify the polyline on each zoom level. More means better performance and smoother look, and less means more accurate representation.
      noClipBooleanfalseDisabled polyline clipping.
      - -

      Methods

      - -

      You can use Path methods and additionally the following methods:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      addLatLng( <LatLng> latlng )thisAdds a given point to the polyline.
      setLatLngs( <LatLng[]> latlngs )thisReplaces all the points in the polyline with the given array of geographical points.
      getLatLngs()LatLng[]Returns an array of the points in the path.
      spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng?, … )LatLng[]Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any).
      getBounds()LatLngBoundsReturns the LatLngBounds of the polyline.
      - - - -

      L.MultiPolyline

      - -

      Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) - new L.MultiPolyline()
      - L.multiPolyline() -
      Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
      - - - -

      L.Polygon

      - -

      A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

      - -

      Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) - new L.Polygon()
      - L.polygon() -
      Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
      - -

      Polygon the same options and methods as Polyline.

      - - - -

      L.MultiPolygon

      - -

      Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) - new L.MultiPolygon()
      - L.multiPolygon() -
      Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
      - -

      L.Rectangle

      - -

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      - -

      Usage example

      -
      // define rectangle geographical bounds
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) + new L.Polyline()
      + L.polyline() +
      Instantiates a polyline object given an array of geographical points and optionally an options object.
      + +

      Options

      + +

      You can use Path options and additionally the following options:

      + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      smoothFactorNumber1.0How much to simplify the polyline on each zoom level. More means better performance and smoother look, and less means more accurate representation.
      noClipBooleanfalseDisabled polyline clipping.
      + +

      Methods

      + +

      You can use Path methods and additionally the following methods:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addLatLng( <LatLng> latlng )thisAdds a given point to the polyline.
      setLatLngs( <LatLng[]> latlngs )thisReplaces all the points in the polyline with the given array of geographical points.
      getLatLngs()LatLng[]Returns an array of the points in the path.
      spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng?, … )LatLng[]Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any).
      getBounds()LatLngBoundsReturns the LatLngBounds of the polyline.
      + + + +

      L.MultiPolyline

      + +

      Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) + new L.MultiPolyline()
      + L.multiPolyline() +
      Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
      + + + +

      L.Polygon

      + +

      A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

      + +

      Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) + new L.Polygon()
      + L.polygon() +
      Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
      + +

      Polygon the same options and methods as Polyline.

      + + + +

      L.MultiPolygon

      + +

      Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) + new L.MultiPolygon()
      + L.multiPolygon() +
      Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
      + +

      L.Rectangle

      + +

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      + +

      Usage example

      +
      // define rectangle geographical bounds
       var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
       
       // create an orange rectangle
      @@ -1860,282 +1801,282 @@ 

      Usage example

      // zoom the map to the rectangle bounds map.fitBounds(bounds);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) - new L.Rectangle()
      - L.rectangle() -
      Instantiates a rectangle object with the given geographical bounds and optionally an options object.
      - -

      Methods

      - -

      You can use Path methods and additionally the following methods:

      - - - - - - - - - - - - -
      MethodReturnsDescription
      setBounds( <LatLngBounds> bounds )thisRedraws the rectangle with the passed bounds.
      - - -

      L.Circle

      - -

      A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      - -
      L.circle([50.5, 30.5], 200).addTo(map);
      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) - new L.Circle()
      - L.circle() -
      Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      getLatLng()LatLngReturns the current geographical position of the circle.
      getRadius()NumberReturns the current radius of a circle. Units are in meters.
      setLatLng( <LatLng> latlng )thisSets the position of a circle to a new location.
      setRadius( <Number> radius )thisSets the radius of a circle. Units are in meters.
      - - - -

      L.CircleMarker

      - -

      A circle of a fixed size with radius specified in pixels. Extends Circle. Use Map#addLayer to add it to the map.

      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.CircleMarker( <LatLng> latlng, <Path options> options? ) - new L.CircleMarker()
      - L.circleMarker() -
      Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
      - -

      Methods

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      setLatLng( <LatLng> latlng )thisSets the position of a circle marker to a new location.
      setRadius( <Number> radius )thisSets the radius of a circle marker. Units are in pixels.
      - - - -

      L.LayerGroup

      - -

      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. Implements ILayer interface.

      - -
      L.layerGroup([marker1, marker2])
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) + new L.Rectangle()
      + L.rectangle() +
      Instantiates a rectangle object with the given geographical bounds and optionally an options object.
      + +

      Methods

      + +

      You can use Path methods and additionally the following methods:

      + + + + + + + + + + + + +
      MethodReturnsDescription
      setBounds( <LatLngBounds> bounds )thisRedraws the rectangle with the passed bounds.
      + + +

      L.Circle

      + +

      A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      + +
      L.circle([50.5, 30.5], 200).addTo(map);
      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) + new L.Circle()
      + L.circle() +
      Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      getLatLng()LatLngReturns the current geographical position of the circle.
      getRadius()NumberReturns the current radius of a circle. Units are in meters.
      setLatLng( <LatLng> latlng )thisSets the position of a circle to a new location.
      setRadius( <Number> radius )thisSets the radius of a circle. Units are in meters.
      + + + +

      L.CircleMarker

      + +

      A circle of a fixed size with radius specified in pixels. Extends Circle. Use Map#addLayer to add it to the map.

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.CircleMarker( <LatLng> latlng, <Path options> options? ) + new L.CircleMarker()
      + L.circleMarker() +
      Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
      + +

      Methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setLatLng( <LatLng> latlng )thisSets the position of a circle marker to a new location.
      setRadius( <Number> radius )thisSets the radius of a circle marker. Units are in pixels.
      + + + +

      L.LayerGroup

      + +

      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. Implements ILayer interface.

      + +
      L.layerGroup([marker1, marker2])
       	.addLayer(polyline)
       	.addTo(map);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.LayerGroup( <ILayer[]> layers? ) - new L.LayerGroup()
      - L.layerGroup() -
      Create a layer group, optionally given an initial set of layers.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      addLayer( <ILayer> layer )thisAdds a given layer to the group.
      removeLayer( <ILayer> layer )thisRemoves a given layer from the group.
      clearLayers()thisRemoves all the layers from the group.
      - - - -

      L.FeatureGroup

      - -

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

      - -
      L.featureGroup([marker1, marker2, polyline])
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.LayerGroup( <ILayer[]> layers? ) + new L.LayerGroup()
      + L.layerGroup() +
      Create a layer group, optionally given an initial set of layers.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addLayer( <ILayer> layer )thisAdds a given layer to the group.
      removeLayer( <ILayer> layer )thisRemoves a given layer from the group.
      clearLayers()thisRemoves all the layers from the group.
      + + + +

      L.FeatureGroup

      + +

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

      + +
      L.featureGroup([marker1, marker2, polyline])
       	.bindPopup('Hello world!')
       	.on('click', function() { alert('Clicked on a group!'); })
       	.addTo(map);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.FeatureGroup( <IFeature[]> layers? ) - new L.FeatureGroup()
      - L.featureGroup() -
      Create a layer group, optionally given an initial set of layers.
      - -

      Methods

      - -

      Has all LayerGroup methods and additionally:

      - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on any layer from the group.
      getBounds()LatLngBoundsReturns the LatLngBounds of the Feature Group.
      - -

      Events

      - -

      You can subscribe to the following events using these methods.

      - - - - - - - - - - - - - - - - - - - - - - - -
      EventDataDescription
      clickMouseEvent - Fired when the user clicks (or taps) the group.
      dblclickMouseEvent - Fired when the user double-clicks (or double-taps) the group.
      mouseoverMouseEvent - Fired when the mouse enters the group.
      mouseoutMouseEvent - Fired when the mouse leaves the group.
      - - -

      L.GeoJSON

      - -

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.

      - -
      L.geoJson(data, {
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.FeatureGroup( <IFeature[]> layers? ) + new L.FeatureGroup()
      + L.featureGroup() +
      Create a layer group, optionally given an initial set of layers.
      + +

      Methods

      + +

      Has all LayerGroup methods and additionally:

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      bindPopup( <String> htmlContent, <Popup options> options? )thisBinds a popup with a particular HTML content to a click on any layer from the group.
      getBounds()LatLngBoundsReturns the LatLngBounds of the Feature Group.
      + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      clickMouseEvent + Fired when the user clicks (or taps) the group.
      dblclickMouseEvent + Fired when the user double-clicks (or double-taps) the group.
      mouseoverMouseEvent + Fired when the mouse enters the group.
      mouseoutMouseEvent + Fired when the mouse leaves the group.
      + + +

      L.GeoJSON

      + +

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.

      + +
      L.geoJson(data, {
       	style: function (feature) {
       		return {color: feature.properties.color};
       	},
      @@ -2144,509 +2085,509 @@ 

      L.GeoJSON

      } }).addTo(map);
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) - new L.GeoJSON()
      - L.geoJson() -
      Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.
      - -

      Options

      - - - - - - - - - - - - - - - - - - - - - - -
      OptionDescription
      pointToLayer( <GeoJSON> featureData, <LatLng> latlng )Function that will be used for creating layers for GeoJSON points (if not specified, simple markers will be created).
      style( <GeoJSON> featureData )Function that will be used to get style options for vector layers created for GeoJSON features.
      onEachFeature( <GeoJSON> featureData, <ILayer> layer )Function that will be called on each created feature layer. Useful for attaching events and popups to features.
      filter( <GeoJSON> featureData, <ILayer> layer )Function that will be used to decide whether to show a feature or not.
      - - -

      Methods

      - - - - - - - - - - - - -
      MethodReturnsDescription
      addData( <GeoJSON> data )BooleanAdds a GeoJSON object to the layer.
      - -

      Static methods

      - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      geometryToLayer( <GeoJSON> featureData, <Function> pointToLayer? )ILayerCreates a layer from a given GeoJSON feature.
      coordsToLatlng( <Array> coords, <Boolean> reverse? )LatLngCreates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude).
      coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? )ArrayCreates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude).
      - - - - -

      L.LatLng

      - -

      Represents a geographical point with a certain latitude and longitude.

      -
      var latlng = new L.LatLng(50.5, 30.5);
      - -

      All Leaflet methods that accept LatLng objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

      - -
      map.panTo([50, 30]);
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) + new L.GeoJSON()
      + L.geoJson() +
      Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.
      + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + +
      OptionDescription
      pointToLayer( <GeoJSON> featureData, <LatLng> latlng )Function that will be used for creating layers for GeoJSON points (if not specified, simple markers will be created).
      style( <GeoJSON> featureData )Function that will be used to get style options for vector layers created for GeoJSON features.
      onEachFeature( <GeoJSON> featureData, <ILayer> layer )Function that will be called on each created feature layer. Useful for attaching events and popups to features.
      filter( <GeoJSON> featureData, <ILayer> layer )Function that will be used to decide whether to show a feature or not.
      + + +

      Methods

      + + + + + + + + + + + + +
      MethodReturnsDescription
      addData( <GeoJSON> data )BooleanAdds a GeoJSON object to the layer.
      + +

      Static methods

      + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      geometryToLayer( <GeoJSON> featureData, <Function> pointToLayer? )ILayerCreates a layer from a given GeoJSON feature.
      coordsToLatlng( <Array> coords, <Boolean> reverse? )LatLngCreates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude).
      coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? )ArrayCreates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude).
      + + + + +

      L.LatLng

      + +

      Represents a geographical point with a certain latitude and longitude.

      +
      var latlng = new L.LatLng(50.5, 30.5);
      + +

      All Leaflet methods that accept LatLng objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

      + +
      map.panTo([50, 30]);
       map.panTo(new L.LatLng(50, 30));
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) - new L.LatLng()
      - L.latLng()
      - L.latLng([]) -
      Creates an object representing a geographical point with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument.
      - -

      Properties

      - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      latNumberLatitude in degrees.
      lngNumberLongitude in degrees.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      distanceTo( <LatLng> otherLatlng )NumberReturns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia
      equals( <LatLng> otherLatlng )BooleanReturns true if the given LatLng point is at the same position (within a small margin of error).
      toString()StringReturns a string representation of the point (for debugging purposes).
      - -

      Constants

      - - - - - - - - - - - - - - - - - - - - - - - - - - -
      ConstantTypeValueDescription
      DEG_TO_RADNumberMath.PI / 180A multiplier for converting degrees into radians.
      RAD_TO_DEGNumber180 / Math.PIA multiplier for converting radians into degrees.
      MAX_MARGINNumber1.0E-9Max margin of error for the equality check.
      - - - - -

      L.LatLngBounds

      - -

      Represents a rectangular geographical area on a map.

      -
      var southWest = new L.LatLng(40.712, -74.227),
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) + new L.LatLng()
      + L.latLng()
      + L.latLng([]) +
      Creates an object representing a geographical point with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument.
      + +

      Properties

      + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      latNumberLatitude in degrees.
      lngNumberLongitude in degrees.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      distanceTo( <LatLng> otherLatlng )NumberReturns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia
      equals( <LatLng> otherLatlng )BooleanReturns true if the given LatLng point is at the same position (within a small margin of error).
      toString()StringReturns a string representation of the point (for debugging purposes).
      + +

      Constants

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ConstantTypeValueDescription
      DEG_TO_RADNumberMath.PI / 180A multiplier for converting degrees into radians.
      RAD_TO_DEGNumber180 / Math.PIA multiplier for converting radians into degrees.
      MAX_MARGINNumber1.0E-9Max margin of error for the equality check.
      + + + + +

      L.LatLngBounds

      + +

      Represents a rectangular geographical area on a map.

      +
      var southWest = new L.LatLng(40.712, -74.227),
       	northEast = new L.LatLng(40.774, -74.125),
       	bounds = new L.LatLngBounds(southWest, northEast);
      -

      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:

      +

      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:

      -
      map.fitBounds([
      +
      map.fitBounds([
       	[40.712, -74.227], 
       	[40.774, -74.125]
       ]);
      -

      Constructor

      - - - - - - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) - new L.LatLngBounds()
      - L.latLngBounds()
      - L.latLngBounds([]) -
      Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.
      L.LatLngBounds( <LatLng[]> latlngs ) - new L.LatLngBounds()
      - L.latLngBounds() -
      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.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      extend( <LatLng|LatLngBounds> latlng )thisExtends the bounds to contain the given point or bounds.
      getSouthWest()LatLngReturns the south-west point of the bounds.
      getNorthEast()LatLngReturns the north-east point of the bounds.
      getNorthWest()LatLngReturns the north-west point of the bounds.
      getSouthEast()LatLngReturns the south-east point of the bounds.
      getCenter()LatLngReturns the center point of the bounds.
      contains( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle contains the given one.
      contains( <LatLng> latlng )BooleanReturns true if the rectangle contains the given point.
      intersects( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle intersects the given bounds.
      equals( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle is equivalent (within a small margin of error) to the given bounds.
      toBBoxString()StringReturns 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.
      - - - - -

      L.Point

      - -

      Represents a point with x and y coordinates in pixels.

      - -
      var point = new 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:

      - -
      map.panBy([200, 300]);
      +

      Constructor

      + + + + + + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) + new L.LatLngBounds()
      + L.latLngBounds()
      + L.latLngBounds([]) +
      Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.
      L.LatLngBounds( <LatLng[]> latlngs ) + new L.LatLngBounds()
      + L.latLngBounds() +
      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.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      extend( <LatLng|LatLngBounds> latlng )thisExtends the bounds to contain the given point or bounds.
      getSouthWest()LatLngReturns the south-west point of the bounds.
      getNorthEast()LatLngReturns the north-east point of the bounds.
      getNorthWest()LatLngReturns the north-west point of the bounds.
      getSouthEast()LatLngReturns the south-east point of the bounds.
      getCenter()LatLngReturns the center point of the bounds.
      contains( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle contains the given one.
      contains( <LatLng> latlng )BooleanReturns true if the rectangle contains the given point.
      intersects( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle intersects the given bounds.
      equals( <LatLngBounds> otherBounds )BooleanReturns true if the rectangle is equivalent (within a small margin of error) to the given bounds.
      toBBoxString()StringReturns 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.
      + + + + +

      L.Point

      + +

      Represents a point with x and y coordinates in pixels.

      + +
      var point = new 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:

      + +
      map.panBy([200, 300]);
       map.panBy(new L.Point(200, 300));
      -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Point( <Number> x, <Number> y, <Boolean> round? ) - new L.Point()
      - L.point()
      - L.point([]) -
      Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
      - -

      Properties

      - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      xNumberThe x coordinate.
      yNumberThe y coordinate.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      add( <Point> otherPoint )PointReturns the result of addition of the current and the given points.
      subtract( <Point> otherPoint )PointReturns the result of subtraction of the given point from the current.
      multiplyBy( <Number> number )PointReturns the result of multiplication of the current point by the given number.
      divideBy( <Number> number, <Boolean> round? )PointReturns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result.
      distanceTo( <Point> otherPoint )NumberReturns the distance between the current and the given points.
      clone()PointReturns a copy of the current point.
      round()PointReturns a copy of the current point with rounded coordinates.
      toString()StringReturns a string representation of the point for debugging purposes.
      - - - -

      L.Bounds

      - -

      Represents a rectangular area in pixel coordinates.

      -
      var p1 = new L.Point(10, 10),
      +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Point( <Number> x, <Number> y, <Boolean> round? ) + new L.Point()
      + L.point()
      + L.point([]) +
      Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
      + +

      Properties

      + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      xNumberThe x coordinate.
      yNumberThe y coordinate.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      add( <Point> otherPoint )PointReturns the result of addition of the current and the given points.
      subtract( <Point> otherPoint )PointReturns the result of subtraction of the given point from the current.
      multiplyBy( <Number> number )PointReturns the result of multiplication of the current point by the given number.
      divideBy( <Number> number, <Boolean> round? )PointReturns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result.
      distanceTo( <Point> otherPoint )NumberReturns the distance between the current and the given points.
      clone()PointReturns a copy of the current point.
      round()PointReturns a copy of the current point with rounded coordinates.
      toString()StringReturns a string representation of the point for debugging purposes.
      + + + +

      L.Bounds

      + +

      Represents a rectangular area in pixel coordinates.

      +
      var p1 = new L.Point(10, 10),
       	p2 = new L.Point(40, 60),
       	bounds = new 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:

      - -
      otherBounds.intersects([[10, 10], [40, 60]]);
      - -

      Constructor

      - - - - - - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Bounds( <Point> topLeft, <Point> bottomRight ) - new L.Bounds()
      - L.bounds()
      - L.bounds([]) -
      Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
      L.LatLngBounds( <Point[]> points ) - new L.Bounds()
      - L.bounds() -
      Creates a Bounds object defined by the points it contains.
      - -

      Properties

      - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      minPoint - The top left corner of the rectangle.
      maxPoint - The bottom right corner of the rectangle.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      extend( <Point> point )-Extends the bounds to contain the given point.
      getCenter()PointReturns the center point of the bounds.
      contains( <Bounds> otherBounds )BooleanReturns true if the rectangle contains the given one.
      contains( <Point> point )BooleanReturns true if the rectangle contains the given point.
      intersects( <Bounds> otherBounds )BooleanReturns true if the rectangle intersects the given bounds.
      - - -

      L.Icon

      - -

      Represents an icon to provide when creating a marker.

      - -
      var myIcon = L.icon({
      +

      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:

      + +
      otherBounds.intersects([[10, 10], [40, 60]]);
      + +

      Constructor

      + + + + + + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Bounds( <Point> topLeft, <Point> bottomRight ) + new L.Bounds()
      + L.bounds()
      + L.bounds([]) +
      Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
      L.LatLngBounds( <Point[]> points ) + new L.Bounds()
      + L.bounds() +
      Creates a Bounds object defined by the points it contains.
      + +

      Properties

      + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      minPoint + The top left corner of the rectangle.
      maxPoint + The bottom right corner of the rectangle.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      extend( <Point> point )-Extends the bounds to contain the given point.
      getCenter()PointReturns the center point of the bounds.
      contains( <Bounds> otherBounds )BooleanReturns true if the rectangle contains the given one.
      contains( <Point> point )BooleanReturns true if the rectangle contains the given point.
      intersects( <Bounds> otherBounds )BooleanReturns true if the rectangle intersects the given bounds.
      + + +

      L.Icon

      + +

      Represents an icon to provide when creating a marker.

      + +
      var myIcon = L.icon({
       	iconUrl: 'my-icon.png',
       	shadowUrl: 'my-icon-shadow.png',
       	iconSize: [38, 95],
      @@ -2657,137 +2598,137 @@ 

      L.Icon

      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.

      - -

      Constructor

      - - - - - - - - - - - - -
      ConstructorUsageDescription
      L.Icon( <Icon properties> props ) - new L.Icon()
      - L.icon() -
      Creates an icon instance with the given properties.
      - -

      Properties

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      iconUrlString - (required) The URL to the icon image (absolute or relative to your script path).
      iconSizePoint - Size of the icon image in pixels.
      iconAnchorPoint - 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.
      shadowUrlString - The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created.
      shadowSizePoint - Size of the shadow image in pixels.
      shadowOffsetPoint - Position of the shadow relative to the icon ((0, 0) by default)
      popupAnchorPoint - The point from which the marker popup opens, relative to the anchor point.
      - - - -

      L.Control.Zoom

      - -

      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 to false. Implements IControl interface.

      - -

      Constructor

      - - - - - - - - - -
      ConstructorDescription
      L.Control.Zoom()Creates a zoom control.
      - - - -

      L.Control.Attribution

      - -

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Implements IControl interface.

      - -

      Constructor

      - - - - - - - - - -
      ConstructorDescription
      L.Control.Attribution()Creates an attribution control.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      setPrefix( <String> prefix )-Sets the string before the attributions ("Powered by Leaflet" by default).
      addAttribution( <String> text )-Adds an attribution text (e.g. "Vector data &copy; CloudMade").
      removeAttribution( <String> text )-Removes an attribution text.
      - - -

      L.Control.Layers

      - -

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). It should be created and added explicitly to the map using Map#addControl method. Implements IControl interface.

      - -
      var baseLayers = {
      +

      L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Icon( <Icon properties> props ) + new L.Icon()
      + L.icon() +
      Creates an icon instance with the given properties.
      + +

      Properties

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      iconUrlString + (required) The URL to the icon image (absolute or relative to your script path).
      iconSizePoint + Size of the icon image in pixels.
      iconAnchorPoint + 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.
      shadowUrlString + The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created.
      shadowSizePoint + Size of the shadow image in pixels.
      shadowOffsetPoint + Position of the shadow relative to the icon ((0, 0) by default)
      popupAnchorPoint + The point from which the marker popup opens, relative to the anchor point.
      + + + +

      L.Control.Zoom

      + +

      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 to false. Implements IControl interface.

      + +

      Constructor

      + + + + + + + + + +
      ConstructorDescription
      L.Control.Zoom()Creates a zoom control.
      + + + +

      L.Control.Attribution

      + +

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Implements IControl interface.

      + +

      Constructor

      + + + + + + + + + +
      ConstructorDescription
      L.Control.Attribution()Creates an attribution control.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setPrefix( <String> prefix )-Sets the string before the attributions ("Powered by Leaflet" by default).
      addAttribution( <String> text )-Adds an attribution text (e.g. "Vector data &copy; CloudMade").
      removeAttribution( <String> text )-Removes an attribution text.
      + + +

      L.Control.Layers

      + +

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). It should be created and added explicitly to the map using Map#addControl method. Implements IControl interface.

      + +
      var baseLayers = {
       	"CloudMade": cloudmade,
       	"OpenStreetMap": osm
       };
      @@ -2801,296 +2742,296 @@ 

      L.Control.Layers

      map.addControl(layersControl);
      -

      Constructor

      - - - - - - - - - -
      ConstructorDescription
      L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? )Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes.
      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      addBaseLayer( <ILayer> layer, <String> name )thisAdds a base layer (radio button entry) with the given name to the control.
      addOverlay( <ILayer> layer, <String> name )thisAdds an overlay (checkbox entry) with the given name to the control.
      removeLayer( <ILayer> layer )thisRemove the given layer from the control.
      - -

      Options

      - - - - - - - - - - - - - - -
      OptionTypeDefaultDescription
      collapsedBooleantrueIf true, the control will be collapsed into an icon and expanded on mouse hover or touch.
      - - -

      Layer Config

      - -

      An object literal with layer names as keys and layer objects as values:

      - -
      {
      +

      Constructor

      + + + + + + + + + +
      ConstructorDescription
      L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? )Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes.
      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addBaseLayer( <ILayer> layer, <String> name )thisAdds a base layer (radio button entry) with the given name to the control.
      addOverlay( <ILayer> layer, <String> name )thisAdds an overlay (checkbox entry) with the given name to the control.
      removeLayer( <ILayer> layer )thisRemove the given layer from the control.
      + +

      Options

      + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      collapsedBooleantrueIf true, the control will be collapsed into an icon and expanded on mouse hover or touch.
      + + +

      Layer Config

      + +

      An object literal with layer names as keys and layer objects as values:

      + +
      {
       	"<someName1>": layer1,
       	"<someName2>": layer2
       }
      -

      Events methods

      +

      Events methods

      -

      A set of methods shared between event-powered classes (like Map). 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 'fire' event).

      +

      A set of methods shared between event-powered classes (like Map). 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 'fire' event).

      -

      Example

      +

      Example

      -
      map.on('click', function(e) {
      +
      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:

      +

      Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:

      -
      function onClick(e) { ... }
      +
      function onClick(e) { ... }
       
       map.on('click', onClick);
       map.off('click', onClick);
      -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      addEventListener( <String> type, <Function> fn, <Object> context? )thisAdds 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).
      removeEventListener( <String> type, <Function> fn, <Object> context? )thisRemoves a previously added listener function.
      on( … )thisAlias to addEventListener.
      off( … )thisAlias to removeEventListener.
      hasEventListeners( <String> type )BooleanReturns true if a particular event type has some listeners attached to it.
      fireEvent( <String> type, <Object> data? )thisFires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties.
      fire( … )thisAlias to fireEvent.
      - - -

      Event objects

      - -

      Event object is an object that you recieve as an argument in a listener function when some event is fired, containing useful information about that event. For example:

      - -
      map.on('click', function(e) {
      +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addEventListener( <String> type, <Function> fn, <Object> context? )thisAdds 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).
      removeEventListener( <String> type, <Function> fn, <Object> context? )thisRemoves a previously added listener function.
      on( … )thisAlias to addEventListener.
      off( … )thisAlias to removeEventListener.
      hasEventListeners( <String> type )BooleanReturns true if a particular event type has some listeners attached to it.
      fireEvent( <String> type, <Object> data? )thisFires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties.
      fire( … )thisAlias to fireEvent.
      + + +

      Event objects

      + +

      Event object is an object that you recieve as an argument in a listener function when some event is fired, containing useful information about that event. For example:

      + +
      map.on('click', function(e) {
       	alert(e.latlng); // e is an event object (MouseEvent in this case)
       });
      -

      Event

      - -

      The base event object. All other event objects contain these properties too.

      - - - - - - - - - - - - - - - - - -
      propertytypedescription
      typeStringThe event type (e.g. 'click').
      targetObjectThe object that fired the event.
      - -

      MouseEvent

      - - - - - - - - - - - - - - - - - -
      propertytypedescription
      latlngLatLngThe geographical point where the mouse event occured.
      layerPointPointPixel coordinates of the point where the mouse event occured relative to the map layer.
      - -

      LocationEvent

      - - - - - - - - - - - - - - - - - - - - - - -
      propertytypedescription
      latlngLatLngDetected geographical location of the user.
      boundsLatLngBoundsGeographical bounds of the area user is located in (with respect to the accuracy of location).
      accuracyNumberAccuracy of location in meters.
      - -

      ErrorEvent

      - - - - - - - - - - - - - - - - - -
      propertytypedescription
      messageStringError message.
      codeNumberError code (if applicable).
      - -

      LayerEvent

      - - - - - - - - - - - - -
      propertytypedescription
      layerILayerThe layer that was added or removed.
      - -

      GeoJSON event

      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      propertytypedescription
      layerILayerThe layer for the GeoJSON feature that is being added to the map.
      propertiesObjectGeoJSON properties of the feature.
      geometryTypeStringGeoJSON geometry type of the feature.
      idStringGeoJSON ID of the feature (if present).
      - - - - - - - - - - - - - - -
      propertytypedescription
      popupPopupThe popup that was opened or closed.
      - - - - - -

      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.

      +

      Event

      + +

      The base event object. All other event objects contain these properties too.

      + + + + + + + + + + + + + + + + + +
      propertytypedescription
      typeStringThe event type (e.g. 'click').
      targetObjectThe object that fired the event.
      + +

      MouseEvent

      + + + + + + + + + + + + + + + + + +
      propertytypedescription
      latlngLatLngThe geographical point where the mouse event occured.
      layerPointPointPixel coordinates of the point where the mouse event occured relative to the map layer.
      + +

      LocationEvent

      + + + + + + + + + + + + + + + + + + + + + + +
      propertytypedescription
      latlngLatLngDetected geographical location of the user.
      boundsLatLngBoundsGeographical bounds of the area user is located in (with respect to the accuracy of location).
      accuracyNumberAccuracy of location in meters.
      + +

      ErrorEvent

      + + + + + + + + + + + + + + + + + +
      propertytypedescription
      messageStringError message.
      codeNumberError code (if applicable).
      + +

      LayerEvent

      + + + + + + + + + + + + +
      propertytypedescription
      layerILayerThe layer that was added or removed.
      + +

      GeoJSON event

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      propertytypedescription
      layerILayerThe layer for the GeoJSON feature that is being added to the map.
      propertiesObjectGeoJSON properties of the feature.
      geometryTypeStringGeoJSON geometry type of the feature.
      idStringGeoJSON ID of the feature (if present).
      + + + + + + + + + + + + + + +
      propertytypedescription
      popupPopupThe popup that was opened or closed.
      + + + + + +

      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.

      var MyClass = L.Class.extend({
       	initialize: function (greeter) {
      @@ -3110,22 +3051,22 @@ 

      L.Class

      a.greet("World");
      -

      Inheritance

      +

      Inheritance

      -

      You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

      +

      You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

      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:

      +

      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:

      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:

      +

      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 () {
      @@ -3140,9 +3081,9 @@ 

      Inheritance

      var a = new MyChildClass(); a.greet('Jason'); // alerts "Yo, bro Jason!"
      -

      Options

      +

      Options

      -

      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:

      +

      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:

      var MyClass = L.Class.extend({
       	options: {
      @@ -3163,7 +3104,7 @@ 

      Options

      a.options.myOption2; // 'bar' a.options.myOption3; // 5
      -

      There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defauls defines in the class:

      +

      There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defauls defines in the class:

      var MyClass = L.Class.extend({
       	options: {
      @@ -3180,9 +3121,9 @@ 

      Options

      var a = new MyClass({bla: 10}); a.options; // {foo: 'bar', bla: 10}
      -

      Includes

      +

      Includes

      -

      includes is a special class property that merges all specified objects into the class (such objects are called mixins). A good example of this is L.Mixin.Events that event-related methods like on, off and fire to the class.

      +

      includes is a special class property that merges all specified objects into the class (such objects are called mixins). A good example of this is L.Mixin.Events that event-related methods like on, off and fire to the class.

       var MyMixin = {
       	foo: function () { ... },
      @@ -3196,13 +3137,13 @@ 

      Includes

      var a = new MyClass(); a.foo();
      -

      You can also do such includes in runtime with the include method:

      +

      You can also do such includes in runtime with the include method:

      MyClass.include(MyMixin);
      -

      Statics

      +

      Statics

      -

      statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:

      +

      statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:

      var MyClass = L.Class.extend({
       	statics: {
      @@ -3215,365 +3156,323 @@ 

      Statics

      -

      L.Browser

      +

      L.Browser

      -

      A namespace with properties for browser/feature detection used by Leaflet internally.

      +

      A namespace with properties for browser/feature detection used by Leaflet internally.

      if (L.Browser.ie6) {
      -	alert('Upgrade your browser, dude!');
      +alert('Upgrade your browser, dude!');
       }
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      propertytypedescription
      ieBooleantrue for all Internet Explorer versions.
      ie6Booleantrue for Internet Explorer 6.
      webkitBooleantrue for webkit-based browsers like Chrome and Safari (including mobile versions).
      webkit3dBooleantrue for webkit-based browsers that support CSS 3D transformations.
      geckoBooleantrue for Gecko-based browsers like Firefox and Mozilla.
      operaBooleantrue for Opera.
      androidBooleantrue for Android mobile browser.
      mobileBooleantrue for modern mobile browsers (including iOS Safari and different Android browsers).
      mobileWebkitBooleantrue for mobile webkit-based browsers.
      mobileOperaBooleantrue for mobile Opera.
      touchBooleantrue for all browsers on touch devices.
      - - -

      L.Util

      - -

      Various utility functions, used by Leaflet internally.

      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      extend( <Object> dest, <Object> src?.. )ObjectMerges the properties of the src object (or multiple objects) into dest object and returns the latter.
      bind( <Function> fn, <Object> obj )FunctionReturns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code).
      stamp( <Object> obj )StringApplies a unique key to the object and returns that key.
      limitExecByInterval( <Function> fn, <Number> time, <Object> context? )FunctionReturns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called.
      falseFn()FunctionReturns a function which always returns false.
      formatNum( <Number> num, <Number> digits )NumberReturns the number num rounded to digits decimals.
      splitWords( <String> str )String[]Trims and splits the string on whitespace and returns the array of parts.
      setOptions( <Object> obj, <Object> options )ObjectMerges the given properties to the options of the obj object, returning the resulting options. See Class options.
      getParamString( <Object> obj )StringConverts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} translates to '?a=foo&b=bar'.
      template( <String> str, <Object> data )StringSimple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', …} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'.
      - -

      Properties

      - - - - - - - - - - - - -
      PropertyTypeDescription
      emptyImageUrlStringData 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).
      - - - -

      L.DomUtil

      - -

      Utility functions to work with the DOM tree, used by Leaflet internally.

      - -

      Methods

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      get( <String or HTMLElement> id )HTMLElementReturns an element with the given id if a string was passed, or just returns the element if it was passed directly.
      getStyle( <HTMLElement> el, <String> style )StringReturns the value for a certain style attribute on an element, including computed values or values set through CSS.
      getViewportOffset( <HTMLElement> el )PointReturns the offset to the viewport for the requested element.
      create( <String> tagName, <String> className, <HTMLElement> container? )HTMLElementCreates an element with tagName, sets the className, and optionally appends it to container element.
      disableTextSelection()-Makes sure text cannot be selected, for example during dragging.
      enableTextSelection()-Makes text selection possible again.
      hasClass( <HTMLElement> el, <String> name )BooleanReturns true if the element class attribute contains name.
      addClass( <HTMLElement> el, <String> name )-Adds name to the element's class attribute.
      removeClass( <HTMLElement> el, <String> name )-Removes name from the element's class attribute.
      setOpacity( <HTMLElement> el, <Number> value )-Set the opacity of an element (including old IE support). Value must be from 0 to 1.
      testProp( <String[]> props )String or falseGoes 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.
      getTranslateString( <Point> point )StringReturns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers.
      getScaleString( <Number> scale, <Point> origin )StringReturns a CSS transform string to scale an element (with the given scale origin).
      setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? )-Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true.
      getPosition( <HTMLElement> el )PointReturns the coordinates of an element previously positioned with setPosition.
      - -

      Properties

      - - - - - - - - - - - - - - - - - -
      PropertyTypeDescription
      TRANSITIONStringVendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit).
      TRANSFORMStringVendor-prefixed transform style name.
      - - -

      IHandler

      -

      An interface implemented by interaction handlers.

      - - - - - - - - - - - - - - - - - - - - - - -
      MethodReturnsDescription
      enable()-Enables the handler.
      disable()-Disables the handler.
      enabled()BooleanReturns true if the handler is enabled.
      - -

      L.version

      - -

      A constant that represents the Leaflet version in use.

      - -

      L.version // returns "0.4" (or whatever version is currently in use)
      - - -

      L.noConflict()

      - -

      This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      - -

      // L points to some other library
      +
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +	
      +		
      +		
      +		
      +	
      +
      propertytypedescription
      ieBooleantrue for all Internet Explorer versions.
      ie6Booleantrue for Internet Explorer 6.
      webkitBooleantrue for webkit-based browsers like Chrome and Safari (including mobile versions).
      webkit3dBooleantrue for webkit-based browsers that support CSS 3D transformations.
      geckoBooleantrue for Gecko-based browsers like Firefox and Mozilla.
      operaBooleantrue for Opera.
      androidBooleantrue for Android mobile browser.
      mobileBooleantrue for modern mobile browsers (including iOS Safari and different Android browsers).
      mobileWebkitBooleantrue for mobile webkit-based browsers.
      mobileOperaBooleantrue for mobile Opera.
      touchBooleantrue for all browsers on touch devices.
      + + +

      L.Util

      + +

      Various utility functions, used by Leaflet internally.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      extend( <Object> dest, <Object> src?.. )ObjectMerges the properties of the src object (or multiple objects) into dest object and returns the latter.
      bind( <Function> fn, <Object> obj )FunctionReturns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code).
      stamp( <Object> obj )StringApplies a unique key to the object and returns that key.
      limitExecByInterval( <Function> fn, <Number> time, <Object> context? )FunctionReturns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called.
      falseFn()FunctionReturns a function which always returns false.
      formatNum( <Number> num, <Number> digits )NumberReturns the number num rounded to digits decimals.
      splitWords( <String> str )String[]Trims and splits the string on whitespace and returns the array of parts.
      setOptions( <Object> obj, <Object> options )ObjectMerges the given properties to the options of the obj object, returning the resulting options. See Class options.
      getParamString( <Object> obj )StringConverts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} translates to '?a=foo&b=bar'.
      template( <String> str, <Object> data )StringSimple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', …} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'.
      + +

      Properties

      + + + + + + + + + + + + +
      PropertyTypeDescription
      emptyImageUrlStringData 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).
      + + + +

      L.DomUtil

      + +

      Utility functions to work with the DOM tree, used by Leaflet internally.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      get( <String or HTMLElement> id )HTMLElementReturns an element with the given id if a string was passed, or just returns the element if it was passed directly.
      getStyle( <HTMLElement> el, <String> style )StringReturns the value for a certain style attribute on an element, including computed values or values set through CSS.
      getViewportOffset( <HTMLElement> el )PointReturns the offset to the viewport for the requested element.
      create( <String> tagName, <String> className, <HTMLElement> container? )HTMLElementCreates an element with tagName, sets the className, and optionally appends it to container element.
      disableTextSelection()-Makes sure text cannot be selected, for example during dragging.
      enableTextSelection()-Makes text selection possible again.
      hasClass( <HTMLElement> el, <String> name )BooleanReturns true if the element class attribute contains name.
      addClass( <HTMLElement> el, <String> name )-Adds name to the element's class attribute.
      removeClass( <HTMLElement> el, <String> name )-Removes name from the element's class attribute.
      setOpacity( <HTMLElement> el, <Number> value )-Set the opacity of an element (including old IE support). Value must be from 0 to 1.
      testProp( <String[]> props )String or falseGoes 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.
      getTranslateString( <Point> point )StringReturns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers.
      getScaleString( <Number> scale, <Point> origin )StringReturns a CSS transform string to scale an element (with the given scale origin).
      setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? )-Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true.
      getPosition( <HTMLElement> el )PointReturns the coordinates of an element previously positioned with setPosition.
      + +

      Properties

      + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      TRANSITIONStringVendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit).
      TRANSFORMStringVendor-prefixed transform style name.
      + + +

      IHandler

      +

      An interface implemented by interaction handlers.

      + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      enable()-Enables the handler.
      disable()-Disables the handler.
      enabled()BooleanReturns true if the handler is enabled.
      + +

      L.version

      + +

      A constant that represents the Leaflet version in use.

      + +

      L.version // returns "0.4" (or whatever version is currently in use)
      + + +

      L.noConflict()

      + +

      This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      + +

      // L points to some other library
       ...
       // you include Leaflet, it replaces the L variable to Leaflet namespace
       
       var Leaflet = L.noConflict();
      -// now L points to that other library again, and you can use Leaflet.Map etc.
      - - - -
      - -

      © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

      - - - Fork me on GitHub - - - - - - - - +// now L points to that other library again, and you can use Leaflet.Map etc.
      \ No newline at end of file From 45e98842578ad8dc0cc63cbd7edfd47f8c2c3a23 Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 16 Jul 2012 23:56:37 +0300 Subject: [PATCH 156/816] remove outdated files --- download.html | 133 ---------------- examples.html | 148 ------------------ examples/quick-start.html | 315 -------------------------------------- index.html | 164 -------------------- 4 files changed, 760 deletions(-) delete mode 100644 download.html delete mode 100644 examples.html delete mode 100644 examples/quick-start.html delete mode 100644 index.html diff --git a/download.html b/download.html deleted file mode 100644 index 65c0a1a61f8..00000000000 --- a/download.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Download - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - - - - -

      Download Leaflet

      - -

      Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system. The production files (included the same way as in the code above) are in the dist folder.

      - -

      - Download Leaflet 0.3.1 stable (February 14, 2012)
      - Download Leaflet 0.4 master (in-progress version) -

      - -

      - View Changelog -

      - -

      Using a hosted version of Leaflet

      - -

      The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the head section of your HTML:

      -
      <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
      -<!--[if lte IE 8]>
      -	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
      -<![endif]-->
      -
      -<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
      - -

      Building a custom version of Leaflet

      -

      Open build/build.html page from the download package, check the components you want to see in your build and then follow the instructions there.

      - -
      - -

      © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - diff --git a/examples.html b/examples.html deleted file mode 100644 index f1a6811c6ec..00000000000 --- a/examples.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Examples - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - - - -

      Leaflet tutorials

      - -

      Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers.

      - -
      - - -

      Leaflet Quick Start Guide

      -

      A simple step-by-step guide that will quickly get you started with Leaflet basics, including setting up a Leaflet map (with CloudMade tiles) on your page, working with markers, polylines and popups, and dealing with events.

      - -
      - - -

      Leaflet on Mobile

      -

      In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

      -
      - - -

      Markers With Custom Icons

      -

      In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map.

      -
      - - -

      Using GeoJSON with Leaflet

      -

      In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

      -
      - - -

      Layer Groups and Layers Control

      -

      A tutorial on how to manage groups of layers and use the layer switching control.

      -
      - -

      Custom Controls

      -

      A brief tutorial on implementing custom map controls.

      -
      - -

      Custom Overlays

      -

      If markers, popups and vectors are not enough for you, here's a guide for creating your own map overlays (things to put on a map).

      -
      - -

      More examples coming soon!

      - -
      - -

      © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - diff --git a/examples/quick-start.html b/examples/quick-start.html deleted file mode 100644 index d0df5a2c30a..00000000000 --- a/examples/quick-start.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Quick Start Guide - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - -

      ← Back to the list of examples

      -

      Leaflet Quick Start Guide

      - -

      This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events.

      - -
      - - -

      View example on a separate page →

      - -

      Preparing your page

      - -

      Before writing any code for the map, you need to do the following preparation steps on your page:

      - -
        -
      1. Download Leaflet and put the contents of the dist folder somewhere in your project directory
      2. -
      3. Include Leaflet CSS files in the head section of your document: -
        <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
        -<!--[if lte IE 8]>
        -	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
        -<![endif]-->
        -
      4. - -
      5. Include Leaflet JavaScript file somewhere on the page (preferably before body close tag): -
        <script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
      6. - -
      7. Put a div element with a certain id where you want your map to be (making sure it has defined height): -
        <div id="map" style="height: 200px"></div>
      8. -
      - -

      Now you're ready to initialize the map and do some stuff with it.

      - - -

      Setting up the map

      - -
      - - -

      Let's create a map instance, set its view to the center of London and add a pretty CloudMade tile layer to it. First we'll initialize the map:

      - -
      var map = new L.Map('map');
      - -

      By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls.

      - -

      Next we'll create a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at CloudMade), the attribution text and the maximum zoom level of the layer:

      - -
      var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png', {
      -	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
      -	maxZoom: 18
      -});
      - -

      It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles, and it doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd recommend CloudMade though, it looks beautiful).

      - -

      Finally we'll set the map view to the center of London at 13th zoom level and add our tile layer (see the resulting map above):

      - -
      var london = new L.LatLng(51.505, -0.09); // geographical point (longitude and latitude)
      -map.setView(london, 13).addLayer(cloudmade);
      - -

      Make sure this code is below both the map div and leaflet.js inclusion, or in a window.load or document.ready event handler.

      - -

      Markers, circles and polygons

      - -
      - - -

      Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker:

      - -
      var markerLocation = new L.LatLng(51.5, -0.09);
      -
      -var marker = new L.Marker(markerLocation);
      -map.addLayer(marker);
      - -

      Adding a circle is the same (except for specifying the radius in meters), but lets configure it by passing options as a third argument when creating the object (the second argument is the radius in pixels):

      - -
      var circleLocation = new L.LatLng(51.508, -0.11),
      -	circleOptions = {
      -		color: 'red',
      -		fillColor: '#f03',
      -		fillOpacity: 0.5
      -	};
      -
      -var circle = new L.Circle(circleLocation, 500, circleOptions);
      -map.addLayer(circle);
      - -

      Add a polygon is easy too:

      -
      var p1 = new L.LatLng(51.509, -0.08),
      -	p2 = new L.LatLng(51.503, -0.06),
      -	p3 = new L.LatLng(51.51, -0.047),
      -	polygonPoints = [p1, p2, p3];
      -
      -var polygon = new L.Polygon(polygonPoints);
      -map.addLayer(polygon);
      - - -

      Working with popups

      - -
      - - -

      Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this:

      - -
      marker.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
      -circle.bindPopup("I am a circle.");
      -polygon.bindPopup("I am a polygon.");
      - -

      Try clicking on our objects. The bindPopup method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the openPopup method (for markers only) immediately opens the attached popup.

      - -

      You can also use popups as layers (when you need something more than attching a popup to an object):

      - -
      var popup = new L.Popup();
      -
      -popup.setLatLng(new L.LatLng(51.5, -0.09));
      -popup.setContent("I am a standalone popup.");
      -
      -map.openPopup(popup);
      - -

      Here we use openPopup instead of addLayer because it handles automatic closing of a previously opened popup when opening a new one which is good for usability.

      - - -

      Dealing with events

      - -

      Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction:

      -
      map.on('click', onMapClick);
      -
      -function onMapClick(e) {
      -	alert("You clicked the map at " + e.latlng);
      -}
      - -

      Each object has its own set of events — see documentation for details. The first argument of the listener function is an event object — it contains useful information about the event that happened. For example, map click event object (e in the example above) has latlng property which is a location at which the click occured.

      - -

      Lets improve our example by using a popup instead of an alert and formatting the location string:

      - -
      map.on('click', onMapClick);
      -
      -var popup = new L.Popup();
      -
      -function onMapClick(e) {
      -	var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
      -
      -	popup.setLatLng(e.latlng);
      -	popup.setContent("You clicked the map at " + latlngStr);
      -
      -	map.openPopup(popup);
      -}
      - -

      Try clicking on the map and you will see the coordinates in a popup. View the full example →

      -

      Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed documentation or other examples.

      - -
      - -

      © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - diff --git a/index.html b/index.html deleted file mode 100644 index 2e15674c66e..00000000000 --- a/index.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - - - - - -

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of CloudMade with a team of dedicated contributors. Weighing just about 25 KB of gzipped JS code, it still has all the features most developers ever need for online maps, while providing a smooth, pleasant user experience.

      -

      It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, A-grade browser support and a simple API with convention over configuration. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.

      - -

      Basic usage example

      -
      - - -

      Here we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

      - - - -
      // create a map in the "map" div, set the view to a given place and zoom
      -var map = L.map('map').setView([51.505, -0.09], 13);
      -
      -// add a CloudMade tile layer with style #997
      -L.tileLayer('http://{s}.tile.cloudmade.com/[API-key]/997/256/{z}/{x}/{y}.png', {
      -	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
      -}).addTo(map);
      -
      -// add a marker in the given location, attach some popup content to it and open the popup
      -L.marker([51.5, -0.09]).addTo(map)
      -	.bindPopup('A pretty CSS3 popup. <br> Easily customizable.').openPopup();
      - - - -

      Check out the examples section for more examples, or head straight to the documentation.

      - -

      Contributing to Leaflet

      -

      The project is hosted on GitHub, waiting for your contributions — just send your pull requests to Vladimir Agafonkin (Leaflet maintainer). Let's make the best library for maps that can possibly exist!

      -

      You can also help the project a lot by reporting bugs on the GitHub issues page, showing your support for your favorite feature suggestions on Leaflet UserVoice page, tweeting to @LeafletJS or joining the Leaflet mailing list. - -


      -

      © 2012 CloudMade. Map data © 2012 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - - From e27bc8db1909fdebe820049fa39a37b43e8cb481 Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 16 Jul 2012 23:56:58 +0300 Subject: [PATCH 157/816] improve social buttons in layout --- _layouts/default.html | 6 +++--- docs/css/screen.css | 49 +++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 7f8bc42aab9..f731de9a52a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -85,7 +85,7 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv {{ content }} diff --git a/docs/css/screen.css b/docs/css/screen.css index fea04c90ae8..3e97cb323c3 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -4,6 +4,7 @@ body { .container { background: white; + position: relative; padding: 15px 40px 20px; width: 790px; @@ -142,7 +143,7 @@ td { } .nav li a, .nav li span { float: left; - padding: 10px 17px; + padding: 10px 14px; border-right: 1px solid #ddd; } .nav a { @@ -179,23 +180,15 @@ td { border-left: 1px solid #ddd; filter: none; } - /*.nav li a.cloudmade-link { - padding: 4px 8px; - opacity: 0.7; - } - .nav li a.cloudmade-link img { - margin: 0; - display: block; - }*/ .nav li a.github-link { - padding-left: 34px; - padding-right: 12px; - background: url(https://github.com/favicon.png) 12px 12px no-repeat; + padding-left: 30px; + padding-right: 10px; + background: url(https://github.com/favicon.png) 10px 12px no-repeat; } .nav li a.twitter-link { - padding-left: 32px; - padding-right: 14px; - background: url(http://twitter.com/phoenix/favicon.ico) 12px 13px no-repeat; + padding-left: 28px; + padding-right: 12px; + background: url(http://twitter.com/phoenix/favicon.ico) 10px 13px no-repeat; } #forkme { @@ -250,9 +243,9 @@ a.nodocs { h3 span { color: #888; } -h3.alt a { +/*h3.alt a { color: #888; -} +}*/ .example-img { float: left; @@ -279,14 +272,6 @@ h3.alt a { margin-right: 0; } -.social-buttons { - margin: 18px 0; -} - -.twitter-follow-button { - margin-left: -9px; -} - table td { color: #666; } @@ -337,4 +322,18 @@ table.factory-table td, table.factory-table th { .factory-usage code { color: black; +} + +.social-buttons { + margin: 18px 0; + padding: 6px 0 2px 8px; + background: #f7f7f7; + position: absolute; + top: 10px; + right: 40px; + border-radius: 5px; +} + +.twitter-follow-button { + margin-left: -9px; } \ No newline at end of file From d354b3fcb7882d3693526cb41e80e3c44eaac1cc Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 17 Jul 2012 01:11:39 +0300 Subject: [PATCH 158/816] more layout improvements --- _layouts/default.html | 6 +++--- docs/css/screen.css | 12 +++++++----- docs/images/logo.png | Bin 6641 -> 12668 bytes index.md | 2 +- reference.html | 2 -- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index f731de9a52a..b2b659442de 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -36,8 +36,8 @@
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      +

      Leaflet

      +

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps

      diff --git a/docs/css/screen.css b/docs/css/screen.css index 2f66809ddc1..ae47d410f25 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -122,7 +122,7 @@ td { .nav { padding: 0; - margin: 22px 0 2em; + margin: 28px 0 2em; list-style: none; font-size: 1.2em; @@ -177,23 +177,27 @@ td { filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } .nav li a.github-link, - .nav li a.twitter-link { + .nav li a.twitter-link, + .nav li a.forum-link { font-weight: normal; float: right; border-right: none; border-left: 1px solid #ddd; + padding-left: 30px; + padding-right: 10px; filter: none; } .nav li a.github-link { - padding-left: 30px; - padding-right: 10px; background: url(https://github.com/favicon.png) 10px 12px no-repeat; } .nav li a.twitter-link { padding-left: 28px; - padding-right: 12px; - background: url(http://twitter.com/phoenix/favicon.ico) 10px 13px no-repeat; + background: url(http://twitter.com/phoenix/favicon.ico) 9px 13px no-repeat; } + .nav li a.forum-link { + padding-right: 12px; + background: url(https://groups.google.com/forum/favicon.ico) 10px 12px no-repeat; + } #forkme { position: absolute; From f3f67a267ac7a2d9a2b69dc38351ed36943fef2d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 17 Jul 2012 16:56:49 +0300 Subject: [PATCH 161/816] more layout improvements, plugins/blog links --- _layouts/default.html | 17 ++++++------ docs/css/screen.css | 63 ++++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 7e6ae33c147..df8dd6368f8 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -37,7 +37,7 @@

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps

      +

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      Fork me on GitHub diff --git a/docs/css/screen.css b/docs/css/screen.css index ae47d410f25..d1d3a7630e9 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -1,5 +1,5 @@ body { - background: #f7f7f7; + background: #f0f0f0; } .container { @@ -122,7 +122,7 @@ td { .nav { padding: 0; - margin: 28px 0 2em; + margin: 28px -13px 2.5em; list-style: none; font-size: 1.2em; @@ -130,11 +130,10 @@ td { overflow: hidden; background-color: #ffffff; - background-image: -moz-linear-gradient(top, #ffffff, #eff0f1); /* FF3.6 */ - background-image: -o-linear-gradient(top, #ffffff, #eff0f1); /* Opera 11.10+ */ - background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #ffffff),color-stop(1, #eff0f1)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(#ffffff, #eff0f1); /* Chrome 10+, Saf5.1+ */ - background-image: linear-gradient(top, #ffffff, #eff0f1); + background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eaebec)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ffffff, #eaebec); /* Chrome 10+, Saf5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, #ffffff, #eaebec); /* FF3.6+ */ + background-image: -o-linear-gradient(top, #ffffff, #eaebec); /* Opera 11.10+ */ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#eff0f1'); /* IE6�IE9 */ border-radius: 10px; @@ -147,8 +146,10 @@ td { } .nav li a, .nav li span { float: left; - padding: 10px 14px; + padding: 0 13px; border-right: 1px solid #ddd; + text-shadow: 1px 1px 0 white; + line-height: 40px; } .nav a { text-decoration: none; @@ -176,27 +177,33 @@ td { background-image: linear-gradient(top, #eff0f1, #f6f7f8); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } + .nav li a.github-link { + background: url(https://github.com/favicon.png) 8px 12px no-repeat; + } + .nav li a.twitter-link { + padding-left: 26px; + background: url(http://twitter.com/phoenix/favicon.ico) 7px 13px no-repeat; + } + .nav li a.forum-link { + padding-right: 10px; + background: url(https://groups.google.com/forum/favicon.ico) 8px 12px no-repeat; + } .nav li a.github-link, .nav li a.twitter-link, .nav li a.forum-link { - font-weight: normal; + font-size: 12px; + color: #555; float: right; border-right: none; border-left: 1px solid #ddd; - padding-left: 30px; - padding-right: 10px; - filter: none; - } - .nav li a.github-link { - background: url(https://github.com/favicon.png) 10px 12px no-repeat; - } - .nav li a.twitter-link { padding-left: 28px; - background: url(http://twitter.com/phoenix/favicon.ico) 9px 13px no-repeat; + padding-right: 8px; + filter: none; } - .nav li a.forum-link { - padding-right: 12px; - background: url(https://groups.google.com/forum/favicon.ico) 10px 12px no-repeat; + .nav li a.github-link:hover, + .nav li a.twitter-link:hover, + .nav li a.forum-link:hover { + color: black; } #forkme { @@ -251,9 +258,13 @@ a.nodocs { h3 span { color: #888; } -/*h3.alt a { - color: #888; -}*/ +h3.alt a { + color: #56b1ee; + text-decoration: none; +} +h3.alt a:hover { + text-decoration: underline; +} .example-img { float: left; @@ -344,4 +355,8 @@ table.factory-table td, table.factory-table th { .twitter-follow-button { margin-left: -9px; +} + +.footer { + margin-top: 2.5em; } \ No newline at end of file From b8c40ee93ad4cacd74cc43453a4486d78c6dbdf8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 17 Jul 2012 18:26:08 +0300 Subject: [PATCH 162/816] partially convert custom icons example to markdown --- docs/css/screen.css | 28 +++--- examples/custom-icons.html | 184 ------------------------------------- examples/custom-icons.md | 111 ++++++++++++++++++++++ 3 files changed, 126 insertions(+), 197 deletions(-) delete mode 100644 examples/custom-icons.html create mode 100644 examples/custom-icons.md diff --git a/docs/css/screen.css b/docs/css/screen.css index d1d3a7630e9..d3ab9ba4c98 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -13,9 +13,9 @@ body { border: 1px solid #dfdfdf; border-top: 0; - box-shadow: 0 0 40px #e0e0e0; - -moz-box-shadow: 0 0 40px #e0e0e0; - -webkit-box-shadow: 0 0 40px #e0e0e0; + box-shadow: 0 0 50px rgba(0,0,0,0.1); + -moz-box-shadow: 0 0 50px rgba(0,0,0,0.1); + -webkit-box-shadow: 0 0 50px rgba(0,0,0,0.1); } h1 { margin-bottom: 10px; @@ -154,6 +154,9 @@ td { .nav a { text-decoration: none; color: #000; + background-color: rgba(0,0,0,0); + background-repeat: no-repeat; + -webkit-transition: 0.08s all; } .nav li span { color: #000; @@ -169,24 +172,23 @@ td { .nav li a:hover { color: black; - background-color: #eff0f1; - background-image: -moz-linear-gradient(top, #eff0f1, #f6f7f8); - background-image: -o-linear-gradient(top, #eff0f1, #f6f7f8); - background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eff0f1),color-stop(1, #f6f7f8)); - background-image: -webkit-linear-gradient(#eff0f1, #f6f7f8); - background-image: linear-gradient(top, #eff0f1, #f6f7f8); + background-color: rgba(0,0,0,0.03); + filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } .nav li a.github-link { - background: url(https://github.com/favicon.png) 8px 12px no-repeat; + background-image: url(https://github.com/favicon.png); + background-position: 8px 12px; } .nav li a.twitter-link { padding-left: 26px; - background: url(http://twitter.com/phoenix/favicon.ico) 7px 13px no-repeat; + background-image: url(http://twitter.com/phoenix/favicon.ico); + background-position: 7px 13px; } .nav li a.forum-link { padding-right: 10px; - background: url(https://groups.google.com/forum/favicon.ico) 8px 12px no-repeat; + background-image: url(https://groups.google.com/forum/favicon.ico); + background-position: 8px 12px; } .nav li a.github-link, .nav li a.twitter-link, @@ -346,7 +348,7 @@ table.factory-table td, table.factory-table th { .social-buttons { margin: 18px 0; padding: 6px 0 2px 8px; - background: #f7f7f7; + background: #f3f3f3; position: absolute; top: 10px; right: 40px; diff --git a/examples/custom-icons.html b/examples/custom-icons.html deleted file mode 100644 index b16497237ec..00000000000 --- a/examples/custom-icons.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Markers With Custom Icons Example - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - -

      ← Back to the list of examples

      -

      Markers With Custom Icons

      - -

      In this example, you'll learn how to easily define your own icons for use by the markers you put on the map.

      - -
      - - - -

      View example on a separate page →

      - -

      Preparing the images

      - -

      To make a custom icon, we usually need two images — the actual icon image and the image of its shadow. For this example, we took the Leaflet logo and created four images out of it — 3 leaf images of different colors and one shadow image for the three:

      - -

      - - - - -

      - -

      The white area in the images is actually transparent, and they are saved in the PNG24 format. Notice there's some excessive area on the left of the shadow image — its cropped in such way that if you align the icon and the shadow images on top of each other, the top left corners are in the same spot.

      - -

      Defining an icon class

      - -

      The default marker icons in Leaflet are defined by the L.Icon class. Its instance (new L.Icon()) is then set by default in the L.Marker options. So how do we define our own icon class? Inherit from L.Icon! It's really easy in Leaflet:

      - -
      var LeafIcon = L.Icon.extend({
      -	options: {
      -		iconUrl: '../docs/images/leaf-green.png',
      -		shadowUrl: '../docs/images/leaf-shadow.png',
      -		iconSize: new L.Point(38, 95),
      -		shadowSize: new L.Point(68, 95),
      -		iconAnchor: new L.Point(22, 94),
      -		popupAnchor: new L.Point(-3, -76)
      -	}
      -});
      - -

      Now we've defined a green leaf icon class. The iconSize and shadowSize properties are the sizes of the corresponding images in pixels, the iconAnchor property is the coordinates of the "tip" of our icon, and the popupAnchor property points to a point from which a marker popup would open relative to the iconAnchor point.

      - -

      Using icons in markers

      - -

      To use our newly created icon class in a marker, we need to create an instance of that class and pass it to the marker constructor in the options:

      - -
      var greenIcon = new LeafIcon(),
      -	marker = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon});
      - -

      Awesome, it works! But what about the orange and the red ones? You could repeat the whole process above for each of them, but there's a much easier way. Notice that these icons would have the same properties except for one — the iconUrl. Because it's a frequent case, the L.Icon constructor has an optional argument — an iconUrl to replace the defined one. Let's see:

      - -
      var greenIcon = new LeafIcon(),
      -	redIcon = new LeafIcon({iconUrl: '../docs/images/leaf-red.png'}),
      -	orangeIcon = new LeafIcon({iconUrl: '../docs/images/leaf-orange.png'});
      -
      - -

      Now we can use all the three icons:

      - -
      var marker1 = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}),
      -	marker2 = new L.Marker(new L.LatLng(51.495, -0.083), {icon: redIcon}),
      -	marker3 = new L.Marker(new L.LatLng(51.49, -0.1), {icon: orangeIcon});
      -
      -marker1.bindPopup("I am a green leaf.");
      -marker2.bindPopup("I am a red leaf.");
      -marker3.bindPopup("I am an orange leaf.");
      -
      -map.addLayer(marker1).addLayer(marker2).addLayer(marker3);
      - -

      That's all. Now take a look at the full example, the L.Icon docs, or browse other examples.

      - -
      - -

      © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - diff --git a/examples/custom-icons.md b/examples/custom-icons.md new file mode 100644 index 00000000000..15748546790 --- /dev/null +++ b/examples/custom-icons.md @@ -0,0 +1,111 @@ +--- +layout: default +title: Custom Icons +root: ../ +--- + +[← Back to the list of examples](../examples.html) + + +### Markers With Custom Icons + +In this example, you'll learn how to easily define your own icons for use by the markers you put on the map. + +
      + +[View example on a separate page →](custom-icons-example.html) + + +### Preparing the images + +To make a custom icon, we usually need two images --- the actual icon image and the image of its shadow. For this example, we took the Leaflet logo and created four images out of it --- 3 leaf images of different colors and one shadow image for the three: + +

      + + + + +

      + +The white area in the images is actually transparent, and they are saved in the PNG24 format. Notice there's some excessive area on the left of the shadow image — its cropped in such way that if you align the icon and the shadow images on top of each other, the top left corners are in the same spot. + + +### Defining an icon class + +The default marker icons in Leaflet are defined by the [L.Icon](../reference.html#icon) class. Its instance (`new L.Icon()`) is then set by default in the `L.Marker` options. So how do we define our own icon class? Inherit from `L.Icon`! It's really easy in Leaflet: + + var LeafIcon = L.Icon.extend({ + options: { + iconUrl: '../docs/images/leaf-green.png', + shadowUrl: '../docs/images/leaf-shadow.png', + iconSize: new L.Point(38, 95), + shadowSize: new L.Point(68, 95), + iconAnchor: new L.Point(22, 94), + popupAnchor: new L.Point(-3, -76) + } + }); + +Now we've defined a green leaf icon class. The iconSize and shadowSize properties are the sizes of the corresponding images in pixels, the iconAnchor property is the coordinates of the "tip" of our icon, and the popupAnchor property points to a point from which a marker popup would open relative to the iconAnchor point. + + +### Using icons in markers + +To use our newly created icon class in a marker, we need to create an instance of that class and pass it to the marker constructor in the options: + + var greenIcon = new LeafIcon(), + marker = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}); + +Awesome, it works! But what about the orange and the red ones? You could repeat the whole process above for each of them, but there's a much easier way. Notice that these icons would have the same properties except for one --- the iconUrl. Because it's a frequent case, the L.Icon constructor has an optional argument --- an iconUrl to replace the defined one. Let's see: + + var greenIcon = new LeafIcon(), + redIcon = new LeafIcon({iconUrl: '../docs/images/leaf-red.png'}), + orangeIcon = new LeafIcon({iconUrl: '../docs/images/leaf-orange.png'}); + +Now we can use all the three icons: + + var marker1 = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}), + marker2 = new L.Marker(new L.LatLng(51.495, -0.083), {icon: redIcon}), + marker3 = new L.Marker(new L.LatLng(51.49, -0.1), {icon: orangeIcon}); + +marker1.bindPopup("I am a green leaf."); +marker2.bindPopup("I am a red leaf."); +marker3.bindPopup("I am an orange leaf."); + +map.addLayer(marker1).addLayer(marker2).addLayer(marker3); + +That's all. Now take a look at the full example, the L.Icon docs, or browse other examples. + + From 1290a31447778b4e11c31f8d2ce60ff3fea28235 Mon Sep 17 00:00:00 2001 From: mourner Date: Wed, 18 Jul 2012 00:32:50 +0300 Subject: [PATCH 163/816] add social icons, improve title --- _layouts/default.html | 4 +++- docs/css/screen.css | 17 +++++++---------- docs/images/forum.png | Bin 0 -> 566 bytes docs/images/github.png | Bin 0 -> 385 bytes docs/images/twitter.png | Bin 0 -> 444 bytes examples.md | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 docs/images/forum.png create mode 100644 docs/images/github.png create mode 100644 docs/images/twitter.png diff --git a/_layouts/default.html b/_layouts/default.html index df8dd6368f8..ff27c712fe3 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,7 +1,9 @@ - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade + {% capture title %}{% if page.title %}{{ page.title }} - {% elsif post.title %}{{ post.title }} - {% endif %}{% endcapture %} + + {{ title }}Leaflet - a JavaScript library for mobile-friendly maps diff --git a/docs/css/screen.css b/docs/css/screen.css index d3ab9ba4c98..13d2b3d6ff4 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -177,18 +177,14 @@ td { filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } .nav li a.github-link { - background-image: url(https://github.com/favicon.png); - background-position: 8px 12px; + background-image: url(../images/github.png); } .nav li a.twitter-link { - padding-left: 26px; - background-image: url(http://twitter.com/phoenix/favicon.ico); - background-position: 7px 13px; + background-image: url(../images/twitter.png); } .nav li a.forum-link { - padding-right: 10px; - background-image: url(https://groups.google.com/forum/favicon.ico); - background-position: 8px 12px; + padding-right: 12px; + background-image: url(../images/forum.png); } .nav li a.github-link, .nav li a.twitter-link, @@ -198,9 +194,10 @@ td { float: right; border-right: none; border-left: 1px solid #ddd; - padding-left: 28px; - padding-right: 8px; + padding-left: 30px; + padding-right: 10px; filter: none; + background-position: 10px 12px; } .nav li a.github-link:hover, .nav li a.twitter-link:hover, diff --git a/docs/images/forum.png b/docs/images/forum.png new file mode 100644 index 0000000000000000000000000000000000000000..a4eaaa49982b80485e53bab7d676894753f278aa GIT binary patch literal 566 zcmV-60?GY}P)W2+ZDf*uq!OD* z#y60N`|v0B3-RbW;*m8dMzOhl>EdiVac%uVunE`!!xbj>AqB|=Rz-`|j*3<8D`p_Y44jo`+ zKz|vn=K=W6Y~&5^2gI7Jyd>PJA)YwD zxiNLVx8&5d1I zZ27)R0Pi*r#qE9%RUH>{xyIm{8p9N6a&q*P`BG;F8^6CvfKfre7t@{zct}c}GRzH+ z(sj=jUeC{;X6qkTtDz&MUF=BK|L4?to>LbddV7uUf1B<}ZG-dy&Hw-a07*qoM6N<$ Ef=+1!%m4rY literal 0 HcmV?d00001 diff --git a/docs/images/github.png b/docs/images/github.png new file mode 100644 index 0000000000000000000000000000000000000000..129e95ab8ee0637014b77a61df1e07065d7eb208 GIT binary patch literal 385 zcmV-{0e=38P) z%`c9!u};;V;K+g(%qh8*FgdiX+F86>@P$DocT+5|r`iF0JDu~elJhARSWxW{J}h{^ zhLV-INSJ(yTGg)O(Sl{|Lj|UEOxDt|H}MQP)i|Am^}k{-b=rp|WOcr_LD${_#mI$P zQ~&j0Vnl_L=*24Dyan#P$$@gC(Q7)bfxIrtmAAkRx^STPnYg>&rhel#@f__g#bbXk fhDEWs>A%8XwB3YkN>@&u00000NkvXXu0mjf$nUo6 literal 0 HcmV?d00001 diff --git a/docs/images/twitter.png b/docs/images/twitter.png new file mode 100644 index 0000000000000000000000000000000000000000..cd2a9162d90f1125dea7bdeb94edfa9933b5624d GIT binary patch literal 444 zcmV;t0YmT_6dbbrEz^Yib$`z{ZY1GCRRd2gUM>(B*khJeICatt%C{AXBr z|3AZ=8~^!x_I>~vXfXZ2`3=`!g)r=Y^wxu6$>aa>6Zbs;8HQ{?-^sg$AUTFL?+|$9 ztN$Pa`BpyuoUr58a-cJQ>VYMeKmX6rx%WS^GwY5&?L*OwgbU7nTJit?e+`Dc_uje{ zod2>KE(vrdL))(Z3KMqUlV5!8F)jmuKn3i~3$H%efc=QB2;?FV#-iC^_s83Ce*#V7 zL2&^QIREtfQM~%{Q1AA!OH7b!68gQbNuPg+kmcS zM=<~>zzoF3^X`A|1S!C!8RYj5zkV5GO>v+!PCustom Controls +

      Custom Controls

      A brief tutorial on implementing custom map controls. *** -### Custom Overlays +

      Custom Overlays

      If markers, popups and vectors are not enough for you, here's a guide for creating your own map overlays (things to put on a map). From eecf61985584b7150b346619ce700587cb978eb3 Mon Sep 17 00:00:00 2001 From: mourner Date: Wed, 18 Jul 2012 00:41:26 +0300 Subject: [PATCH 164/816] initial blog and plugins pages --- _layouts/default.html | 16 ++++++++++++++-- blog.md | 6 ++++++ plugins.md | 6 ++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 blog.md create mode 100644 plugins.md diff --git a/_layouts/default.html b/_layouts/default.html index ff27c712fe3..8f0496d5990 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -78,8 +78,20 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv Download {% endif %} -
    7. Plugins
    8. -
    9. Blog
    10. +
    11. + {% if page.title == 'Plugins' %} + Plugins + {% else %} + Plugins + {% endif %} +
    12. +
    13. + {% if page.title == 'Blog' %} + Blog + {% else %} + Blog + {% endif %} +
    14. Forum
    15. GitHub
    16. diff --git a/blog.md b/blog.md new file mode 100644 index 00000000000..291e08766ba --- /dev/null +++ b/blog.md @@ -0,0 +1,6 @@ +--- +layout: default +title: Blog +--- + +Blog will be here. \ No newline at end of file diff --git a/plugins.md b/plugins.md new file mode 100644 index 00000000000..0649adcd36c --- /dev/null +++ b/plugins.md @@ -0,0 +1,6 @@ +--- +layout: default +title: Plugins +--- + +Plugins will be listed here. \ No newline at end of file From b4f509abd35c5c1979f13451473880d5db24ba18 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 18 Jul 2012 11:25:20 +0300 Subject: [PATCH 165/816] minor style improvements, logo easter egg --- _layouts/default.html | 49 +++++++++++---------- docs/css/blueprint/screen.css | 2 +- docs/css/screen.css | 80 +++++++++++++++++++++++++---------- 3 files changed, 82 insertions(+), 49 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 8f0496d5990..fa0b40c8d8b 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -41,6 +41,30 @@

      Leaflet

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      + + - - - {{ content }}

      -Check out the [examples](examples.html) section for more examples, or head straight to the [documentation](reference.html). +Learn more with the [quick start guide](examples/quick-start.html), check out [other tutorials](examples.html), or head straight to the [API documentation](reference.html). ### Contributing to Leaflet @@ -65,4 +65,4 @@ You can also help the project a lot by reporting bugs on the [GitHub issues page map.addLayer(marker); marker.bindPopup('A pretty CSS3 popup.
      Easily customizable.').openPopup(); - \ No newline at end of file + diff --git a/reference.html b/reference.html index 4aa628f2880..a8de452424b 100644 --- a/reference.html +++ b/reference.html @@ -12,7 +12,7 @@

      Map

    17. Options
    18. Events
    19. -

      Map methods

      +

      Map Methods

      -

      Map misc.

      +

      Map Misc

      -

      UI layers

      +

      UI Layers

      -

      Raster layers

      +

      Raster Layers

      -

      Vector layers

      +

      Vector Layers

      -

      Other layers

      +

      Other Layers

      -

      Basic types

      +

      Basic Types

      -

      DOM utility

      +

      DOM Utility


      -

      This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.
      Grayed out things are not yet documented but planned to be.

      +

      This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch

      L.Map

      @@ -418,7 +418,7 @@

      Events

      -

      Methods that modify map state

      +

      Methods for Modifying Map State

      @@ -498,7 +498,7 @@

      Methods that modify map state

      -

      Methods that get map state

      +

      Methods for Getting Map State

      @@ -553,7 +553,7 @@

      Methods that get map state

      -

      Methods for layers and controls

      +

      Methods for Layers and Controls

      @@ -600,7 +600,7 @@

      Methods for layers and controls

      -

      Conversion methods

      +

      Conversion Methods

      @@ -655,7 +655,7 @@

      Conversion methods

      -

      Other methods

      +

      Other Methods

      @@ -800,7 +800,7 @@

      Projections

      -

      Map panes

      +

      Map Panes

      An object literal (returned by map.getPanes) that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

      @@ -2286,7 +2286,7 @@

      L.LatLngBounds

      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:

      map.fitBounds([
      -	[40.712, -74.227], 
      +	[40.712, -74.227],
       	[40.774, -74.125]
       ]);
      @@ -3271,7 +3271,7 @@

      Methods

      Function Returns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called. - + falseFn() Function @@ -3473,4 +3473,4 @@

      L.noConflict()

      // you include Leaflet, it replaces the L variable to Leaflet namespace var Leaflet = L.noConflict(); -// now L points to that other library again, and you can use Leaflet.Map etc.
      \ No newline at end of file +// now L points to that other library again, and you can use Leaflet.Map etc.
      From c2a687be2952dfb7554a65298df6b8a43af91e6f Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 18 Jul 2012 17:31:24 +0300 Subject: [PATCH 170/816] update readme regarding docs and jekyll --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 8f70d3997c0..18a1756e74f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ It is built from the ground up to work efficiently and smoothly on both desktop Check out the website for more information: [leaflet.cloudmade.com](http://leaflet.cloudmade.com) +## Contributing to Leaflet Website (Docs) + + 1. Install Ruby if don't have it yet + 2. Run `gem install jekyll` + 3. Run `jekyll --auto` inside the `Leaflet` folder + 4. Open the website from the `_site` folder + +Now any file changes will be reflected on the generated pages automatically. + ## Contributing to Leaflet Let's make the best open-source library for maps that can possibly exist! From c89e855a9449ee78db82a40b2c5565ed5be55969 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 18 Jul 2012 17:32:12 +0300 Subject: [PATCH 171/816] remove logo easter egg, causing hover animation problems --- docs/css/screen.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 88ac2a1025e..5381f91fdc1 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -33,11 +33,11 @@ h1 a { -webkit-transition: 0.8s all; - -webkit-animation-duration: 2s; + /*-webkit-animation-duration: 2s; -webkit-animation-delay: 15s; -webkit-animation-name: autumn; -webkit-animation-iteration-count: 2; - -webkit-animation-direction: alternate; + -webkit-animation-direction: alternate;*/ } @-webkit-keyframes autumn { @@ -194,7 +194,7 @@ td { color: black; background-color: rgba(0,0,0,0.03); - + filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } .nav li a.github-link, @@ -392,4 +392,4 @@ table.factory-table td, table.factory-table th { .footer { margin-top: 2.5em; -} \ No newline at end of file +} From 539b44e0aaa80b965c580a7ead1fc2ad1359958a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 18 Jul 2012 19:12:01 +0300 Subject: [PATCH 172/816] initial plugins list --- docs/css/screen.css | 26 +++++++++++++ plugins.md | 95 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 5381f91fdc1..09167b319d7 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -393,3 +393,29 @@ table.factory-table td, table.factory-table th { .footer { margin-top: 2.5em; } + +dl { + overflow: hidden; +} + +dl dt { + font-size: 14px; + font-weight: normal; + float: left; + clear: left; + width: 160px; +} + +dl dd { + margin-bottom: 2em; + float: left; + width: 500px; +} + +.plugins td:first-child, .plugins td:last-child { + white-space: nowrap; +} + +.plugins td { + color: black; +} diff --git a/plugins.md b/plugins.md index 0649adcd36c..9b6c95745e7 100644 --- a/plugins.md +++ b/plugins.md @@ -3,4 +3,97 @@ layout: default title: Plugins --- -Plugins will be listed here. \ No newline at end of file +### Notable Leaflet Plugins + +While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are lots of nice plugins to choose from. + +### Services, providers and formats + + + + + + + + + + + + + + + + + + + + + + +
      PluginDescriptionMaintainer
      + Plugins by Pavel Shramov + + A set of plugins for: GPX, KML layers; Bing tile layer; Google and Yandex layers (implemented with their APIs), Permalink and alternative Scale controls. + + Pavel Shramov +
      + Proj4Leaflet + + Proj4js integration plugin, allowing you to use all kinds of weird projections in Leaflet. + + Kartena +
      + Leaflet Vector Layers + + Allows to easily create vector layers from a number of geo web services, such as ArcGIS Server, Arc2Earth, GeoIQ, CartoDB and GIS Cloud. + + Jason Sanford +
      + leaflet-tilejson + + Adds support for the TileJSON specification to Leaflet. + + Per Liedman, Kartena +
      + leaflet-providers + + Contains configurations for various free tile providers — OSM, OpenCycleMap, MapQuest, Mapbox Streets, Stamen, Esri, etc. + + Stefan Seelmann +
      + + From fea0a680675eddd4896be68cc85a9d344bbf4850 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 19 Jul 2012 01:55:21 +0300 Subject: [PATCH 173/816] add remaining plugins --- plugins.md | 211 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 179 insertions(+), 32 deletions(-) diff --git a/plugins.md b/plugins.md index 9b6c95745e7..a46484bce2d 100644 --- a/plugins.md +++ b/plugins.md @@ -7,7 +7,8 @@ title: Plugins While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are lots of nice plugins to choose from. -### Services, providers and formats + +### Layers and Overlays @@ -17,13 +18,60 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s + + + + + + + + + + + + +
      - Plugins by Pavel Shramov + Leaflet.markercluster - A set of plugins for: GPX, KML layers; Bing tile layer; Google and Yandex layers (implemented with their APIs), Permalink and alternative Scale controls. + Sophisticated marker clustering solution with smooth animations. - Pavel Shramov + Dave Leaver +
      + RaphaelLayer + + Allows you to use Raphael as a layer on a Leaflet map for advanced animations and visualizations. + + Dynamic Methods +
      + Leaflet.iconlabel + + Adds text labels to map markers. + + Jacob Toye +
      + Overlapping Marker Spiderfier + + Deals with overlapping markers in a Google Earth-inspired way by gracefully springing them apart on click. + + George MacKerron
      + arc.js + + Allows you to draw great circle routes between two points. + + Dane Springmeyer +
      + + +### Services, Providers and Formats + + + + + + + + + + + + + @@ -55,45 +121,126 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s + + + + + +
      PluginDescriptionMaintainer
      Proj4Leaflet @@ -33,11 +81,29 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Kartena
      + Plugins by Pavel Shramov + + A set of plugins for: GPX, KML layers; Bing tile layer; Google and Yandex layers (implemented with their APIs), Permalink and alternative Scale controls. + + Pavel Shramov +
      + cartodb-leaflet + + Official CartoDB plugin for Leaflet. + + Vizzuality +
      Leaflet Vector Layers - Allows to easily create vector layers from a number of geo web services, such as ArcGIS Server, Arc2Earth, GeoIQ, CartoDB and GIS Cloud. + Allows to easily create vector layers from a number of geo web services, such as ArcGIS Server, Arc2Earth, GeoIQ, CartoDB and GIS Cloud. Jason Sanford leaflet-providers - Contains configurations for various free tile providers — OSM, OpenCycleMap, MapQuest, Mapbox Streets, Stamen, Esri, etc. + Contains configurations for various free tile providers — OSM, OpenCycleMap, MapQuest, Mapbox Streets, Stamen, Esri, etc. Stefan Seelmann
      + azgs-leaflet + + A set of small plugins for Leaflet, including WFS-GeoJSON layer with filtering, a hover control for GeoJSON, and an Esri tile layer. + + AZGS +
      + Leaflet Control Bing Geocoder + + A simple geocoder control that uses Bing to locate places. + + Samuel Piquet +
      - From 5933cb31df15326797a0eccf02123bee5475ef31 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 19 Jul 2012 02:00:36 +0300 Subject: [PATCH 174/816] minor fixes --- download.md | 2 +- features.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/download.md b/download.md index ffba86b07b2..6d41be21ca2 100644 --- a/download.md +++ b/download.md @@ -10,7 +10,7 @@ code, unit tests, files for debugging and a build system. The production files (included the same way as in the code above) are in the `dist` folder. -[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012) +[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012)
      [Download Leaflet 0.4 master](http://github.com/CloudMade/Leaflet/zipball/master) (in-progress version) [View Changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md) diff --git a/features.html b/features.html index 8be60f200ee..a8297e593b4 100644 --- a/features.html +++ b/features.html @@ -5,7 +5,7 @@

      Leaflet Features

      -

      Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being easily extended by third-party plugins.

      +

      Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being easily extended by third-party plugins.


      From d8eef8fb8b4bbf81c598f5f93ba169b4e1054ae9 Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 19 Jul 2012 02:08:47 +0300 Subject: [PATCH 175/816] nicer style for plugins page --- docs/css/screen.css | 3 +++ plugins.md | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 09167b319d7..25a406573f9 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -78,6 +78,9 @@ h2 { text-shadow: -1px -1px 0 #999; } +h2.less-margin { + margin-top: 1em; +} h3 { margin-top: 1.5em; } diff --git a/plugins.md b/plugins.md index a46484bce2d..719eb19ea16 100644 --- a/plugins.md +++ b/plugins.md @@ -8,7 +8,7 @@ title: Plugins While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are lots of nice plugins to choose from. -### Layers and Overlays +

      Layers and Overlays

      @@ -64,7 +64,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -### Services, Providers and Formats +

      Services, Providers and Formats

      @@ -147,7 +147,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -### Controls +

      Controls

      @@ -212,7 +212,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -### Other Plugins +

      Other Plugins

      From 4d776737ab7886f3f9e825c4083ddb54ab5d5003 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 19 Jul 2012 11:11:48 +0300 Subject: [PATCH 176/816] add docs todo for 0.4 --- DOCS-TODO | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 DOCS-TODO diff --git a/DOCS-TODO b/DOCS-TODO new file mode 100644 index 00000000000..fb0ea1df1f1 --- /dev/null +++ b/DOCS-TODO @@ -0,0 +1,180 @@ + +Layers addTo(map) + +Map + panning inertia options + + remove locateAndSetView + new locate options + + getContainer + containerPointToLatLng + latLngToContainerPoint + addHandler + + autopanstart event + +Icon +Icon.Default +DivIcon + +Control + position option + + setPosition + getPosition + +Control.Attribution prefix in options + +Scale control + +LatLngBounds pad + +on/off(eventMap) +on/off(space-separated types) +off(type) to remove all listeners + +TileLayer + removed urlParams + + detectRetina option + + redraw + setUrl + bringToFront + bringToBack + +TileLayer.WMS + setParams + +Marker + opacity option + + setOpacity + update + +ImageOverlay + opacity option + + setOpacity + +Popup + maxHeight + +Path + bringToFront + bringToBack + + openPopup + + redraw + + events + contextmenu + +Circle + getBounds + getLatLng + getRadius + +MouseEvent + originalEvent + containerPoint + +Global switches + L_NO_TOUCH + L_PREFER_CANVAS + L_DISABLE_3D + + + +Transformation + Transformation(a, b, c, d) + + transform(point, scale) + untransform(point, scale) + +LineUtil + simplify(points, tolerance) + pointToSegmentDistance(p, p1, p2) + closestPointOnSegment(p, p1, p2) + clipSegment(a, b, bounds) + +PolyUtil + clipPolygon(points, bounds) + +DomEvent + addListener(obj, type, fn, context) + on + removeListener(obj, type, fn) + off + stopPropagation(e) + disableClickPropagation(el) + preventDefault(e) + stop(e) + getMousePosition(e, container) + getWheelDelta(e) + +Transition + Transition(el, options) + + run(props) + + options + fps: 50 + easing: 'ease', + duration: 0.5 + fakeStepInterval: 100 + + events + start + step + end + +Draggable + Draggable(element, dragStartTarget) + + enable() + disable() + + events + dragstart + predrag + drag + dragend + +ILayer + onAdd(map) + onRemove(map) + + important events: viewreset, moveend + + options.minZoom and options.maxZoom + +IFeature - ? + getBounds() or getLatLng() + setStyle + bindPopup + events + +Control + Control(options) + + getPosition() + setPosition() + addTo(map) + removeFrom(map) + +IControl + onAdd(map) + onRemove(map) + +IProjection + project(latlng) + unproject(point) + +ICRS + latLngToPoint(latlng, zoom) + pointToLatLng(point, zoom) + project(latlng) + scale(zoom) From fb307af27405ce7765797ed6b23c89b3b358aecf Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 19 Jul 2012 11:12:10 +0300 Subject: [PATCH 177/816] more files to ignore by Jekyll --- _config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 78504620f11..fb96b8041a7 100644 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,6 @@ -exclude: build, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE +exclude: build, debug, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, DOCS-TODO.md markdown: kramdown kramdown: - entity_output: as_input \ No newline at end of file + entity_output: as_input From 726213e701af368fd23b9b52932cafdec932ea1b Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 19 Jul 2012 11:32:09 +0300 Subject: [PATCH 178/816] minor tweaks --- _layouts/default.html | 8 ++++---- docs/css/screen.css | 11 ++++++----- plugins.md | 8 ++++---- reference.html | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index fa0b40c8d8b..27c30111025 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -6,11 +6,11 @@ {{ title }}Leaflet - a JavaScript library for mobile-friendly maps - + - + @@ -36,7 +36,7 @@ - +

      Leaflet

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      @@ -49,7 +49,7 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv - + diff --git a/docs/css/screen.css b/docs/css/screen.css index 25a406573f9..0efca4c613c 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -53,8 +53,8 @@ h1 a:hover, h1 a:focus { h2 { font-size: 1.8em; + margin-top: 1em; font-weight: bold; - margin-top: 2.5em; padding: 4px 12px 3px; margin-left: 0; margin-right: 0; @@ -78,9 +78,9 @@ h2 { text-shadow: -1px -1px 0 #999; } -h2.less-margin { - margin-top: 1em; -} +.api-page h2 { + margin-top: 2.5em; + } h3 { margin-top: 1.5em; } @@ -94,6 +94,7 @@ h4 { font-weight: bold; color: #555; } + h3.alt { color: #999; font-family: Georgia, serif; @@ -145,7 +146,7 @@ td { .nav { padding: 0; - margin: 28px 0 2.5em; + margin: 28px 0 32px; list-style: none; font-size: 1.2em; diff --git a/plugins.md b/plugins.md index 719eb19ea16..c0a92100eb2 100644 --- a/plugins.md +++ b/plugins.md @@ -8,7 +8,7 @@ title: Plugins While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are lots of nice plugins to choose from. -

      Layers and Overlays

      +## Layers and Overlays
      @@ -64,7 +64,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -

      Services, Providers and Formats

      +## Services, Providers and Formats @@ -147,7 +147,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -

      Controls

      +## Controls @@ -212,7 +212,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -

      Other Plugins

      +## Other Plugins diff --git a/reference.html b/reference.html index a8de452424b..5e33d17c552 100644 --- a/reference.html +++ b/reference.html @@ -1,6 +1,7 @@ --- layout: default title: Documentation +bodyclass: api-page ---
      From 92e9d43071911bef236f347277f817611a23cd78 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 19 Jul 2012 11:39:36 +0300 Subject: [PATCH 179/816] update docs snippets --- reference-tpl.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/reference-tpl.html b/reference-tpl.html index f617b45d07a..2e3cee70374 100644 --- a/reference-tpl.html +++ b/reference-tpl.html @@ -1,13 +1,12 @@ + -<[type][name] - +<Foo> name -

      [class-name]

      [description]

      @@ -22,10 +21,15 @@

      Constructor

      + +
      ConstructorUsage Description
      [constructor]( [arguments] ) + new L.Map()
      + L.map() +
      [description]
      @@ -41,7 +45,7 @@

      Methods

      Description - [method]( [arguments] ) + [method]( argument, argument ) [return-type] [description] @@ -60,9 +64,9 @@

      Options

      Description - [name] + [name] [type] [default] [description] - \ No newline at end of file + From a2d7c9819e6ada18f00522a3062e1fd0069ff4c8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 19 Jul 2012 17:11:26 +0300 Subject: [PATCH 180/816] more docs updates --- DOCS-TODO | 95 +---- docs/css/screen.css | 22 +- docs/highlight/styles/github.css | 6 +- reference.html | 630 ++++++++++++++++++++++++------- 4 files changed, 527 insertions(+), 226 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index fb0ea1df1f1..3dce470d738 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -1,66 +1,28 @@ - -Layers addTo(map) - Map panning inertia options remove locateAndSetView new locate options - getContainer - containerPointToLatLng - latLngToContainerPoint addHandler - autopanstart event - Icon Icon.Default -DivIcon - -Control - position option - - setPosition - getPosition - -Control.Attribution prefix in options -Scale control - -LatLngBounds pad +NEW DivIcon on/off(eventMap) on/off(space-separated types) off(type) to remove all listeners TileLayer - removed urlParams - - detectRetina option + detectRetina option redraw setUrl bringToFront bringToBack -TileLayer.WMS - setParams - -Marker - opacity option - - setOpacity - update - -ImageOverlay - opacity option - - setOpacity - -Popup - maxHeight - Path bringToFront bringToBack @@ -69,41 +31,30 @@ Path redraw - events - contextmenu - -Circle - getBounds - getLatLng - getRadius - -MouseEvent - originalEvent - containerPoint +FeatureGroup - ? + setStyle -Global switches +NEW Global switches L_NO_TOUCH L_PREFER_CANVAS L_DISABLE_3D - - -Transformation +NEW Transformation Transformation(a, b, c, d) transform(point, scale) untransform(point, scale) -LineUtil +NEW LineUtil simplify(points, tolerance) pointToSegmentDistance(p, p1, p2) closestPointOnSegment(p, p1, p2) clipSegment(a, b, bounds) -PolyUtil +NEW PolyUtil clipPolygon(points, bounds) -DomEvent +NEW DomEvent addListener(obj, type, fn, context) on removeListener(obj, type, fn) @@ -115,7 +66,7 @@ DomEvent getMousePosition(e, container) getWheelDelta(e) -Transition +NEW Transition Transition(el, options) run(props) @@ -131,9 +82,9 @@ Transition step end -Draggable +NEW Draggable Draggable(element, dragStartTarget) - + enable() disable() @@ -143,7 +94,7 @@ Draggable drag dragend -ILayer +NEW ILayer onAdd(map) onRemove(map) @@ -151,29 +102,15 @@ ILayer options.minZoom and options.maxZoom -IFeature - ? - getBounds() or getLatLng() - setStyle - bindPopup - events - -Control - Control(options) - - getPosition() - setPosition() - addTo(map) - removeFrom(map) - -IControl +NEW IControl onAdd(map) onRemove(map) -IProjection +NEW IProjection project(latlng) unproject(point) -ICRS +NEW ICRS latLngToPoint(latlng, zoom) pointToLatLng(point, zoom) project(latlng) diff --git a/docs/css/screen.css b/docs/css/screen.css index 0efca4c613c..77dd55fddb6 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -122,24 +122,32 @@ pre code a:hover { text-decoration: underline; } +p code, td:last-child code { + color: #666; +} + table { border-collapse: collapse; box-shadow: 0 3px 15px #f0f0f0; } th { - background-color: #f3f3f3; - background-image: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#e7e7e7)); /* Saf4+, Chrome */ - background-image: -webkit-linear-gradient(top, #f3f3f3, #e7e7e7); /* Chrome 10+, Saf5.1+, iOS 5+ */ - background-image: -moz-linear-gradient(top, #f3f3f3, #e7e7e7); /* FF3.6+ */ - background-image: -o-linear-gradient(top, #f3f3f3, #e7e7e7); /* Opera 11.10+ */ - background-image: linear-gradient(to bottom, #f3f3f3, #e7e7e7); + background-color: #eeeeee; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#d7d7d7)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #eeeeee, #d7d7d7); /* Chrome 10+, Saf5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, #eeeeee, #d7d7d7); /* FF3.6+ */ + background-image: -o-linear-gradient(top, #eeeeee, #d7d7d7); /* Opera 11.10+ */ + background-image: linear-gradient(to bottom, #eeeeee, #d7d7d7); + + text-shadow: 1px 1px 0 white; + + padding: 5px 10px; } th, td { - padding: 8px 10px; vertical-align: top; /*line-height: 1.4;*/ } td { + padding: 8px 10px; /*border-right: 1px solid #eee;*/ } diff --git a/docs/highlight/styles/github.css b/docs/highlight/styles/github.css index 69622eedff2..ba1fabd9198 100644 --- a/docs/highlight/styles/github.css +++ b/docs/highlight/styles/github.css @@ -36,7 +36,8 @@ pre .javascript .title { } code .number, -pre .hexcolor { +pre .hexcolor, +code .literal { color: #00A707 } @@ -66,9 +67,6 @@ pre .tex .command { color: #458; font-weight: bold } -code .literal { - color: #333; -} pre .tag, pre .tag .title, diff --git a/reference.html b/reference.html index 5e33d17c552..973b1b426c8 100644 --- a/reference.html +++ b/reference.html @@ -67,13 +67,15 @@

      Basic Types

    20. Point
    21. Bounds
    22. Icon
    23. +
    24. DivIcon
    25. Controls

      @@ -112,8 +114,9 @@

      Interfaces

      Misc

      @@ -275,7 +278,7 @@

      Options

      closePopupOnClick Boolean true - Set it to false if you don't want popups to close when user clicks the map. + Set it to false if you don't want popups to close when user clicks the map. worldCopyJump @@ -329,7 +332,7 @@

      Events

      contextmenu MouseEvent - Fired when the user pushes the right mouse button on the map. + Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event. preclick @@ -386,6 +389,11 @@

      Events

      Event Fired when the map zoom changes. + + autopanstart + Event + Fired when the map starts autopanning when opening a popup. + layeradd LayerEvent @@ -429,72 +437,72 @@

      Methods for Modifying Map State

      setView( <LatLng> center, <Number> zoom, <Boolean> forceReset? ) - this - Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). + this + Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). setZoom( <Number> zoom ) - this + this Sets the zoom of the map. zoomIn() - this + this Increases the zoom of the map by 1. zoomOut() - this + this Decreases the zoom of the map by 1. fitBounds( <LatLngBounds> bounds ) - this + this Sets a map view that contains the given geographical bounds with the maximum zoom level possible. fitWorld() - this + this Sets a map view that mostly contains the whole world with the maximum zoom level possible. panTo( <LatLng> latlng ) - this + this Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. panInsideBounds( <LatLngBounds> bounds ) - this + this Pans the map to the closest view that would lie inside the given bounds (if it's not already). panBy( <Point> point ) - this + this Pans the map by a given number of pixels (animated). invalidateSize() - this + this Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. setMaxBounds( <LatLngBounds> bounds ) - this + this Restricts the map view to the given bounds (see map maxBounds option). locate( <Locate options> options? ) - this + this Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details. locateAndSetView( <Number> maxZoom?, <Locate options> options? ) - this + this Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. stopLocate() - this + this Stops watching location previously initiated by map.locate({watch: true}). @@ -535,7 +543,7 @@

      Methods for Getting Map State

      getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? ) Number - Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety. + Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety. getSize() @@ -564,38 +572,38 @@

      Methods for Layers and Controls

      addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? ) - this - Adds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers). + this + Adds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers). removeLayer( <ILayer> layer ) - this + this Removes the given layer from the map. hasLayer( <ILayer> layer ) Boolean - Returns true if the given layer is currently added to the map. + Returns true if the given layer is currently added to the map. openPopup( <Popup> popup ) - this + this Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability). closePopup() - this + this Closes the popup opened with openPopup. addControl( <IControl> control ) - this + this Adds the given control to the map. removeControl( <IControl> control ) - this + this Removes the given control from the map. @@ -629,6 +637,16 @@

      Conversion Methods

      Point Converts the point relative to the map layer to a point relative to the map container. + + latLngToContainerPoint( <LatLng> latlng ) + Point + Returns the map container point that corresponds to the given geographical coordinates. + + + containerPointToLatLng( <Point> point ) + LatLng + Returns the geographical coordinates of a given map container point. + project( <LatLng> latlng, <Number> zoom? ) Point @@ -689,13 +707,13 @@

      Locate options

      watch Boolean false - If true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method. + If true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method. setView Boolean false - If true, automatically sets the map view to the user location with respect to detection accuracy. + If true, automatically sets the map view to the user location with respect to detection accuracy. maxZoom @@ -892,7 +910,7 @@

      Options

      clickable Boolean true - If false, the marker will not emit mouse events and will act as a part of the underlying map. + If false, the marker will not emit mouse events and will act as a part of the underlying map. draggable @@ -912,6 +930,12 @@

      Options

      0 By default, marker images zIndex is set automatically based on its latitude. You 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). + + opacity + Number + 1.0 + The opacity of the marker. +

      Events

      @@ -974,6 +998,11 @@

      Methods

      Returns Description + + addTo( <Map> map ) + this + Adds the marker to the map. + getLatLng() LatLng @@ -981,37 +1010,47 @@

      Methods

      setLatLng( <LatLng> latlng ) - this + this Changes the marker position to the given point. setIcon( <Icon> icon ) - this + this Changes the marker icon. setZIndexOffset( <Number> offset ) - this + this Changes the zIndex offset of the marker. - + + setOpacity( <Number> opacity ) + this + Changes the opacity of the marker. + + + update() + this + Updates the marker position, useful if coordinates of its latLng object were changed directly. + + bindPopup( <String> htmlContent, <Popup options> options? ) - this + this Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method. - + unbindPopup() - this + this Unbinds the popup previously bound to the marker with bindPopup. - + openPopup() - this + this Opens the popup previously bound by the bindPopup method. - + closePopup() - this + this Closes the bound popup of the marker if it's opened. @@ -1090,11 +1129,17 @@ 50 Min width of the popup. + + maxHeight + Number + null + If set, creates a scrollable container of the given height inside a popup if its content exceeds it. + autoPan Boolean true - Set it to false if you don't want the map to do panning animation to fit the opened popup. + Set it to false if you don't want the map to do panning animation to fit the opened popup. closeButton @@ -1119,6 +1164,11 @@

      Methods

      + + + + + @@ -1126,12 +1176,12 @@

      Methods

      - + - +
      addTo( <Map> map )thisAdds the popup to the map.
      Method Returns
      setLatLng( <LatLng> latlng )thisthis Sets the geographical point where the popup will open.
      setContent( <String> htmlContent )thisthis Sets the HTML content of the popup.
      @@ -1228,19 +1278,19 @@

      Options

      tms Boolean false - If true, inverses Y axis numbering for tiles (turn this on for TMS services). + If true, inverses Y axis numbering for tiles (turn this on for TMS services). continuousWorld Boolean false - If set to true, the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps). + If set to true, the tile coordinates won't be wrapped by world width (-180 to 180 longitude) or clamped to lie within world height (-90 to 90). Use this if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor or photo maps). noWrap Boolean false - If set to true, the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating. + If set to true, the tiles just won't load outside the world width (-180 to 180 longitude) instead of repeating. zoomOffset @@ -1252,7 +1302,7 @@

      Options

      zoomReverse Boolean false - If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom) + If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom) opacity @@ -1264,19 +1314,19 @@

      Options

      unloadInvisibleTiles Boolean depends - If true, all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false. + If true, all the tiles that are not visible after panning are removed (for better performance). true by default on mobile WebKit, otherwise false. updateWhenIdle Boolean depends - If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false. + If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false. reuseTiles Boolean false - If true, all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed. + If true, all the tiles that are not visible after panning are placed in a reuse queue from which they will be fetched when new tiles become visible (as opposed to dynamically creating new ones). This will in theory keep memory usage low and eliminate the need for reserving new memory whenever a new tile is needed. @@ -1288,9 +1338,14 @@

      Methods

      Returns Description + + addTo( <Map> map ) + this + Adds the layer to the map. + setOpacity( <Number> opacity ) - this + this Changes the opacity of the tile layer. @@ -1304,7 +1359,7 @@

      Methods

      L.TileLayer.WMS

      -

      Used to display WMS services as tile layers on the map. Extends TileLayer, implements ILayer interface.

      +

      Used to display WMS services as tile layers on the map. Extends TileLayer.

      Usage example

      @@ -1366,7 +1421,7 @@

      Options

      transparent Boolean false - If true, the WMS service will return images with transparency. + If true, the WMS service will return images with transparency. version @@ -1376,11 +1431,25 @@

      Options

      +

      Methods

      + + + + + + + + + + + + +
      MethodReturnsDescription
      setParams( <WMS parameters> params, <Boolean> noRedraw? )thisMerges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).

      L.TileLayer.Canvas

      -

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer, implements ILayer interface.

      +

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer.

      Usage example

      @@ -1419,7 +1488,7 @@

      Methods

      drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom ) - this + this You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom. @@ -1450,7 +1519,7 @@

      Constructor

      Description - L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds ) + L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds, <ImageOverlay options> options? ) new L.ImageOverlay()
      L.imageOverlay() @@ -1459,7 +1528,40 @@

      Constructor

      +

      Options

      + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      opacityNumber1.0The opacity of the image overlay.
      +

      Methods

      + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      addTo( <Map> map )thisAdds the overlay to the map.
      setOpacity( <Number> opacity )thisSets the opacity of the overlay.

      L.Path

      @@ -1477,7 +1579,7 @@

      Options

      stroke Boolean true - Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles. + Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles. color @@ -1501,7 +1603,7 @@

      Options

      fill Boolean depends - Whether to fill the path with color. Set it to false to disable filling on polygons or circles. + Whether to fill the path with color. Set it to false to disable filling on polygons or circles. fillColor @@ -1519,7 +1621,7 @@

      Options

      clickable Boolean true - If false, the vector will not emit mouse events and will act as a part of the underlying map. + If false, the vector will not emit mouse events and will act as a part of the underlying map. @@ -1558,6 +1660,11 @@

      Events

      MouseEvent Fired when the mouse leaves the object. + + contextmenu + MouseEvent + Fired when the user pushes the right mouse button on the object, prevents default browser context menu from showing if there are listeners on this event. +

      Static properties

      @@ -1584,7 +1691,7 @@

      Static properties

      CANVAS Boolean depends - True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow. + True if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow. CLIP_PADDING @@ -1601,14 +1708,24 @@

      Methods

      Returns Description + + addTo( <Map> map ) + this + Adds the layer to the map. + bindPopup( <String> htmlContent, <Popup options> options? ) - this + this Binds a popup with a particular HTML content to a click on this path. + + openPopup( <LatLng> latlng? ) + this + Opens the popup previously bound by the bindPopup method in the given point, or in one of the path's points if not specified. + setStyle( <Path options> object ) - this + this Changes the appearance of a Path based on the options in the Path options object. @@ -1685,12 +1802,12 @@

      Methods

      addLatLng( <LatLng> latlng ) - this + this Adds a given point to the polyline. setLatLngs( <LatLng[]> latlngs ) - this + this Replaces all the points in the polyline with the given array of geographical points. @@ -1703,7 +1820,7 @@

      Methods

      LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). - + getBounds() LatLngBounds Returns the LatLngBounds of the polyline. @@ -1830,7 +1947,7 @@

      Methods

      setBounds( <LatLngBounds> bounds ) - this + this Redraws the rectangle with the passed bounds. @@ -1880,12 +1997,12 @@

      Methods

      setLatLng( <LatLng> latlng ) - this + this Sets the position of a circle to a new location. setRadius( <Number> radius ) - this + this Sets the radius of a circle. Units are in meters. @@ -1924,12 +2041,12 @@

      Methods

      setLatLng( <LatLng> latlng ) - this + this Sets the position of a circle marker to a new location. setRadius( <Number> radius ) - this + this Sets the radius of a circle marker. Units are in pixels. @@ -1970,19 +2087,24 @@

      Methods

      Returns Description + + addTo( <Map> map ) + this + Adds the group of layers to the map. + addLayer( <ILayer> layer ) - this + this Adds a given layer to the group. removeLayer( <ILayer> layer ) - this + this Removes a given layer from the group. clearLayers() - this + this Removes all the layers from the group. @@ -2028,13 +2150,13 @@

      Methods

      bindPopup( <String> htmlContent, <Popup options> options? ) - this - Binds a popup with a particular HTML content to a click on any layer from the group. + this + Binds a popup with a particular HTML content to a click on any layer from the group that has a bindPopup method. getBounds() LatLngBounds - Returns the LatLngBounds of the Feature Group. + Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children). @@ -2159,12 +2281,12 @@

      Static methods

      coordsToLatlng( <Array> coords, <Boolean> reverse? ) LatLng - Creates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude). + Creates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude). coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? ) Array - Creates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude). + Creates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude). @@ -2236,7 +2358,7 @@

      Methods

      equals( <LatLng> otherLatlng ) Boolean - Returns true if the given LatLng point is at the same position (within a small margin of error). + Returns true if the given LatLng point is at the same position (within a small margin of error). toString() @@ -2328,7 +2450,7 @@

      Methods

      extend( <LatLng|LatLngBounds> latlng ) - this + this Extends the bounds to contain the given point or bounds. @@ -2359,28 +2481,33 @@

      Methods

      contains( <LatLngBounds> otherBounds ) Boolean - Returns true if the rectangle contains the given one. + Returns true if the rectangle contains the given one. contains( <LatLng> latlng ) Boolean - Returns true if the rectangle contains the given point. + Returns true if the rectangle contains the given point. intersects( <LatLngBounds> otherBounds ) Boolean - Returns true if the rectangle intersects the given bounds. + Returns true if the rectangle intersects the given bounds. equals( <LatLngBounds> otherBounds ) Boolean - Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. + Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. 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. + + pad( <Number> bufferRatio ) + LatLngBounds + Returns bigger bounds created by extending the current bounds by a given percentage in each direction. + @@ -2412,7 +2539,7 @@

      Constructor

      L.point()
      L.point([]) - Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values. + Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values. @@ -2462,7 +2589,7 @@

      Methods

      divideBy( <Number> number, <Boolean> round? ) Point - Returns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result. + Returns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result. distanceTo( <Point> otherPoint ) @@ -2567,17 +2694,17 @@

      Methods

      contains( <Bounds> otherBounds ) Boolean - Returns true if the rectangle contains the given one. + Returns true if the rectangle contains the given one. contains( <Point> point ) Boolean - Returns true if the rectangle contains the given point. + Returns true if the rectangle contains the given point. intersects( <Bounds> otherBounds ) Boolean - Returns true if the rectangle intersects the given bounds. + Returns true if the rectangle intersects the given bounds. @@ -2643,7 +2770,7 @@

      Properties

      shadowUrl String - The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created. + The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created. shadowSize @@ -2664,40 +2791,186 @@

      Properties

      -

      L.Control.Zoom

      +

      L.Control

      + +

      The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:

      -

      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 to false. Implements IControl interface.

      +
      control.addTo(map);
      +// the same as
      +map.addControl(control);

      Constructor

      - + + + + + + + + + +
      ConstructorConstructorUsageDescription
      L.Control( <Control options> options? ) + new L.Control()
      + L.control() +
      Creates a control with the given options.
      + +

      Options

      + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      positionString'topright'The initial position of the control (one of the map corners). See control positions.
      + +

      Methods

      + + + + - + + + + + + + + + + + + + + + + + + + +
      MethodReturns Description
      L.Control.Zoom()setPosition( <String> position )thisSets the position of the control. See control positions.
      getPosition()StringReturns the current position of the control.
      addTo( <Map> map )thisAdds the control to the map.
      removeFrom( <Map> map )thisRemoves the control from the map.
      + +

      Control Positions

      + +

      Control positions (map corner to put a control to) are set using strings. Margins between controls and the map border are set with CSS, so that you can easily override them.

      + + + + + + + + + + + + + + + + + + + + + + +
      PositionDescription
      'topleft'Top left of the map.
      'topright'Top right of the map.
      'bottomleft'Bottom left of the map.
      'bottomright'Bottom right of the map.
      + + +

      L.Control.Zoom

      + +

      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 to false. Extends Control.

      + +

      Constructor

      + + + + + + + + +
      ConstructorUsageDescription
      L.Control.Zoom( <Control.Zoom options> options? ) + new L.Control.Zoom()
      + L.control.zoom() +
      Creates a zoom control.
      +

      Options

      + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      positionString'topleft'The position of the control (one of the map corners). See control positions.
      +

      L.Control.Attribution

      -

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Implements IControl interface.

      +

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Extends Control.

      Constructor

      + - + +
      ConstructorUsage Description
      L.Control.Attribution()L.Control.Attribution( <Control.Attribution options> options? ) + new L.Control.Attribution()
      + L.control.attribution() +
      Creates an attribution control.
      +

      Options

      + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      positionString'bottomright'The position of the control (one of the map corners). See control positions.
      prefixString'Powered by Leaflet'The HTML text shown before the attributions. Pass false to disable.
      +

      Methods

      @@ -2707,17 +2980,17 @@

      Methods

      - - + + - - + + - +
      setPrefix( <String> prefix )-Sets the string before the attributions ("Powered by Leaflet" by default).thisSets the text before the attributions.
      addAttribution( <String> text )-Adds an attribution text (e.g. "Vector data &copy; CloudMade").thisAdds an attribution text (e.g. 'Vector data &copy; CloudMade').
      removeAttribution( <String> text )-this Removes an attribution text.
      @@ -2725,7 +2998,7 @@

      Methods

      L.Control.Layers

      -

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). It should be created and added explicitly to the map using Map#addControl method. Implements IControl interface.

      +

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

      var baseLayers = {
       	"CloudMade": cloudmade,
      @@ -2737,18 +3010,21 @@ 

      L.Control.Layers

      "Roads": roadsLayer }; -layersControl = new L.Control.Layers(baseLayers, overlays); - -map.addControl(layersControl);
      +L.control.layers(baseLayers, overlays).addTo(map);

      Constructor

      + +
      ConstructorUsage Description
      L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? ) + new L.Control.Layers()
      + L.control.layers() +
      Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes.
      @@ -2762,17 +3038,17 @@

      Methods

      addBaseLayer( <ILayer> layer, <String> name ) - this + this Adds a base layer (radio button entry) with the given name to the control. addOverlay( <ILayer> layer, <String> name ) - this + this Adds an overlay (checkbox entry) with the given name to the control. removeLayer( <ILayer> layer ) - this + this Remove the given layer from the control. @@ -2786,11 +3062,17 @@

      Options

      Default Description + + position + String + 'topright' + The position of the control (one of the map corners). See control positions. + collapsed Boolean true - If true, the control will be collapsed into an icon and expanded on mouse hover or touch. + If true, the control will be collapsed into an icon and expanded on mouse hover or touch. @@ -2806,6 +3088,72 @@

      Layer Config

      +

      L.Control.Scale

      + +

      A simple scale control that shows the scale of the current center of screen in metric (m/km) and imerial (mi/ft) systems. Implements IControl interface.

      + +
      L.control.scale().addTo(map);
      + +

      Constructor

      + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Control.Scale( <Control.Scale options> options? ) + new L.Control.Attribution()
      + L.control.attribution() +
      Creates an scale control with the given options.
      + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      positionString'bottomleft'The position of the control (one of the map corners). See control positions.
      maxWidthNumber100Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
      metricBooleantrueWhether to show the metric scale line (m/km).
      imerialBooleantrueWhether to show the imerial scale line (mi/ft).
      updateWhenIdleBooleanfalseIf true, the control is updated on moveend, otherwise it's always up-to-date (updated on move).
      + + +

      Events methods

      A set of methods shared between event-powered classes (like Map). 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 'fire' event).

      @@ -2832,37 +3180,37 @@

      Methods

      addEventListener( <String> type, <Function> fn, <Object> context? ) - 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). + 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). removeEventListener( <String> type, <Function> fn, <Object> context? ) - this + this Removes a previously added listener function. on( … ) - this + this Alias to addEventListener. off( … ) - this + this Alias to removeEventListener. hasEventListeners( <String> type ) Boolean - Returns true if a particular event type has some listeners attached to it. + Returns true if a particular event type has some listeners attached to it. fireEvent( <String> type, <Object> data? ) - this + 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. fire( … ) - this + this Alias to fireEvent. @@ -2916,6 +3264,16 @@

      MouseEvent

      Point Pixel coordinates of the point where the mouse event occured relative to the map layer. + + containerPoint + Point + Pixel coordinates of the point where the mouse event occured relative to the map сontainer. + + + originalEvent + DOMMouseEvent + The original DOM mouse event fired by the browser. +

      LocationEvent

      @@ -3172,57 +3530,57 @@

      L.Browser

      ie Boolean - true for all Internet Explorer versions. + true for all Internet Explorer versions. ie6 Boolean - true for Internet Explorer 6. + true for Internet Explorer 6. webkit Boolean - true for webkit-based browsers like Chrome and Safari (including mobile versions). + true for webkit-based browsers like Chrome and Safari (including mobile versions). webkit3d Boolean - true for webkit-based browsers that support CSS 3D transformations. + true for webkit-based browsers that support CSS 3D transformations. gecko Boolean - true for Gecko-based browsers like Firefox and Mozilla. + true for Gecko-based browsers like Firefox and Mozilla. opera Boolean - true for Opera. + true for Opera. android Boolean - true for Android mobile browser. + true for Android mobile browser. mobile Boolean - true for modern mobile browsers (including iOS Safari and different Android browsers). + true for modern mobile browsers (including iOS Safari and different Android browsers). mobileWebkit Boolean - true for mobile webkit-based browsers. + true for mobile webkit-based browsers. mobileOpera Boolean - true for mobile Opera. + true for mobile Opera. touch Boolean - true for all browsers on touch devices. + true for all browsers on touch devices. @@ -3247,7 +3605,7 @@

      Methods

      bind( <Function> fn, <Object> obj ) Function - Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). + Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). stamp( <Object> obj ) @@ -3276,7 +3634,7 @@

      Methods

      falseFn() Function - Returns a function which always returns false. + Returns a function which always returns false. formatNum(
      <Number> num, <Number> digits ) @@ -3367,7 +3725,7 @@

      Methods

      hasClass( <HTMLElement> el, <String> name ) Boolean - Returns true if the element class attribute contains name. + Returns true if the element class attribute contains name. addClass( <HTMLElement> el, <String> name ) @@ -3387,7 +3745,7 @@

      Methods

      testProp( <String[]> props ) String or 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. + 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. getTranslateString( <Point> point ) @@ -3402,7 +3760,7 @@

      Methods

      setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? ) - - Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true. + Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true. getPosition( <HTMLElement> el ) @@ -3454,7 +3812,7 @@

      IHandler

      enabled() Boolean - Returns true if the handler is enabled. + Returns true if the handler is enabled. From 7d6af0fad3744539860d8709d56960bce03c179a Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 20 Jul 2012 20:10:30 +0300 Subject: [PATCH 181/816] more docs updates and additions --- DOCS-TODO | 25 +--- docs/css/screen.css | 9 +- reference.html | 323 ++++++++++++++++++++++++++++++++------------ 3 files changed, 249 insertions(+), 108 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index 3dce470d738..e2e12f88764 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -1,15 +1,3 @@ -Map - panning inertia options - - remove locateAndSetView - new locate options - - addHandler - -Icon -Icon.Default - -NEW DivIcon on/off(eventMap) on/off(space-separated types) @@ -20,20 +8,10 @@ TileLayer redraw setUrl - bringToFront - bringToBack Path - bringToFront - bringToBack - - openPopup - redraw -FeatureGroup - ? - setStyle - NEW Global switches L_NO_TOUCH L_PREFER_CANVAS @@ -115,3 +93,6 @@ NEW ICRS pointToLatLng(point, zoom) project(latlng) scale(zoom) + + +Map addHandler? diff --git a/docs/css/screen.css b/docs/css/screen.css index 77dd55fddb6..6b609feaa8d 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -88,11 +88,11 @@ h3.alt { margin-top: 0; } h4 { - margin-bottom: 0.2em; + margin-bottom: 0.5em; line-height: inherit; - font-size: 1em; + font-size: 1.1em; font-weight: bold; - color: #555; + color: #777; } h3.alt { @@ -367,6 +367,9 @@ th.width300 { th.width100 { width: 100px; } +th.width140 { + width: 140px; +} th.minwidth { width: 1px; } diff --git a/reference.html b/reference.html index 973b1b426c8..9ae3f734a1b 100644 --- a/reference.html +++ b/reference.html @@ -159,6 +159,8 @@

      Constructor

      Options

      +

      Map State Options

      + @@ -181,19 +183,19 @@

      Options

      - + - + - + @@ -208,6 +210,17 @@

      Options

      +
      Option
      layers ILayer[][]null Layers that will be added to the map initially.
      minZoom Number0null Minimum zoom level of the map. Overrides any minZoom set on map layers.
      maxZoom Number18null Maximum zoom level of the map. This overrides any maxZoom set on map layers.
      L.CRS.
      EPSG3857
      Coordinate Reference System to use. Don't change this if you're not sure what it means.
      + +

      Interaction Options

      + + + + + + + + @@ -238,6 +251,70 @@

      Options

      + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      dragging Boolean true Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
      trackResizeBooleantrueWhether the map automatically handles browser window resize to update itself.
      worldCopyJumpBooleantrueWith this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there.
      closePopupOnClickBooleantrueSet it to false if you don't want popups to close when user clicks the map.
      + +

      Panning Inertia Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      inertiaBooleantrueIf enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices.
      inertiaDecelerationNumber3000The rate with which the inertial movement slows down, in pixels/second2.
      inertiaMaxSpeedNumber1500Max speed of the inertial movement, in pixels/second.
      inertiaThresholdNumberdependsAmount of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement. 32 for touch devices and 14 for the rest by default.
      + +

      Control options

      + + + + + + + + @@ -250,11 +327,16 @@

      Options

      +
      OptionTypeDefaultDescription
      zoomControl Boolean true Whether the attribution control is added to the map by default.
      + +

      Animation options

      + + - - - - + + + + @@ -274,18 +356,6 @@

      Options

      - - - - - - - - - - - -
      trackResizeBooleantrueWhether the map automatically handles browser window resize to update itself.OptionTypeDefaultDescription
      fadeAnimation depends Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.
      closePopupOnClickBooleantrueSet it to false if you don't want popups to close when user clicks the map.
      worldCopyJumpBooleantrueWith this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there.
      @@ -407,12 +477,12 @@

      Events

      locationfound LocationEvent - Fired when geolocation (using locate or locateAndSetView method) went successfully. + Fired when geolocation (using locate method) went successfully. locationerror ErrorEvent - Fired when geolocation (using locate or locateAndSetView method) failed. + Fired when geolocation (using locate method) failed. popupopen @@ -493,12 +563,7 @@

      Methods for Modifying Map State

      locate( <Locate options> options? ) this - Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure. See Locate options for more details. - - - locateAndSetView( <Number> maxZoom?, <Locate options> options? ) - this - Automatically sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). A shortcut for map.locate({setView: true, maxZoom: maxZoom});. + Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure, and optionally sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). See Locate options for more details. stopLocate() @@ -713,7 +778,7 @@

      Locate options

      setView Boolean false - If true, automatically sets the map view to the user location with respect to detection accuracy. + If true, automatically sets the map view to the user location with respect to detection accuracy, or to world view if geolocation failed. maxZoom @@ -1343,6 +1408,16 @@

      Methods

      this Adds the layer to the map. + + bringToFront() + this + Brings the tile layer to the top of all tile layers. + + + bringToBack() + this + Brings the tile layer to the bottom of all tile layers. + setOpacity( <Number> opacity ) this @@ -1667,40 +1742,6 @@

      Events

      -

      Static properties

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      ConstantTypeValueDescription
      SVGBooleandependsTrue if SVG is used for vector rendering (true for most modern browsers).
      VMLBooleandependsTrue if VML is used for vector rendering (IE 6-8).
      CANVASBooleandependsTrue if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
      CLIP_PADDINGNumber0.5 for SVG
      0.02 for VML
      How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
      -

      Methods

      @@ -1733,6 +1774,50 @@

      Methods

      + + + + + + + + + + +
      LatLngBounds Returns the LatLngBounds of the path.
      bringToFront()thisBrings the layer to the top of all path layers.
      bringToBack()thisBrings the layer to the bottom of all path layers.
      + +

      Static properties

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ConstantTypeValueDescription
      SVGBooleandependsTrue if SVG is used for vector rendering (true for most modern browsers).
      VMLBooleandependsTrue if VML is used for vector rendering (IE 6-8).
      CANVASBooleandependsTrue if Canvas is used for vector rendering (Android 2). You can also force this by setting global variable L_PREFER_CANVAS to true before the Leaflet include on your page — sometimes it can increase performance dramatically when rendering thousands of circle markers, but currently suffers from a bug that causes removing such layers to be extremely slow.
      CLIP_PADDINGNumber0.5 for SVG
      0.02 for VML
      How much to extend the clip area around the map view (relative to its size, e.g. 0.5 is half the screen in each direction). Smaller values mean that you will see clipped ends of paths while you're dragging the map, and bigger values decrease drawing performance.
      @@ -2149,7 +2234,7 @@

      Methods

      Description - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( <String> htmlContent, <Popup options> options? ) this Binds a popup with a particular HTML content to a click on any layer from the group that has a bindPopup method. @@ -2158,6 +2243,11 @@

      Methods

      LatLngBounds Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children). + + setStyle( <Path options> style ) + this + Sets the given path options to each layer of the group that has a setStyle method. +

      Events

      @@ -2190,6 +2280,16 @@

      Events

      MouseEvent Fired when the mouse leaves the group. + + mousemove + MouseEvent + Fired while the mouse moves over the layers of the group. + + + contextmenu + MouseEvent + Fired when the user right-clicks on one of the layers. + @@ -2715,11 +2815,12 @@

      L.Icon

      var myIcon = L.icon({
       	iconUrl: 'my-icon.png',
      -	shadowUrl: 'my-icon-shadow.png',
       	iconSize: [38, 95],
      -	shadowSize: [68, 95],
       	iconAnchor: [22, 94],
      -	popupAnchor: [-3, -76]
      +	popupAnchor: [-3, -76],
      +	shadowUrl: 'my-icon-shadow.png',
      +	shadowSize: [68, 95],
      +	shadowAnchor: [22, 94]
       });
       
       L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
      @@ -2735,20 +2836,20 @@

      Constructor

      Description - L.Icon( <Icon properties> props ) + L.Icon( <Icon options> options ) new L.Icon()
      L.icon() - Creates an icon instance with the given properties. + Creates an icon instance with the given options. -

      Properties

      +

      Options

      - + @@ -2765,12 +2866,12 @@

      Properties

      + + @@ -2778,19 +2879,75 @@

      Properties

      - + + - + + + +
      PropertyOption Type Description
      iconAnchor Point - 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.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.
      shadowUrl String - The URL to the icon shadow image. If shadowUrl is null then no shadow image will be created.The URL to the icon shadow image. If not specified, no shadow image will be created.
      shadowSize Size of the shadow image in pixels.
      shadowOffsetshadowAnchor Point - Position of the shadow relative to the icon ((0, 0) by default)The coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor if not specified).
      popupAnchorclassNameString + A custom class name to assign to both icon and shadow images. Empty by default.
      + + +

      L.DivIcon

      + +

      Represents a lightweight icon for markers that uses a simple div element instead of an image.

      + +
      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' class and is styled as a little white square with a shadow.

      + +

      Constructor

      + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.DivIcon( <DivIcon options> options ) + new L.DivIcon()
      + L.divIcon() +
      Creates a div icon instance with the given options.
      + +

      Options

      + + + + + + + + + + + + + + + + + +
      OptionTypeDescription
      iconSize Point - The point from which the marker popup opens, relative to the anchor point.Size of the icon in pixels. Can be also set through CSS.
      iconAnchorPoint + 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.
      classNameString + A custom class name to assign to the icon. 'leaflet-div-icon' by default.
      +

      L.Control

      The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:

      @@ -3816,13 +3973,6 @@

      IHandler

      -

      L.version

      - -

      A constant that represents the Leaflet version in use.

      - -

      L.version // returns "0.4" (or whatever version is currently in use)
      - -

      L.noConflict()

      This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      @@ -3833,3 +3983,10 @@

      L.noConflict()

      var Leaflet = L.noConflict(); // now L points to that other library again, and you can use Leaflet.Map etc.
      + + +

      L.version

      + +

      A constant that represents the Leaflet version in use.

      + +

      L.version // returns "0.4" (or whatever version is currently in use)
      From 30a5caee4d3f76ac4965c7e1a5b88f2018022f5a Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 20 Jul 2012 23:15:21 +0300 Subject: [PATCH 182/816] more docs updates --- DOCS-TODO | 21 --------------- reference.html | 70 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 30 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index e2e12f88764..b2d65e29090 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -1,22 +1,4 @@ -on/off(eventMap) -on/off(space-separated types) -off(type) to remove all listeners - -TileLayer - detectRetina option - - redraw - setUrl - -Path - redraw - -NEW Global switches - L_NO_TOUCH - L_PREFER_CANVAS - L_DISABLE_3D - NEW Transformation Transformation(a, b, c, d) @@ -93,6 +75,3 @@ NEW ICRS pointToLatLng(point, zoom) project(latlng) scale(zoom) - - -Map addHandler? diff --git a/reference.html b/reference.html index 9ae3f734a1b..88e3b1a8644 100644 --- a/reference.html +++ b/reference.html @@ -114,7 +114,7 @@

      Interfaces

      Misc

      @@ -1387,6 +1387,12 @@

      Options

      depends If false, new tiles are loaded during panning, otherwise only after it (for better performance). true by default on mobile WebKit, otherwise false. + + detectRetina + Boolean + false + If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution. + reuseTiles Boolean @@ -1426,7 +1432,12 @@

      Methods

      redraw() - - Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas + Causes the layer to clear all the tiles and request them again. + + + setUrl( <String> urlTemplate ) + this + Updates the layer's URL template and redraws it. @@ -1784,6 +1795,11 @@

      Methods

      this Brings the layer to the bottom of all path layers. + + redraw() + this + Redraws the layer. Sometimes useful after you changed the coordinates that the path uses. +

      Static properties

      @@ -3338,22 +3354,22 @@

      Methods

      addEventListener( <String> type, <Function> fn, <Object> context? ) 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). + 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'). - removeEventListener( <String> type, <Function> fn, <Object> context? ) + addEventListener( <Object> eventMap, <Object> context? ) this - Removes a previously added listener function. + Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} - on( … ) + removeEventListener( <String> type, <Function> fn?, <Object> context? ) this - Alias to addEventListener. + Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. - off( … ) + removeEventListener( <Object> eventMap, <Object> context? ) this - Alias to removeEventListener. + Removes a set of type/listener pairs.
      hasEventListeners( <String> type ) @@ -3365,6 +3381,16 @@

      Methods

      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. + + on( … ) + this + Alias to addEventListener. + + + off( … ) + this + Alias to removeEventListener. + fire( … ) this @@ -3973,6 +3999,32 @@

      IHandler

      +

      Global Switches

      + +

      Global switches are created for rare cases and generally make Leaflet to not detect a particular browser feature even if it's there. You need to set the switch as a global variable to true before including Leaflet on the page, like this:

      + +
      <script>L_PREFER_CANVAS = true;</script>
      +<script src="leaflet.js"></script>
      + + + + + + + + + + + + + + + + + + +
      SwitchDescription
      L_PREFER_CANVASForces Leaflet to use the Canvas back-end (if available) for vector layers instead of SVG. This can increase performance considerably in some cases (e.g. many thousands of circle markers on the map).
      L_NO_TOUCHForces Leaflet to not use touch events even if it detects them. Particularly useful if you embed Leaflet inside a QT WebView (which exposes touch events even on desktop PCs).
      L_DISABLE_3DForces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.
      +

      L.noConflict()

      This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      From 4ee1ee8b9c425b7fb856541c0acea7469b22ade0 Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 21 Jul 2012 01:11:26 +0300 Subject: [PATCH 183/816] more docs updates, jekyllize remaining pages --- _layouts/default.html | 2 +- examples/custom-icons.md | 2 +- examples/geojson.html | 257 ++++++++++++----------------------- examples/layers-control.html | 185 ++++++++----------------- examples/mobile.html | 129 ++++-------------- reference.html | 16 ++- 6 files changed, 186 insertions(+), 405 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 27c30111025..8f2d95ed497 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -125,7 +125,7 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv diff --git a/examples/custom-icons.md b/examples/custom-icons.md index 15748546790..7ca68043ea0 100644 --- a/examples/custom-icons.md +++ b/examples/custom-icons.md @@ -1,6 +1,6 @@ --- layout: default -title: Custom Icons +title: Markers With Custom Icons root: ../ --- diff --git a/examples/geojson.html b/examples/geojson.html index 782becf74b9..6ccb95c30bd 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -1,133 +1,96 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Leaflet on Mobile Example - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - -

      ← Back to the list of examples

      -

      Using GeoJSON with Leaflet

      - -

      GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

      - -
      - - - + + -

      View example on a separate page →

      +

      View example on a separate page →

      -

      About GeoJSON

      +

      About GeoJSON

      -

      According to http://geojson.org:

      +

      According to http://geojson.org:

      -
      GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
      +
      GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
      -

      Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

      +

      Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

      -

      The GeoJSON layer

      +

      The GeoJSON layer

      -

      GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

      +

      GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

      -
      var geojsonLayer = new L.GeoJSON();
      +
      var geojsonLayer = new L.GeoJSON();
       
       map.addLayer(geojsonLayer);
      -

      This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

      +

      This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

      -
      var geojsonFeature = {
      +
      var geojsonFeature = {
       	"type": "Feature",
       	"properties": {
       		"name": "Coors Field",
      @@ -142,29 +105,29 @@ 

      The GeoJSON layer

      geojsonLayer.addGeoJSON(geojsonFeature);
      -

      We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

      +

      We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

      -
      var geojsonLayer = new L.GeoJSON(geojsonFeature);
      +
      var geojsonLayer = new L.GeoJSON(geojsonFeature);
       
       map.addLayer(geojsonLayer);
      -

      Popups

      +

      Popups

      -

      We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

      +

      We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

      -
      geojsonLayer.on("featureparse", function (e) {
      +
      geojsonLayer.on("featureparse", function (e) {
       	if (e.properties && e.properties.popupContent){
       		e.layer.bindPopup(e.properties.popupContent);
       	}
       });
      -

      Make sure to do this before adding GeoJSON objects through the addGeoJSON method.

      +

      Make sure to do this before adding GeoJSON objects through the addGeoJSON method.

      -

      Styling Features

      +

      Styling Features

      -

      We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

      +

      We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

      -
      var freeBus = {
      +
      var freeBus = {
       	"type": "Feature",
       	"geometry": {
       		"type": "LineString",
      @@ -187,22 +150,22 @@ 

      Styling Features

      } };
      -

      To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

      +

      To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

      -
      geojsonLayer.on("featureparse", function (e){
      +
      geojsonLayer.on("featureparse", function (e){
       	if (e.properties && e.properties.style && e.layer.setStyle){
       		// The setStyle method isn't available for Points. More on that below ...
       		e.layer.setStyle(e.properties.style);
       	}
       });
      -

      Styling Points

      +

      Styling Points

      -

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      +

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      -

      Here we're using a CircleMarker:

      +

      Here we're using a CircleMarker:

      -
      var geojsonMarkerOptions = {
      +
      var geojsonMarkerOptions = {
       	radius: 8,
       	fillColor: "#ff7800",
       	color: "#000",
      @@ -217,9 +180,9 @@ 

      Styling Points

      } });
      -

      And here's an example of using a custom Marker:

      +

      And here's an example of using a custom Marker:

      -
      var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
      +
      var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
       	pointToLayer: function (latlng) {
       		return new L.Marker(latlng, {
       			icon: new MyCustomIcon()
      @@ -227,44 +190,4 @@ 

      Styling Points

      } });
      -

      View the example page to see in detail what is possible with the GeoJSON layer.

      - -
      - -

      © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - +

      View the example page to see in detail what is possible with the GeoJSON layer.

      diff --git a/examples/layers-control.html b/examples/layers-control.html index 5518184e4e5..45c525916a1 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -1,104 +1,67 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Layers Control Example +--- +layout: default +title: Layer Groups and Layers Control +root: ../ +--- - - - +

      ← Back to the list of examples

      +

      Layer Groups and Layers Control

      - +

      This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

      +

      Note: this only works in the latest (master) version of Leaflet.

      - +
      + - + var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', + cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png'; - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      + var minimal = new L.TileLayer(cloudmadeUrl, {styleId: 22677, attribution: cloudmadeAttribution}), + midnightCommander = new L.TileLayer(cloudmadeUrl, {styleId: 999, attribution: cloudmadeAttribution}), + motorways = new L.TileLayer(cloudmadeUrl, {styleId: 46561, attribution: cloudmadeAttribution}); - + var map = new L.Map('map', {center: new L.LatLng(39.73, -104.99), zoom: 10, layers: [minimal, motorways, citiesLayer]}); -

      ← Back to the list of examples

      -

      Layer Groups and Layers Control

      + var baseMaps = { + "Minimal": minimal, + "Night View": midnightCommander + }; -

      This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

      -

      Note: this only works in the latest (master) version of Leaflet.

      + var overlayMaps = { + "Motorways": motorways, + "Cities": citiesLayer + }; -
      - - citiesLayer.addLayer(littletonMarker); - citiesLayer.addLayer(denverMarker); - citiesLayer.addLayer(auroraMarker); - citiesLayer.addLayer(goldenMarker); +

      View example on a separate page →

      - var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', - cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png'; +

      Layer Groups

      - var minimal = new L.TileLayer(cloudmadeUrl, {styleId: 22677, attribution: cloudmadeAttribution}), - midnightCommander = new L.TileLayer(cloudmadeUrl, {styleId: 999, attribution: cloudmadeAttribution}), - motorways = new L.TileLayer(cloudmadeUrl, {styleId: 46561, attribution: cloudmadeAttribution}); +

      Lets suppose you have a bunch of layers you want to combine into a group to handle them as one in your code:

      - var map = new L.Map('map', {center: new L.LatLng(39.73, -104.99), zoom: 10, layers: [minimal, motorways, citiesLayer]}); - - var baseMaps = { - "Minimal": minimal, - "Night View": midnightCommander - }; - - var overlayMaps = { - "Motorways": motorways, - "Cities": citiesLayer - }; - - layersControl = new L.Control.Layers(baseMaps, overlayMaps); - - map.addControl(layersControl); - - -

      View example on a separate page →

      - -

      Layer Groups

      - -

      Lets suppose you have a bunch of layers you want to combine into a group to handle them as one in your code:

      - -
      var littletonMarker = new L.Marker(new L.LatLng(39.61, -105.02)).bindPopup("This is Littleton, CO."),
      +
      var littletonMarker = new L.Marker(new L.LatLng(39.61, -105.02)).bindPopup("This is Littleton, CO."),
       	denverMarker = new L.Marker(new L.LatLng(39.74, -104.99)).bindPopup("This is Denver, CO."),
       	auroraMarker = new L.Marker(new L.LatLng(39.73, -104.8)).bindPopup("This is Aurora, CO."),
       	goldenMarker = new L.Marker(new L.LatLng(39.77, -105.23)).bindPopup("This is Golden, CO.");
      -

      Instead of adding them directly to the map, you can do the following, using the LayerGroup class:

      +

      Instead of adding them directly to the map, you can do the following, using the LayerGroup class:

      -
      var citiesLayer = new L.LayerGroup();
      +
      var citiesLayer = new L.LayerGroup();
       
       citiesLayer.addLayer(littletonMarker)
                  .addLayer(denverMarker)
      @@ -107,15 +70,15 @@ 

      Layer Groups

      map.addLayer(citiesLayer);
      -

      Easy enough! Now you have citiesLayer that combines your city markers into one layer you can add or remove from the map at once.

      +

      Easy enough! Now you have citiesLayer that combines your city markers into one layer you can add or remove from the map at once.

      -

      Layers Control

      +

      Layers Control

      -

      Leaflet has a nice little control that allows your users control what layers they want to see on your map. In addition to showing you how to use it, we'll show another handy use for layer groups.

      +

      Leaflet has a nice little control that allows your users control what layers they want to see on your map. In addition to showing you how to use it, we'll show another handy use for layer groups.

      -

      There are two types of layers — base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays — all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off — a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map:

      +

      There are two types of layers — base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays — all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off — a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map:

      -
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/{styleId}/256/{z}/{x}/{y}.png',
      +
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/{styleId}/256/{z}/{x}/{y}.png',
       	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
       	cloudmadeOptions = {maxZoom: 18, };
       
      @@ -129,9 +92,9 @@ 

      Layers Control

      layers: [minimal, motorways, citiesLayer] });
      -

      Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. midnightCommander).

      +

      Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. midnightCommander).

      -
      var baseMaps = {
      +
      var baseMaps = {
       	"Minimal": minimal,
       	"Night View": midnightCommander
       };
      @@ -141,51 +104,11 @@ 

      Layers Control

      "Cities": citiesLayer };
      - -

      Now, all that's left to do is to create a Layers Control and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional — for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing null as the first argument.

      + +

      Now, all that's left to do is to create a Layers Control and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional — for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing null as the first argument.

      -
      var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
      +
      var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
       
       map.addControl(layersControl);
      -

      Now lets view the result on a separate page →

      - -
      - -

      © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - +

      Now lets view the result on a separate page →

      diff --git a/examples/mobile.html b/examples/mobile.html index 13fc3231b73..2ac04cec439 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -1,56 +1,21 @@ - - - - Leaflet - a JavaScript library for mobile-friendly interactive maps by CloudMade - Leaflet on Mobile Example +--- +layout: default +title: Leaflet on Mobile +root: ../ +--- - - - +

      ← Back to the list of examples

      +

      Leaflet on Mobile

      - +

      In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

      - - - - +

      View example →

      - +

      Preparing the page

      - - +

      First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

      - - - - - - -
      -

      Leaflet

      -

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      - - - -

      ← Back to the list of examples

      -

      Leaflet on Mobile

      - -

      In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

      - -

      View example →

      - -

      Preparing the page

      - -

      First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

      - -
      body {
      +
      body {
       	padding: 0;
       	margin: 0;
       }
      @@ -58,15 +23,15 @@ 

      Preparing the page

      height: 100%; }
      -

      Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section:

      +

      Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section:

      -
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
      +
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
      -

      Initializing the map

      +

      Initializing the map

      -

      We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

      +

      We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

      -
      var map = new L.Map('map');
      +
      var map = new L.Map('map');
       
       var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
       	cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
      @@ -74,15 +39,15 @@ 

      Initializing the map

      map.addLayer(cloudmade);
      -

      Geolocation

      +

      Geolocation

      -

      Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

      +

      Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

      -
      map.locateAndSetView(16);
      +
      map.locateAndSetView(16);
      -

      Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

      +

      Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

      -
      map.on('locationfound', onLocationFound);
      +
      map.on('locationfound', onLocationFound);
       
       function onLocationFound(e) {
       	var radius = e.accuracy / 2;
      @@ -95,54 +60,14 @@ 

      Geolocation

      map.addLayer(circle); }
      -

      Excellent! But it would also be nice to show an error message if the geolocation failed:

      +

      Excellent! But it would also be nice to show an error message if the geolocation failed:

      -
      map.on('locationerror', onLocationError);
      +
      map.on('locationerror', onLocationError);
       
       function onLocationError(e) {
       	alert(e.message);
       }
      -

      Now the example is complete — try it on your mobile phone: View the full example →

      - -

      Next steps would be to take a look at the detailed documentation and browse other examples.

      - -
      - -

      © 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.

      -
      - - Fork me on GitHub - - - - - - - - +

      Now the example is complete — try it on your mobile phone: View the full example →

      + +

      Next steps would be to take a look at the detailed documentation and browse other examples.

      diff --git a/reference.html b/reference.html index 88e3b1a8644..bbc16ef5cca 100644 --- a/reference.html +++ b/reference.html @@ -384,6 +384,11 @@

      Events

      MouseEvent Fired when the user pushes the mouse button on the map. + + mouseup + MouseEvent + Fired when the user pushes the mouse button on the map. + mouseenter MouseEvent @@ -1229,15 +1234,20 @@

      Methods

      + + + + + - - - + + + From 94c027c208f8a6017f4a50395ca129ab5428a22f Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 10:20:49 +0300 Subject: [PATCH 184/816] separate layout for tutorials --- _layouts/default.html | 2 +- _layouts/tutorial.html | 9 +++++++++ docs/css/screen.css | 7 +++++++ examples/custom-icons.md | 6 +----- examples/geojson.html | 4 +--- examples/layers-control.html | 4 +--- examples/mobile.html | 4 +--- examples/quick-start.md | 8 ++------ 8 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 _layouts/tutorial.html diff --git a/_layouts/default.html b/_layouts/default.html index 8f2d95ed497..4d069679ec7 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -85,7 +85,7 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv {% if page.title == 'Tutorials' %} Tutorials {% else %} - Tutorials + Tutorials {% endif %}
    26. diff --git a/_layouts/tutorial.html b/_layouts/tutorial.html new file mode 100644 index 00000000000..4471a1a2d9f --- /dev/null +++ b/_layouts/tutorial.html @@ -0,0 +1,9 @@ +--- +layout: default +root: ../ +tutorial: true +--- + +

      ← Back to the list of tutorials

      + +{{ content }} diff --git a/docs/css/screen.css b/docs/css/screen.css index 6b609feaa8d..b7eebfb6491 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -209,6 +209,13 @@ td { filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); } + .nav li a.active { + color: black; + + background-color: rgba(0,0,0,0.06); + + filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eff0f1', EndColorStr='#f6f7f8'); + } .nav li a.github-link, .nav li a.twitter-link, .nav li a.forum-link { diff --git a/examples/custom-icons.md b/examples/custom-icons.md index 7ca68043ea0..7d95ef382e1 100644 --- a/examples/custom-icons.md +++ b/examples/custom-icons.md @@ -1,12 +1,8 @@ --- -layout: default +layout: tutorial title: Markers With Custom Icons -root: ../ --- -[← Back to the list of examples](../examples.html) - - ### Markers With Custom Icons In this example, you'll learn how to easily define your own icons for use by the markers you put on the map. diff --git a/examples/geojson.html b/examples/geojson.html index 6ccb95c30bd..f7c1bdb0fac 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -1,10 +1,8 @@ --- -layout: default +layout: tutorial title: Using GeoJSON with Leaflet -root: ../ --- -

      ← Back to the list of examples

      Using GeoJSON with Leaflet

      GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

      diff --git a/examples/layers-control.html b/examples/layers-control.html index 45c525916a1..d36690540a8 100644 --- a/examples/layers-control.html +++ b/examples/layers-control.html @@ -1,10 +1,8 @@ --- -layout: default +layout: tutorial title: Layer Groups and Layers Control -root: ../ --- -

      ← Back to the list of examples

      Layer Groups and Layers Control

      This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

      diff --git a/examples/mobile.html b/examples/mobile.html index 2ac04cec439..ef7f067583f 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -1,10 +1,8 @@ --- -layout: default +layout: tutorial title: Leaflet on Mobile -root: ../ --- -

      ← Back to the list of examples

      Leaflet on Mobile

      In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

      diff --git a/examples/quick-start.md b/examples/quick-start.md index 17d8eb0ec17..3a773e8cc86 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -1,12 +1,8 @@ --- -layout: default +layout: tutorial title: Quick Start Guide -root: ../ --- -[← Back to the list of examples](../examples.html) - - ### Leaflet Quick Start Guide This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events. @@ -234,4 +230,4 @@ Now you've learned Leaflet basics and can start building map apps straight away! var polygon3 = new L.Polygon(polygonPoints); polygon3.bindPopup("I am a polygon."); map3.addLayer(polygon3); - \ No newline at end of file + From 5806d6bc6dac9e4f8be84203c1e9561431ac60df Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 12:15:00 +0300 Subject: [PATCH 185/816] add lineutil and polyutil docs --- reference.html | 90 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index bbc16ef5cca..34ad4bf327b 100644 --- a/reference.html +++ b/reference.html @@ -90,8 +90,8 @@

      Utility

    27. Browser
    28. Util
    29. Transformation
    30. -
    31. LineUtil
    32. -
    33. PolyUtil
    34. +
    35. LineUtil
    36. +
    37. PolyUtil
    38. DOM Utility

        @@ -121,6 +121,8 @@

        Misc

        + +

        This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch

        @@ -3872,6 +3874,90 @@

        Properties

      MethodReturnsDescription
      addTo( <Map> map ) this Adds the popup to the map.
      MethodReturnsDescriptionopenOn( <Map> map )thisAdds the popup to the map and closes the previous one. The same as map.openPopup(popup).
      setLatLng( <LatLng> latlng )
      +

      L.LineUtil

      + +

      Various utility functions for polyine points processing, used by Leaflet internally to make polylines lightning-fast.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      simplify( + <Point[]> points, + <Number> tolerance ) + Point[]Dramatically reduces the number of points in a polyline while retaining its shape and returns a new array of simplified points. 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.
      pointToSegmentDistance( + <Point> p, + <Point> p1, + <Point> p2 ) + NumberReturns the distance between point p and segment p1 to p2.
      closestPointOnSegment( + <Point> p, + <Point> p1, + <Point> p2 ) + NumberReturns the closest point from a point p on a segment p1 to p2.
      clipSegment( + <Point> a, + <Point> b, + <Bounds> bounds ) + -Clips the segment a to b by rectangular bounds (modifying the segment points directly!). Used by Leaflet to only show polyline points that are on the screen or near, increasing performance.
      + + + +

      L.PolyUtil

      + +

      Various utility functions for polygon geometries.

      + +

      Methods

      + + + + + + + + + + + + + + +
      MethodReturnsDescription
      clipPolygon( + <Point[]> points, + <Bounds> bounds ) + Point[]Clips the polygon geometry defined by the given points by rectangular bounds. 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 seperate method for it.
      + +

      L.DomUtil

      From cff5d6552802e5bae0695aeb65ea5e7e1dea4222 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 12:45:18 +0300 Subject: [PATCH 186/816] color method arguments --- docs/css/screen.css | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index b7eebfb6491..fae3f9fb537 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -354,7 +354,7 @@ table td:last-child { } table td code i { - color: black; + color: #00A707; } table td code b { @@ -441,3 +441,17 @@ dl dd { .plugins td { color: black; } + + +#back-to-top { + text-decoration: none; + padding: 0px 10px 2px; + background: white; + color: black; + font-weight: bold; + font-size: 16px; + position: fixed; + top: -1px; + left: 0; + box-shadow: 0 3px 20px rgba(0, 0, 0, 0.1); +} From 8827c66c6c1fa265ba217c9424035eb86dcf3626 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 12:45:52 +0300 Subject: [PATCH 187/816] improve docs html formatting --- reference.html | 854 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 697 insertions(+), 157 deletions(-) diff --git a/reference.html b/reference.html index 34ad4bf327b..d2497d7a0a4 100644 --- a/reference.html +++ b/reference.html @@ -147,11 +147,16 @@

      Constructor

      Description - L.Map( <HTMLElement|String> id, <Map options> options? ) + L.Map( + <HTMLElement|String> id, + <Map options> options? ) + + new L.Map()
      L.map() + Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below. @@ -513,12 +518,18 @@

      Methods for Modifying Map State

      Description - setView( <LatLng> center, <Number> zoom, <Boolean> forceReset? ) + setView( + <LatLng> center, + <Number> zoom, + <Boolean> forceReset? ) + this Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). - setZoom( <Number> zoom ) + setZoom( + <Number> zoom ) + this Sets the zoom of the map. @@ -533,7 +544,9 @@

      Methods for Modifying Map State

      Decreases the zoom of the map by 1. - fitBounds( <LatLngBounds> bounds ) + fitBounds( + <LatLngBounds> bounds ) + this Sets a map view that contains the given geographical bounds with the maximum zoom level possible. @@ -543,17 +556,23 @@

      Methods for Modifying Map State

      Sets a map view that mostly contains the whole world with the maximum zoom level possible. - panTo( <LatLng> latlng ) + panTo( + <LatLng> latlng ) + this Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. - panInsideBounds( <LatLngBounds> bounds ) + panInsideBounds( + <LatLngBounds> bounds ) + this Pans the map to the closest view that would lie inside the given bounds (if it's not already). - panBy( <Point> point ) + panBy( + <Point> point ) + this Pans the map by a given number of pixels (animated). @@ -563,12 +582,16 @@

      Methods for Modifying Map State

      Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. - setMaxBounds( <LatLngBounds> bounds ) + setMaxBounds( + <LatLngBounds> bounds ) + this Restricts the map view to the given bounds (see map maxBounds option). - locate( <Locate options> options? ) + locate( + <Locate options> options? ) + this Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure, and optionally sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). See Locate options for more details. @@ -613,8 +636,13 @@

      Methods for Getting Map State

      Returns the LatLngBounds of the current map view. - getBoundsZoom( <LatLngBounds> bounds, <Boolean> inside? ) + getBoundsZoom( + <LatLngBounds> bounds, + <Boolean> inside? ) + + Number + Returns the maximum zoom level on which the given bounds fit to the map view in its entirety. If inside (optional) is set to true, the method instead returns the minimum zoom level on which the map view fits into the given bounds in its entirety. @@ -643,23 +671,36 @@

      Methods for Layers and Controls

      Description - addLayer( <ILayer> layer, <Boolean> insertAtTheBottom? ) + addLayer( + <ILayer> layer, + <Boolean> insertAtTheBottom? ) + + this Adds the given layer to the map. If optional insertAtTheBottom is set to true, the layer is inserted under all others (useful when switching base tile layers). - removeLayer( <ILayer> layer ) + removeLayer( + <ILayer> layer ) + + this Removes the given layer from the map. - hasLayer( <ILayer> layer ) + hasLayer( + <ILayer> layer ) + + Boolean Returns true if the given layer is currently added to the map. - openPopup( <Popup> popup ) + 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). @@ -669,12 +710,18 @@

      Methods for Layers and Controls

      Closes the popup opened with openPopup. - addControl( <IControl> control ) + addControl( + <IControl> control ) + + this Adds the given control to the map. - removeControl( <IControl> control ) + removeControl( + <IControl> control ) + + this Removes the given control from the map. @@ -690,57 +737,92 @@

      Conversion Methods

      Description - latLngToLayerPoint( <LatLng> latlng ) + latLngToLayerPoint( + <LatLng> latlng ) + + Point Returns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map). - layerPointToLatLng( <Point> point ) + layerPointToLatLng( + <Point> point ) + + LatLng Returns the geographical coordinates of a given map layer point. - containerPointToLayerPoint( <Point> point ) + containerPointToLayerPoint( + <Point> point ) + + Point Converts the point relative to the map container to a point relative to the map layer. - layerPointToContainerPoint( <Point> point ) + layerPointToContainerPoint( + <Point> point ) + + Point Converts the point relative to the map layer to a point relative to the map container. - latLngToContainerPoint( <LatLng> latlng ) + latLngToContainerPoint( + <LatLng> latlng ) + + Point Returns the map container point that corresponds to the given geographical coordinates. - containerPointToLatLng( <Point> point ) + containerPointToLatLng( + <Point> point ) + + LatLng Returns the geographical coordinates of a given map container point. - project( <LatLng> latlng, <Number> zoom? ) + project( + <LatLng> latlng, + <Number> zoom? ) + + Point Projects the given geographical coordinates to absolute pixel coordinates for the given zoom level (current zoom level by default). - unproject( <Point> point, <Number> zoom? ) + unproject( + <Point> point, + <Number> zoom? ) + + LatLng Projects the given absolute pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default). - mouseEventToContainerPoint( <MouseEvent> event ) + mouseEventToContainerPoint( + <MouseEvent> event ) + + Point Returns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object. - mouseEventToLayerPoint( <MouseEvent> event ) + mouseEventToLayerPoint( + <MouseEvent> event ) + + Point Returns the pixel coordinates of a mouse click relative to the map layer given its event object. - mouseEventToLatLng( <MouseEvent> event ) + mouseEventToLatLng( + <MouseEvent> event ) + + LatLng Returns the geographical coordinates of the point the mouse clicked on given the click's event object. @@ -954,11 +1036,16 @@

      Constructor

      Description - L.Marker( <LatLng> latlng, <Marker options> options? ) + L.Marker( + <LatLng> latlng, + <Marker options> options? ) + + new L.Marker()
      L.marker() + Instantiates a Marker object given a geographical point and optionally an options object. @@ -1071,7 +1158,10 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the marker to the map. @@ -1081,32 +1171,49 @@

      Methods

      Returns the current geographical position of the marker. - setLatLng( <LatLng> latlng ) + setLatLng( + <LatLng> latlng ) + + this Changes the marker position to the given point. - setIcon( <Icon> icon ) + setIcon( + <Icon> icon ) + + this Changes the marker icon. - setZIndexOffset( <Number> offset ) + setZIndexOffset( + <Number> offset ) + + this Changes the zIndex offset of the marker. - setOpacity( <Number> opacity ) + setOpacity( + <Number> opacity ) + this Changes the opacity of the marker. - update() + update() + + this Updates the marker position, useful if coordinates of its latLng object were changed directly. - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( + <String> htmlContent, + <Popup options> options? ) + + this Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method. @@ -1171,11 +1278,16 @@

      Constructor

      Description - L.Popup( <Popup options> options?, <object> source? ) + L.Popup( + <Popup options> options?, + <object> source? ) + + new L.Popup()
      L.popup() + Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers. @@ -1222,13 +1334,15 @@ offset Point - Point(0, 0) + Point(0, 0) + The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays. autoPanPadding Point - Point(5, 5) + Point(5, 5) + The margin between the popup and the edges of the map view after autopanning was performed. @@ -1242,22 +1356,34 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the popup to the map. - openOn( <Map> map ) + openOn( + <Map> map ) + + this Adds the popup to the map and closes the previous one. The same as map.openPopup(popup). - setLatLng( <LatLng> latlng ) + setLatLng( + <LatLng> latlng ) + + this Sets the geographical point where the popup will open. - setContent( <String> htmlContent ) + setContent( + <String> htmlContent ) + + this Sets the HTML content of the popup. @@ -1285,11 +1411,16 @@

      Constructor

      Description - L.TileLayer( <String> urlTemplate, <TileLayer options> options? ) + L.TileLayer( + <String> urlTemplate, + <TileLayer options> options? ) + + new L.TileLayer()
      L.tileLayer() + Instantiates a tile layer object given a URL template and optionally an options object. @@ -1422,7 +1553,10 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the layer to the map. @@ -1437,7 +1571,10 @@

      Methods

      Brings the tile layer to the bottom of all tile layers. - setOpacity( <Number> opacity ) + setOpacity( + <Number> opacity ) + + this Changes the opacity of the tile layer. @@ -1447,7 +1584,9 @@

      Methods

      Causes the layer to clear all the tiles and request them again. - setUrl( <String> urlTemplate ) + setUrl( + <String> urlTemplate ) + this Updates the layer's URL template and redraws it. @@ -1477,11 +1616,16 @@

      Constructor

      Description - L.TileLayer.WMS( <String> baseUrl, <TileLayer.WMS options> options ) + L.TileLayer.WMS( + <String> baseUrl, + <TileLayer.WMS options> options ) + + new L.TileLayer.WMS()
      L.tileLayer.wms() + Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object. @@ -1538,7 +1682,10 @@

      Methods

      Description - setParams( <WMS parameters> params, <Boolean> noRedraw? ) + setParams( + <WMS parameters> params, + <Boolean> noRedraw? ) + this Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true). @@ -1567,7 +1714,9 @@

      Constructor

      Description - L.TileLayer.Canvas( <TileLayer options> options? ) + L.TileLayer.Canvas( + <TileLayer options> options? ) + new L.TileLayer.Canvas()
      L.tileLayer.canvas() @@ -1585,7 +1734,11 @@

      Methods

      Description - drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, <Number> zoom ) + drawTile( + <HTMLCanvasElement> canvas, + <Point> tilePoint, + <Number> zoom ) + this You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom. @@ -1617,11 +1770,17 @@

      Constructor

      Description - L.ImageOverlay( <String> imageUrl, <LatLngBounds> bounds, <ImageOverlay options> options? ) + L.ImageOverlay( + <String> imageUrl, + <LatLngBounds> bounds, + <ImageOverlay options> options? ) + + new L.ImageOverlay()
      L.imageOverlay() + Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to. @@ -1650,12 +1809,18 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the overlay to the map. - setOpacity( <Number> opacity ) + setOpacity( + <Number> opacity ) + + this Sets the opacity of the overlay. @@ -1773,22 +1938,35 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the layer to the map. - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( + <String> htmlContent, + <Popup options> options? ) + + this Binds a popup with a particular HTML content to a click on this path. - openPopup( <LatLng> latlng? ) + openPopup( + <LatLng> latlng? ) + + this Opens the popup previously bound by the bindPopup method in the given point, or in one of the path's points if not specified. - setStyle( <Path options> object ) + setStyle( + <Path options> object ) + + this Changes the appearance of a Path based on the options in the Path options object. @@ -1869,11 +2047,16 @@

      Constructor

      Description - L.Polyline( <LatLng[]> latlngs, <Polyline options> options? ) + L.Polyline( + <LatLng[]> latlngs, + <Polyline options> options? ) + + new L.Polyline()
      L.polyline() + Instantiates a polyline object given an array of geographical points and optionally an options object. @@ -1914,12 +2097,18 @@

      Methods

      Description - addLatLng( <LatLng> latlng ) + addLatLng( + <LatLng> latlng ) + + this Adds a given point to the polyline. - setLatLngs( <LatLng[]> latlngs ) + setLatLngs( + <LatLng[]> latlngs ) + + this Replaces all the points in the polyline with the given array of geographical points. @@ -1929,7 +2118,12 @@

      Methods

      Returns an array of the points in the path. - spliceLatLngs( <Number> index, <Number> pointsToRemove, <LatLng> latlng?, … ) + spliceLatLngs( + <Number> index, + <Number> pointsToRemove, + <LatLng> latlng?, … ) + + LatLng[] Allows adding, removing or replacing points in the polyline. Syntax is the same as in Array#splice. Returns the array of removed points (if any). @@ -1955,11 +2149,16 @@

      Constructor

      Description - L.MultiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) + L.MultiPolyline( + <LatLng[][]> latlngs, + <Polyline options> options? ) + + new L.MultiPolyline()
      L.multiPolyline() + Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object. @@ -1981,11 +2180,16 @@

      Constructor

      Description - L.Polygon( <LatLng[]> latlngs, <Polyline options> options? ) + L.Polygon( + <LatLng[]> latlngs, + <Polyline options> options? ) + + new L.Polygon()
      L.polygon() + Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside. @@ -2007,11 +2211,16 @@

      Constructor

      Description - L.MultiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) + L.MultiPolygon( + <LatLng[][]> latlngs, + <Polyline options> options? ) + + new L.MultiPolygon()
      L.multiPolygon() + Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline). @@ -2039,11 +2248,16 @@

      Constructor

      Description - L.Rectangle( <LatLngBounds> bounds, <Path options> options? ) + L.Rectangle( + <LatLngBounds> bounds, + <Path options> options? ) + + new L.Rectangle()
      L.rectangle() + Instantiates a rectangle object with the given geographical bounds and optionally an options object. @@ -2059,7 +2273,10 @@

      Methods

      Description - setBounds( <LatLngBounds> bounds ) + setBounds( + <LatLngBounds> bounds ) + + this Redraws the rectangle with the passed bounds. @@ -2081,11 +2298,17 @@

      Constructor

      Description - L.Circle( <LatLng> latlng, <Number> radius, <Path options> options? ) + L.Circle( + <LatLng> latlng, + <Number> radius, + <Path options> options? ) + + new L.Circle()
      L.circle() + Instantiates a circle object given a geographical point, a radius in meters and optionally an options object. @@ -2109,12 +2332,18 @@

      Methods

      Returns the current radius of a circle. Units are in meters. - setLatLng( <LatLng> latlng ) + setLatLng( + <LatLng> latlng ) + + this Sets the position of a circle to a new location. - setRadius( <Number> radius ) + setRadius( + <Number> radius ) + + this Sets the radius of a circle. Units are in meters. @@ -2135,11 +2364,16 @@

      Constructor

      Description - L.CircleMarker( <LatLng> latlng, <Path options> options? ) + L.CircleMarker( + <LatLng> latlng, + <Path options> options? ) + + new L.CircleMarker()
      L.circleMarker() + Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object. @@ -2153,12 +2387,18 @@

      Methods

      Description - setLatLng( <LatLng> latlng ) + setLatLng( + <LatLng> latlng ) + + this Sets the position of a circle marker to a new location. - setRadius( <Number> radius ) + setRadius( + <Number> radius ) + + this Sets the radius of a circle marker. Units are in pixels. @@ -2183,11 +2423,15 @@

      Constructor

      Description - L.LayerGroup( <ILayer[]> layers? ) + L.LayerGroup( + <ILayer[]> layers? ) + + new L.LayerGroup()
      L.layerGroup() + Create a layer group, optionally given an initial set of layers. @@ -2201,17 +2445,26 @@

      Methods

      Description - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the group of layers to the map. - addLayer( <ILayer> layer ) + addLayer( + <ILayer> layer ) + + this Adds a given layer to the group. - removeLayer( <ILayer> layer ) + removeLayer( + <ILayer> layer ) + + this Removes a given layer from the group. @@ -2242,11 +2495,15 @@

      Constructor

      Description - L.FeatureGroup( <IFeature[]> layers? ) + L.FeatureGroup( + <IFeature[]> layers? ) + + new L.FeatureGroup()
      L.featureGroup() + Create a layer group, optionally given an initial set of layers. @@ -2262,7 +2519,11 @@

      Methods

      Description - bindPopup( <String> htmlContent, <Popup options> options? ) + bindPopup( + <String> htmlContent, + <Popup options> options? ) + + this Binds a popup with a particular HTML content to a click on any layer from the group that has a bindPopup method. @@ -2272,7 +2533,9 @@

      Methods

      Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children). - setStyle( <Path options> style ) + setStyle( + <Path options> style ) + this Sets the given path options to each layer of the group that has a setStyle method. @@ -2343,11 +2606,16 @@

      Constructor

      Description - L.GeoJSON( <Object> geojson?, <GeoJSON options> options? ) + L.GeoJSON( + <Object> geojson?, + <GeoJSON options> options? ) + + new L.GeoJSON()
      L.geoJson() + Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object. @@ -2360,19 +2628,34 @@

      Options

      Description - pointToLayer( <GeoJSON> featureData, <LatLng> latlng ) + pointToLayer( + <GeoJSON> featureData, + <LatLng> latlng ) + + Function that will be used for creating layers for GeoJSON points (if not specified, simple markers will be created). - style( <GeoJSON> featureData ) + style( + <GeoJSON> featureData ) + + Function that will be used to get style options for vector layers created for GeoJSON features. - onEachFeature( <GeoJSON> featureData, <ILayer> layer ) + onEachFeature( + <GeoJSON> featureData, + <ILayer> layer ) + + Function that will be called on each created feature layer. Useful for attaching events and popups to features. - filter( <GeoJSON> featureData, <ILayer> layer ) + filter( + <GeoJSON> featureData, + <ILayer> layer ) + + Function that will be used to decide whether to show a feature or not. @@ -2387,7 +2670,10 @@

      Methods

      Description - addData( <GeoJSON> data ) + addData( + <GeoJSON> data ) + + Boolean Adds a GeoJSON object to the layer. @@ -2402,17 +2688,30 @@

      Static methods

      Description - geometryToLayer( <GeoJSON> featureData, <Function> pointToLayer? ) + geometryToLayer( + <GeoJSON> featureData, + <Function> pointToLayer? ) + + ILayer Creates a layer from a given GeoJSON feature. - coordsToLatlng( <Array> coords, <Boolean> reverse? ) + coordsToLatlng( + <Array> coords, + <Boolean> reverse? ) + + LatLng Creates a LatLng object from an array of 2 numbers (latitude, longitude) used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted as (longitude, latitude). - coordsToLatlngs( <Array> coords, <Number> levelsDeep?, <Boolean> reverse? ) + coordsToLatlngs( + <Array> coords, + <Number> levelsDeep?, + <Boolean> reverse? ) + + Array Creates a multidimensional array of LatLng objects 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). If reverse is set to true, the numbers will be interpreted as (longitude, latitude). @@ -2440,12 +2739,18 @@

      Constructor

      Description - L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) + L.LatLng( + <Number> latitude, + <Number> longitude, + <Boolean> noWrap? ) + + new L.LatLng()
      L.latLng()
      L.latLng([]) + Creates an object representing a geographical point with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument. @@ -2479,12 +2784,18 @@

      Methods

      Description - distanceTo( <LatLng> otherLatlng ) + distanceTo( + <LatLng> otherLatlng ) + + Number Returns the distance (in meters) to the given LatLng calculated using the Haversine formula. See description on wikipedia - equals( <LatLng> otherLatlng ) + equals( + <LatLng> otherLatlng ) + + Boolean Returns true if the given LatLng point is at the same position (within a small margin of error). @@ -2550,16 +2861,24 @@

      Constructor

      Description - L.LatLngBounds( <LatLng> southWest, <LatLng> northEast ) + + L.LatLngBounds( + <LatLng> southWest, + <LatLng> northEast ) + + new L.LatLngBounds()
      L.latLngBounds()
      L.latLngBounds([]) + Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle. - L.LatLngBounds( <LatLng[]> latlngs ) + L.LatLngBounds( + <LatLng[]> latlngs ) + new L.LatLngBounds()
      L.latLngBounds() @@ -2577,7 +2896,10 @@

      Methods

      Description - extend( <LatLng|LatLngBounds> latlng ) + extend( + <LatLng|LatLngBounds> latlng ) + + this Extends the bounds to contain the given point or bounds. @@ -2607,22 +2929,34 @@

      Methods

      Returns the center point of the bounds. - contains( <LatLngBounds> otherBounds ) + contains( + <LatLngBounds> otherBounds ) + + Boolean Returns true if the rectangle contains the given one. - contains( <LatLng> latlng ) + contains( + <LatLng> latlng ) + + Boolean Returns true if the rectangle contains the given point. - intersects( <LatLngBounds> otherBounds ) + intersects( + <LatLngBounds> otherBounds ) + + Boolean Returns true if the rectangle intersects the given bounds. - equals( <LatLngBounds> otherBounds ) + equals( + <LatLngBounds> otherBounds ) + + Boolean Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. @@ -2632,7 +2966,10 @@

      Methods

      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. - pad( <Number> bufferRatio ) + pad( + <Number> bufferRatio ) + + LatLngBounds Returns bigger bounds created by extending the current bounds by a given percentage in each direction. @@ -2661,12 +2998,17 @@

      Constructor

      Description - L.Point( <Number> x, <Number> y, <Boolean> round? ) + L.Point( + <Number> x, <Number> y, + <Boolean> round? ) + + new L.Point()
      L.point()
      L.point([]) + Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values. @@ -2700,27 +3042,43 @@

      Methods

      Description - add( <Point> otherPoint ) + add( + <Point> otherPoint ) + + Point Returns the result of addition of the current and the given points. - subtract( <Point> otherPoint ) + subtract( + <Point> otherPoint ) + + Point Returns the result of subtraction of the given point from the current. - multiplyBy( <Number> number ) + multiplyBy( + <Number> number ) + + Point Returns the result of multiplication of the current point by the given number. - divideBy( <Number> number, <Boolean> round? ) + divideBy( + <Number> number, + <Boolean> round? ) + + Point Returns the result of division of the current point by the given number. If optional round is set to true, returns a rounded result. - distanceTo( <Point> otherPoint ) + distanceTo( + <Point> otherPoint ) + + Number Returns the distance between the current and the given points. @@ -2763,20 +3121,29 @@

      Constructor

      Description - L.Bounds( <Point> topLeft, <Point> bottomRight ) + L.Bounds( + <Point> topLeft, + <Point> bottomRight ) + + new L.Bounds()
      L.bounds()
      L.bounds([]) + Creates a Bounds object from two coordinates (usually top-left and bottom-right corners). - L.LatLngBounds( <Point[]> points ) + L.LatLngBounds( + <Point[]> points ) + + new L.Bounds()
      L.bounds() + Creates a Bounds object defined by the points it contains. @@ -2810,7 +3177,10 @@

      Methods

      Description - extend( <Point> point ) + extend( + <Point> point ) + + - Extends the bounds to contain the given point. @@ -2820,17 +3190,26 @@

      Methods

      Returns the center point of the bounds. - contains( <Bounds> otherBounds ) + contains( + <Bounds> otherBounds ) + + Boolean Returns true if the rectangle contains the given one. - contains( <Point> point ) + contains( + <Point> point ) + + Boolean Returns true if the rectangle contains the given point. - intersects( <Bounds> otherBounds ) + intersects( + <Bounds> otherBounds ) + + Boolean Returns true if the rectangle intersects the given bounds. @@ -2864,11 +3243,15 @@

      Constructor

      Description - L.Icon( <Icon options> options ) + L.Icon( + <Icon options> options ) + + new L.Icon()
      L.icon() + Creates an icon instance with the given options. @@ -2939,11 +3322,15 @@

      Constructor

      Description - L.DivIcon( <DivIcon options> options ) + L.DivIcon( + <DivIcon options> options ) + + new L.DivIcon()
      L.divIcon() + Creates a div icon instance with the given options. @@ -2992,11 +3379,15 @@

      Constructor

      Description - L.Control( <Control options> options? ) + L.Control( + <Control options> options? ) + + new L.Control()
      L.control() + Creates a control with the given options. @@ -3025,7 +3416,10 @@

      Methods

      Description - setPosition( <String> position ) + setPosition( + <String> position ) + + this Sets the position of the control. See control positions. @@ -3035,12 +3429,18 @@

      Methods

      Returns the current position of the control. - addTo( <Map> map ) + addTo( + <Map> map ) + + this Adds the control to the map. - removeFrom( <Map> map ) + removeFrom( + <Map> map ) + + this Removes the control from the map. @@ -3086,11 +3486,15 @@

      Constructor

      Description - L.Control.Zoom( <Control.Zoom options> options? ) + L.Control.Zoom( + <Control.Zoom options> options? ) + + new L.Control.Zoom()
      L.control.zoom() + Creates a zoom control. @@ -3125,11 +3529,15 @@

      Constructor

      Description - L.Control.Attribution( <Control.Attribution options> options? ) + L.Control.Attribution( + <Control.Attribution options> options? ) + + new L.Control.Attribution()
      L.control.attribution() + Creates an attribution control. @@ -3164,17 +3572,23 @@

      Methods

      Description - setPrefix( <String> prefix ) + setPrefix( + <String> prefix ) + this Sets the text before the attributions. - addAttribution( <String> text ) + addAttribution( + <String> text ) + this Adds an attribution text (e.g. 'Vector data &copy; CloudMade'). - removeAttribution( <String> text ) + removeAttribution( + <String> text ) + this Removes an attribution text. @@ -3205,7 +3619,11 @@

      Constructor

      Description - L.Control.Layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? ) + L.Control.Layers( + <Layer Config> baseLayers?, + <Layer Config> overlays?, + <Control.Layers options> options? ) + new L.Control.Layers()
      L.control.layers() @@ -3222,17 +3640,25 @@

      Methods

      Description - addBaseLayer( <ILayer> layer, <String> name ) + addBaseLayer( + <ILayer> layer, + <String> name ) + this Adds a base layer (radio button entry) with the given name to the control. - addOverlay( <ILayer> layer, <String> name ) + addOverlay( + <ILayer> layer, + <String> name ) + this Adds an overlay (checkbox entry) with the given name to the control. - removeLayer( <ILayer> layer ) + removeLayer( + <ILayer> layer ) + this Remove the given layer from the control. @@ -3287,11 +3713,15 @@

      Constructor

      Description - L.Control.Scale( <Control.Scale options> options? ) + L.Control.Scale( + <Control.Scale options> options? ) + + new L.Control.Attribution()
      L.control.attribution() + Creates an scale control with the given options. @@ -3364,32 +3794,57 @@

      Methods

      Description - addEventListener( <String> type, <Function> fn, <Object> context? ) + addEventListener( + <String> type, + <Function> fn, + <Object> context? ) + + 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'). - addEventListener( <Object> eventMap, <Object> context? ) + addEventListener( + <Object> eventMap, + <Object> context? ) + + this Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} - removeEventListener( <String> type, <Function> fn?, <Object> context? ) + removeEventListener( + <String> type, + <Function> fn?, + <Object> context? ) + + 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. - removeEventListener( <Object> eventMap, <Object> context? ) + removeEventListener( + <Object> eventMap, + <Object> context? ) + + this Removes a set of type/listener pairs.
      - hasEventListeners( <String> type ) + hasEventListeners( + <String> type ) + + Boolean Returns true if a particular event type has some listeners attached to it. - fireEvent( <String> type, <Object> data? ) + fireEvent( + <String> type, + <Object> data? ) + + 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. @@ -3793,17 +4248,25 @@

      Methods

      Description - extend( <Object> dest, <Object> src?.. ) + extend( + <Object> dest, + <Object> src?.. ) + + Object Merges the properties of the src object (or multiple objects) into dest object and returns the latter. - bind( <Function> fn, <Object> obj ) + bind( + <Function> fn, + <Object> obj ) + + Function Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). - stamp( <Object> obj ) + stamp( <Object> obj ) String Applies a unique key to the object and returns that key. @@ -3821,7 +4284,12 @@

      Methods

      --> - limitExecByInterval(
      <Function> fn, <Number> time, <Object> context? ) + limitExecByInterval( + <Function> fn, + <Number> time, + <Object> context? ) + + Function Returns a wrapper around the function fn that makes sure it's called not more often than a certain time interval time, but as fast as possible otherwise (for example, it is used for checking and requesting new tiles while dragging the map), optionally passing the scope (context) in which the function will be called. @@ -3832,27 +4300,44 @@

      Methods

      Returns a function which always returns false. - formatNum( <Number> num, <Number> digits ) + formatNum( + <Number> num, + <Number> digits ) + + Number Returns the number num rounded to digits decimals. - splitWords( <String> str ) + splitWords( + <String> str ) + + String[] Trims and splits the string on whitespace and returns the array of parts.
      - setOptions( <Object> obj, <Object> options ) + setOptions( + <Object> obj, + <Object> options ) + + Object Merges the given properties to the options of the obj object, returning the resulting options. See Class options. - getParamString( <Object> obj ) + getParamString( + <Object> obj ) + + String Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} translates to '?a=foo&b=bar'. - template( <String> str, <Object> data ) + template( + <String> str, <Object> data ) + + String Simple templating facility, creates a string by applying the values of the data object of a form {a: 'foo', b: 'bar', …} to a template string of the form 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. @@ -3972,23 +4457,39 @@

      Methods

      Description - get( <String or HTMLElement> id ) + get( + <String or HTMLElement> id ) + + HTMLElement Returns an element with the given id if a string was passed, or just returns the element if it was passed directly. - getStyle( <HTMLElement> el, <String> style ) + getStyle( + <HTMLElement> el, + <String> style ) + + String Returns the value for a certain style attribute on an element, including computed values or values set through CSS. - getViewportOffset( <HTMLElement> el ) + getViewportOffset( + <HTMLElement> el ) + + Point Returns the offset to the viewport for the requested element. - create( <String> tagName, <String> className, <HTMLElement> container? ) + create( + <String> tagName, + <String> className, + <HTMLElement> container? ) + + HTMLElement + Creates an element with tagName, sets the className, and optionally appends it to container element. @@ -4002,47 +4503,84 @@

      Methods

      Makes text selection possible again. - hasClass( <HTMLElement> el, <String> name ) + hasClass( + <HTMLElement> el, + <String> name ) + + Boolean + Returns true if the element class attribute contains name. - addClass( <HTMLElement> el, <String> name ) + addClass( + <HTMLElement> el, + <String> name ) + + - + Adds name to the element's class attribute. - removeClass( <HTMLElement> el, <String> name ) + removeClass( + <HTMLElement> el, + <String> name ) + + - + Removes name from the element's class attribute. - setOpacity( <HTMLElement> el, <Number> value ) + setOpacity( + <HTMLElement> el, + <Number> value ) + + - Set the opacity of an element (including old IE support). Value must be from 0 to 1. - testProp( <String[]> props ) + testProp( + <String[]> props ) + + String or 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. - getTranslateString( <Point> point ) + getTranslateString( + <Point> point ) + + String Returns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers. - getScaleString( <Number> scale, <Point> origin ) + getScaleString( + <Number> scale, + <Point> origin ) + + String Returns a CSS transform string to scale an element (with the given scale origin). - setPosition( <HTMLElement> el, <Point> point, <Boolean> disable3D? ) + setPosition( + <HTMLElement> el, + <Point> point, + <Boolean> disable3D? ) + + - Sets the position of an element to coordinates specified by point, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true. - getPosition( <HTMLElement> el ) + getPosition( + <HTMLElement> el ) + + Point Returns the coordinates of an element previously positioned with setPosition. @@ -4057,12 +4595,14 @@

      Properties

      Description - TRANSITION + TRANSITION + String Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit). - TRANSFORM + TRANSFORM + String Vendor-prefixed transform style name. From b8b161d7a25930605d16b3c1dc5078e79131351d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 17:22:08 +0300 Subject: [PATCH 188/816] more docs updates, ilayer and icontrol docs at last! --- DOCS-TODO | 25 ++----- docs/css/screen.css | 4 +- examples.md | 5 +- reference.html | 169 +++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 167 insertions(+), 36 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index b2d65e29090..6b4beebd87e 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -5,15 +5,6 @@ NEW Transformation transform(point, scale) untransform(point, scale) -NEW LineUtil - simplify(points, tolerance) - pointToSegmentDistance(p, p1, p2) - closestPointOnSegment(p, p1, p2) - clipSegment(a, b, bounds) - -NEW PolyUtil - clipPolygon(points, bounds) - NEW DomEvent addListener(obj, type, fn, context) on @@ -54,18 +45,6 @@ NEW Draggable drag dragend -NEW ILayer - onAdd(map) - onRemove(map) - - important events: viewreset, moveend - - options.minZoom and options.maxZoom - -NEW IControl - onAdd(map) - onRemove(map) - NEW IProjection project(latlng) unproject(point) @@ -75,3 +54,7 @@ NEW ICRS pointToLatLng(point, zoom) project(latlng) scale(zoom) + +ILayer options.minZoom and options.maxZoom? +Map.addHandler? + diff --git a/docs/css/screen.css b/docs/css/screen.css index fae3f9fb537..92bcf902069 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -102,8 +102,8 @@ h3.alt { font-weight: normal; } -code { - font-family: "Courier New", monospace; +.container code, .container pre code { + font-family: "Consolas", "Lucida Console", "Courier New", monospace; } .container pre code { padding: 10px 15px; diff --git a/examples.md b/examples.md index 7cf74780223..f273915c517 100644 --- a/examples.md +++ b/examples.md @@ -42,7 +42,7 @@ In this example, you'll learn how to create and interact with map vectors create A tutorial on how to manage groups of layers and use the layer switching control. -*** + *** -More examples coming soon! +If you find that an important tutorial is missing here, let us know! [1]: examples/quick-start.html [2]: examples/mobile.html diff --git a/reference.html b/reference.html index d2497d7a0a4..75df9668267 100644 --- a/reference.html +++ b/reference.html @@ -105,9 +105,9 @@

      DOM Utility

      Interfaces

      @@ -189,7 +189,7 @@

      Map State Options

      layers - ILayer[] + ILayer[] null Layers that will be added to the map initially. @@ -426,7 +426,7 @@

      Events

      Event Fired when the map is initialized (when its center and zoom are set for the first time). - + viewreset Event Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays. @@ -441,7 +441,7 @@

      Events

      Event Fired on any movement of the map view. - + moveend Event Fired when the view of the map ends changed (e.g. user stopped dragging the map). @@ -672,7 +672,7 @@

      Methods for Layers and Controls

      addLayer( - <ILayer> layer, + <ILayer> layer, <Boolean> insertAtTheBottom? ) @@ -681,7 +681,7 @@

      Methods for Layers and Controls

      removeLayer( - <ILayer> layer ) + <ILayer> layer ) this @@ -689,7 +689,7 @@

      Methods for Layers and Controls

      hasLayer( - <ILayer> layer ) + <ILayer> layer ) Boolean @@ -2479,7 +2479,7 @@

      Methods

      L.FeatureGroup

      -

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements IFeature interface.

      +

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

      L.featureGroup([marker1, marker2, polyline])
       	.bindPopup('Hello world!')
      @@ -2496,7 +2496,7 @@ 

      Constructor

      L.FeatureGroup( - <IFeature[]> layers? ) + <ILayer[]> layers? ) @@ -2693,7 +2693,7 @@

      Static methods

      <Function> pointToLayer? )
      - ILayer + ILayer Creates a layer from a given GeoJSON feature. @@ -4635,6 +4635,153 @@

      IHandler

      + +

      ILayer

      + +

      Represents an object attached to a particular location (or a set of locations) on a map. Implemented by tile layers, markers, popups, image overlays, vector layers and layer groups.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      onAdd( + <Map> map ) + -Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
      onRemove( + <Map> map ) + -Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners preciously added in onAdd. Called on map.removeLayer(layer).
      + +

      Implementing Custom Layers

      + +

      The most important things know about when implementing custom layers are Map viewreset event and latLngToLayerPoint method. viewreset is fired when the map needs to reposition its layers (e.g. on zoom), and latLngToLayerPoint is used to get coordinates for the layer's new position.

      + +

      Another event often used in layer implementations is moveend which fires after any movement of the map (panning, zooming, etc.).

      + +

      Another thing to note is that you'll usually need to add leaflet-zoom-hide class to the DOM elements you create for the layer so that it hides during zoom animation. Implementing zoom animation for custom layers is a complex topic and will be documented separately in future, but meanwhile you can take a look at how it's done for Leaflet layers (e.g. ImageOverlay) in the source.

      + +

      Custom Layer Example

      + +

      Here's how a custom layer implementation usually looks:

      + +
      var MyCustomLayer = L.Class.extend({
      +
      +	initialize: function (latlng) {
      +		// save position of the layer or any options from the constructor
      +		this._latlng = latlng;
      +	},
      +
      +	onAdd: function (map) {
      +		this._map = map;
      +
      +		// create a DOM element and put it into one of the map panes
      +		this._el = L.DomUtil.create('div', 'my-custom-layer leaflet-zoom-hide');
      +		map.getPanes().overlayPane.appendChild(this._el);
      +
      +		// add a viewreset event listener for updating layer's position, do the latter
      +		map.on('viewreset', this._reset, this);
      +		this._reset();
      +	},
      +
      +	onRemove: function (map) {
      +		// remove layer's DOM elements and listeners
      +		map.getPanes().overlayPane.removeChild(this._el);
      +		map.off('viewreset', this._reset, this);
      +	},
      +
      +	_reset: function () {
      +		// update layer's position
      +		var pos = this._map.latLngToLayerPoint(this._latlng);
      +		L.DomUtil.setPosition(this._el, pos);
      +	}
      +});
      +
      +map.addLayer(new MyCustomLayer(latlng));
      +
      + + + +

      IControl

      + +

      Represents a UI element in one of the corners of the map. Implemented by zoom, attribution, scale and layers controls.

      + +

      Methods

      + +

      Every control in Leaflet should extend from Control class and additionally have the following methods:

      + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      onAdd( + <Map> map ) + HTMLElementShould contain code that creates all the neccessary DOM elements for the control, adds listeners on relevant map events, and returns the element containing the control. Called on map.addControl(control) or control.addTo(map).
      onRemove( + <Map> map ) + -Optional, should contain all clean up code (e.g. removes control's event listeners). Called on map.removeControl(control) or control.removeFrom(map). The control's DOM container is removed automatically.
      + +

      Custom Control Example

      + +
      var MyControl = L.Control.extend({
      +	options: {
      +		position: 'topright'
      +	},
      +
      +	onAdd: function (map) {
      +		// create the control container with a particular class name
      +		var container = L.DomUtil.create('div', 'my-custom-control');
      +
      +		// ... initialize other DOM elements, add listeners, etc.
      +
      +		return container;
      +	}
      +});
      +
      +map.addControl(new MyControl());
      +
      + +

      If specify your own contructor for the control, you'll also probably want to process options properly:

      + +
      var MyControl = L.Control.extend({
      +	initialize: function (foo, options) {
      +		// ...
      +		L.Util.setOptions(this, options);
      +	},
      +	// ...
      +});
      + +

      This will allow you to pass options like position when creating the control instances:

      + +
      map.addControl(new MyControl('bar', {position: 'bottomleft'}));
      + +

      Global Switches

      Global switches are created for rare cases and generally make Leaflet to not detect a particular browser feature even if it's there. You need to set the switch as a global variable to true before including Leaflet on the page, like this:

      From b2ec1e086f957890664e7041a231f95cb43cff5b Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Jul 2012 19:20:29 +0300 Subject: [PATCH 189/816] add transformation and domevent docs, improve styles --- DOCS-TODO | 22 ------ docs/css/screen.css | 13 ++++ reference.html | 165 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 176 insertions(+), 24 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index 6b4beebd87e..59d9e754989 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -1,22 +1,4 @@ -NEW Transformation - Transformation(a, b, c, d) - - transform(point, scale) - untransform(point, scale) - -NEW DomEvent - addListener(obj, type, fn, context) - on - removeListener(obj, type, fn) - off - stopPropagation(e) - disableClickPropagation(el) - preventDefault(e) - stop(e) - getMousePosition(e, container) - getWheelDelta(e) - NEW Transition Transition(el, options) @@ -54,7 +36,3 @@ NEW ICRS pointToLatLng(point, zoom) project(latlng) scale(zoom) - -ILayer options.minZoom and options.maxZoom? -Map.addHandler? - diff --git a/docs/css/screen.css b/docs/css/screen.css index 92bcf902069..e3100706af8 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -114,6 +114,8 @@ h3.alt { box-shadow: 0 0 15px #ddd; -moz-box-shadow: 0 0 15px #ddd; -webkit-box-shadow: 0 0 15px #ddd; + + border-radius: 5px; } pre code a { text-decoration: none; @@ -455,3 +457,14 @@ dl dd { left: 0; box-shadow: 0 3px 20px rgba(0, 0, 0, 0.1); } + +.api-page td pre { + margin: 1em 0 0; + +} + +.api-page td pre code { + padding: 0 10px; + border: 0; + box-shadow: none; +} diff --git a/reference.html b/reference.html index 75df9668267..33a4f70e6e9 100644 --- a/reference.html +++ b/reference.html @@ -89,13 +89,13 @@

      Utility

    39. Class
    40. Browser
    41. Util
    42. -
    43. Transformation
    44. +
    45. Transformation
    46. LineUtil
    47. PolyUtil
    48. DOM Utility

        -
      • DomEvent
      • +
      • DomEvent
      • DomUtil
      • Transition
      • Draggable
      • @@ -4359,6 +4359,74 @@

        Properties

        + +

        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.

        + +
        var transformation = new L.Transformation(2, 5, -1, 10),
        +	p = new L.Point(1, 2),
        +	p2 = transformation.transform(p), // new L.Point(7, 8)
        +	p3 = transformation.untransform(p2); // new L.Point(1, 2)
        +
        + +

        Constructor

        + + + + + + + + + + + + + + +
        ConstructorUsageDescription
        L.Transformation( + <Number> a, + <Number> b, + <Number> c, + <Number> d ) + + new L.Transformation()
        + +
        Creates a transformation object with the given coefficients.
        + +

        Methods

        + + + + + + + + + + + + + + + + + + + +
        MethodReturnsDescription
        transform( + <Point> point, + <Number> scale? ) + PointReturns a transformed point, optionally multiplied by the given scale. Only accepts real L.Point instances, not arrays.
        untransform( + <Point> point, + <Number> scale? ) + PointReturns the reverse transformation of the given point, optionally divided by the given scale. Only accepts real L.Point instances, not arrays.
        + + + +

        L.LineUtil

        Various utility functions for polyine points processing, used by Leaflet internally to make polylines lightning-fast.

        @@ -4444,6 +4512,99 @@

        Methods

        + +

        L.DomEvent

        + +

        Utility functions to work with the DOM events, used by Leaflet internally.

        + +

        Methods

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        MethodReturnsDescription
        addListener( + <HTMLElement> el, + <String> type, + <Function> fn, + <Object> context? ) + thisAdds a listener fn to the element's DOM event of the specified type. this keyword inside the listener will point to context, or to the element if not specified.
        removeListener( + <HTMLElement> el, + <String> type, + <Function> fn ) + thisRemoves an event listener from the element.
        stopPropagation( + <DOMEvent> e ) + thisStop the given event from propagation to parent elements. Used inside the listener functions: +
        L.DomEvent.addListener(div, 'click', function (e) {
        +	L.DomEvent.stopPropagation(e);
        +});
        +
        preventDefault( + <DOMEvent> e ) + thisPrevents the default action of the event from happening (such as following a link in the href of the a element, or doing a POST request with page reload when form is submitted). Use it inside listener functions. +
        stop( + <DOMEvent> e ) + thisDoes stopPropagation and preventDefault at the same time.
        disableClickPropagation( + <HTMLElement> el ) + thisAdds stopPropagation to the element's 'click', 'doubleclick', 'mousedown' and 'touchstart' events.
        getMousePosition( + <DOMEvent> e, + <HTMLElement> container? ) + PointGets normalized mouse position from a DOM event relative to the container or to the whole page if not specified.
        getWheelDelta( + <DOMEvent> e ) + NumberGets normalized wheel delta from a mousewheel DOM event.
        + + + +

        L.DomUtil

        Utility functions to work with the DOM tree, used by Leaflet internally.

        From 7f812ad9ece3b8b5ca3013238942b1c071f72544 Mon Sep 17 00:00:00 2001 From: mourner Date: Tue, 24 Jul 2012 01:41:55 +0300 Subject: [PATCH 190/816] improve features page, more styling --- docs/css/screen.css | 6 +++--- download.md | 2 +- examples.md | 2 +- features.html | 48 +++++++++++++++++++++++++++++++-------------- index.md | 2 +- plugins.md | 43 ++++++++++++++++++++-------------------- reference.html | 16 ++++++++++++++- 7 files changed, 76 insertions(+), 43 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index e3100706af8..54506f25286 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -53,9 +53,9 @@ h1 a:hover, h1 a:focus { h2 { font-size: 1.8em; - margin-top: 1em; + margin-top: 1.3em; font-weight: bold; - padding: 4px 12px 3px; + padding: 3px 12px 2px; margin-left: 0; margin-right: 0; background: #edeeef; @@ -76,7 +76,7 @@ h2 { -moz-border-radius: 5px; -webkit-border-radius: 5px; - text-shadow: -1px -1px 0 #999; + text-shadow: -1px -1px 1px rgba(0,0,0,0.3); } .api-page h2 { margin-top: 2.5em; diff --git a/download.md b/download.md index 6d41be21ca2..7712f97a007 100644 --- a/download.md +++ b/download.md @@ -3,7 +3,7 @@ layout: default title: Download --- -### Download Leaflet +## Download Leaflet Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system. The production diff --git a/examples.md b/examples.md index f273915c517..7a80c3585b5 100644 --- a/examples.md +++ b/examples.md @@ -3,7 +3,7 @@ layout: default title: Tutorials --- -### Leaflet Tutorials +## Leaflet Tutorials Every example here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers. diff --git a/features.html b/features.html index a8297e593b4..9f7a86ffafa 100644 --- a/features.html +++ b/features.html @@ -3,7 +3,7 @@ title: Features --- -

        Leaflet Features

        +

        Leaflet Features

        Leaflet doesn't try to do everything for everyone. Instead it focuses on making the basic things work perfectly. It should still satisfy the needs of the vast majority of map apps developers while being easily extended by third-party plugins.

        @@ -16,21 +16,27 @@

        Available Map Layers

        • Tile layers
        • -
        • Vector layers: polylines, polygons, circles, rectangles, circle markers
        • Markers
        • Popups
        • +
        • Vector layers: polylines, polygons, circles, rectangles, circle markers
        • Image overlays
        • WMS layers
        • -
        • GeoJSON
        • +
        • Layer groups
        • +
        • GeoJSON layers

        Interaction Features

        +

        General

        + +
          +
        • Drag panning with inertia
        • +
        +

        On Desktop Browsers

          -
        • Drag panning
        • Scroll wheel zoom
        • Double click zoom
        • Shift-drag zoom to bounding box
        • @@ -40,18 +46,18 @@

          On Desktop Browsers

          On Mobile Browsers (iOS, Android)

            -
          • Touch-drag panning
          • -
          • Multi-touch zoom (iOS and Android 4+)
          • +
          • Multi-touch zoom (iOS and Android 4+)
          • Double tap zoom
          - -

          Other Features

          +

          For Layers

            -
          • Panning inertia
          • - +
          • Various events: click (tap), mouseover, contextmenu, etc.
          • +
          • Marker dragging
          + +
          @@ -59,8 +65,8 @@

          Other Features

          Visual Features

            +
          • Zoom animation on modern browsers (except IE) (for all layers, including markers and vector layers)
          • Panning animation
          • -
          • Zooming animation on modern browsers (except IE)
          • Smooth continuous zoom on iOS
          • Tile and popup fade animation
          • Very nice default design for markers, popups and other map controls
          • @@ -71,19 +77,22 @@

            Customization Features

            • Pure CSS3 popups and controls for easy restyling
            • +
            • Image- and HTML-based markers
            • A simple interface for implementing custom map layers
            • The same for custom map controls
            • Custom map projections (with EPSG:4326, EPSG:3857 and EPSG:3395 out of the box)
            • +
            • Powerful OOP facilities for extending existing classes

            Performance Features

            • Hardware acceleration on iOS (and other modern browsers) makes it feel as smooth as native apps
            • -
            • Clever tricks to make panning and zooming really smooth
            • -
            • Smart polyline/polygon rendering makes it responsive even when displaying objects with thousands of points
            • -
            • Modular design and a build system allow you to reduce the size of the library by leaving out the code you don't need
            • +
            • Utilizing CSS3 features like Transitions, Transforms, requestAnimationFrame where possible to make panning and zooming really smooth
            • +
            • Smart polyline/polygon rendering with dynamic clipping and simplification makes it responsive even when displaying objects with thousands of points
            • +
            • Modular design and a build system allow you to reduce the library size by leaving out features you don't need
            • +
            • Tap delay elimination on mobile devices makes controls and layers respond to taps immediately
          @@ -120,9 +129,18 @@

          On Mobile

        • Android browser 2.2+, 3.1+, 4+
        • Chrome for Android 4+ and iOS
        • Firefox for Android
        • -
        • Other webkit-based browsers (webOS, Blackberry 6+, etc.)
        • +
        • Other webkit-based browsers (webOS, Blackberry 7+, etc.)
        • IE for Windows Phone 7
        + + +

        Misc

        + +
          +
        • Extremely lightweight — around 26 KB of gzipped JS code
        • +
        • No external dependencies
        • +
        • Keeps your JS environment clean — no global or native prototypes pollution
        • +
        diff --git a/index.md b/index.md index 90644c04a69..2e91f927bd6 100644 --- a/index.md +++ b/index.md @@ -31,7 +31,7 @@ L.marker([51.5, -0.09]). Learn more with the [quick start guide](examples/quick-start.html), check out [other tutorials](examples.html), or head straight to the [API documentation](reference.html). -### Contributing to Leaflet +## Contributing to Leaflet The project is [hosted on GitHub][], waiting for your contributions --- just send your pull requests to [@mourner][] (Vladimir Agafonkin, Leaflet author and maintainer). Let’s make the best library for maps that can possibly exist! diff --git a/plugins.md b/plugins.md index c0a92100eb2..459f516fd09 100644 --- a/plugins.md +++ b/plugins.md @@ -3,12 +3,13 @@ layout: default title: Plugins --- -### Notable Leaflet Plugins +## Notable Leaflet Plugins While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are lots of nice plugins to choose from. +--- -## Layers and Overlays +### Layers and Overlays @@ -25,15 +26,6 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Dave Leaver - - -
        - RaphaelLayer - - Allows you to use Raphael as a layer on a Leaflet map for advanced animations and visualizations. - - Dynamic Methods -
        Leaflet.iconlabel @@ -45,26 +37,26 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
        - Overlapping Marker Spiderfier + RaphaelLayer - Deals with overlapping markers in a Google Earth-inspired way by gracefully springing them apart on click. + Allows you to use Raphael as a layer on a Leaflet map for advanced animations and visualizations. - George MacKerron + Dynamic Methods
        - arc.js + Overlapping Marker Spiderfier - Allows you to draw great circle routes between two points. + Deals with overlapping markers in a Google Earth-inspired way by gracefully springing them apart on click. - Dane Springmeyer + George MacKerron
        -## Services, Providers and Formats +### Services, Providers and Formats @@ -147,7 +139,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
        -## Controls +### Controls and Interaction @@ -212,7 +204,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
        -## Other Plugins +### Other Plugins and Libraries @@ -224,7 +216,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s @@ -238,6 +230,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Michael Lawrence Evans + + +
        OSM Buildings - Amazing plugin for visualizing 3D OSM building data on top of Leaflet. + Amazing JS library for visualizing 3D OSM building data on top of Leaflet. Jan Marsch
        + arc.js + + A JS library for drawing great circle routes that can be used with Leaflet. + + Dane Springmeyer +
        From d95761cb42af0f3ec4340d5ddb0868c7150581ec Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Jul 2012 10:49:22 +0300 Subject: [PATCH 192/816] make the frontpage map a little bigger --- docs/css/screen.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 13511e13b5b..8620d750272 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -301,7 +301,7 @@ a.nodocs { } #map { - height: 280px; + height: 320px; border: 1px solid #ccc; margin-bottom: 20px; margin-top: 30px; From 3bf097ff0ab4837d56db1d015a8726142fff1988 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Jul 2012 11:34:54 +0300 Subject: [PATCH 193/816] officially recommend great plugins :) --- plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index 459f516fd09..e2adba61c70 100644 --- a/plugins.md +++ b/plugins.md @@ -21,7 +21,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.markercluster - Sophisticated marker clustering solution with smooth animations. + Beautiful, sophisticated, high performance marker clustering solution with smooth animations and lots of great features. Recommended! Dave Leaver @@ -151,7 +151,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.draw - Enables drawing features like polylines, polygons, rectangles, circles and markers with a nice user-friendly interface. + Enables drawing features like polylines, polygons, rectangles, circles and markers through a very nice user-friendly interface with icons and hints. Recommended! Jacob Toye From 31633ffcee57f6a64860785c9a3477e081b04d2f Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Jul 2012 13:57:31 +0300 Subject: [PATCH 194/816] update quick start guide --- examples/quick-start.md | 98 ++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 54 deletions(-) diff --git a/examples/quick-start.md b/examples/quick-start.md index 3a773e8cc86..b742503f7d8 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -3,7 +3,7 @@ layout: tutorial title: Quick Start Guide --- -### Leaflet Quick Start Guide +## Leaflet Quick Start Guide This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events. @@ -19,18 +19,22 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS files in the head section of your document: - + - * Include Leaflet JavaScript file somewhere on the page (preferably before body close tag): + * Include Leaflet JavaScript file: - + - * Put a div element with a certain id where you want your map to be (making sure it has defined height): + * Put a `div` element with a certain `id` where you want your map to be: -
        +
        + + * Make sure the map container has a defined height, for example by setting it in CSS: + +
        #map { height: 180px; }
        Now you're ready to initialize the map and do some stuff with it. @@ -40,27 +44,24 @@ Now you're ready to initialize the map and do some stuff with it.
        -Let's create a map instance, set its view to the center of London and add a pretty CloudMade tile layer to it. First we'll initialize the map: +Let's create a map of the center of London with pretty CloudMade tiles. First we'll initialize the map and set its view to our chosen geographical coordinates and a zoom level: - var map = new L.Map('map'); + var map = L.map('map').setView([51.505, -0.09], 13); By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls. -Next we'll create a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at [CloudMade](http://cloudmade.com/register)), the attribution text and the maximum zoom level of the layer: +Note that `setView` call also returns the map object --- most Leaflet methods act like this when they don't return an explicit value, which allows convenient jQuery-like method chaining. + +Next we'll add a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at [CloudMade](http://cloudmade.com/register)), the attribution text and the maximum zoom level of the layer: -
        var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/API-KEY/997/256/{z}/{x}/{y}.png', {
        +
        L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
         	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
         	maxZoom: 18
        -});
        +}).addTo(map);
        -It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles, and it doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd recommend CloudMade though, it looks beautiful). - -Finally we'll set the map view to the center of London at 13th zoom level and add our tile layer (see the resulting map above): +Make sure all the code is called after the `div` and `leaflet.js` inclusion. That's it! You have a working Leaflet map now. - var london = new L.LatLng(51.505, -0.09); // geographical point (longitude and latitude) - map.setView(london, 13).addLayer(cloudmade); - -Make sure this code is below both the map div and leaflet.js inclusion, or in a window.load or document.ready event handler. +It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles, and it doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd recommend CloudMade though, it looks beautiful). ### Markers, circles and polygons @@ -69,24 +70,17 @@ Make sure this code is below both the map div and leaflet.js< Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker: - var markerLocation = new L.LatLng(51.5, -0.09); + var marker = L.marker([51.5, -0.09]).addTo(map); - var marker = new L.Marker(markerLocation); - map.addLayer(marker); - -Adding a circle is the same (except for specifying the radius in meters), but lets configure it by passing options as a third argument when creating the object (the second argument is the radius in pixels): +Adding a circle is the same (except for specifying the radius in meters as a second argument), but lets you control how it looks by passing options as the last argument when creating the object: - var circleLocation = new L.LatLng(51.508, -0.11), - circleOptions = { - color: 'red', - fillColor: '#f03', - fillOpacity: 0.5 - }; + var circle = L.circle([51.508, -0.11], 500, { + color: 'red', + fillColor: '#f03', + fillOpacity: 0.5 + }).addTo(map); - var circle = new L.Circle(circleLocation, 500, circleOptions); - map.addLayer(circle); - -Add a polygon is easy too: +Adding a polygon is as easy: L.polygon([[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]]).addTo(map); @@ -101,47 +95,43 @@ Popups are usually used when you want to attach some information to a particular circle.bindPopup("I am a circle."); polygon.bindPopup("I am a polygon."); -Try clicking on our objects. The bindPopup method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the openPopup method (for markers only) immediately opens the attached popup. +Try clicking on our objects. The `bindPopup` method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the `openPopup` method (for markers only) immediately opens the attached popup. You can also use popups as layers (when you need something more than attching a popup to an object): - var popup = new L.Popup(); - - popup.setLatLng(new L.LatLng(51.5, -0.09)); - popup.setContent("I am a standalone popup."); + var popup = L.popup() + .setLatLng([51.5, -0.09]) + .setContent("I am a standalone popup.") + .openOn(map); - map.openPopup(popup); - -Here we use openPopup instead of addLayer because it handles automatic closing of a previously opened popup when opening a new one which is good for usability. +Here we use `openOn` instead of `addTo` because it handles automatic closing of a previously opened popup when opening a new one which is good for usability. ### Dealing with events Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction: - map.on('click', onMapClick); - function onMapClick(e) { alert("You clicked the map at " + e.latlng); } -Each object has its own set of events — see documentation for details. The first argument of the listener function is an event object — it contains useful information about the event that happened. For example, map click event object (e in the example above) has latlng property which is a location at which the click occured. - -Lets improve our example by using a popup instead of an alert and formatting the location string: - map.on('click', onMapClick); - var popup = new L.Popup(); +Each object has its own set of events --- see [documentation](../reference.html) for details. The first argument of the listener function is an event object --- it contains useful information about the event that happened. For example, map click event object (`e` in the example above) has `latlng` property which is a location at which the click occured. - function onMapClick(e) { - var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')'; +Lets improve our example by using a popup instead of an alert: - popup.setLatLng(e.latlng); - popup.setContent("You clicked the map at " + latlngStr); + var popup = L.popup(); - map.openPopup(popup); + function onMapClick(e) { + popup + .setLatLng(e.latlng); + .setContent("You clicked the map at " + e.latlng.toString()); + .openOn(map); } + map.on('click', onMapClick); + Try clicking on the map and you will see the coordinates in a popup. View the full example → Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed documentation or other examples. From fd3fbf84196f41ba24b45ec2db46ac8c3e5d6f68 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Jul 2012 14:07:28 +0300 Subject: [PATCH 195/816] minor quick start fix --- examples/quick-start.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/quick-start.md b/examples/quick-start.md index b742503f7d8..23f0d3a2e8e 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -82,7 +82,11 @@ Adding a circle is the same (except for specifying the radius in meters as a sec Adding a polygon is as easy: - L.polygon([[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]]).addTo(map); + var polygon = L.polygon([ + [51.509, -0.08], + [51.503, -0.06], + [51.51, -0.047] + ]).addTo(map); ### Working with popups From 6bdf50f41581a808a2ffd6fe1865d41486191fd7 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Jul 2012 18:37:33 +0300 Subject: [PATCH 196/816] finish quick start update --- examples/quick-start-example.html | 57 ++++++--------- examples/quick-start.md | 117 +++++++++++++++--------------- 2 files changed, 81 insertions(+), 93 deletions(-) diff --git a/examples/quick-start-example.html b/examples/quick-start-example.html index 85ccdd70d7b..5a9bb56f980 100644 --- a/examples/quick-start-example.html +++ b/examples/quick-start-example.html @@ -14,51 +14,42 @@ diff --git a/examples/quick-start.md b/examples/quick-start.md index 23f0d3a2e8e..be99b377253 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -129,8 +129,8 @@ Lets improve our example by using a popup instead of an alert: function onMapClick(e) { popup - .setLatLng(e.latlng); - .setContent("You clicked the map at " + e.latlng.toString()); + .setLatLng(e.latlng) + .setContent("You clicked the map at " + e.latlng.toString()) .openOn(map); } @@ -141,87 +141,84 @@ Try clicking on the map and you will see the coordinates in a popup. documentation or other examples. - + var map1 = L.map('map1').setView([51.505, -0.09], 13); + L.tileLayer(tilesUrl, {attribution: tilesAttrib}).addTo(map1); - + L.circle([51.508, -0.11], 500, { + color: 'red', + fillColor: '#f03', + fillOpacity: 0.5 + }).addTo(map2); + + L.polygon([ + [51.509, -0.08], + [51.503, -0.06], + [51.51, -0.047] + ]).addTo(map2); - From 46eb027c7602f2574ecd3826e9db5b7034de7001 Mon Sep 17 00:00:00 2001 From: mourner Date: Wed, 25 Jul 2012 01:09:31 +0300 Subject: [PATCH 197/816] news flash on frontpage --- docs/css/screen.css | 12 +++++++++++- index.md | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 8620d750272..ee1b15327a4 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -157,7 +157,7 @@ td { .nav { padding: 0; - margin: 28px 0 32px; + margin: 28px 0 28px; list-style: none; font-size: 1.2em; @@ -470,3 +470,13 @@ dl dd { border: 0; box-shadow: none; } + + +p.notice { + border: none; + border-radius: 10px; + color: #444; + background: #DBF8A7; + padding: 5px 10px; + margin-bottom: 1.5em; +} diff --git a/index.md b/index.md index 4066a160bff..493df17d1cc 100644 --- a/index.md +++ b/index.md @@ -2,6 +2,8 @@ layout: default --- +

        July 27, 2012 — Leaflet 0.4 released with lots of exciting improvements! — read more in the blog

        + Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 26 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. From f1a8f609d03edc290916cbff4f7fff1232cc00d7 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 12:04:57 +0300 Subject: [PATCH 198/816] temporary fix for github icon --- docs/css/screen.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 0a046c0cf3f..babe130a9e2 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -178,7 +178,7 @@ th, td { display: block; }*/ .nav li a.github-link { - background: url(https://github.com/favicon.png) 15px 12px no-repeat; + background: url(https://github.com/CloudMade/Leaflet/raw/gh-pages-master/docs/images/github.png) 15px 12px no-repeat; } .nav li a.twitter-link { background: url(http://twitter.com/phoenix/favicon.ico) 15px 12px no-repeat; From 62e75978b8abdfb8b4f2cc61247b6800ddf27d21 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 13:05:51 +0300 Subject: [PATCH 199/816] showcase companies on frontpage #400 --- docs/css/screen.css | 22 +++++++++++++++++++++- index.md | 4 +++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index ee1b15327a4..7d05d829b00 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -304,7 +304,7 @@ a.nodocs { height: 320px; border: 1px solid #ccc; margin-bottom: 20px; - margin-top: 30px; + margin-top: 34px; /*box-shadow: 0px 0px 10px #ccc; -moz-box-shadow: 0px 0px 10px #ccc; @@ -480,3 +480,23 @@ p.notice { padding: 5px 10px; margin-bottom: 1.5em; } + +.usedby a { + text-decoration: none; + margin: 0 2px; + color: #777; +} + +.usedby a:hover { + text-decoration: underline; + color: black; +} + +.usedby { + background: #f3f3f3; + border-radius: 5px; + padding: 5px 7px; + margin: 1.5em -7px; + white-space: nowrap; + overflow: hidden; +} diff --git a/index.md b/index.md index 493df17d1cc..75f05e7e3af 100644 --- a/index.md +++ b/index.md @@ -2,12 +2,14 @@ layout: default --- -

        July 27, 2012 — Leaflet 0.4 released with lots of exciting improvements! — read more in the blog

        +

        July 27, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

        Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 26 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. +{: .usedby} +Used by: [Flickr](http://flickr.com/map) [Foursquare](https://foursquare.com/) [Wikipedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [City-Data.com](http://city-data.com) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [CityMaps](http://www.citymaps.com) [Chartbeat](http://chartbeat.com/) [GisCloud](http://www.giscloud.com/) [Skobbler](http://maps.skobbler.com/) ...
        From 24dd02aacc014fc9ea558b56524880c27cb4c052 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 13:15:33 +0300 Subject: [PATCH 200/816] improve download page --- download.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/download.md b/download.md index 7712f97a007..50c45675720 100644 --- a/download.md +++ b/download.md @@ -27,8 +27,20 @@ it straight away, place this code in the `head` section of your HTML: +### Building Leaflet from the Source + +Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and Jake, JSHint and UglifyJS libraries, which install easily and work well across all major platforms. Here are the steps to install it: + + 1. [Download and install Node](http://nodejs.org) + 2. Run the following commands in the command line: + +
        npm install -g jake
        +npm install jshint
        +npm install uglify-js
        +
        + +Now that you have everything installed, run `jake` inside the Leaflet directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and compress it to the `dist` folder. + ### Building a Custom Version of Leaflet -Open `build/build.html` page from the download package, check the -components you want to see in your build and then follow the -instructions there. +To make a custom build of the library with only the things you need, open `build/build.html` page of the package contents, choose the components (it figures out dependencies for you) and then run the command generated with it. From 9c253a627c379671ba4c6b483ef0683d53cbeff4 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 14:02:10 +0300 Subject: [PATCH 201/816] update "used by" links --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 75f05e7e3af..5677c9e03b0 100644 --- a/index.md +++ b/index.md @@ -9,7 +9,7 @@ Leaflet is a modern open-source JavaScript library for mobile-friendly interacti It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. {: .usedby} -Used by: [Flickr](http://flickr.com/map) [Foursquare](https://foursquare.com/) [Wikipedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [City-Data.com](http://city-data.com) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [CityMaps](http://www.citymaps.com) [Chartbeat](http://chartbeat.com/) [GisCloud](http://www.giscloud.com/) [Skobbler](http://maps.skobbler.com/) ... +Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [CityMaps](http://www.citymaps.com) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [skobbler](http://maps.skobbler.com/) ...
        From 6b2184821e514536d070fec21a88ab1c46b27966 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 16:24:11 +0300 Subject: [PATCH 202/816] improve download page more --- docs/css/screen.css | 12 ++++++------ download.md | 25 ++++++++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 7d05d829b00..a6334395bbe 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -366,22 +366,22 @@ table td code b { font-weight: normal; } -th.width250 { +.width250 { width: 250px; } -th.width200 { +.width200 { width: 200px; } -th.width300 { +.width300 { width: 300px; } -th.width100 { +.width100 { width: 100px; } -th.width140 { +.width140 { width: 140px; } -th.minwidth { +.minwidth { width: 1px; } diff --git a/download.md b/download.md index 50c45675720..e9f60449663 100644 --- a/download.md +++ b/download.md @@ -5,16 +5,27 @@ title: Download ## Download Leaflet -Besides the library itself, the download package contains full source -code, unit tests, files for debugging and a build system. The production -files (included the same way as in the code above) are in the `dist` -folder. - -[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012)
        -[Download Leaflet 0.4 master](http://github.com/CloudMade/Leaflet/zipball/master) (in-progress version) +Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system. The production files are in the `dist` folder. + + + + + + + + + + + + + + +
        VersionDescription
        Leaflet 0.3.1Stable version, released on February 14, 2012
        Leaflet masterIn-progress version, developed on the master branch
        [View Changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md) +Note that the master version can contain incompatible changes, so please read the changelog carefully when upgrading to it. + ### Using a Hosted Version of Leaflet The latest stable release of Leaflet is hosted on a CDN — to start using From 97b43a3e9882725b7c2691bb06e5e4bf9c2d6a71 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 18:51:38 +0300 Subject: [PATCH 203/816] update mobile example --- _layouts/default.html | 8 +++- examples/mobile-example.html | 29 +++++++-------- examples/mobile.html | 51 +++++++++++++------------- examples/mobile.md | 71 ++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 43 deletions(-) create mode 100644 examples/mobile.md diff --git a/_layouts/default.html b/_layouts/default.html index 4d069679ec7..69a6eea2112 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -135,11 +135,15 @@

        An Open-Source JavaScript Library for Mobile-Friendly Interactiv hljs.tabReplace = ' '; (function () { - var codes = document.getElementsByTagName('code'); + var codes = document.getElementsByTagName('code'), + parentClass; for (var i = 0, len = codes.length; i < len; i++) { if (!codes[i].className) { - if (codes[i].innerHTML.match(/^\s*</)) { + parentClass = codes[i].parentNode.className; + if (parentClass) { + codes[i].className = parentClass; + } else if (codes[i].innerHTML.match(/^\s*</)) { codes[i].className = 'xml'; } else { codes[i].className = 'javascript'; diff --git a/examples/mobile-example.html b/examples/mobile-example.html index 345f0b7fb6c..d00b0b5128a 100644 --- a/examples/mobile-example.html +++ b/examples/mobile-example.html @@ -24,33 +24,30 @@
        diff --git a/examples/mobile.html b/examples/mobile.html index ef7f067583f..3dcf96c7767 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -7,11 +7,11 @@

        Leaflet on Mobile

        In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

        -

        View example →

        +

        View example in fullscreen →

        Preparing the page

        -

        First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

        +

        First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

        body {
         	padding: 0;
        @@ -21,7 +21,7 @@ 

        Preparing the page

        height: 100%; }
        -

        Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section:

        +

        Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section or our HTML page:

        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        @@ -29,42 +29,43 @@

        Initializing the map

        We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

        -
        var map = new L.Map('map');
        +
        var map = L.map('map');
         
        -var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',
        -	cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
        -	cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
        -
        -map.addLayer(cloudmade);
        +L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', { + attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>', + maxZoom: 18 +}).addTo(map);

        Geolocation

        -

        Leaflet has a very handy shortcut for zooming the map view to the detected location — locateAndSetView method, replacing the usual setView method in the code:

        - -
        map.locateAndSetView(16);
        +

        Leaflet has a very handy shortcut for zooming the map view to the detected location — locate method with the setView option, replacing the usual setView method in the code:

        -

        Here we specify 16 as the maximum zoom when setting the map view automatically. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

        +
        map.locate({setView: true, maxZoom: 16});
        -
        map.on('locationfound', onLocationFound);
        +

        Here we specify 16 as the maximum zoom when setting the map view automatically. As soon as the user agrees to share its location and it's detected by the browser, the map will set the view to it. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

        -function onLocationFound(e) { +
        function onLocationFound(e) {
         	var radius = e.accuracy / 2;
         
        -	var marker = new L.Marker(e.latlng);
        -	map.addLayer(marker);
        -	marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
        +	L.marker(e.latlng).addTo(map)
        +		.bindPopup("You are within " + radius + " meters from this point").openPopup();
         
        -	var circle = new L.Circle(e.latlng, radius);
        -	map.addLayer(circle);
        -}
        + L.circle(e.latlng, radius).addTo(map); +} -

        Excellent! But it would also be nice to show an error message if the geolocation failed:

        +map.on('locationfound', onLocationFound); +
        -
        map.on('locationerror', onLocationError);
        +

        Excellent! But it would also be nice to show an error message if the geolocation failed:

        -function onLocationError(e) { +
        function onLocationError(e) {
         	alert(e.message);
        -}
        +} + +map.on('locationerror', onLocationError); +
        + +

        If you have setView option set to true and the geolocation failed, it will set the view to the whole world.

        Now the example is complete — try it on your mobile phone: View the full example →

        diff --git a/examples/mobile.md b/examples/mobile.md new file mode 100644 index 00000000000..045be0956ce --- /dev/null +++ b/examples/mobile.md @@ -0,0 +1,71 @@ +--- +layout: tutorial +title: Leaflet on Mobile +--- + +## Leaflet on Mobile + +In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location. + +[View example in fullscreen →](mobile-example.html) + +### Preparing the page + +First we'll take a look at the HTML & CSS code of the page. To make our map `div` element stretch to all available space (fullscreen), we can use the following CSS code: + +{: .css} + body { + padding: 0; + margin: 0; + } + html, body, #map { + height: 100%; + } + +Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the `head` section or our HTML page: + + + +### Initializing the map + +We'll now initialize the map in the JavaScript code exactly like we did in the [quick start guide](quick-start.html), but won't set the map view yet: + +
        var map = L.map('map');
        +
        +L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
        +	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
        +	maxZoom: 18
        +}).addTo(map);
        + +### Geolocation + +Leaflet has a very handy shortcut for zooming the map view to the detected location --- `locate` method with the `setView` option, replacing the usual `setView` method in the code: + + map.locate({setView: true, maxZoom: 16}); + +Here we specify 16 as the maximum zoom when setting the map view automatically. As soon as the user agrees to share its location and it's detected by the browser, the map will set the view to it. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the `locationfound` and `locationerror` events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to `locationfound` event before the `locateAndSetView` call: + + function onLocationFound(e) { + var radius = e.accuracy / 2; + + L.marker(e.latlng).addTo(map) + .bindPopup("You are within " + radius + " meters from this point").openPopup(); + + L.circle(e.latlng, radius).addTo(map); + } + + map.on('locationfound', onLocationFound); + +Excellent! But it would also be nice to show an error message if the geolocation failed: + + function onLocationError(e) { + alert(e.message); + } + + map.on('locationerror', onLocationError); + +If you have `setView` option set to true and the geolocation failed, it will set the view to the whole world. + +Now the example is complete --- try it on your mobile phone: [View the full example →](mobile-example.html) + +Next steps would be to take a look at the detailed [documentation](../reference.html) and browse [other examples](../examples.html). From 522c8310103d925c0aa809eec5fa72c462dad115 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Jul 2012 19:50:59 +0300 Subject: [PATCH 204/816] update custom icons example, minor fixes --- _layouts/default.html | 8 +++ docs/images/leaf-shadow.png | Bin 3852 -> 3236 bytes examples.md | 8 +-- examples/custom-icons-example.html | 12 ++-- examples/custom-icons.md | 112 ++++++++++++++++++----------- examples/mobile.html | 72 ------------------- examples/quick-start.md | 12 ++-- 7 files changed, 91 insertions(+), 133 deletions(-) delete mode 100644 examples/mobile.html diff --git a/_layouts/default.html b/_layouts/default.html index 69a6eea2112..9b3ca05474a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -35,6 +35,14 @@ + +
        diff --git a/docs/images/leaf-shadow.png b/docs/images/leaf-shadow.png index f8129861309457b00d5e7b5f425e9b2766df8515..119a71dbcfb43c0a0788b1a72806bdcf2323124a 100644 GIT binary patch literal 3236 zcmWkxc|4T+7k+K!h8RmEG2ST2ZZPAjsCSB(G?|yi?qY00_JR zz%mB_ltXWOy*dE^(zOV?}p=mP{^df;~JuvLCqz%f5D&WaCeKFpmv@PQc|& z@CvW3nk=y%AYHsAPS3LlRh^&NDZ+}dEYQKu9IDV2VU3OLpB`#iyV+x5VUfX6F5=oB zf1gQvR8=L>+us|LyKAs1O4g;?-I%CYW1N(!bsu{xqnZrg{k;}f_0u)A*t(G4KM~<) zq%t0c{a96{-x9ktJ-`|tdzVMSsA_YbYg;;Mx2{b$d7Ch`*k8b6TPP7NsRBR{9ulD= zr&N+SIDVQjfvA{nTsE<^77`F}^2pXY^?AZpYjnAU+}{^2oAgE2a!yv+F+@1nLNWpx&zVc?#BgWY6SwX zrv{$grH5^-F8)Ke?Crlx4gZ~p7 z)NJ%_K@pe?F#|+2LH#mTj>rvp<^%>kbJcexlfwfLNffbZaA%sa2i)=i=>yz%G1O_l z>TlS*< z5zFmH+QklVw{vA=L)qfS(lEET*ZF+aRE5AF-VkTuHBP;I@qYLLdv;|ETfBpX1eGB@ zz@*W9H9c+4%CN_sF&mwRz17a%Nt=%%Do1VXMa?KZxsj}Y2MtQ0op_qGhrn;h@5@9) zim+J^xm2t0-6s{kTEp3J{Z!nIA&J>sUBSbB#qumg78UFlc|w4iIM0cN{2wk}aoPbP zuCcMPcl^oY-5IThxc(zo<_5eyQ~h+o({M0g3KsyM#GV|7wtCoYs=kGWhK4;+QBhOb zUhx%II#cfPg6y*VOR3XxtXAZRGJ^ykf+JTiHWMVu5!c{Sz3xVxl#W`xB1^tHA`qi& zdV!aos(|T;#0MFttZ3#s%4?|EO2P?oH@{CsG zH}pUoyy}J7>qzI|u>7Zb_RM#bc?_Y*@gcV>rts*6+_4(tG4Gg|nAL>|t_guV_VaOD zeCfvF%AJhnmz^$;3yh?*@qPu&P^0dyF3shJyFLA!ld!Hey#u@bCCy1W0FeXEv*I&J9d zsB7Qi3kwRKm^N>v(HmJ{LKR^RJ*V=kjIFTxFD-_z_yUmK?TDX^t@jWY(xNUZ?)#of z7&TE5luA$RGi~Zo2;(HzHyrG)okM3fR&%X-QZa-)jriqn1p~*&?gU;dpw<{u-nhno zUK-t!`5M}KrA^%X&62`Z!#5dy&InSBq*JS_5hUjwg*y?kdci#JFtdm6SU|n$=H|AG z^{1(B(J`5{6Z;HOz}jAe3PCR2UAs6ER0YP@F7-y+%Y&AJp5*dvXMh}$91LN;SSLl9 zoRwayx93Mp{5i!}?ojTMP5vpASM464#<=XK^3YOC)Og$26-qWj~u_T@{ zfh%37w zucM-yb#SD5(KF=&HZI$r>^wCy!)oH==ieC^OC~rOc>q+3de60M>v^c;=;n@)_)I#ZeR%6LYnib z74*?akAch_9(j~evi^P|BGIa+11 z*XWzf9~i>pkCB5)3t{_TQBwvIufY&=_J$ zb%fp64!|iC4%6vSiM+kp;jVCm}x$n+(G%H>8x2lNst}smrrA4YBH*VLyBI zGIV(@fz~B6>X8_K@`P z@}O_|-OLzDT1DaESjy3tcaCVSfB3_o_SdyA;d;SV6S2*~{r+4)FQ45LT!$bjAx0}rvA1)3j2|Gt&8@q_+JoX z$}0;;GulB@4bdDtkrWadY7sE;Ux36h;Cx)%Vd;)1!BrmqV{p-^E~OC5-|tW6bdH3_ z4V5k2&yy9WReQFmniIH}IE(4Vak4~(_xGtGAAT-w%F{Cw)ojiMyV>1d!2980w@wu) zv`pgHCxan9jf2x(qT%uZ2Y}|*R`u&XpD1Ik)R4Q(0rq4*HBe4mfx=nch~Jp+Il84S zH{&#_W4YV6G1B9)=)bm*2Ph9X`Lc89wRi8{6+FHkon5B@v_{YVrG_VFGc(lOV0}}K zl-F3v#HZYeJHlRHw$~h@xQf%ZU9(XXw~=L8!^*OlV1P+?$cb64v2Ny_toCYC$MXBZ zi&vR_>l8N`v=YPE^kIwVuEZG%~|AbRMVE19WksRX)3J34q z2B0thi&jeU%FvMKwTvs`fRT#yN0k!rtit;{^ow9_r2r$DDDX9}c(u$2-jC1Oyd9 zse*!_(iAZS0goU80&*$mg>#SRz8}~3_8NPyGUlA$x7IhuSYszUIamuElsO0h00eAp z;4Z8l&U(-Ca#o}L;|69R>RA(~*QraDv)rlkpkK!ATg zAXYRYCIIFFxB5F4Yi0}zB9jR)FgPkIN+U{315XSDLk$cJ_BAv$)maF2QcO4*6|Ejl zQv9U=$CA)Q9D$6(hXeN&QT})e*%-vi^xs_79pwcESE9-~TF1a*H8g!7f-5o5A&kI^49602kywls5g!Kp zYr`IqR@iEX=SSDddRpV`}^ zy!@e6>@nr*sK@-fZ}`2Kke*&I(C3<(8l`{jUK}-`A4T3-uqb~25Z~+W;lZT4^{4kT z!9o&JB?2V$j)SRCPlz*$?|g_m8ygDr0%#Uk|F>jI?SP# zH2e8yw}-am=Zz*GH5L{P#!iJlyt4)gEopC!VD@+pwbj>Wmk**fE1Wo1KRx592fn(Z z@%mZZaDD2|V2b?Bc?V8_^oZ`KCu~>z%}Uz3b<{gTUG#$RBOf`71wWCyOSU(cGppYP zi(V^axRX$kcLlX00|NqFj26_e>CMyhxH9qb()a{GX_T4uiOlaXld$Xm2jRfXxD1CKSj`ZvCi)9e0=CB_4<*1(f$Vm0|Q5d#vv8%pz^uf3o|7u zIj_BeFU?krnhF@)ulfV6v(zQ4{5l9r)7@Ocl#$Vh!=a%lROz{uneJHK8%v3K3RDG= z%K3p+t94ziAJA_PI(a&I=2TB#9)9D|8fp6FflcCL)z`sv(* z+qVGaR#OVE`7H*7XB*ip$$9Kec*^2~PvbQ zCs6H5yK&=9=VtVHhPn^k@kFz~^? z^{TnlDp&oMVFm-0?{GM1QQ`C*ElRM! zyDGb`ye-E`rHEpRtG^2u^oA>ws`O4xlwG))A)c$$;5_f>d^AXdOy=jkV0VQnC;sKg z&*ZWARUeJ_NzwuvhK&N@AD?{5jC*bXMqjTO;C+jG_+HU2>EV=HX_-&qC79Z^k_;}s zc{k3Us)^9ZkS6c-H+LNItlRmlOFNvcz0=D>KfEnwt?~$GCsnqAGaF40$yMquUytq# zdA$?W-@ZlT%R6Rw47OJ_rg!L;T!C%oaEOGNFWd7tZC`Q2(Xp}9WA}Z&z7L)7pgG1T zOTZ6}nYg;s&0!Ba-ur%zPT!>fJeymyTDYEXrDj!Q9xNLc<*%9NRx6&YF3WR8q`N3z*j?}jFbg9bTcDo;e(}V!^>h!&hrT5KPWQ#Nic%aFm zm_AF9Grf)D{F2@PFEFpA6%@_F$7c<>Bljx0ry0tV##Eap=Qi*2Y6Y-$esG*$Ikw9z zI8{LIgU5B`#1rYsa1dev@kU`QFPF<=OQb@$w>V$_8po1tHmE@~*Pz3*f(}eL6?0;V zZCg;?uxFktt3(nyc=6)Jj|p=t=B1yW%a}H_kaew8&_&~wYa_DttlO@;)twP5{aw65 z``Kg1U6cHQB{82zy;z&79!<8-LCW{p0_$2^=`Vt=Yzz(#a#GI2YtCpq{+X`SfoaTT z6P}HhplD;gy7_O6DjeCqcPr_$@Y$ou*;9j~qj}~OnLEcm!_d3wqQi;^XMaRdpaG{g zcmo@-oX^=cF+Tp9)4j+caOGGLIp=Nuou$qkN#+rQ30=P*HT0bvey9lsi?s~aDU;Si zSWXgZraiuub3qQ)wrws?Z^k7`mpb3=PNM@ig<-{Bb_Yw`06J z7Isbj;%N$ViDR{Aqs~5wF5U7<@GG?X=y2xCL=&X)o`Dw~Nw)bj5HV{6@ZaG~BP1(% zdsGS+Rn7twt!dA#)2a+}{#eK!orY%P5`E^SgbY{2yg7T{=f^qGnuC!Rg_mf4!J;VG zLasav9WCltEMak3<>@9m<0W%zZGKgZ%d=!%_8>ig=v{`~c-4}yre4954BGAZISYr0 zN}BO&<>lpJ1V_YE#g8V7yKhGZO`9d_Vn8yTexNJuU%{0U*dEi8wJ!Utg_s?3un zZL*oQ2xqhE+Pl7h2XbG*4u{hq`tJ^CadOkZ&#uPsCCb~oW=KqG*NzAl^wD=YdT|+8 zWxu{aK+j=0um|y!(jR#TjoC!Zw$tNaDmbeKqmm?XsEO;W+~IPX22l=F{XZt_cM47~hbe zZVftc#f1B9UsDX@dBUxmCk%$1tx)b~PgSaGHTG3hLsNW&U=#)=kKftBEp=V)rDf`w zT#?a!+T9&)hekQb_1EDl{lXW#Gg^b%@~!UMEvo)Gk*MCE5R1~4h+|#59DpVzA)VxC S-l_fnQ(H?1_][1] @@ -19,21 +19,21 @@ A simple step-by-step guide that will quickly get you started with Leaflet basic ### [Leaflet on Mobile][2] -In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location. +In this tutorial, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location. *** [][3] ### [Markers With Custom Icons][3] -In this pretty example, you'll learn how to easily define your own icons for use by the markers you put on the map. +In this pretty tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map. *** [][4] ### [Using GeoJSON with Leaflet][4] -In this example, you'll learn how to create and interact with map vectors created from [GeoJSON][5] objects. +In this tutorial, you'll learn how to create and interact with map vectors created from [GeoJSON][5] objects. *** [][6] diff --git a/examples/custom-icons-example.html b/examples/custom-icons-example.html index cb6c521a61f..4263e2fa21d 100644 --- a/examples/custom-icons-example.html +++ b/examples/custom-icons-example.html @@ -23,16 +23,16 @@ var LeafIcon = L.Icon.extend({ options: { - iconUrl: '../docs/images/leaf-green.png', shadowUrl: '../docs/images/leaf-shadow.png', - iconSize: [38, 95], - shadowSize: [68, 95], - iconAnchor: [22, 94], - popupAnchor: [-3, -76] + iconSize: [38, 95], + shadowSize: [50, 64], + iconAnchor: [22, 94], + shadowAnchor: [4, 62], + popupAnchor: [-3, -76] } }); - var greenIcon = new LeafIcon(), + var greenIcon = new LeafIcon({iconUrl: '../docs/images/leaf-green.png'}), redIcon = new LeafIcon({iconUrl: '../docs/images/leaf-red.png'}), orangeIcon = new LeafIcon({iconUrl: '../docs/images/leaf-orange.png'}); diff --git a/examples/custom-icons.md b/examples/custom-icons.md index 7d95ef382e1..4928840eb18 100644 --- a/examples/custom-icons.md +++ b/examples/custom-icons.md @@ -5,7 +5,7 @@ title: Markers With Custom Icons ### Markers With Custom Icons -In this example, you'll learn how to easily define your own icons for use by the markers you put on the map. +In this tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map.
        @@ -14,7 +14,7 @@ In this example, you'll learn how to easily define your own icons for use by the ### Preparing the images -To make a custom icon, we usually need two images --- the actual icon image and the image of its shadow. For this example, we took the Leaflet logo and created four images out of it --- 3 leaf images of different colors and one shadow image for the three: +To make a custom icon, we usually need two images --- the actual icon image and the image of its shadow. For this tutorial, we took the Leaflet logo and created four images out of it --- 3 leaf images of different colors and one shadow image for the three:

        @@ -23,71 +23,78 @@ To make a custom icon, we usually need two images --- the actual icon image and

        -The white area in the images is actually transparent, and they are saved in the PNG24 format. Notice there's some excessive area on the left of the shadow image — its cropped in such way that if you align the icon and the shadow images on top of each other, the top left corners are in the same spot. +Note that the white area in the images is actually transparent. +### Creating an icon -### Defining an icon class +Marker icons in Leaflet are defined by [L.Icon](../reference.html#icon) objects, which are passed as an option when creating markers. Let's create a green leaf icon: -The default marker icons in Leaflet are defined by the [L.Icon](../reference.html#icon) class. Its instance (`new L.Icon()`) is then set by default in the `L.Marker` options. So how do we define our own icon class? Inherit from `L.Icon`! It's really easy in Leaflet: + var greenIcon = L.icon({ + iconUrl: 'leaf-green.png', + shadowUrl: 'leaf-shadow.png', - var LeafIcon = L.Icon.extend({ - options: { - iconUrl: '../docs/images/leaf-green.png', - shadowUrl: '../docs/images/leaf-shadow.png', - iconSize: new L.Point(38, 95), - shadowSize: new L.Point(68, 95), - iconAnchor: new L.Point(22, 94), - popupAnchor: new L.Point(-3, -76) - } - }); + iconSize: [38, 95], // size of the icon + shadowSize: [50, 64], // size of the shadow + iconAnchor: [22, 94], // point of the icon which will correspond to marker's location + shadowAnchor: [4, 62], // the same for the shadow + popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor + }); -Now we've defined a green leaf icon class. The iconSize and shadowSize properties are the sizes of the corresponding images in pixels, the iconAnchor property is the coordinates of the "tip" of our icon, and the popupAnchor property points to a point from which a marker popup would open relative to the iconAnchor point. +Now putting a marker with this icon on a map is easy: + L.marker([51.5, -0.09], {icon: greenIcon}).addTo(map); -### Using icons in markers +
        -To use our newly created icon class in a marker, we need to create an instance of that class and pass it to the marker constructor in the options: +### Defining an icon class - var greenIcon = new LeafIcon(), - marker = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}); +What if we need to create several icons that have lots in common? Lets define our own icon class containing the shared options, inheriting from `L.Icon`! It's really easy in Leaflet: -Awesome, it works! But what about the orange and the red ones? You could repeat the whole process above for each of them, but there's a much easier way. Notice that these icons would have the same properties except for one --- the iconUrl. Because it's a frequent case, the L.Icon constructor has an optional argument --- an iconUrl to replace the defined one. Let's see: + var LeafIcon = L.Icon.extend({ + options: { + shadowUrl: 'leaf-shadow.png', + iconSize: [38, 95], + shadowSize: [50, 64], + iconAnchor: [22, 94], + shadowAnchor: [4, 62], + popupAnchor: [-3, -76] + } + }); - var greenIcon = new LeafIcon(), - redIcon = new LeafIcon({iconUrl: '../docs/images/leaf-red.png'}), - orangeIcon = new LeafIcon({iconUrl: '../docs/images/leaf-orange.png'}); +Now we can create all three of our leaf icons from this class and use them: -Now we can use all the three icons: + var greenIcon = new LeafIcon({iconUrl: 'leaf-green.png'}), + redIcon = new LeafIcon({iconUrl: 'leaf-red.png'}), + orangeIcon = new LeafIcon({iconUrl: 'leaf-orange.png'}); - var marker1 = new L.Marker(new L.LatLng(51.5, -0.09), {icon: greenIcon}), - marker2 = new L.Marker(new L.LatLng(51.495, -0.083), {icon: redIcon}), - marker3 = new L.Marker(new L.LatLng(51.49, -0.1), {icon: orangeIcon}); +You may have noticed that we used the `new` keyword for creating LeafIcon instances. So why do all Leaflet classes get created without it? The answer is simple: the real Leaflet classes are named with a capital letter (e.g. `L.Icon`), and they also need to be created with `new`, but there are also shortcuts with lowercase names (`L.icon`), created for convenience like this: -marker1.bindPopup("I am a green leaf."); -marker2.bindPopup("I am a red leaf."); -marker3.bindPopup("I am an orange leaf."); + L.icon = function (options) { + return new L.Icon(options); + }; -map.addLayer(marker1).addLayer(marker2).addLayer(marker3); +You can do the same with your classes too. OK, lets finally put some markers with these icons on the map: -That's all. Now take a look at the full example, the L.Icon docs, or browse other examples. + L.marker([51.5, -0.09], {icon: greenIcon}).addTo(map).bindPopup("I am a green leaf."); + L.marker([51.495, -0.083], {icon: redIcon}).addTo(map).bindPopup("I am a red leaf."); + L.marker([51.49, -0.1], {icon: orangeIcon}).addTo(map).bindPopup("I am an orange leaf."); - diff --git a/examples/mobile.html b/examples/mobile.html deleted file mode 100644 index 3dcf96c7767..00000000000 --- a/examples/mobile.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -layout: tutorial -title: Leaflet on Mobile ---- - -

        Leaflet on Mobile

        - -

        In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.

        - -

        View example in fullscreen →

        - -

        Preparing the page

        - -

        First we'll take a look at the HTML & CSS code of the page. To make our map div element stretch to all available space (fullscreen), we can use the following CSS code:

        - -
        body {
        -	padding: 0;
        -	margin: 0;
        -}
        -html, body, #map {
        -	height: 100%;
        -}
        - -

        Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the head section or our HTML page:

        - -
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        - -

        Initializing the map

        - -

        We'll now initialize the map in the JavaScript code exactly like we did in the quick start guide, but won't set the map view yet:

        - -
        var map = L.map('map');
        -
        -L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
        -	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
        -	maxZoom: 18
        -}).addTo(map);
        - -

        Geolocation

        - -

        Leaflet has a very handy shortcut for zooming the map view to the detected location — locate method with the setView option, replacing the usual setView method in the code:

        - -
        map.locate({setView: true, maxZoom: 16});
        - -

        Here we specify 16 as the maximum zoom when setting the map view automatically. As soon as the user agrees to share its location and it's detected by the browser, the map will set the view to it. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the locationfound and locationerror events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to locationfound event before the locateAndSetView call:

        - -
        function onLocationFound(e) {
        -	var radius = e.accuracy / 2;
        -
        -	L.marker(e.latlng).addTo(map)
        -		.bindPopup("You are within " + radius + " meters from this point").openPopup();
        -
        -	L.circle(e.latlng, radius).addTo(map);
        -}
        -
        -map.on('locationfound', onLocationFound);
        -
        - -

        Excellent! But it would also be nice to show an error message if the geolocation failed:

        - -
        function onLocationError(e) {
        -	alert(e.message);
        -}
        -
        -map.on('locationerror', onLocationError);
        -
        - -

        If you have setView option set to true and the geolocation failed, it will set the view to the whole world.

        - -

        Now the example is complete — try it on your mobile phone: View the full example →

        - -

        Next steps would be to take a look at the detailed documentation and browse other examples.

        diff --git a/examples/quick-start.md b/examples/quick-start.md index be99b377253..c30abe7ce6b 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -142,13 +142,9 @@ Now you've learned Leaflet basics and can start building map apps straight away!

        View example on a separate page →

        @@ -92,12 +97,6 @@

        The GeoJSON layer

        GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

        -
        var geojsonLayer = new L.GeoJSON();
        -
        -map.addLayer(geojsonLayer);
        - -

        This creates an empty GeoJSON layer that we can easily add vectors to with the addGeoJSON method.

        -
        var geojsonFeature = {
         	"type": "Feature",
         	"properties": {
        @@ -111,25 +110,56 @@ 

        The GeoJSON layer

        } }; -geojsonLayer.addGeoJSON(geojsonFeature);
        +L.geoJson(geojsonFeature).addTo(map);
      + +

      Alternatively, we could create an empty GeoJSON layer and assign it to a variable so that we can add more features to it later.

      + +
      var myLayer = L.geoJson().addTo(map);
      +
      +myLayer.addData(geojsonFeature);
      +
      + +

      Options

      + +

      style

      + +

      The style option is used to ...

      -

      We can also instantiate the GeoJSON layer with a GeoJSON object to show it immediately, without having to call addGeoJSON.

      +

      onEachFeature

      -
      var geojsonLayer = new L.GeoJSON(geojsonFeature);
      +

      The onEachFeature option is used to ...

      -map.addLayer(geojsonLayer);
      +

      filter

      + +

      The filter option is used to ...

      Popups

      -

      We can use popups to show information about these features when they are clicked. To accomplish this we'll listen to the featureparse event of the GeoJSON layer. Here we're checking to see if a feature has a property named "popupContent" and if so binding a popup to the feature so this text (or HTML) appears when clicked.

      +

      We can use popups to show information about features when they are clicked. To accomplish this we'll utilise the onEachFeature option of the GeoJSON layer.

      -
      geojsonLayer.on("featureparse", function (e) {
      -	if (e.properties && e.properties.popupContent){
      -		e.layer.bindPopup(e.properties.popupContent);
      +
      function onEachFeature (feature, layer) {
      +	// Does this feature have a property named popupContent
      +	if (feature.properties && feature.properties.popupContent) {
      +		layer.bindPopup(feature.properties.popupContent);
       	}
      -});
      +} + +var geojsonFeature = { + "type": "Feature", + "properties": { + "name": "Coors Field", + "amenity": "Baseball Stadium", + "popupContent": "This is where the Rockies play!" + }, + "geometry": { + "type": "Point", + "coordinates": [-104.99404, 39.75621] + } +}; -

      Make sure to do this before adding GeoJSON objects through the addGeoJSON method.

      +L.geoJson(geojsonFeature, { + onEachFeature: onEachFeature +}).addTo(map);

      Styling Features

      diff --git a/examples/sample-geojson.js b/examples/sample-geojson.js index b65735e0945..2c2471e58cc 100644 --- a/examples/sample-geojson.js +++ b/examples/sample-geojson.js @@ -11,7 +11,7 @@ var freeBus = { ] }, "properties": { - "name": "16th Street Free Bus", + "popupContent": "This is free bus that will take you across downtown.", "underConstruction": false }, "id": 1 @@ -26,7 +26,7 @@ var freeBus = { ] }, "properties": { - "name": "16th Street Free Bus", + "popupContent": "This is free bus that will take you across downtown.", "underConstruction": true }, "id": 2 @@ -41,7 +41,7 @@ var freeBus = { ] }, "properties": { - "name": "16th Street Free Bus", + "popupContent": "This is free bus that will take you across downtown.", "underConstruction": false }, "id": 3 From b3d751818c469c7fb75c1c829978cb03448e21ca Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 12:16:38 +0300 Subject: [PATCH 209/816] fix jekyll error --- download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.md b/download.md index e9f60449663..3253fd8b71e 100644 --- a/download.md +++ b/download.md @@ -45,7 +45,7 @@ Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and 1. [Download and install Node](http://nodejs.org) 2. Run the following commands in the command line: -
      npm install -g jake
      + 
      npm install -g jake
       npm install jshint
       npm install uglify-js
       
      From 40a6fc1d10484e9c6b925620fbbf56bc37418f12 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 12:17:40 +0300 Subject: [PATCH 210/816] update layers control --- examples/layers-control-example.html | 42 +++++----- examples/layers-control.html | 112 --------------------------- examples/layers-control.md | 98 +++++++++++++++++++++++ 3 files changed, 118 insertions(+), 134 deletions(-) delete mode 100644 examples/layers-control.html create mode 100644 examples/layers-control.md diff --git a/examples/layers-control-example.html b/examples/layers-control-example.html index 638c9c43ebb..9ce0f12517b 100644 --- a/examples/layers-control-example.html +++ b/examples/layers-control-example.html @@ -14,40 +14,38 @@ diff --git a/examples/layers-control.html b/examples/layers-control.html deleted file mode 100644 index d36690540a8..00000000000 --- a/examples/layers-control.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -layout: tutorial -title: Layer Groups and Layers Control ---- - -

      Layer Groups and Layers Control

      - -

      This guide will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map.

      -

      Note: this only works in the latest (master) version of Leaflet.

      - -
      - - -

      View example on a separate page →

      - -

      Layer Groups

      - -

      Lets suppose you have a bunch of layers you want to combine into a group to handle them as one in your code:

      - -
      var littletonMarker = new L.Marker(new L.LatLng(39.61, -105.02)).bindPopup("This is Littleton, CO."),
      -	denverMarker = new L.Marker(new L.LatLng(39.74, -104.99)).bindPopup("This is Denver, CO."),
      -	auroraMarker = new L.Marker(new L.LatLng(39.73, -104.8)).bindPopup("This is Aurora, CO."),
      -	goldenMarker = new L.Marker(new L.LatLng(39.77, -105.23)).bindPopup("This is Golden, CO.");
      - -

      Instead of adding them directly to the map, you can do the following, using the LayerGroup class:

      - -
      var citiesLayer = new L.LayerGroup();
      -
      -citiesLayer.addLayer(littletonMarker)
      -           .addLayer(denverMarker)
      -           .addLayer(auroraMarker)
      -           .addLayer(goldenMarker);
      -
      -map.addLayer(citiesLayer);
      - -

      Easy enough! Now you have citiesLayer that combines your city markers into one layer you can add or remove from the map at once.

      - -

      Layers Control

      - -

      Leaflet has a nice little control that allows your users control what layers they want to see on your map. In addition to showing you how to use it, we'll show another handy use for layer groups.

      - -

      There are two types of layers — base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays — all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off — a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map:

      - -
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/{styleId}/256/{z}/{x}/{y}.png',
      -	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
      -	cloudmadeOptions = {maxZoom: 18, };
      -
      -var minimal = new L.TileLayer(cloudmadeUrl, {styleId: 22677, attribution: cloudmadeAttribution}),
      -	midnightCommander = new L.TileLayer(cloudmadeUrl, {styleId: 999, attribution: cloudmadeAttribution}),
      -	motorways = new L.TileLayer(cloudmadeUrl, {styleId: 46561, attribution: cloudmadeAttribution});
      -
      -var map = new L.Map('map', {
      -	center: new L.LatLng(39.73, -104.99),
      -	zoom: 10,
      -	layers: [minimal, motorways, citiesLayer]
      -});
      - -

      Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. midnightCommander).

      - -
      var baseMaps = {
      -	"Minimal": minimal,
      -	"Night View": midnightCommander
      -};
      -
      -var overlayMaps = {
      -    "Motorways": motorways,
      -    "Cities": citiesLayer
      -};
      - - -

      Now, all that's left to do is to create a Layers Control and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional — for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing null as the first argument.

      - -
      var layersControl = new L.Control.Layers(baseMaps, overlayMaps);
      -
      -map.addControl(layersControl);
      - -

      Now lets view the result on a separate page →

      diff --git a/examples/layers-control.md b/examples/layers-control.md new file mode 100644 index 00000000000..f30d14855d7 --- /dev/null +++ b/examples/layers-control.md @@ -0,0 +1,98 @@ +--- +layout: tutorial +title: Layer Groups and Layers Control +--- + +## Layer Groups and Layers Control + +This tutorial will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map. + +
      + +[View example on a separate page →](ayers-control-example.html) + + +### Layer Groups + +Lets suppose you have a bunch of layers you want to combine into a group to handle them as one in your code: + + var littleton = L.marker([39.61, -105.02]).bindPopup('This is Littleton, CO.'), + denver = L.marker([39.74, -104.99]).bindPopup('This is Denver, CO.'), + aurora = L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.'), + golden = L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.'); + +Instead of adding them directly to the map, you can do the following, using the LayerGroup class: + + var cities = L.layerGroup([littleton, denver, aurora, golden]); + +Easy enough! Now you have a `cities` layer that combines your city markers into one layer you can add or remove from the map at once. + +### Layers Control + +Leaflet has a nice little control that allows your users control what layers they want to see on your map. In addition to showing you how to use it, we'll show another handy use for layer groups. + +There are two types of layers --- base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays --- all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off --- a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map: + +
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png',
      +	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade';
      +
      +var minimal   = L.tileLayer(cloudmadeUrl, {styleId: 22677, attribution: cloudmadeAttribution}),
      +	midnight  = L.tileLayer(cloudmadeUrl, {styleId: 999,   attribution: cloudmadeAttribution}),
      +	motorways = L.tileLayer(cloudmadeUrl, {styleId: 46561, attribution: cloudmadeAttribution});
      +
      +var map = L.map('map', {
      +	center: new L.LatLng(39.73, -104.99),
      +	zoom: 10,
      +	layers: [minimal, motorways, cities]
      +});
      + +Next, we'll create two objects. One will contain our base layers and one will contain our overlays. These are just simple objects with key/value pairs. The key is what sets the text for the layer in the control (e.g. "Night View"). The corresponding value is a reference to the layer (e.g. `midnight`). + +
      var baseMaps = {
      +	"Minimal": minimal,
      +	"Night View": midnight
      +};
      +
      +var overlayMaps = {
      +    "Motorways": motorways,
      +    "Cities": cities
      +};
      + +Now, all that's left to do is to create a [Layers Control](../reference.html#control-layers) and add it to the map. The first argument passed when creating the layers control is the base layers object. The second argument is the overlays object. Both arguments are optional --- for example, you can pass just a base layers object by ommiting the second argument, or just an overlays objects by passing `null` as the first argument. + +
      L.control.layers(baseMaps, overlayMaps).addTo(map);
      + +Note that we added `minimal`, `motorways` and `cities` layers to the map but didn't add `midnight`. The layers control is smart enough to detect what layers we've already added and have corresponding checkboxes and radioboxes set. + +Now lets [view the result on a separate page →](layers-control-example.html) + + From 1ed9a6c7cebf391a893f643358e35b0cba8867e5 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 14:39:06 +0300 Subject: [PATCH 211/816] add draggable and transition docs --- DOCS-TODO | 28 ----- reference.html | 307 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 305 insertions(+), 30 deletions(-) diff --git a/DOCS-TODO b/DOCS-TODO index 59d9e754989..c60e29beb74 100644 --- a/DOCS-TODO +++ b/DOCS-TODO @@ -1,32 +1,4 @@ -NEW Transition - Transition(el, options) - - run(props) - - options - fps: 50 - easing: 'ease', - duration: 0.5 - fakeStepInterval: 100 - - events - start - step - end - -NEW Draggable - Draggable(element, dragStartTarget) - - enable() - disable() - - events - dragstart - predrag - drag - dragend - NEW IProjection project(latlng) unproject(point) diff --git a/reference.html b/reference.html index 78c3e70d645..df9186fab60 100644 --- a/reference.html +++ b/reference.html @@ -97,8 +97,8 @@

      DOM Utility

      @@ -1544,6 +1544,38 @@

      Options

      +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      loadingEvent + Fired when the tile layer starts loading tiles.
      loadEvent + Fired when the tile layer loaded all visible tiles.
      tileloadEvent + Fired when a tile loads.
      tileunloadEvent + Fired when a tile is removed (e.g. when you have unloadInvisibleTiles on).
      +

      Methods

      @@ -1824,6 +1856,16 @@

      Methods

      + + + + + + + + + +
      this Sets the opacity of the overlay.
      bringToFront()thisBrings the layer to the top of all overlays.
      bringToBack()thisBrings the layer to the bottom of all overlays.
      @@ -1880,6 +1922,12 @@

      Options

      0.2 Fill opacity. + + dashArray + String + null + A string that defines the stroke dash pattern. Doesn't work on canvas-powered layers (e.g. Android 2). + clickable Boolean @@ -3986,6 +4034,26 @@

      LayerEvent

      +

      TileEvent

      + + + + + + + + + + + + + + + + + +
      propertytypedescription
      tileHTMLElementThe tile element (image).
      urlStringThe source URL of the tile.
      +

      GeoJSON event

      @@ -4784,6 +4852,241 @@

      Properties

      + +

      L.Transition

      + +

      Used internally for most animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.

      + +
      var fx = new L.Transition(el, {duration: 0.5});
      +
      +fx.run({left: '300px', top: '500px'});
      + +

      Constructor

      + + + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Transition( + <HTMLElement> element, + <Transition options> options? ) + + new L.Transition() + Creates a Transition object tied to a particular element with the given options.
      + +

      Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      durationNumber0.5Duration of the animation in seconds.
      easingString'ease'One of the timing functions for the animation.
      fpsNumber50Frames per second for the timer fallback (IE6-9).
      fakeStepIntervalNumber100How often to fire the step event during transition with a timer (as native transitions don't support such events).
      + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      startEvent + Fired when the animation starts.
      stepEvent + Fired continuously during the animation.
      endEvent + Fired when the animation ends.
      + +

      Methods

      + + + + + + + + + + + + + +
      MethodReturnsDescription
      run( + <Object> properties ) + thisRun the animation with the given set of properties and their end values.
      + +

      Transition Properties

      + +

      An object literal of the following form:

      + +
      {
      +	'<style-property-1>': '<value-1>',
      +	'<style-property-2>': '<value-2>'
      +	// ...
      +}
      + + + + +

      L.Draggable

      + +

      A class for making DOM elements draggable (including touch support). Used internally for map and marker dragging.

      + +
      var draggable = new L.Draggable(elementToDrag);
      +draggable.enable();
      +
      + +

      Constructor

      + + + + + + + + + + + + + + +
      ConstructorUsageDescription
      L.Draggable( + <HTMLElement> element, + <HTMLElement> dragHandle? ) + + new L.Draggable() + Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).
      + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + + + + + + + + + + + + + +
      EventDataDescription
      dragstartEvent + Fired when the dragging starts.
      predragEvent + Fired continuously during dragging before each corresponding update of the element position.
      dragEvent + Fired continuously during dragging.
      dragendEvent + Fired when the dragging ends.
      + +

      Methods

      + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      enable()-Enables the dragging ability.
      disable()-Disables the dragging ability.
      + +

      Static Properties

      + + + + + + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      STARTStringName of the DOM event that initiates dragging. 'mousedown' for desktop browsers, 'touchstart' for mobile devices.
      MOVEStringName of the DOM event for drag moving. 'mousemove' for desktop browsers, 'touchmove' for mobile devices.
      ENDStringName of the DOM event that ends dragging. 'mouseup' for desktop browsers, 'touchend' for mobile devices.
      + + +

      IHandler

      An interface implemented by interaction handlers.

      From 97edb8d88db04d4f175612e5778871e07583411e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 14:53:24 +0300 Subject: [PATCH 212/816] minor download page edits --- download.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/download.md b/download.md index 3253fd8b71e..5cf58c03b4c 100644 --- a/download.md +++ b/download.md @@ -12,9 +12,13 @@ Besides the library itself, the download package contains full source code, unit Version Description + + Leaflet 0.4 + Stable version, released on July 27, 2012 + Leaflet 0.3.1 - Stable version, released on February 14, 2012 + Previous stable version, released on February 14, 2012 Leaflet master From 862fe30438bf6ca1dbdd91858be4071e069734da Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 15:53:46 +0300 Subject: [PATCH 213/816] add crs and projection docs, API docs now 100% COMPLETE!!! --- DOCS-TODO | 10 --- docs/css/screen.css | 4 + reference.html | 214 ++++++++++++++++++++++++++++++++++++++------ 3 files changed, 191 insertions(+), 37 deletions(-) delete mode 100644 DOCS-TODO diff --git a/DOCS-TODO b/DOCS-TODO deleted file mode 100644 index c60e29beb74..00000000000 --- a/DOCS-TODO +++ /dev/null @@ -1,10 +0,0 @@ - -NEW IProjection - project(latlng) - unproject(point) - -NEW ICRS - latLngToPoint(latlng, zoom) - pointToLatLng(point, zoom) - project(latlng) - scale(zoom) diff --git a/docs/css/screen.css b/docs/css/screen.css index a6334395bbe..06bbbe25c0e 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -129,6 +129,10 @@ p code, td:last-child code { color: #666; } +/*.api-page td:last-child pre { + margin-top: 0.5em; +}*/ + table { border-collapse: collapse; box-shadow: 0 3px 15px #f0f0f0; diff --git a/reference.html b/reference.html index df9186fab60..5275ee29a3b 100644 --- a/reference.html +++ b/reference.html @@ -24,7 +24,6 @@

      Map Methods

      Map Misc

      @@ -108,8 +107,8 @@

      Interfaces

    49. ILayer
    50. IControl
    51. -
    52. IProjection
    53. -
    54. ICRS
    55. +
    56. IProjection
    57. +
    58. ICRS
    59. Misc

      @@ -213,7 +212,7 @@

      Map State Options

      crs - CRS + CRS L.CRS.
      EPSG3857
      Coordinate Reference System to use. Don't change this if you're not sure what it means. @@ -949,29 +948,6 @@

      Properties

      -

      Projections

      - -

      You can specify different CRS for map to use through its crs option. Here's the list of available CRS:

      - - - - - - - - - - - - - - - - - - -
      CRSData
      L.CRS.EPSG3857EPSG:3857 (Spherical Mercator), used by most of commercial map providers (CloudMade, Google, Yahoo, Bing, etc.).
      L.CRS.EPSG4326EPSG:4326 (Plate Carree), very popular among GIS enthusiasts.
      L.CRS.EPSG3395EPSG:3395 (True Mercator), used by some map providers.
      -

      Map Panes

      @@ -2521,6 +2497,18 @@

      Methods

      this Removes all the layers from the group. + + eachLayers( + <Function> fn, + <Object> context? ) + + this + Iterates over the layers of the group, optionally specifying context of the iterator function. +
      group.eachLayer(function (layer) {
      +	layer.bindPopup('Hello');
      +});
      + + @@ -5260,6 +5248,178 @@

      Custom Control Example

      map.addControl(new MyControl('bar', {position: 'bottomleft'}));
      + + +

      IProjection

      + +

      An object with methods for projecting geographical coordinates of the world onto a flat surface (and back). See Map projection.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      project( + <LatLng> latlng ) + PointProjects geographical coordinates into a 2D point.
      unproject( + <Point> point ) + LatLngThe inverse of project. Projects a 2D point into geographical location.
      + +

      Defined Projections

      + +

      Leaflet comes with a set of already defined projections out of the box:

      + + + + + + + + + + + + + + + + + + + + + +
      ProjectionDescription
      L.Projection.SphericalMercatorSpherical 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.
      L.Projection.MercatorElliptical 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.
      L.Projection.LonLatEquirectangular, 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:3395 and Simple CRS.
      + + + + +

      ICRS

      + +

      Defines coordinate reference systems for projecting geographical points into pixel (screen) coordinates and back (and to coordinates in other units for WMS services). See Spatial reference system.

      + +

      Methods

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      latLngToPoint( + <LatLng> latlng, + <Number> zoom ) + PointProjects geographical coordinates on a given zoom into pixel coordinates.
      pointToLatLng( + <Point> point, + <Number> zoom ) + LatLngThe inverse of latLngToPoint. Projects pixel coordinates on a given zoom into geographical coordinates.
      project( + <LatLng> latlng ) + PointProjects geographical coordinates into coordinates in units accepted for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
      scale( + <Number> zoom ) + NumberReturns 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.
      + +

      Properties

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      PropertyTypeDescription
      projectionIProjectionProjection that this CRS uses.
      transformationTransformationTransformation that this CRS uses to turn projected coordinates into screen coordinates for a particular tile service.
      codeStringStandard code name of the CRS passed into WMS services (e.g. 'EPSG:3857').
      + +

      Defined CRS

      + +

      Leaflet comes with a set of already defined CRS to use out of the box:

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ProjectionDescription
      L.CRS.EPSG3857The 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.
      L.CRS.EPSG4326A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
      L.CRS.EPSG3395Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
      L.CRS.SimpleA simple CRS that maps longitude and latitude into x and y directly. May be used for maps of flat surfaces (e.g. game maps).
      + +

      If you want to use some obscure CRS not listed here, take a look at the Proj4Leaflet plugin.

      + +

      Global Switches

      Global switches are created for rare cases and generally make Leaflet to not detect a particular browser feature even if it's there. You need to set the switch as a global variable to true before including Leaflet on the page, like this:

      From 8f329343f583245ac774308b181c7fc1e6e3f261 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 16:12:20 +0300 Subject: [PATCH 214/816] fix sample maps border and margins --- docs/css/screen.css | 8 +++++--- examples/custom-icons.md | 6 +++--- examples/layers-control.md | 2 +- examples/quick-start.md | 8 ++++---- index.md | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 06bbbe25c0e..8d5e38a6a7c 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -304,11 +304,13 @@ a.nodocs { color: #bbb; } +.container .map { + border: 1px solid #ccc; + margin: 1.5em 0; +} + #map { height: 320px; - border: 1px solid #ccc; - margin-bottom: 20px; - margin-top: 34px; /*box-shadow: 0px 0px 10px #ccc; -moz-box-shadow: 0px 0px 10px #ccc; diff --git a/examples/custom-icons.md b/examples/custom-icons.md index 4928840eb18..51a88d6b35e 100644 --- a/examples/custom-icons.md +++ b/examples/custom-icons.md @@ -3,11 +3,11 @@ layout: tutorial title: Markers With Custom Icons --- -### Markers With Custom Icons +## Markers With Custom Icons In this tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map. -
      +
      [View example on a separate page →](custom-icons-example.html) @@ -44,7 +44,7 @@ Now putting a marker with this icon on a map is easy: L.marker([51.5, -0.09], {icon: greenIcon}).addTo(map); -
      +
      ### Defining an icon class diff --git a/examples/layers-control.md b/examples/layers-control.md index f30d14855d7..5d3b7ebe550 100644 --- a/examples/layers-control.md +++ b/examples/layers-control.md @@ -7,7 +7,7 @@ title: Layer Groups and Layers Control This tutorial will show you how to group several layers into one, and how to use the layers control to allow users to easily switch different layers on your map. -
      +
      [View example on a separate page →](ayers-control-example.html) diff --git a/examples/quick-start.md b/examples/quick-start.md index c30abe7ce6b..85bd31a16a4 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -8,7 +8,7 @@ title: Quick Start Guide This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events. -
      +
      [View example on a separate page →](quick-start-example.html) @@ -41,7 +41,7 @@ Now you're ready to initialize the map and do some stuff with it. ### Setting up the map -
      +
      Let's create a map of the center of London with pretty CloudMade tiles. First we'll initialize the map and set its view to our chosen geographical coordinates and a zoom level: @@ -66,7 +66,7 @@ It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enf ### Markers, circles and polygons -
      +
      Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker: @@ -91,7 +91,7 @@ Adding a polygon is as easy: ### Working with popups -
      +
      Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this: diff --git a/index.md b/index.md index 5677c9e03b0..ee29a0c1f32 100644 --- a/index.md +++ b/index.md @@ -11,7 +11,7 @@ It is built from the ground up to work efficiently on both desktop and mobile pl {: .usedby} Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [CityMaps](http://www.citymaps.com) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [skobbler](http://maps.skobbler.com/) ... -
      +
      In this basic example, we create a map with tiles of our choice, add a marker and bind a popup with some text to it: From 5d57d208fe7ff1981a7df8446fc1266eebcd1a65 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 26 Jul 2012 16:58:48 +0300 Subject: [PATCH 215/816] minor style tweaks --- docs/css/screen.css | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 8d5e38a6a7c..631098eb6e4 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -10,12 +10,10 @@ body { padding: 15px 40px 20px; width: 790px; - border: 1px solid #dfdfdf; + /*border: 1px solid #dfdfdf;*/ border-top: 0; - box-shadow: 0 0 50px rgba(0,0,0,0.1); - -moz-box-shadow: 0 0 50px rgba(0,0,0,0.1); - -webkit-box-shadow: 0 0 50px rgba(0,0,0,0.1); + box-shadow: 0 0 60px rgba(0,0,0,0.15); } h1 { margin-bottom: 10px; From bbe6a94a81f867310da10a3ec989c0da196bd886 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 26 Jul 2012 15:43:24 -0600 Subject: [PATCH 216/816] Explaining the filter option. --- examples/geojson.html | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/examples/geojson.html b/examples/geojson.html index fe37c8eead1..83833c9b4f8 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -131,7 +131,43 @@

      onEachFeature

      filter

      -

      The filter option is used to ...

      +

      The filter option can be used to control the visibility of GeoJSON features. To accomplish this we pass a function as the filter option. This function gets called for each feature in your GeoJSON layer, and gets passed the feature and the layer. You can then utilise the values in the feature's properties to control the visibility by returning true or false.

      + +

      In the example below "Busch Field" will not be shown on the map.

      + +
      var someFeatures = {
      +	"type": "FeatureCollection",
      +	"features": [
      +		{
      +			"type": "Feature",
      +			"properties": {
      +				"name": "Coors Field",
      +				"show_on_map": true
      +			},
      +			"geometry": {
      +				"type": "Point",
      +				"coordinates": [-104.99404, 39.75621]
      +			}
      +		},
      +		{
      +			"type": "Feature",
      +			"properties": {
      +				"name": "Busch Field",
      +				"show_on_map": false
      +			},
      +			"geometry": {
      +				"type": "Point",
      +				"coordinates": [-104.98404, 39.74621]
      +			}
      +		}
      +	]
      +};
      +
      +L.geoJson(someFeatures, {
      +	filter: function(feature, layer) {
      +		return feature.properties.show_on_map;
      +	}
      +}).addTo(map);

      Popups

      From 57c13390e91b56afef42b2be6e06f3328d532acc Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Thu, 26 Jul 2012 16:50:57 -0600 Subject: [PATCH 217/816] Style tutorial --- examples/geojson.html | 106 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/examples/geojson.html b/examples/geojson.html index 83833c9b4f8..93f05129b18 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -123,7 +123,111 @@

      Options

      style

      -

      The style option is used to ...

      +

      The style option can be used to style features two different ways. We can pass a simple object that styles all paths (polylines and polygons) the same way.

      + +
      var myStyle = {
      +	"color": "#ff7800",
      +	"weight": 5,
      +	"opacity": 0.65
      +};
      +
      +var myLines = {
      +	"type": "GeometryCollection",
      +	"features": [
      +		{
      +			"type": "LineString",
      +			"coordinates": [
      +				[-100, 40],
      +				[-105, 45],
      +				[-110, 55]
      +			]
      +		},
      +		{
      +			"type": "LineString",
      +			"coordinates": [
      +				[-105, 40],
      +				[-110, 45],
      +				[-115, 55]
      +			]
      +		}
      +	]
      +};
      +
      +L.geoJson(myLines, {
      +	style: myStyle
      +}).addTo(map);
      + +

      Alternatively, we can pass an function that styles individual features based on their properties. In the example below we check the "party" property and style our polygons accordingly.

      + +
      var republicanStyle = {
      +	"color": "#ff0000",
      +	"opacity": 1,
      +	"weight": 2,
      +	"fillOpacity": 0.4,
      +	"fillColor": "#ff0000"
      +
      +};
      +
      +var democratStyle = {
      +	"color": "#0000ff",
      +	"opacity": 1,
      +	"weight": 2,
      +	"fillOpacity": 0.4,
      +	"fillColor": "#0000ff"
      +
      +};
      +
      +var states = {
      +	"type": "FeatureCollection",
      +	"features": [
      +		{
      +			"type": "Feature",
      +			"properties": {
      +				"party": "Republican"
      +			},
      +			"geometry": {
      +				"type": "Polygon",
      +				"coordinates": [
      +					[
      +						[-104.05, 48.99],
      +						[-97.22, 48.98],
      +						[-96.58, 45.94],
      +						[-104.03, 45.94],
      +						[-104.05, 48.99]
      +					]
      +				]
      +			}
      +		},
      +		{
      +			"type": "Feature",
      +			"properties": {
      +				"party": "Democrat"
      +			},
      +			"geometry": {
      +				"type": "Polygon",
      +				"coordinates": [
      +					[
      +						[-109.05, 41.00],
      +						[-102.06, 40.99],
      +						[-102.03, 36.99],
      +						[-109.04, 36.99],
      +						[-109.05, 41.00]
      +					]
      +				]
      +			}
      +		}
      +	]
      +};
      +
      +L.geoJson(states, {
      +	style: function(feature) {
      +		if (feature.properties.party === "Republican") {
      +			return republicanStyle;
      +		} else if (feature.properties.party === "Democrat") {
      +			return democratStyle;
      +		}
      +	}
      +}).addTo(map);

      onEachFeature

      From 72c81f0f677ada39a2350aa714b776b8b77f1f3d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 27 Jul 2012 13:19:51 +0300 Subject: [PATCH 218/816] update docs and other minor things --- download.md | 2 +- index.md | 4 ++-- reference.html | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/download.md b/download.md index 5cf58c03b4c..89f79568b5c 100644 --- a/download.md +++ b/download.md @@ -14,7 +14,7 @@ Besides the library itself, the download package contains full source code, unit Leaflet 0.4 - Stable version, released on July 27, 2012 + Stable version, released on July 30, 2012 Leaflet 0.3.1 diff --git a/index.md b/index.md index ee29a0c1f32..8df52b39e08 100644 --- a/index.md +++ b/index.md @@ -2,14 +2,14 @@ layout: default --- -

      July 27, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

      +

      July 30, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 26 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. {: .usedby} -Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [CityMaps](http://www.citymaps.com) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [skobbler](http://maps.skobbler.com/) ... +Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [Topix](http://topix.com/) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [CityMaps](http://www.citymaps.com) ...
      diff --git a/reference.html b/reference.html index 5275ee29a3b..3700733d011 100644 --- a/reference.html +++ b/reference.html @@ -1494,6 +1494,12 @@

      Options

      1.0 The opacity of the tile layer. + + zIndex + Number + null + The explicit zIndex of the tile layer. Not set by default. + unloadInvisibleTiles Boolean @@ -1586,6 +1592,14 @@

      Methods

      this Changes the opacity of the tile layer. + + setZIndex( + <Number> zIndex ) + + + this + Sets the zIndex of the tile layer. + redraw() - @@ -3721,6 +3735,12 @@

      Options

      true If true, the control will be collapsed into an icon and expanded on mouse hover or touch. + + 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. + From 4da5ae5e20d2116c673ebfc6b7a90d8443540943 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 27 Jul 2012 15:18:52 +0300 Subject: [PATCH 219/816] add keyboard nav docs --- reference.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/reference.html b/reference.html index 3700733d011..4f4a069e515 100644 --- a/reference.html +++ b/reference.html @@ -277,6 +277,35 @@

      Interaction Options

      +

      Keyboard Navigation Options

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      keyboardBooleantrueMakes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.
      keyboardPanOffsetNumber80Amount of pixels to pan when pressing an arrow key.
      keyboardZoomOffsetNumber1Number of zoom levels to change when pressing + or - key.
      +

      Panning Inertia Options

      @@ -936,6 +965,11 @@

      Properties

      + + + + + From e57cce2678cf430fc0a313bcb065f792adb2958a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 27 Jul 2012 17:59:28 +0300 Subject: [PATCH 220/816] document keyboard events, highlight focused maps --- docs/css/screen.css | 3 +++ reference.html | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/css/screen.css b/docs/css/screen.css index 631098eb6e4..417a95baf77 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -306,6 +306,9 @@ a.nodocs { border: 1px solid #ccc; margin: 1.5em 0; } +.container .map:focus { + border-color: #999; +} #map { height: 320px; diff --git a/reference.html b/reference.html index 4f4a069e515..8e82a0d1ad6 100644 --- a/reference.html +++ b/reference.html @@ -444,6 +444,16 @@

      Events

      + + + + + + + + + + +
      IHandler Box (shift-drag with mouse) zoom handler.
      keyboardIHandlerKeyboard navigation handler.
      zoomControl Control.ZoomMouseEvent Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event.
      focusEvent + Fired when the user focuses the map either by tabbing to it or clicking/panning.
      blurEvent + Fired when the map looses focus.
      preclick MouseEvent From 81746a8aaed71feb02045ac14d9f3b057ab6e9cd Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 27 Jul 2012 18:34:24 +0300 Subject: [PATCH 221/816] update features --- features.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features.html b/features.html index 9f7a86ffafa..f753579fba8 100644 --- a/features.html +++ b/features.html @@ -39,7 +39,8 @@

      On Desktop Browsers

      • Scroll wheel zoom
      • Double click zoom
      • -
      • Shift-drag zoom to bounding box
      • +
      • Zoom to area (shift-drag)
      • +
      • Keyboard navigation (with arrows and +/- keys)
      From facdcbfbdff74f35b15f4e6a6400f6d3ef4d23d5 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Sat, 28 Jul 2012 00:41:12 -0600 Subject: [PATCH 222/816] Finishing up GeoJSON tutorial. --- examples/geojson-example.html | 143 +++++++++++++++------------------- examples/geojson.html | 142 +++++++++++---------------------- 2 files changed, 109 insertions(+), 176 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 20a4d25efd6..9afed090cf2 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -1,106 +1,89 @@ - Leaflet GeoJSON example + Leaflet Layers Control Example + - - - -
      + + + diff --git a/examples/geojson.html b/examples/geojson.html index 93f05129b18..66ffbef6814 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -229,9 +229,54 @@

      style

      } }).addTo(map); +

      pointToLayer

      + +

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      + +

      Here we're using the pointToLayer option to create a CircleMarker:

      + +
      var geojsonMarkerOptions = {
      +	radius: 8,
      +	fillColor: "#ff7800",
      +	color: "#000",
      +	weight: 1,
      +	opacity: 1,
      +	fillOpacity: 0.8
      +};
      +
      +L.geoJson(someGeojsonFeature, {
      +	pointToLayer: function (feature, latlng) {
      +		return L.circleMarker(latlng, geojsonMarkerOptions);
      +	}
      +}).addTo(map);
      +

      onEachFeature

      -

      The onEachFeature option is used to ...

      +

      The onEachFeature option is a function that gets triggered when each feature added to a GeoJSON layer. A common reason to use this option is to attach a popup to features when they are clicked.

      + +
      function onEachFeature (feature, layer) {
      +	// Does this feature have a property named popupContent?
      +	if (feature.properties && feature.properties.popupContent) {
      +		layer.bindPopup(feature.properties.popupContent);
      +	}
      +}
      +
      +var geojsonFeature = {
      +	"type": "Feature",
      +	"properties": {
      +		"name": "Coors Field",
      +		"amenity": "Baseball Stadium",
      +		"popupContent": "This is where the Rockies play!"
      +	},
      +	"geometry": {
      +		"type": "Point",
      +		"coordinates": [-104.99404, 39.75621]
      +	}
      +};
      +
      +L.geoJson(geojsonFeature, {
      +	onEachFeature: onEachFeature
      +}).addTo(map);

      filter

      @@ -273,99 +318,4 @@

      filter

      } }).addTo(map); -

      Popups

      - -

      We can use popups to show information about features when they are clicked. To accomplish this we'll utilise the onEachFeature option of the GeoJSON layer.

      - -
      function onEachFeature (feature, layer) {
      -	// Does this feature have a property named popupContent
      -	if (feature.properties && feature.properties.popupContent) {
      -		layer.bindPopup(feature.properties.popupContent);
      -	}
      -}
      -
      -var geojsonFeature = {
      -	"type": "Feature",
      -	"properties": {
      -		"name": "Coors Field",
      -		"amenity": "Baseball Stadium",
      -		"popupContent": "This is where the Rockies play!"
      -	},
      -	"geometry": {
      -		"type": "Point",
      -		"coordinates": [-104.99404, 39.75621]
      -	}
      -};
      -
      -L.geoJson(geojsonFeature, {
      -	onEachFeature: onEachFeature
      -}).addTo(map);
      - -

      Styling Features

      - -

      We can also listen to the featureparse event to style our Polyline and Polygon features. As with our popup content, we can store our styling information in the properties of the GeoJSON object as well. These style properties should match those found in path options. Our feature with styling information might look something like:

      - -
      var freeBus = {
      -	"type": "Feature",
      -	"geometry": {
      -		"type": "LineString",
      -		"coordinates": [
      -			[-104.98726, 39.74136],
      -			[-104.98720, 39.74132],
      -			[-104.98715, 39.74127],
      -			[-104.98713, 39.74117],
      -			[-104.98712, 39.74106], ...
      -		]
      -	},
      -	"properties": {
      -		"name": "16th Street Free Bus",
      -		"style": {
      -			"color": "#004070",
      -			"weight": 4,
      -			"opacity": 0.9
      -		},
      -		"popupContent": "This is the 16th street free bus ..."
      -	}
      -};
      - -

      To change the feature's style from the Leaflet default, we simply call the setStyle method on our layer (e.layer) in our featureparse event listener.

      - -
      geojsonLayer.on("featureparse", function (e){
      -	if (e.properties && e.properties.style && e.layer.setStyle){
      -		// The setStyle method isn't available for Points. More on that below ...
      -		e.layer.setStyle(e.properties.style);
      -	}
      -});
      - -

      Styling Points

      - -

      Points are handled differently than polylines and polygons. By default simple markers are drawn for GeoJSON Points. We can alter this by passing a pointToLayer function in a GeoJSON options object when creating the GeoJSON layer. This function is passed a LatLng and should return an instance of ILayer, in this case likely a Marker or CircleMarker.

      - -

      Here we're using a CircleMarker:

      - -
      var geojsonMarkerOptions = {
      -	radius: 8,
      -	fillColor: "#ff7800",
      -	color: "#000",
      -	weight: 1,
      -	opacity: 1,
      -	fillOpacity: 0.8
      -};
      -
      -var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
      -	pointToLayer: function (latlng) {
      -		return new L.CircleMarker(latlng, geojsonMarkerOptions);
      -	}
      -});
      - -

      And here's an example of using a custom Marker:

      - -
      var geojsonLayer = new L.GeoJSON(someGeojsonFeature, {
      -	pointToLayer: function (latlng) {
      -		return new L.Marker(latlng, {
      -			icon: new MyCustomIcon()
      -		});
      -	}
      -});
      -

      View the example page to see in detail what is possible with the GeoJSON layer.

      From 754e46c9b225596e77e33b3f013c7c7472316beb Mon Sep 17 00:00:00 2001 From: mourner Date: Sat, 28 Jul 2012 14:32:45 +0300 Subject: [PATCH 223/816] improve GeoJSON example --- examples/geojson-example.html | 6 +- examples/geojson.html | 205 +++++++++++++--------------------- 2 files changed, 79 insertions(+), 132 deletions(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 9afed090cf2..59e90b9048f 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -41,7 +41,7 @@ layer.bindPopup(popupContent); } - L.geoJson({features: [bicycleRental, campus]}, { + L.geoJson([bicycleRental, campus], { style: function (feature) { return feature.properties && feature.properties.style; @@ -74,7 +74,7 @@ onEachFeature: onEachFeature }).addTo(map); - var coorsLayer = L.geoJson(null, { + var coorsLayer = L.geoJson(coorsField, { pointToLayer: function (feature, latlng) { return L.marker(latlng, {icon: baseballIcon}); @@ -83,8 +83,6 @@ onEachFeature: onEachFeature }).addTo(map); - coorsLayer.addData(coorsField); - diff --git a/examples/geojson.html b/examples/geojson.html index 66ffbef6814..bf2e1b72015 100644 --- a/examples/geojson.html +++ b/examples/geojson.html @@ -7,7 +7,7 @@

      Using GeoJSON with Leaflet

      GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

      -
      +
      -

      View example on a separate page →

      +

      View example on a separate page →

      About GeoJSON

      @@ -91,11 +91,7 @@

      About GeoJSON

      GeoJSON is a format for encoding a variety of geographic data structures. A GeoJSON object may represent a geometry, a feature, or a collection of features. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.
      -

      Leaflet supports all of the GeoJSON types above but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. (see example)

      - -

      The GeoJSON layer

      - -

      GeoJSON objects are added to the map through a GeoJSON layer. To create a GeoJSON layer and add it to a map we can use the following code.

      +

      Leaflet supports all of the GeoJSON types above, but Features and FeatureCollections work best as they allow you to describe features with a set of properties. We can even use these properties to style our Leaflet vectors. Here's an example of a simple GeoJSON feature:

      var geojsonFeature = {
       	"type": "Feature",
      @@ -109,13 +105,17 @@ 

      The GeoJSON layer

      "coordinates": [-104.99404, 39.75621] } }; +
      + +

      The GeoJSON layer

      + +

      GeoJSON objects are added to the map through a GeoJSON layer. To create it and add it to a map, we can use the following code:

      -L.geoJson(geojsonFeature).addTo(map); +
      L.geoJson(geojsonFeature).addTo(map);

      Alternatively, we could create an empty GeoJSON layer and assign it to a variable so that we can add more features to it later.

      var myLayer = L.geoJson().addTo(map);
      -
       myLayer.addData(geojsonFeature);
       
      @@ -123,108 +123,61 @@

      Options

      style

      -

      The style option can be used to style features two different ways. We can pass a simple object that styles all paths (polylines and polygons) the same way.

      +

      The style option can be used to style features two different ways. First, we can pass a simple object that styles all paths (polylines and polygons) the same way:

      + +
      var myLines = [{
      +	"type": "LineString",
      +	"coordinates": [[-100, 40], [-105, 45], [-110, 55]]
      +}, {
      +	"type": "LineString",
      +	"coordinates": [[-105, 40], [-110, 45], [-115, 55]]
      +}];
       
      -
      var myStyle = {
      +var myStyle = {
       	"color": "#ff7800",
       	"weight": 5,
       	"opacity": 0.65
       };
       
      -var myLines = {
      -	"type": "GeometryCollection",
      -	"features": [
      -		{
      -			"type": "LineString",
      -			"coordinates": [
      -				[-100, 40],
      -				[-105, 45],
      -				[-110, 55]
      -			]
      -		},
      -		{
      -			"type": "LineString",
      -			"coordinates": [
      -				[-105, 40],
      -				[-110, 45],
      -				[-115, 55]
      -			]
      -		}
      -	]
      -};
      -
       L.geoJson(myLines, {
       	style: myStyle
       }).addTo(map);
      -

      Alternatively, we can pass an function that styles individual features based on their properties. In the example below we check the "party" property and style our polygons accordingly.

      +

      Alternatively, we can pass a function that styles individual features based on their properties. In the example below we check the "party" property and style our polygons accordingly:

      -
      var republicanStyle = {
      -	"color": "#ff0000",
      -	"opacity": 1,
      -	"weight": 2,
      -	"fillOpacity": 0.4,
      -	"fillColor": "#ff0000"
      -
      -};
      -
      -var democratStyle = {
      -	"color": "#0000ff",
      -	"opacity": 1,
      -	"weight": 2,
      -	"fillOpacity": 0.4,
      -	"fillColor": "#0000ff"
      -
      -};
      -
      -var states = {
      -	"type": "FeatureCollection",
      -	"features": [
      -		{
      -			"type": "Feature",
      -			"properties": {
      -				"party": "Republican"
      -			},
      -			"geometry": {
      -				"type": "Polygon",
      -				"coordinates": [
      -					[
      -						[-104.05, 48.99],
      -						[-97.22, 48.98],
      -						[-96.58, 45.94],
      -						[-104.03, 45.94],
      -						[-104.05, 48.99]
      -					]
      -				]
      -			}
      -		},
      -		{
      -			"type": "Feature",
      -			"properties": {
      -				"party": "Democrat"
      -			},
      -			"geometry": {
      -				"type": "Polygon",
      -				"coordinates": [
      -					[
      -						[-109.05, 41.00],
      -						[-102.06, 40.99],
      -						[-102.03, 36.99],
      -						[-109.04, 36.99],
      -						[-109.05, 41.00]
      -					]
      -				]
      -			}
      -		}
      -	]
      -};
      +
      var states = [{
      +	"type": "Feature",
      +	"properties": {"party": "Republican"},
      +	"geometry": {
      +		"type": "Polygon",
      +		"coordinates": [[
      +			[-104.05, 48.99],
      +			[-97.22,  48.98],
      +			[-96.58,  45.94],
      +			[-104.03, 45.94],
      +			[-104.05, 48.99]
      +		]]
      +	}
      +}, {
      +	"type": "Feature",
      +	"properties": {"party": "Democrat"},
      +	"geometry": {
      +		"type": "Polygon",
      +		"coordinates": [[
      +			[-109.05, 41.00],
      +			[-102.06, 40.99],
      +			[-102.03, 36.99],
      +			[-109.04, 36.99],
      +			[-109.05, 41.00]
      +		]]
      +	}
      +}];
       
       L.geoJson(states, {
       	style: function(feature) {
      -		if (feature.properties.party === "Republican") {
      -			return republicanStyle;
      -		} else if (feature.properties.party === "Democrat") {
      -			return democratStyle;
      +		switch (feature.properties.party) {
      +			case 'Republican': return {color: "#ff0000"};
      +			case 'Democrat':   return {color: "#0000ff"};
       		}
       	}
       }).addTo(map);
      @@ -250,13 +203,15 @@

      pointToLayer

      } }).addTo(map);
      +

      We could also set the style property in this example — Leaflet is smart enough to apply styles to GeoJSON points if you create a vector layer like circle inside the pointToLayer function.

      +

      onEachFeature

      -

      The onEachFeature option is a function that gets triggered when each feature added to a GeoJSON layer. A common reason to use this option is to attach a popup to features when they are clicked.

      +

      The onEachFeature option is a function that gets called on each feature before adding it to a GeoJSON layer. A common reason to use this option is to attach a popup to features when they are clicked.

      -
      function onEachFeature (feature, layer) {
      -	// Does this feature have a property named popupContent?
      -	if (feature.properties && feature.properties.popupContent) {
      +
      function onEachFeature(feature, layer) {
      +	// does this feature have a property named popupContent?
      +	if (feature.properties && feature.properties.popupContent) {
       		layer.bindPopup(feature.properties.popupContent);
       	}
       }
      @@ -284,33 +239,27 @@ 

      filter

      In the example below "Busch Field" will not be shown on the map.

      -
      var someFeatures = {
      -	"type": "FeatureCollection",
      -	"features": [
      -		{
      -			"type": "Feature",
      -			"properties": {
      -				"name": "Coors Field",
      -				"show_on_map": true
      -			},
      -			"geometry": {
      -				"type": "Point",
      -				"coordinates": [-104.99404, 39.75621]
      -			}
      -		},
      -		{
      -			"type": "Feature",
      -			"properties": {
      -				"name": "Busch Field",
      -				"show_on_map": false
      -			},
      -			"geometry": {
      -				"type": "Point",
      -				"coordinates": [-104.98404, 39.74621]
      -			}
      -		}
      -	]
      -};
      +
      var someFeatures = [{
      +	"type": "Feature",
      +	"properties": {
      +		"name": "Coors Field",
      +		"show_on_map": true
      +	},
      +	"geometry": {
      +		"type": "Point",
      +		"coordinates": [-104.99404, 39.75621]
      +	}
      +}, {
      +	"type": "Feature",
      +	"properties": {
      +		"name": "Busch Field",
      +		"show_on_map": false
      +	},
      +	"geometry": {
      +		"type": "Point",
      +		"coordinates": [-104.98404, 39.74621]
      +	}
      +}];
       
       L.geoJson(someFeatures, {
       	filter: function(feature, layer) {
      
      From 706159078479188782965fd130dffff3be45ffbf Mon Sep 17 00:00:00 2001
      From: mourner 
      Date: Sun, 29 Jul 2012 02:20:15 +0300
      Subject: [PATCH 224/816] add developer blog and release post
      
      ---
       _layouts/default.html                     |   4 +-
       _layouts/post.html                        |  13 ++
       _posts/2012-07-30-leaflet-0-4-released.md | 233 ++++++++++++++++++++++
       atom.xml                                  |  31 +++
       blog.md                                   |  19 +-
       docs/css/screen.css                       |  23 ++-
       examples.md                               |   2 +-
       index.md                                  |   2 +-
       8 files changed, 315 insertions(+), 12 deletions(-)
       create mode 100644 _layouts/post.html
       create mode 100644 _posts/2012-07-30-leaflet-0-4-released.md
       create mode 100644 atom.xml
      
      diff --git a/_layouts/default.html b/_layouts/default.html
      index 9b3ca05474a..40e947f9cf1 100644
      --- a/_layouts/default.html
      +++ b/_layouts/default.html
      @@ -21,6 +21,8 @@
       
       	
       
      +	
      +
       	
       	
       	
      @@ -121,7 +123,7 @@ 

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv {% if page.title == 'Blog' %} Blog {% else %} - Blog + Blog {% endif %}
    60. Forum
    61. diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 00000000000..d7886299cff --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,13 @@ +--- +layout: default +root: ../../../ +post: true +--- + +

      ← Back to the list of blog posts

      + +

      {{ page.title }}

      + + + +{{ content }} diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md new file mode 100644 index 00000000000..42f7f1e2840 --- /dev/null +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -0,0 +1,233 @@ +--- +layout: post +title: Leaflet 0.4 Released +description: After 5.5 months of development with 32 contributors involved, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and lots of great improvements, along with a major update to documentation, a plugins page and the launch of the developer blog. +--- + +After 5.5 months of development with [32 contributors](https://github.com/CloudMade/Leaflet/graphs/contributors?from=2012-02-15&to=2012-07-30&type=c) involved since the previous stable release, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and *lots* of great improvements and important bugfixes, along with a major update to documentation, an official plugins page and the launch of this developer blog. Lets take a look at the improvements one by one. + +### Simpler API + +Leaflet 0.4 contains several API improvements that allow you to write simpler, terser code ([jQuery](http://jquery.com)-like), while being backwards compatible with the previous approach (so that you can use both styles). + + L.marker([51.5, -0.09]) + .addTo(map) + .bindPopup('Hello world!') + .openPopup(); + +First, Leaflet methods now accept [LatLng][], [LatLngBounds][], [Point][] and [Bounds][] objects in a simple array form, so you don't need to always create them explicitly: + + map.panTo([50, 30]); // the same as: + map.panTo(new L.LatLng(50, 30)); + +Second, Map methods like [addLayer][], [addControl][], [openPopup][] got their counterparts from the other side: + + marker.addTo(map); // same as map.addLayer(marker) + control.addTo(map); // map.addControl(control) + popup.openOn(map); // map.openPopup(popup) + +Along with the fact that all Leaflet methods that don't explicitly return a value return the object itself, this allows for convenient method chaining. + +Third, Leaflet classes now come with lowercase shortcuts (class factories) that allow you to create objects without the new keyword, which makes chained code look nicer: + + L.map('map').fitWorld(); // same as + (new L.Map('map')).fitWorld(); + +### Notable New Features + +
      + +#### Improved Zoom Animation + +Markers, popups, vector layers and image overlays were hidden during zoom in the previous version, but now (thanks to [Dave Leaver][]) they all have beautiful, smooth zoom animation unlike any other existing mapping libraries. Try zooming on the map above to see how it looks! If you have thousands of markers on a map though, you can turn off the marker animation if it gets slow with the Map's `markerZoomAnimation` option. + +In addition, now tiles won't disappear if you zoom in or out more than once quickly. + +#### Keyboard Navigation + +Leaflet maps got a nice accessibility boost in 0.4 with the new keyboard handler (contributed by [Eric Martinez](https://github.com/ericmmartinez)), enabled by default. It allows users to navigate the map by using arrow keys for panning and +/- keys for zooming (after making the map focused either by tabbing to it or clicking on it). Try it on the map above, it feels very nice! + +#### Panning Inertia + +Another nice improvement comes to the panning experience --- now it has an inertial movement effect, where the map smoothly continues to move after a quick pan. Feels especially natural on touch devices --- and it's enabled by default too, try it now! It's also highly configurable, allowing you to set the maximum speed of the effect, decceleration, and time threshold under which it triggers. + +#### Pinch-Zoom on Android 4 + +In the previous Leaflet version, pinch-zoom only worked on iOS devices, but now comes finally to Android! Works from Android 4+ not only in the stock browser, but also on Chrome and Firefox for Android. + +#### Scale Control + +A simple, lightweight control that indicates the scale of the current map view in metric and/or imerial systems. As usual, you can customize its appearance with CSS. Take a look at the bottom left corner of the map above! + + L.control.scale().addTo(map); + +#### Polyline and Polygon Editing + +Allows users to edit polylines and polygons with a simple, intuitive interface. Note that this feature will eventually be merged into [Leaflet.draw][] --- an awesome plugin for drawing shapes by Jacob Toye. + + polygon.editing.enable(); + +#### Div-based Icons + +In addition to the image-based [Icon][] class, Leaflet 0.4 gets a [DivIcon][] class for creating lightweight div-based markers (that can contain custom HTML and can be styled with CSS). For example, you can see them in action when editing polylines (the square handles), or in the [Leaflet.markercluster][] plugin I'll talk about later (the colored clusters). + + L.marker([50.505, 30.57], { + icon: L.divIcon({className: 'my-div-icon'}) + }).addTo(map); + +#### Rectangle Layer + +Rectangle is a convenient shortcut for creating rectangular area layers. You could do this earlier with polygons, but this is easier: + + L.rectangle([[51.505, -0.03], [51.5, -0.045]]).addTo(map); + +### API improvements + +#### GeoJSON API + +[GeoJSON][] API was improved to be simpler and much more flexible. [Jason Sanford][] wrote a [great tutorial](../../../examples/geojson.html) that showcases the new API. The changes are not backwards-compatible though, so be sure to update your old code. + +#### Icon API + +[Icon][] API was improved to be simpler and more flexible, and the changes are not backwards-compatible too (the old code can be updated very quickly though). Check out the updated [Custom Icons tutorial](../../../examples/custom-icons.html), or head straigt to the [API docs](../../../reference.html#icon). + +#### Control API + +Custom Controls are much easier to create now --- checkout the [API docs](../../../reference.html#icontrol) that also have a simple example. + +#### Better Events API + +[Aaron King][] brough some improvements to [event methods](../../../reference.html#events). `on` and `off` methods can now accept multiple event types at once as a string space-separated types: + + map.on('click dblclick moveend', doStuff); + +Also, they can accept an object with types and listener functions as key/value pairs, like this: + + marker.on({ + click: onMarkerClick, + dragend: onMarkerDragEnd + }); + +Moreover, now if only specify an event type to the `off` method, it will remove all listeners tied to this event. + + map.off('click'); + +#### Other API Improvements + +Leaflet 0.4 features more than 30 new methods, options and events across different Leaflet classes that make the API more complete and powerful. Check out the [full changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md#other-api-improvements) for the complete list. + +### Performance and Usability Improvements + +You may think that Leaflet is unbelievably fast already, but this version brings several performance improvements that makes it even faster. + + * Panning, map resizing and pinch-zoom performance was improved (some tricks behind this will be explained in a future blog post). + * Updating and removing vector layers on the canvas backend (e.g. on Android 2) works many times faster. + * Box shadows on controls were replaced with simple borders on mobile devices to improve performance. + * Vector layers won't flicker after each panning on iOS now. + +In addition, there are several usability improvents not already mentioned: + + * Panning now works even if there are markers under the cursor (helps on crowded maps). + * Popup appearance is slightly improved. + * Tile layer now has detectRetina option that, when enabled, doubles the tile resolution for retina displays (contributed by [Mithgol][]) . + +### Bugfixes + +Leaflet 0.4 brings around 45 bugfixes that make it more stable and reliable across all browsers and platforms. Notable bugfixes include the dreaded iOS bug that caused the map to completely disappear after pinch-zooming in some rare cases, broken zooming on IE10 beta, broken Leaflet maps on pages served with an XHTML content type, and incorrect zooming on maps inside a fixed-position element. + +Here's [a full list of bugfixes](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md#bug-fixes) in the changelog. + +### Upgrading from older versions + +Besides the GeoJSON and Icon changes mentioned above, here's a [list of potentially breaking changes](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md#other-breaking-api-changes) --- read it carefully when updating your code (shouldn't take much time though). + +Download options for Leaflet 0.4 (including the actual download, the CDN-hosted version, and intructions for building manually) are listed on the [download page](../../../download.html). + +### Documentation Update + +Until now, Leaflet API reference was incomplete. But for this release, enourmous effort was put into making it 100% complete, up-to-date and generally the best API reference page you've ever seen. All remaining classes, methods, options, events and properties were carefully documented and more code examples added, and the docs will always be kept up-to-date from now on. + +Besides, the design of the page was significantly improved --- with better colors, font, spacing, hyphenation, manually adjusted column widths, etc. --- lots of detail to make it beautiful and easy to read. + +### Plugins Page + +Leaflet website now has an official [plugins page](../../../plugins.html) that lists many Leaflet plugins created by the awesome Leaflet community, adding lots of great features and helping with service integration. + +One plugin I'd like to mention is [Leaflet.markercluster][] by [Dave Leaver], currently the best marker clustering plugin I've ever seen among any mapping libraries --- it's fast, beautiful, provides smooth animations for clusters, includes a smart Google Earth-style solution for crowded markers on the last zoom level (by [George MacKerron][]), can highlight the area covered by a cluster on hover, works well on mobile devices, and can be customized easily. I think we'll cover this plugin in more detail in one of the next posts. + +Another plugin to note is [Leaflet.draw][] by [Jacob Toye][], inspired by a similar plugin by [Bruno B](https://github.com/brunob). It enables drawing features like polylines, polygons, rectangles, circles and markers through a very nice user-friendly interface with icons and hints. Other editing-related code will probably move into this plugin in future. + +Also, thanks to [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin by [Kartena](http://www.kartena.se/), GIS enthusiasts can now enjoy Leaflet for maps with some quirky and rare projections. + +One more Leaflet-based creation everyone needs to check out is [OSM Buildings](http://flyjs.com/buildings/) by [Jan Marsch](http://flyjs.com/buildings/about.php), an amazing JS library for visualizing 3D OSM building data on top of Leaflet maps. Incredibly cool stuff. + +### Developer Blog + +This is the first post of the official Leaflet developer blog, that will become the main place for all important Leaflet-related news, tutorials, tips and development notes. + +### Big Players Using Leaflet + +Since the previous release, Leaflet got adopted by many great companies, including [Flickr](http://flickr.com/map), [foursquare](http://foursquare.com) and [Wikimedia Foundation](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) (featured on [frontpage](../../../index.html) now). This is a really exciting time for Leaflet and open source maps, and I look forward to see many other companies follow this awesome trend in future. + +### Thank You + +I'd like to thank all the awesome people that helped Leaflet becoming what it is now --- contributed code, reported bugs, used Leaflet on their websites, told collegues about it, talked about it on conferences, etc. Keep up the great work! + +Special thanks go to [Dave Leaver][] for his inspiring contributions including improved zoom animation and the state-of-the-art clustering plugin, and [Jason Sanford][] for his friendly support (and setting up the Leaflet CDN among other things). + +And, of course, thanks to my amazing company, [CloudMade](http://cloudmade.com), for embracing open source and supporting this development. + +Sinerely,
      +Vladimir Agafonkin, Leaflet maintainer. + + + [LatLng]: ../../../reference.html#latlng + [LatLngBounds]: ../../../reference.html#latlngbounds + [Point]: ../../../reference.html#point + [Bounds]: ../../../reference.html#bounds + [Icon]: ../../../reference.html#icon + [DivIcon]: ../../../reference.html#divicon + [GeoJSON]: ../../../reference.html#geojson + + [addControl]: ../../../reference.html#map-addcontrol + [addLayer]: ../../../reference.html#map-addlayer + [openPopup]: ../../../reference.html#map-openpopup + + [Leaflet.draw]: https://github.com/jacobtoye/Leaflet.draw + [Leaflet.markercluster]: https://github.com/danzel/Leaflet.markercluster + + [Dave Leaver]: https://github.com/danzel + [Jason Sanford]: https://github.com/JasonSanford + [Aaron King]: https://github.com/Guiswa + [Mithgol]: https://github.com/Mithgol + [George MacKerron]: https://github.com/jawj/ + [Jacob Toye]: https://github.com/jacobtoye + + diff --git a/atom.xml b/atom.xml new file mode 100644 index 00000000000..3efaa4132bf --- /dev/null +++ b/atom.xml @@ -0,0 +1,31 @@ +--- +layout: nil +title: Leaflet Developer Blog Atom Feed +--- + + + + Leaflet Dev Blog + + + + + {{ site.time | date_to_xmlschema }} + http://leaflet.cloudmade.com + + + + {% for post in site.posts %} + + {{ post.title }} + + {{ post.date | date_to_xmlschema }} + http://leaflet.cloudmade.com{{ post.id }} + {{ post.content | xml_escape }} + + {% endfor %} + + diff --git a/blog.md b/blog.md index 291e08766ba..f05409ad72a 100644 --- a/blog.md +++ b/blog.md @@ -3,4 +3,21 @@ layout: default title: Blog --- -Blog will be here. \ No newline at end of file +## Leaflet Developer Blog + +The main place for all important Leaflet-related news, tutorials, tips and development notes. + +--- + +{% for post in site.posts %} +
      + +
      +

      {{ post.title }}

      +

      {{ post.description }}

      +
      +
      +{% unless forloop.last %}
      {% endunless %} +{% endfor %} diff --git a/docs/css/screen.css b/docs/css/screen.css index 417a95baf77..f385889d8c6 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -310,14 +310,6 @@ a.nodocs { border-color: #999; } -#map { - height: 320px; - - /*box-shadow: 0px 0px 10px #ccc; - -moz-box-shadow: 0px 0px 10px #ccc; - -webkit-box-shadow: 0px 0px 10px #ccc;*/ - } - h3 span { color: #888; } @@ -507,3 +499,18 @@ p.notice { white-space: nowrap; overflow: hidden; } + +.post-title { + margin-top: 0; +} + +.post-date { + color: #777; + font-size: 18px; + line-height: 1; +} + +.post-meta { + color: #888; + margin-top: -1em; +} diff --git a/examples.md b/examples.md index 20cee828f5f..33d7dc8618b 100644 --- a/examples.md +++ b/examples.md @@ -24,7 +24,7 @@ In this tutorial, you'll learn how to create a fullscreen map tuned for mobile d *** [][3] -### [Markers With Custom Icons][3] +### [Markers with Custom Icons][3] In this pretty tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map. diff --git a/index.md b/index.md index 8df52b39e08..55985d38187 100644 --- a/index.md +++ b/index.md @@ -11,7 +11,7 @@ It is built from the ground up to work efficiently on both desktop and mobile pl {: .usedby} Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [Topix](http://topix.com/) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [CityMaps](http://www.citymaps.com) ... -
      +
      In this basic example, we create a map with tiles of our choice, add a marker and bind a popup with some text to it: From 4b8e9e4a29e3b7666930113dedb13490484f1931 Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 30 Jul 2012 01:34:17 +0300 Subject: [PATCH 225/816] add disquis comments to posts --- _layouts/post.html | 16 ++++++++++++++++ docs/css/screen.css | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/_layouts/post.html b/_layouts/post.html index d7886299cff..8825a654b94 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -11,3 +11,19 @@

      {{ page.title }}

      {{ content }} + +
      + + + +comments powered by Disqus + diff --git a/docs/css/screen.css b/docs/css/screen.css index f385889d8c6..fd4025adc8c 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -514,3 +514,7 @@ p.notice { color: #888; margin-top: -1em; } + +#disqus_thread { + margin-top: 3em; +} From 9559344d3d4f042f210d96fe6e6a02f56a697657 Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 30 Jul 2012 01:34:53 +0300 Subject: [PATCH 226/816] minor fixes --- _posts/2012-07-30-leaflet-0-4-released.md | 16 ++++++++++++---- index.md | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index 42f7f1e2840..fac0c41e90a 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -53,7 +53,7 @@ Another nice improvement comes to the panning experience --- now it has an inert #### Pinch-Zoom on Android 4 -In the previous Leaflet version, pinch-zoom only worked on iOS devices, but now comes finally to Android! Works from Android 4+ not only in the stock browser, but also on Chrome and Firefox for Android. +In the previous Leaflet version, pinch-zoom only worked on iOS devices, but now it finally comes to Android! Works for Android 4+ not only in the stock browser, but also on Chrome and Firefox for Android. #### Scale Control @@ -108,7 +108,7 @@ Also, they can accept an object with types and listener functions as key/value p dragend: onMarkerDragEnd }); -Moreover, now if only specify an event type to the `off` method, it will remove all listeners tied to this event. +Moreover, now if you only specify an event type to the `off` method, it will remove all listeners tied to this event. map.off('click'); @@ -118,7 +118,7 @@ Leaflet 0.4 features more than 30 new methods, options and events across differe ### Performance and Usability Improvements -You may think that Leaflet is unbelievably fast already, but this version brings several performance improvements that makes it even faster. +You may think that Leaflet is unbelievably fast already, but this version brings several performance improvements that make it even faster. * Panning, map resizing and pinch-zoom performance was improved (some tricks behind this will be explained in a future blog post). * Updating and removing vector layers on the canvas backend (e.g. on Android 2) works many times faster. @@ -143,6 +143,14 @@ Besides the GeoJSON and Icon changes mentioned above, here's a [list of potentia Download options for Leaflet 0.4 (including the actual download, the CDN-hosted version, and intructions for building manually) are listed on the [download page](../../../download.html). +### Code Stats + +I'm still commited to keeping Leaflet as small and lightweight as possible. Here's a breakdown of the current size of the library: + + * JavaScript: **27 KB** minified and gzipped (102 KB minified, 176 KB in source, 7578 lines of code) + * CSS: **1.8 KB** gzipped (8 KB, 377 lines of code) + * Images: **10 KB** (5 PNG images) + ### Documentation Update Until now, Leaflet API reference was incomplete. But for this release, enourmous effort was put into making it 100% complete, up-to-date and generally the best API reference page you've ever seen. All remaining classes, methods, options, events and properties were carefully documented and more code examples added, and the docs will always be kept up-to-date from now on. @@ -177,7 +185,7 @@ Special thanks go to [Dave Leaver][] for his inspiring contributions including i And, of course, thanks to my amazing company, [CloudMade](http://cloudmade.com), for embracing open source and supporting this development. -Sinerely,
      +Sincerely,
      Vladimir Agafonkin, Leaflet maintainer. diff --git a/index.md b/index.md index 55985d38187..18cdb9980a8 100644 --- a/index.md +++ b/index.md @@ -4,7 +4,7 @@ layout: default

      July 30, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

      -Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 26 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. +Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 27 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. From dbd875d960a3eaf243c882d10ae1585db94ae79c Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 30 Jul 2012 01:42:15 +0300 Subject: [PATCH 227/816] minor fixes --- _posts/2012-07-30-leaflet-0-4-released.md | 4 ++-- index.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index fac0c41e90a..6ed96f6d781 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -1,10 +1,10 @@ --- layout: post title: Leaflet 0.4 Released -description: After 5.5 months of development with 32 contributors involved, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and lots of great improvements, along with a major update to documentation, a plugins page and the launch of the developer blog. +description: After 5.5 months of development with 33 contributors involved, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and lots of great improvements, along with a major update to documentation, a plugins page and the launch of the developer blog. --- -After 5.5 months of development with [32 contributors](https://github.com/CloudMade/Leaflet/graphs/contributors?from=2012-02-15&to=2012-07-30&type=c) involved since the previous stable release, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and *lots* of great improvements and important bugfixes, along with a major update to documentation, an official plugins page and the launch of this developer blog. Lets take a look at the improvements one by one. +After 5.5 months of development with [33 contributors](https://github.com/CloudMade/Leaflet/graphs/contributors?from=2012-02-15&to=2012-07-30&type=c) involved since the previous stable release, I'm proud to announce the release of Leaflet 0.4! It comes with a simpler API and *lots* of great improvements and important bugfixes, along with a major update to documentation, an official plugins page and the launch of this developer blog. Lets take a look at the improvements one by one. ### Simpler API diff --git a/index.md b/index.md index 18cdb9980a8..fe93e886b6d 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- -

      July 30, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

      +

      July 30, 2012 — Leaflet 0.4 Released with Lots of Exciting Improvements! — Read More in the Blog

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] of [CloudMade][] with a team of dedicated [contributors][]. Weighing just about 27 KB of gzipped JS code, it still has all the [features][] most developers ever need for online maps, while providing a smooth, pleasant user experience. From be1ac7aff639a5a16db7b3ca234069a51f96e4af Mon Sep 17 00:00:00 2001 From: Alexander Parshin Date: Mon, 30 Jul 2012 03:50:44 +0400 Subject: [PATCH 228/816] Add TileLayer.BoundaryCanvas plugin description into plugins.md --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index e2adba61c70..ead0a0e63b2 100644 --- a/plugins.md +++ b/plugins.md @@ -53,6 +53,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s George MacKerron
      + TileLayer.BoundaryCanvas + + Plugin allows to draw tiled raster layers with arbitrary polygonal boundary. HTML5 Canvas is used for rendering. + + Alexander Parshin +
      From adc139f07e54f7e0693348e8e247a2fd1d830b7d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 30 Jul 2012 10:35:16 +0300 Subject: [PATCH 229/816] minor plugins page fix --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index ead0a0e63b2..4c9e79af9d4 100644 --- a/plugins.md +++ b/plugins.md @@ -57,7 +57,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s TileLayer.BoundaryCanvas - Plugin allows to draw tiled raster layers with arbitrary polygonal boundary. HTML5 Canvas is used for rendering. + Allows you to draw tile layers with arbitrary polygonal boundary. HTML5 Canvas is used for rendering. Alexander Parshin From 4a7eecbec943e13b8dcc874eeac47e8ac72a457d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 30 Jul 2012 11:17:10 +0300 Subject: [PATCH 230/816] final polishing --- _posts/2012-07-30-leaflet-0-4-released.md | 2 -- atom.xml | 7 +++---- blog.md | 2 +- download.md | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index 6ed96f6d781..da2c3516aa8 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -212,7 +212,6 @@ Vladimir Agafonkin, Leaflet maintainer. [Jacob Toye]: https://github.com/jacobtoye diff --git a/atom.xml b/atom.xml index 3efaa4132bf..c998e841348 100644 --- a/atom.xml +++ b/atom.xml @@ -11,12 +11,11 @@ title: Leaflet Developer Blog Atom Feed {{ site.time | date_to_xmlschema }} - http://leaflet.cloudmade.com + http://leaflet.cloudmade.com/ - + {% for post in site.posts %} diff --git a/blog.md b/blog.md index f05409ad72a..74e85741a9c 100644 --- a/blog.md +++ b/blog.md @@ -5,7 +5,7 @@ title: Blog ## Leaflet Developer Blog -The main place for all important Leaflet-related news, tutorials, tips and development notes. +The main place for all important Leaflet-related news, tutorials, tips and development notes. [Subscribe to Atom feed](atom.xml) --- diff --git a/download.md b/download.md index 89f79568b5c..b0d3e8791ac 100644 --- a/download.md +++ b/download.md @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From 2aeebe6473adcd079419f362b1e2947a549196a6 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 30 Jul 2012 12:53:08 +0300 Subject: [PATCH 231/816] fix ugly marker shadows on iE8 --- dist/leaflet-src.js | 4 ++-- dist/leaflet.js | 2 +- src/layer/marker/Marker.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index 39fc495f7b0..ada423f5197 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -2901,7 +2901,7 @@ L.Marker = L.Class.extend({ } this._initInteraction(); - needOpacityUpdate = true; + needOpacityUpdate = (this.options.opacity < 1); L.DomUtil.addClass(this._icon, classToAdd); } @@ -2910,7 +2910,7 @@ L.Marker = L.Class.extend({ if (this._shadow) { L.DomUtil.addClass(this._shadow, classToAdd); - needOpacityUpdate = true; + needOpacityUpdate = (this.options.opacity < 1); } } diff --git a/dist/leaflet.js b/dist/leaflet.js index 61cf0d3de11..060cc64d001 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -3,4 +3,4 @@ Leaflet is an open-source JavaScript library for mobile-friendly interactive maps. http://leaflet.cloudmade.com */ -(function(e,t){var n,r;typeof exports!=t+""?n=exports:(r=e.L,n={},n.noConflict=function(){return e.L=r,this},e.L=n),n.version="0.4",n.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r=t.length,i;n2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,o),i=!1)},t),e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},splitWords:function(e){return e.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(e,t){return e.options=n.Util.extend({},e.options,t),e.options},getParamString:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+"="+e[n]);return"?"+t.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,n){var r=t[n];if(!t.hasOwnProperty(n))throw Error("No value provided for variable "+e);return r})},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n0},removeEventListener:function(e,t,r){var s=this[i],o,u,a,f,l;if(typeof e=="object"){for(o in e)e.hasOwnProperty(o)&&this.removeEventListener(o,e[o],t);return this}e=n.Util.splitWords(e);for(u=0,a=e.length;u=0;l--)(!t||f[l].action===t)&&(!r||f[l].context===r)&&f.splice(l,1)}return this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var r=n.Util.extend({type:e,target:this},t),s=this[i][e].slice();for(var o=0,u=s.length;o=this.min.x&&r.x<=this.max.x&&t.y>=this.min.y&&r.y<=this.max.y},intersects:function(e){e=n.bounds(e);var t=this.min,r=this.max,i=e.min,s=e.max,o=s.x>=t.x&&i.x<=r.x,u=s.y>=t.y&&i.y<=r.y;return o&&u}}),n.bounds=function(e,t){return!e||e instanceof n.Bounds?e:new n.Bounds(e,t)},n.Transformation=n.Class.extend({initialize:function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new n.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}}),n.DomUtil={get:function(e){return typeof e=="string"?document.getElementById(e):e},getStyle:function(e,t){var n=e.style[t];!n&&e.currentStyle&&(n=e.currentStyle[t]);if(!n||n==="auto"){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n==="auto"?null:n},getViewportOffset:function(e){var t=0,r=0,i=e,s=document.body;do{t+=i.offsetTop||0,r+=i.offsetLeft||0;if(i.offsetParent===s&&n.DomUtil.getStyle(i,"position")==="absolute")break;if(n.DomUtil.getStyle(i,"position")==="fixed"){t+=s.scrollTop||0,r+=s.scrollLeft||0;break}i=i.offsetParent}while(i);i=e;do{if(i===s)break;t-=i.scrollTop||0,r-=i.scrollLeft||0,i=i.parentNode}while(i);return new n.Point(r,t)},create:function(e,t,n){var r=document.createElement(e);return r.className=t,n&&n.appendChild(r),r},disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty(),this._onselectstart||(this._onselectstart=document.onselectstart,document.onselectstart=n.Util.falseFn)},enableTextSelection:function(){document.onselectstart=this._onselectstart,this._onselectstart=null},hasClass:function(e,t){return e.className.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},addClass:function(e,t){n.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){function n(e,n){return n===t?"":e}e.className=e.className.replace(/(\S+)\s*/g,n).replace(/(^\s+|\s+$)/,"")},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if(n.Browser.ie){var r=!1,i="DXImageTransform.Microsoft.Alpha";try{r=e.filters.item(i)}catch(s){}t=Math.round(t*100),r?(r.Enabled=t===100,r.Opacity=t):e.style.filter+=" progid:"+i+"(opacity="+t+")"}},testProp:function(e){var t=document.documentElement.style;for(var n=0;n=t.lat&&s.lat<=r.lat&&i.lng>=t.lng&&s.lng<=r.lng},intersects:function(e){e=n.latLngBounds(e);var t=this._southWest,r=this._northEast,i=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&i.lat<=r.lat,u=s.lng>=t.lng&&i.lng<=r.lng;return o&&u},toBBoxString:function(){var e=this._southWest,t=this._northEast;return[e.lng,e.lat,t.lng,t.lat].join(",")},equals:function(e){return e?(e=n.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1}}),n.latLngBounds=function(e,t){return!e||e instanceof n.LatLngBounds?e:new n.LatLngBounds(e,t)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=n.LatLng.DEG_TO_RAD,r=this.MAX_LATITUDE,i=Math.max(Math.min(r,e.lat),-r),s=e.lng*t,o=i*t;return o=Math.log(Math.tan(Math.PI/4+o/2)),new n.Point(s,o)},unproject:function(e){var t=n.LatLng.RAD_TO_DEG,r=e.x*t,i=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new n.LatLng(i,r,!0)}},n.Projection.LonLat={project:function(e){return new n.Point(e.lng,e.lat)},unproject:function(e){return new n.LatLng(e.y,e.x,!0)}},n.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}},n.CRS.EPSG3857=n.Util.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),n.CRS.EPSG900913=n.Util.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.Util.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(e,r){r=n.Util.setOptions(this,r),this._initContainer(e),this._initLayout(),this._initHooks(),this._initEvents(),r.maxBounds&&this.setMaxBounds(r.maxBounds),r.center&&r.zoom!==t&&this.setView(n.latLng(r.center),r.zoom,!0),this._initLayers(r.layers)},setView:function(e,t){return this._resetView(n.latLng(e),this._limitZoom(t)),this},setZoom:function(e){return this.setView(this.getCenter(),e)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(e){var t=this.getBoundsZoom(e);return this.setView(n.latLngBounds(e).getCenter(),t)},fitWorld:function(){var e=new n.LatLng(-60,-170),t=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(e,t))},panTo:function(e){return this.setView(e,this._zoom)},panBy:function(e){return this.fire("movestart"),this._rawPanBy(n.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){e=n.latLngBounds(e),this.options.maxBounds=e;if(!e)return this._boundsMinZoom=null,this;var t=this.getBoundsZoom(e,!0);return this._boundsMinZoom=t,this._loaded&&(this._zoomo.x&&(u=o.x-i.x),r.y>s.y&&(a=s.y-r.y),r.xc&&--h>0)d=u*Math.sin(f),p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f,f+=p;return new n.LatLng(f*t,s,!0)}},n.CRS.EPSG3395=n.Util.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var e=n.Projection.Mercator,t=e.R_MAJOR,r=e.R_MINOR;return new n.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*r),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,r){r=n.Util.setOptions(this,r),r.detectRetina&&e.devicePixelRatio>1&&r.maxZoom>0&&(r.tileSize=Math.floor(r.tileSize/2),r.zoomOffset++,r.minZoom>0&&r.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;typeof i=="string"&&(this.options.subdomains=i.split(""))},onAdd:function(e){this._map=e,this._initContainer(),this._createTileProto(),e.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._panes.tilePane.removeChild(this._container),e.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==t&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.getElementsByClassName("leaflet-layer"),r=-t(Infinity,-Infinity),i;for(var s=0,o=n.length;sthis.options.maxZoom||r=t)||e.y<0||e.y>=t)return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)this._tiles.hasOwnProperty(i)&&(t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(ne.max.x||re.max.y)&&this._removeTile(i))},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(n.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._container&&this._container.removeChild(t),n.Browser.android||(t.src=n.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var r=this._getTilePos(e),i=this._getTile();n.DomUtil.setPosition(i,r,n.Browser.chrome),this._tiles[e.x+":"+e.y]=i,this._loadTile(i,e),i.parentNode!==this._container&&t.appendChild(i)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return this._adjustTilePoint(e),n.Util.template(this._url,n.Util.extend({s:this._getSubdomain(e),z:this._getZoomForUrl(),x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t),this.options.tms&&(e.y=t-e.y-1)},_getSubdomain:function(e){var t=(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=n.DomUtil.create("img","leaflet-tile");e.galleryimg="no";var t=this.options.tileSize;e.style.width=t+"px",e.style.height=t+"px"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(e){},_createTile:function(){var e=this._tileImg.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(e){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(e){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var n=t.options.errorTileUrl;n&&(this.src=n),t._tileLoaded()}}),n.tileLayer=function(e,t){return new n.TileLayer(e,t)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,r){this._url=t;var i=n.Util.extend({},this.defaultWmsParams);r.detectRetina&&e.devicePixelRatio>1?i.width=i.height=this.options.tileSize*2:i.width=i.height=this.options.tileSize;for(var s in r)this.options.hasOwnProperty(s)||(i[s]=r[s]);this.wmsParams=i,n.Util.setOptions(this,r)},onAdd:function(e){var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=e.options.crs.code,n.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var r=this._map,i=r.options.crs,s=this.options.tileSize,o=e.multiplyBy(s),u=o.add(new n.Point(s,s)),a=i.project(r.unproject(o,t)),f=i.project(r.unproject(u,t)),l=[a.x,f.y,f.x,a.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(e)});return c+n.Util.getParamString(this.wmsParams)+"&bbox="+l},setParams:function(e,t){return n.Util.extend(this.wmsParams,e),t||this.redraw(),this}}),n.tileLayer.wms=function(e,t){return new n.TileLayer(e,t)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(e){n.Util.setOptions(this,e)},redraw:function(){var e,t=this._tiles;for(e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(e){this.drawTile(e,e._tilePoint,e._zoom)},_createTileProto:function(){var e=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile"),t=this.options.tileSize;e.width=t,e.height=t},_createTile:function(){var e=this._canvasProto.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t,n){e._layer=this,e._tilePoint=t,e._zoom=n,this.drawTile(e,t,n),this.options.async||this.tileDrawn(e)},drawTile:function(e,t,n){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),n.tileLayer.canvas=function(e){return new n.TileLayer.Canvas(e)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(e,t,r){this._url=e,this._bounds=n.latLngBounds(t),n.Util.setOptions(this,r)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&n.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this._image&&e.insertBefore(this._image,e.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.Util.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.Util.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,r=this._image,i=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center).subtract(u),f=t.latLngToLayerPoint(o).subtract(t.latLngToLayerPoint(s)),l=u.add(a.subtract(f).divideBy(2));r.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+i+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),r=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(t);n.DomUtil.setPosition(e,t),e.style.width=r.x+"px",e.style.height=r.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(e,t,r){return new n.ImageOverlay(e,t,r)},n.Icon=n.Class.extend({options:{className:""},initialize:function(e){n.Util.setOptions(this,e)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(e){var t=this._getIconUrl(e);if(!t){if(e==="icon")throw Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(t);return this._setIconStyles(n,e),n},_setIconStyles:function(e,t){var r=this.options,i=n.point(r[t+"Size"]),s;t==="shadow"?s=n.point(r.shadowAnchor||r.iconAnchor):s=n.point(r.iconAnchor),!s&&i&&(s=i.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+r.className,s&&(e.style.marginLeft=-s.x+"px",e.style.marginTop=-s.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e){var t;return n.Browser.ie6?(t=document.createElement("div"),t.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'):(t=document.createElement("img"),t.src=e),t},_getIconUrl:function(e){return this.options[e+"Url"]}}),n.icon=function(e){return new n.Icon(e)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(13,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];var r=n.Icon.Default.imagePath;if(!r)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return r+"/marker-"+e+".png"}}),n.Icon.Default.imagePath=function(){var e=document.getElementsByTagName("script"),t=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/,n,r,i,s;for(n=0,r=e.length;ns?(t.height=s+"px",n.DomUtil.addClass(e,o)):n.DomUtil.removeClass(e,o),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng),t=n.Browser.any3d,r=this.options.offset;t&&n.DomUtil.setPosition(this._container,e),this._containerBottom=-r.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+r.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);n.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,r=this._containerWidth,i=new n.Point(this._containerLeft,-t-this._containerBottom);n.Browser.any3d&&i._add(n.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(i),o=this.options.autoPanPadding,u=e.getSize(),a=0,f=0;s.x<0&&(a=s.x-o.x),s.x+r>u.x&&(a=s.x+r-u.x+o.x),s.y<0&&(f=s.y-o.y),s.y+t>u.y&&(f=s.y+t-u.y+o.y),(a||f)&&e.panBy(new n.Point(a,f))},_onCloseButtonClick:function(e){this._close(),n.DomEvent.stop(e)}}),n.popup=function(e,t){return new n.Popup(e,t)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(e,t){var r=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return r=r.add(n.Popup.prototype.options.offset),t&&t.offset&&(r=r.add(t.offset)),t=n.Util.extend({offset:r},t),this._popup||this.on("click",this.openPopup,this),this._popup=(new n.Popup(t,this)).setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup)),this}}),n.Map.include({openPopup:function(e){return this.closePopup(),this._popup=e,this.addLayer(e).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&typeof t.adj=="object"}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("')}}catch(e){return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");n.DomUtil.addClass(e,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=n.dashArray.replace(/ *, */g," "):e.dashStyle=""):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none",this._path.v=this.getPathString()+" ",e.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=document.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}),n.Browser.canvas=function(){return!!document.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!e.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return n.Util.setOptions(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&(n.Util.cancelAnimFrame(this._fireMapMoveEnd),this._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,r,i,s,o;this._ctx.beginPath();for(e=0,r=this._parts.length;es&&(o=u,s=a);s>n&&(t[o]=1,this._simplifyDPStep(e,t,n,r,o),this._simplifyDPStep(e,t,n,o,i))},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;rt&&(n.push(e[r]),i=r);return it.max.x&&(n|=2),e.yt.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,r,i){var s=t.x,o=t.y,u=r.x-s,a=r.y-o,f=u*u+a*a,l;return f>0&&(l=((e.x-s)*u+(e.y-o)*a)/f,l>1?(s=r.x,o=r.y):l>0&&(s+=u*l,o+=a*l)),u=e.x-s,a=e.y-o,i?u*u+a*a:new n.Point(s,o)}},n.Polyline=n.Path.extend({initialize:function(e,t){n.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e),n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable())},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;ee.max.x||n.y-t>e.max.y||n.x+te.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(t=!t)}return t}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(e,t){n.Util.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=e instanceof Array?e:e.features,r,i;if(t){for(r=0,i=t.length;r1){this._simulateClick=!1;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=t.target;n.DomEvent.preventDefault(e),n.Browser.touch&&r.tagName.toLowerCase()==="a"&&n.DomUtil.addClass(r,"leaflet-active"),this._moved=!1;if(this._moving)return;n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor()),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),this._startPoint=new n.Point(t.clientX,t.clientY),n.DomEvent.on(document,n.Draggable.MOVE,this._onMove,this),n.DomEvent.on(document,n.Draggable.END,this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1)return;var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=new n.Point(t.clientX,t.clientY),i=r.subtract(this._startPoint);if(!i.x&&!i.y)return;n.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0),this._newPos=this._startPos.add(i),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){if(this._simulateClick&&e.changedTouches){var t=e.changedTouches[0],r=t.target,i=this._newPos&&this._newPos.distanceTo(this._startPos)||0;r.tagName.toLowerCase()==="a"&&n.DomUtil.removeClass(r,"leaflet-active"),i200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var e=this._map,t=this._worldWidth,n=Math.round(t/2),r=this._initialWorldOffset,i=this._draggable._newPos.x,s=(i-n+r)%t+n-r,o=(i+n+r)%t-n-r,u=Math.abs(s+r)r.inertiaThreshold||this._positions[0]===t;if(s)e.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),u=(this._lastTime+i-this._times[0])/1e3,a=o.multiplyBy(.58/u),f=a.distanceTo(new n.Point(0,0)),l=Math.min(r.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/r.inertiaDeceleration,p=c.multiplyBy(-h/2).round(),d={duration:h,easing:"ease-out"};n.Util.requestAnimFrame(n.Util.bind(function(){this._map.panBy(p,d)},this))}e.fire("dragend"),r.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,e,!0,e._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setView(e.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!n.Browser.touch}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(e){var t=n.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),clearTimeout(this._timer),this._timer=setTimeout(n.Util.bind(this._performZoom,this),40),n.DomEvent.preventDefault(e)},_performZoom:function(){var e=this._map,t=Math.round(this._delta),n=e.getZoom();t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0;if(!t)return;var r=n+t,i=this._getCenterForScrollWheelZoom(this._lastMousePos,r);e.setView(i,r)},_getCenterForScrollWheelZoom:function(e,t){var n=this._map,r=n.getZoomScale(t),i=n.getSize().divideBy(2),s=e.subtract(i).multiplyBy(1-1/r),o=n._getTopLeftPoint().add(i).add(s);return n.unproject(o)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.Util.extend(n.DomEvent,{addDoubleTapListener:function(e,t,n){function l(e){if(e.touches.length!==1)return;var t=Date.now(),n=t-(r||t);o=e.touches[0],i=n>0&&n<=s,r=t}function c(e){i&&(o.type="dblclick",t(o),r=null)}var r,i=!1,s=250,o,u="_leaflet_",a="touchstart",f="touchend";return e[u+a+n]=l,e[u+f+n]=c,e.addEventListener(a,l,!1),e.addEventListener(f,c,!1),this},removeDoubleTapListener:function(e,t){var n="_leaflet_";return e.removeEventListener(e,e[n+"touchstart"+t],!1),e.removeEventListener(e,e[n+"touchend"+t],!1),this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)return;var r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]),s=t._getCenterLayerPoint();this._startCenter=r.add(i).divideBy(2,!0),this._startDist=r.distanceTo(i),this._moved=!1,this._zooming=!0,this._centerOffset=s.subtract(this._startCenter),n.DomEvent.on(document,"touchmove",this._onTouchMove,this).on(document,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(e)},_onTouchMove:function(e){if(!e.touches||e.touches.length!==2)return;var t=this._map,r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]);this._scale=r.distanceTo(i)/this._startDist,this._delta=r.add(i).divideBy(2,!0).subtract(this._startCenter);if(this._scale===1)return;this._moved||(n.DomUtil.addClass(t._mapPane,"leaflet-zoom-anim leaflet-touching"),t.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(e)},_updateOnMove:function(){var e=this._map,t=this._getScaleOrigin(),r=e.layerPointToLatLng(t);e.fire("zoomanim",{center:r,zoom:e.getScaleZoom(this._scale)}),e._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(e){if(!this._moved||!this._zooming)return;var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(document,"touchmove",this._onTouchMove).off(document,"touchend",this._onTouchEnd);var r=this._getScaleOrigin(),i=t.layerPointToLatLng(r),s=t.getZoom(),o=t.getScaleZoom(this._scale)-s,u=o>0?Math.ceil(o):Math.floor(o),a=t._limitZoom(s+u);t.fire("zoomanim",{center:i,zoom:a}),t._runAnimation(i,a,t.getZoomScale(a)/this._scale,r,!0)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(document,"mousemove",this._onMouseMove,this).on(document,"mouseup",this._onMouseUp,this).preventDefault(e),this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,r=this._box,i=this._map.mouseEventToLayerPoint(e),s=i.subtract(t),o=new n.Point(Math.min(i.x,t.x),Math.min(i.y,t.y));n.DomUtil.setPosition(r,o),r.style.width=Math.abs(s.x)-4+"px",r.style.height=Math.abs(s.y)-4+"px"},_onMouseUp:function(e){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(document,"mousemove",this._onMouseMove).off(document,"mouseup",this._onMouseUp);var t=this._map,r=t.mouseEventToLayerPoint(e),i=new n.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(r));t.fitBounds(i),t.fire("boxzoomend",{boxZoomBounds:i})}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,61,107],zoomOut:[189,109,0]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0"),n.DomEvent.addListener(e,"focus",this._onFocus,this).addListener(e,"blur",this._onBlur,this).addListener(e,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;n.DomEvent.removeListener(e,"focus",this._onFocus,this).removeListener(e,"blur",this._onBlur,this).removeListener(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;re&&(n._index+=t)})},_createMiddleMarker:function(e,t){var n=this._getMiddleLatLng(e,t),r=this._createMarker(n),i,s,o;r.setOpacity(.6),e._middleRight=t._middleLeft=r,s=function(){var s=t._index;r._index=s,r.off("click",i).on("click",this._onMarkerClick,this),n.lat=r.getLatLng().lat,n.lng=r.getLatLng().lng,this._poly.spliceLatLngs(s,0,n),this._markers.splice(s,0,r),r.setOpacity(1),this._updateIndexes(s,1),t._index++,this._updatePrevNext(e,r),this._updatePrevNext(r,t)},o=function(){r.off("dragstart",s,this),r.off("dragend",o,this),this._createMiddleMarker(e,r),this._createMiddleMarker(r,t)},i=function(){s.call(this),o.call(this),this._poly.fire("edit")},r.on("click",i,this).on("dragstart",s,this).on("dragend",o,this),this._markerGroup.addLayer(r)},_updatePrevNext:function(e,t){e._next=t,t._prev=e},_getMiddleLatLng:function(e,t){var n=this._poly._map,r=n.latLngToLayerPoint(e.getLatLng()),i=n.latLngToLayerPoint(t.getLatLng());return n.layerPointToLatLng(r._add(i).divideBy(2))}}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(e){n.Util.setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},addTo:function(e){this._map=e;var t=this._container=this.onAdd(e),r=this.getPosition(),i=e._controlCorners[r];return n.DomUtil.addClass(t,"leaflet-control"),r.indexOf("bottom")!==-1?i.insertBefore(t,i.firstChild):i.appendChild(t),this},removeFrom:function(e){var t=this.getPosition(),n=e._controlCorners[t];return n.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(e),this}}),n.control=function(e){return new n.Control(e)},n.Map.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.removeFrom(this),this},_initControlPos:function(){function i(i,s){var o=t+i+" "+t+s;e[i+s]=n.DomUtil.create("div",o,r)}var e=this._controlCorners={},t="leaflet-",r=this._controlContainer=n.DomUtil.create("div",t+"control-container",this._container);i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(e){var t="leaflet-control-zoom",r=n.DomUtil.create("div",t);return this._createButton("Zoom in",t+"-in",r,e.zoomIn,e),this._createButton("Zoom out",t+"-out",r,e.zoomOut,e),r},_createButton:function(e,t,r,i,s){var o=n.DomUtil.create("a",t,r);return o.href="#",o.title=e,n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",i,s).on(o,"dblclick",n.DomEvent.stopPropagation),o}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(e){return new n.Control.Zoom(e)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(e){n.Util.setOptions(this,e),this._attributions={}},onAdd:function(e){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){if(!e)return;return this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this},removeAttribution:function(e){if(!e)return;return this._attributions[e]--,this._update(),this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions.hasOwnProperty(t)&&this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" — ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(e){return new n.Control.Attribution(e)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",r=n.DomUtil.create("div",t),i=this.options;return this._addScales(i,t,r),e.on(i.updateWhenIdle?"moveend":"move",this._update,this),this._update(),r},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,r){e.metric&&(this._mScale=n.DomUtil.create("div",t+"-line",r)),e.imperial&&(this._iScale=n.DomUtil.create("div",t+"-line",r))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,r=(new n.LatLng(t,0)).distanceTo(new n.LatLng(t,180)),i=r*(e.getNorthEast().lng-e.getSouthWest().lng)/180,s=this._map.getSize(),o=this.options,u=0;s.x>0&&(u=i*(o.maxWidth/s.x)),this._updateScales(o,u)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;t>5280?(r=t/5280,i=this._getRoundNum(r),n.style.width=this._getScaleWidth(i/r)+"px",n.innerHTML=i+" mi"):(s=this._getRoundNum(t),n.style.width=this._getScaleWidth(s/t)+"px",n.innerHTML=s+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),n.control.scale=function(e){return new n.Control.Scale(e)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,r){n.Util.setOptions(this,r),this._layers={},this._lastZIndex=0;for(var i in e)e.hasOwnProperty(i)&&this._addLayer(e[i],i);for(i in t)t.hasOwnProperty(i)&&this._addLayer(t[i],i,!0)},onAdd:function(e){return this._initLayout(),this._update(),this._container},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update(),this},removeLayer:function(e){var t=n.Util.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=n.DomUtil.create("div",e);n.Browser.touch?n.DomEvent.on(t,"click",n.DomEvent.stopPropagation):n.DomEvent.disableClickPropagation(t);var r=this._form=n.DomUtil.create("form",e+"-list");if(this.options.collapsed){n.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var i=this._layersLink=n.DomUtil.create("a",e+"-toggle",t);i.href="#",i.title="Layers",n.Browser.touch?n.DomEvent.on(i,"click",n.DomEvent.stopPropagation).on(i,"click",n.DomEvent.preventDefault).on(i,"click",this._expand,this):n.DomEvent.on(i,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",e+"-base",r),this._separator=n.DomUtil.create("div",e+"-separator",r),this._overlaysList=n.DomUtil.create("div",e+"-overlays",r),t.appendChild(r)},_addLayer:function(e,t,r){var i=n.Util.stamp(e);this._layers[i]={layer:e,name:t,overlay:r},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e=!1,t=!1;for(var n in this._layers)if(this._layers.hasOwnProperty(n)){var r=this._layers[n];this._addItem(r),t=t||r.overlay,e=e||!r.overlay}this._separator.style.display=t&&e?"":"none"},_addItem:function(e,t){var r=document.createElement("label"),i=document.createElement("input");e.overlay||(i.name="leaflet-base-layers"),i.type=e.overlay?"checkbox":"radio",i.layerId=n.Util.stamp(e.layer),i.defaultChecked=this._map.hasLayer(e.layer),n.DomEvent.on(i,"click",this._onInputClick,this);var s=document.createTextNode(" "+e.name);r.appendChild(i),r.appendChild(s);var o=e.overlay?this._overlaysList:this._baseLayersList;o.appendChild(r)},_onInputClick:function(){var e,t,n,r=this._form.getElementsByTagName("input"),i=r.length;for(e=0;e.5&&this._getLoadedTilesPercentage(e)<.5){e.style.visibility="hidden",e.empty=!0,this._stopLoadingImages(e);return}t||(t=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),t.style.zIndex=1),t.style[n.DomUtil.TRANSFORM]="",t.style.visibility="hidden",t.empty=!0,e.empty=!1,this._tilePane=this._panes.tilePane=t;var r=this._tileBg=e;r.transition||(r.transition=new n.Transition(r,{duration:.25,easing:"cubic-bezier(0.25,0.1,0.25,0.75)"}),r.transition.on("end",this._onZoomTransitionEnd,this)),this._stopLoadingImages(r)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;n2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,o),i=!1)},t),e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},splitWords:function(e){return e.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(e,t){return e.options=n.Util.extend({},e.options,t),e.options},getParamString:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+"="+e[n]);return"?"+t.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,n){var r=t[n];if(!t.hasOwnProperty(n))throw Error("No value provided for variable "+e);return r})},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n0},removeEventListener:function(e,t,r){var s=this[i],o,u,a,f,l;if(typeof e=="object"){for(o in e)e.hasOwnProperty(o)&&this.removeEventListener(o,e[o],t);return this}e=n.Util.splitWords(e);for(u=0,a=e.length;u=0;l--)(!t||f[l].action===t)&&(!r||f[l].context===r)&&f.splice(l,1)}return this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var r=n.Util.extend({type:e,target:this},t),s=this[i][e].slice();for(var o=0,u=s.length;o=this.min.x&&r.x<=this.max.x&&t.y>=this.min.y&&r.y<=this.max.y},intersects:function(e){e=n.bounds(e);var t=this.min,r=this.max,i=e.min,s=e.max,o=s.x>=t.x&&i.x<=r.x,u=s.y>=t.y&&i.y<=r.y;return o&&u}}),n.bounds=function(e,t){return!e||e instanceof n.Bounds?e:new n.Bounds(e,t)},n.Transformation=n.Class.extend({initialize:function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new n.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}}),n.DomUtil={get:function(e){return typeof e=="string"?document.getElementById(e):e},getStyle:function(e,t){var n=e.style[t];!n&&e.currentStyle&&(n=e.currentStyle[t]);if(!n||n==="auto"){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n==="auto"?null:n},getViewportOffset:function(e){var t=0,r=0,i=e,s=document.body;do{t+=i.offsetTop||0,r+=i.offsetLeft||0;if(i.offsetParent===s&&n.DomUtil.getStyle(i,"position")==="absolute")break;if(n.DomUtil.getStyle(i,"position")==="fixed"){t+=s.scrollTop||0,r+=s.scrollLeft||0;break}i=i.offsetParent}while(i);i=e;do{if(i===s)break;t-=i.scrollTop||0,r-=i.scrollLeft||0,i=i.parentNode}while(i);return new n.Point(r,t)},create:function(e,t,n){var r=document.createElement(e);return r.className=t,n&&n.appendChild(r),r},disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty(),this._onselectstart||(this._onselectstart=document.onselectstart,document.onselectstart=n.Util.falseFn)},enableTextSelection:function(){document.onselectstart=this._onselectstart,this._onselectstart=null},hasClass:function(e,t){return e.className.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},addClass:function(e,t){n.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){function n(e,n){return n===t?"":e}e.className=e.className.replace(/(\S+)\s*/g,n).replace(/(^\s+|\s+$)/,"")},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if(n.Browser.ie){var r=!1,i="DXImageTransform.Microsoft.Alpha";try{r=e.filters.item(i)}catch(s){}t=Math.round(t*100),r?(r.Enabled=t===100,r.Opacity=t):e.style.filter+=" progid:"+i+"(opacity="+t+")"}},testProp:function(e){var t=document.documentElement.style;for(var n=0;n=t.lat&&s.lat<=r.lat&&i.lng>=t.lng&&s.lng<=r.lng},intersects:function(e){e=n.latLngBounds(e);var t=this._southWest,r=this._northEast,i=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&i.lat<=r.lat,u=s.lng>=t.lng&&i.lng<=r.lng;return o&&u},toBBoxString:function(){var e=this._southWest,t=this._northEast;return[e.lng,e.lat,t.lng,t.lat].join(",")},equals:function(e){return e?(e=n.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1}}),n.latLngBounds=function(e,t){return!e||e instanceof n.LatLngBounds?e:new n.LatLngBounds(e,t)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=n.LatLng.DEG_TO_RAD,r=this.MAX_LATITUDE,i=Math.max(Math.min(r,e.lat),-r),s=e.lng*t,o=i*t;return o=Math.log(Math.tan(Math.PI/4+o/2)),new n.Point(s,o)},unproject:function(e){var t=n.LatLng.RAD_TO_DEG,r=e.x*t,i=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new n.LatLng(i,r,!0)}},n.Projection.LonLat={project:function(e){return new n.Point(e.lng,e.lat)},unproject:function(e){return new n.LatLng(e.y,e.x,!0)}},n.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}},n.CRS.EPSG3857=n.Util.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),n.CRS.EPSG900913=n.Util.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.Util.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(e,r){r=n.Util.setOptions(this,r),this._initContainer(e),this._initLayout(),this._initHooks(),this._initEvents(),r.maxBounds&&this.setMaxBounds(r.maxBounds),r.center&&r.zoom!==t&&this.setView(n.latLng(r.center),r.zoom,!0),this._initLayers(r.layers)},setView:function(e,t){return this._resetView(n.latLng(e),this._limitZoom(t)),this},setZoom:function(e){return this.setView(this.getCenter(),e)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(e){var t=this.getBoundsZoom(e);return this.setView(n.latLngBounds(e).getCenter(),t)},fitWorld:function(){var e=new n.LatLng(-60,-170),t=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(e,t))},panTo:function(e){return this.setView(e,this._zoom)},panBy:function(e){return this.fire("movestart"),this._rawPanBy(n.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){e=n.latLngBounds(e),this.options.maxBounds=e;if(!e)return this._boundsMinZoom=null,this;var t=this.getBoundsZoom(e,!0);return this._boundsMinZoom=t,this._loaded&&(this._zoomo.x&&(u=o.x-i.x),r.y>s.y&&(a=s.y-r.y),r.xc&&--h>0)d=u*Math.sin(f),p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f,f+=p;return new n.LatLng(f*t,s,!0)}},n.CRS.EPSG3395=n.Util.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var e=n.Projection.Mercator,t=e.R_MAJOR,r=e.R_MINOR;return new n.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*r),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,r){r=n.Util.setOptions(this,r),r.detectRetina&&e.devicePixelRatio>1&&r.maxZoom>0&&(r.tileSize=Math.floor(r.tileSize/2),r.zoomOffset++,r.minZoom>0&&r.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;typeof i=="string"&&(this.options.subdomains=i.split(""))},onAdd:function(e){this._map=e,this._initContainer(),this._createTileProto(),e.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._panes.tilePane.removeChild(this._container),e.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==t&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.getElementsByClassName("leaflet-layer"),r=-t(Infinity,-Infinity),i;for(var s=0,o=n.length;sthis.options.maxZoom||r=t)||e.y<0||e.y>=t)return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)this._tiles.hasOwnProperty(i)&&(t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(ne.max.x||re.max.y)&&this._removeTile(i))},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(n.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._container&&this._container.removeChild(t),n.Browser.android||(t.src=n.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var r=this._getTilePos(e),i=this._getTile();n.DomUtil.setPosition(i,r,n.Browser.chrome),this._tiles[e.x+":"+e.y]=i,this._loadTile(i,e),i.parentNode!==this._container&&t.appendChild(i)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return this._adjustTilePoint(e),n.Util.template(this._url,n.Util.extend({s:this._getSubdomain(e),z:this._getZoomForUrl(),x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t),this.options.tms&&(e.y=t-e.y-1)},_getSubdomain:function(e){var t=(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=n.DomUtil.create("img","leaflet-tile");e.galleryimg="no";var t=this.options.tileSize;e.style.width=t+"px",e.style.height=t+"px"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(e){},_createTile:function(){var e=this._tileImg.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(e){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(e){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var n=t.options.errorTileUrl;n&&(this.src=n),t._tileLoaded()}}),n.tileLayer=function(e,t){return new n.TileLayer(e,t)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,r){this._url=t;var i=n.Util.extend({},this.defaultWmsParams);r.detectRetina&&e.devicePixelRatio>1?i.width=i.height=this.options.tileSize*2:i.width=i.height=this.options.tileSize;for(var s in r)this.options.hasOwnProperty(s)||(i[s]=r[s]);this.wmsParams=i,n.Util.setOptions(this,r)},onAdd:function(e){var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=e.options.crs.code,n.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var r=this._map,i=r.options.crs,s=this.options.tileSize,o=e.multiplyBy(s),u=o.add(new n.Point(s,s)),a=i.project(r.unproject(o,t)),f=i.project(r.unproject(u,t)),l=[a.x,f.y,f.x,a.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(e)});return c+n.Util.getParamString(this.wmsParams)+"&bbox="+l},setParams:function(e,t){return n.Util.extend(this.wmsParams,e),t||this.redraw(),this}}),n.tileLayer.wms=function(e,t){return new n.TileLayer(e,t)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(e){n.Util.setOptions(this,e)},redraw:function(){var e,t=this._tiles;for(e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(e){this.drawTile(e,e._tilePoint,e._zoom)},_createTileProto:function(){var e=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile"),t=this.options.tileSize;e.width=t,e.height=t},_createTile:function(){var e=this._canvasProto.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t,n){e._layer=this,e._tilePoint=t,e._zoom=n,this.drawTile(e,t,n),this.options.async||this.tileDrawn(e)},drawTile:function(e,t,n){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),n.tileLayer.canvas=function(e){return new n.TileLayer.Canvas(e)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(e,t,r){this._url=e,this._bounds=n.latLngBounds(t),n.Util.setOptions(this,r)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&n.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this._image&&e.insertBefore(this._image,e.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.Util.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.Util.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,r=this._image,i=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center).subtract(u),f=t.latLngToLayerPoint(o).subtract(t.latLngToLayerPoint(s)),l=u.add(a.subtract(f).divideBy(2));r.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+i+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),r=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(t);n.DomUtil.setPosition(e,t),e.style.width=r.x+"px",e.style.height=r.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(e,t,r){return new n.ImageOverlay(e,t,r)},n.Icon=n.Class.extend({options:{className:""},initialize:function(e){n.Util.setOptions(this,e)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(e){var t=this._getIconUrl(e);if(!t){if(e==="icon")throw Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(t);return this._setIconStyles(n,e),n},_setIconStyles:function(e,t){var r=this.options,i=n.point(r[t+"Size"]),s;t==="shadow"?s=n.point(r.shadowAnchor||r.iconAnchor):s=n.point(r.iconAnchor),!s&&i&&(s=i.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+r.className,s&&(e.style.marginLeft=-s.x+"px",e.style.marginTop=-s.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e){var t;return n.Browser.ie6?(t=document.createElement("div"),t.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'):(t=document.createElement("img"),t.src=e),t},_getIconUrl:function(e){return this.options[e+"Url"]}}),n.icon=function(e){return new n.Icon(e)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(13,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];var r=n.Icon.Default.imagePath;if(!r)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return r+"/marker-"+e+".png"}}),n.Icon.Default.imagePath=function(){var e=document.getElementsByTagName("script"),t=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/,n,r,i,s;for(n=0,r=e.length;ns?(t.height=s+"px",n.DomUtil.addClass(e,o)):n.DomUtil.removeClass(e,o),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng),t=n.Browser.any3d,r=this.options.offset;t&&n.DomUtil.setPosition(this._container,e),this._containerBottom=-r.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+r.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);n.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,r=this._containerWidth,i=new n.Point(this._containerLeft,-t-this._containerBottom);n.Browser.any3d&&i._add(n.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(i),o=this.options.autoPanPadding,u=e.getSize(),a=0,f=0;s.x<0&&(a=s.x-o.x),s.x+r>u.x&&(a=s.x+r-u.x+o.x),s.y<0&&(f=s.y-o.y),s.y+t>u.y&&(f=s.y+t-u.y+o.y),(a||f)&&e.panBy(new n.Point(a,f))},_onCloseButtonClick:function(e){this._close(),n.DomEvent.stop(e)}}),n.popup=function(e,t){return new n.Popup(e,t)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(e,t){var r=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return r=r.add(n.Popup.prototype.options.offset),t&&t.offset&&(r=r.add(t.offset)),t=n.Util.extend({offset:r},t),this._popup||this.on("click",this.openPopup,this),this._popup=(new n.Popup(t,this)).setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup)),this}}),n.Map.include({openPopup:function(e){return this.closePopup(),this._popup=e,this.addLayer(e).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&typeof t.adj=="object"}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("')}}catch(e){return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");n.DomUtil.addClass(e,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=n.dashArray.replace(/ *, */g," "):e.dashStyle=""):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none",this._path.v=this.getPathString()+" ",e.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=document.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}),n.Browser.canvas=function(){return!!document.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!e.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return n.Util.setOptions(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&(n.Util.cancelAnimFrame(this._fireMapMoveEnd),this._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,r,i,s,o;this._ctx.beginPath();for(e=0,r=this._parts.length;es&&(o=u,s=a);s>n&&(t[o]=1,this._simplifyDPStep(e,t,n,r,o),this._simplifyDPStep(e,t,n,o,i))},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;rt&&(n.push(e[r]),i=r);return it.max.x&&(n|=2),e.yt.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,r,i){var s=t.x,o=t.y,u=r.x-s,a=r.y-o,f=u*u+a*a,l;return f>0&&(l=((e.x-s)*u+(e.y-o)*a)/f,l>1?(s=r.x,o=r.y):l>0&&(s+=u*l,o+=a*l)),u=e.x-s,a=e.y-o,i?u*u+a*a:new n.Point(s,o)}},n.Polyline=n.Path.extend({initialize:function(e,t){n.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e),n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable())},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;ee.max.x||n.y-t>e.max.y||n.x+te.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(t=!t)}return t}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(e,t){n.Util.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=e instanceof Array?e:e.features,r,i;if(t){for(r=0,i=t.length;r1){this._simulateClick=!1;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=t.target;n.DomEvent.preventDefault(e),n.Browser.touch&&r.tagName.toLowerCase()==="a"&&n.DomUtil.addClass(r,"leaflet-active"),this._moved=!1;if(this._moving)return;n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor()),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),this._startPoint=new n.Point(t.clientX,t.clientY),n.DomEvent.on(document,n.Draggable.MOVE,this._onMove,this),n.DomEvent.on(document,n.Draggable.END,this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1)return;var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=new n.Point(t.clientX,t.clientY),i=r.subtract(this._startPoint);if(!i.x&&!i.y)return;n.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0),this._newPos=this._startPos.add(i),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){if(this._simulateClick&&e.changedTouches){var t=e.changedTouches[0],r=t.target,i=this._newPos&&this._newPos.distanceTo(this._startPos)||0;r.tagName.toLowerCase()==="a"&&n.DomUtil.removeClass(r,"leaflet-active"),i200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var e=this._map,t=this._worldWidth,n=Math.round(t/2),r=this._initialWorldOffset,i=this._draggable._newPos.x,s=(i-n+r)%t+n-r,o=(i+n+r)%t-n-r,u=Math.abs(s+r)r.inertiaThreshold||this._positions[0]===t;if(s)e.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),u=(this._lastTime+i-this._times[0])/1e3,a=o.multiplyBy(.58/u),f=a.distanceTo(new n.Point(0,0)),l=Math.min(r.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/r.inertiaDeceleration,p=c.multiplyBy(-h/2).round(),d={duration:h,easing:"ease-out"};n.Util.requestAnimFrame(n.Util.bind(function(){this._map.panBy(p,d)},this))}e.fire("dragend"),r.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,e,!0,e._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setView(e.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!n.Browser.touch}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(e){var t=n.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),clearTimeout(this._timer),this._timer=setTimeout(n.Util.bind(this._performZoom,this),40),n.DomEvent.preventDefault(e)},_performZoom:function(){var e=this._map,t=Math.round(this._delta),n=e.getZoom();t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0;if(!t)return;var r=n+t,i=this._getCenterForScrollWheelZoom(this._lastMousePos,r);e.setView(i,r)},_getCenterForScrollWheelZoom:function(e,t){var n=this._map,r=n.getZoomScale(t),i=n.getSize().divideBy(2),s=e.subtract(i).multiplyBy(1-1/r),o=n._getTopLeftPoint().add(i).add(s);return n.unproject(o)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.Util.extend(n.DomEvent,{addDoubleTapListener:function(e,t,n){function l(e){if(e.touches.length!==1)return;var t=Date.now(),n=t-(r||t);o=e.touches[0],i=n>0&&n<=s,r=t}function c(e){i&&(o.type="dblclick",t(o),r=null)}var r,i=!1,s=250,o,u="_leaflet_",a="touchstart",f="touchend";return e[u+a+n]=l,e[u+f+n]=c,e.addEventListener(a,l,!1),e.addEventListener(f,c,!1),this},removeDoubleTapListener:function(e,t){var n="_leaflet_";return e.removeEventListener(e,e[n+"touchstart"+t],!1),e.removeEventListener(e,e[n+"touchend"+t],!1),this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)return;var r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]),s=t._getCenterLayerPoint();this._startCenter=r.add(i).divideBy(2,!0),this._startDist=r.distanceTo(i),this._moved=!1,this._zooming=!0,this._centerOffset=s.subtract(this._startCenter),n.DomEvent.on(document,"touchmove",this._onTouchMove,this).on(document,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(e)},_onTouchMove:function(e){if(!e.touches||e.touches.length!==2)return;var t=this._map,r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]);this._scale=r.distanceTo(i)/this._startDist,this._delta=r.add(i).divideBy(2,!0).subtract(this._startCenter);if(this._scale===1)return;this._moved||(n.DomUtil.addClass(t._mapPane,"leaflet-zoom-anim leaflet-touching"),t.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(e)},_updateOnMove:function(){var e=this._map,t=this._getScaleOrigin(),r=e.layerPointToLatLng(t);e.fire("zoomanim",{center:r,zoom:e.getScaleZoom(this._scale)}),e._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(e){if(!this._moved||!this._zooming)return;var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(document,"touchmove",this._onTouchMove).off(document,"touchend",this._onTouchEnd);var r=this._getScaleOrigin(),i=t.layerPointToLatLng(r),s=t.getZoom(),o=t.getScaleZoom(this._scale)-s,u=o>0?Math.ceil(o):Math.floor(o),a=t._limitZoom(s+u);t.fire("zoomanim",{center:i,zoom:a}),t._runAnimation(i,a,t.getZoomScale(a)/this._scale,r,!0)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(document,"mousemove",this._onMouseMove,this).on(document,"mouseup",this._onMouseUp,this).preventDefault(e),this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,r=this._box,i=this._map.mouseEventToLayerPoint(e),s=i.subtract(t),o=new n.Point(Math.min(i.x,t.x),Math.min(i.y,t.y));n.DomUtil.setPosition(r,o),r.style.width=Math.abs(s.x)-4+"px",r.style.height=Math.abs(s.y)-4+"px"},_onMouseUp:function(e){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(document,"mousemove",this._onMouseMove).off(document,"mouseup",this._onMouseUp);var t=this._map,r=t.mouseEventToLayerPoint(e),i=new n.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(r));t.fitBounds(i),t.fire("boxzoomend",{boxZoomBounds:i})}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,61,107],zoomOut:[189,109,0]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0"),n.DomEvent.addListener(e,"focus",this._onFocus,this).addListener(e,"blur",this._onBlur,this).addListener(e,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;n.DomEvent.removeListener(e,"focus",this._onFocus,this).removeListener(e,"blur",this._onBlur,this).removeListener(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;re&&(n._index+=t)})},_createMiddleMarker:function(e,t){var n=this._getMiddleLatLng(e,t),r=this._createMarker(n),i,s,o;r.setOpacity(.6),e._middleRight=t._middleLeft=r,s=function(){var s=t._index;r._index=s,r.off("click",i).on("click",this._onMarkerClick,this),n.lat=r.getLatLng().lat,n.lng=r.getLatLng().lng,this._poly.spliceLatLngs(s,0,n),this._markers.splice(s,0,r),r.setOpacity(1),this._updateIndexes(s,1),t._index++,this._updatePrevNext(e,r),this._updatePrevNext(r,t)},o=function(){r.off("dragstart",s,this),r.off("dragend",o,this),this._createMiddleMarker(e,r),this._createMiddleMarker(r,t)},i=function(){s.call(this),o.call(this),this._poly.fire("edit")},r.on("click",i,this).on("dragstart",s,this).on("dragend",o,this),this._markerGroup.addLayer(r)},_updatePrevNext:function(e,t){e._next=t,t._prev=e},_getMiddleLatLng:function(e,t){var n=this._poly._map,r=n.latLngToLayerPoint(e.getLatLng()),i=n.latLngToLayerPoint(t.getLatLng());return n.layerPointToLatLng(r._add(i).divideBy(2))}}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(e){n.Util.setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},addTo:function(e){this._map=e;var t=this._container=this.onAdd(e),r=this.getPosition(),i=e._controlCorners[r];return n.DomUtil.addClass(t,"leaflet-control"),r.indexOf("bottom")!==-1?i.insertBefore(t,i.firstChild):i.appendChild(t),this},removeFrom:function(e){var t=this.getPosition(),n=e._controlCorners[t];return n.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(e),this}}),n.control=function(e){return new n.Control(e)},n.Map.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.removeFrom(this),this},_initControlPos:function(){function i(i,s){var o=t+i+" "+t+s;e[i+s]=n.DomUtil.create("div",o,r)}var e=this._controlCorners={},t="leaflet-",r=this._controlContainer=n.DomUtil.create("div",t+"control-container",this._container);i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(e){var t="leaflet-control-zoom",r=n.DomUtil.create("div",t);return this._createButton("Zoom in",t+"-in",r,e.zoomIn,e),this._createButton("Zoom out",t+"-out",r,e.zoomOut,e),r},_createButton:function(e,t,r,i,s){var o=n.DomUtil.create("a",t,r);return o.href="#",o.title=e,n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",i,s).on(o,"dblclick",n.DomEvent.stopPropagation),o}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(e){return new n.Control.Zoom(e)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(e){n.Util.setOptions(this,e),this._attributions={}},onAdd:function(e){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){if(!e)return;return this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this},removeAttribution:function(e){if(!e)return;return this._attributions[e]--,this._update(),this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions.hasOwnProperty(t)&&this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" — ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(e){return new n.Control.Attribution(e)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",r=n.DomUtil.create("div",t),i=this.options;return this._addScales(i,t,r),e.on(i.updateWhenIdle?"moveend":"move",this._update,this),this._update(),r},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,r){e.metric&&(this._mScale=n.DomUtil.create("div",t+"-line",r)),e.imperial&&(this._iScale=n.DomUtil.create("div",t+"-line",r))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,r=(new n.LatLng(t,0)).distanceTo(new n.LatLng(t,180)),i=r*(e.getNorthEast().lng-e.getSouthWest().lng)/180,s=this._map.getSize(),o=this.options,u=0;s.x>0&&(u=i*(o.maxWidth/s.x)),this._updateScales(o,u)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;t>5280?(r=t/5280,i=this._getRoundNum(r),n.style.width=this._getScaleWidth(i/r)+"px",n.innerHTML=i+" mi"):(s=this._getRoundNum(t),n.style.width=this._getScaleWidth(s/t)+"px",n.innerHTML=s+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),n.control.scale=function(e){return new n.Control.Scale(e)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,r){n.Util.setOptions(this,r),this._layers={},this._lastZIndex=0;for(var i in e)e.hasOwnProperty(i)&&this._addLayer(e[i],i);for(i in t)t.hasOwnProperty(i)&&this._addLayer(t[i],i,!0)},onAdd:function(e){return this._initLayout(),this._update(),this._container},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update(),this},removeLayer:function(e){var t=n.Util.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=n.DomUtil.create("div",e);n.Browser.touch?n.DomEvent.on(t,"click",n.DomEvent.stopPropagation):n.DomEvent.disableClickPropagation(t);var r=this._form=n.DomUtil.create("form",e+"-list");if(this.options.collapsed){n.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var i=this._layersLink=n.DomUtil.create("a",e+"-toggle",t);i.href="#",i.title="Layers",n.Browser.touch?n.DomEvent.on(i,"click",n.DomEvent.stopPropagation).on(i,"click",n.DomEvent.preventDefault).on(i,"click",this._expand,this):n.DomEvent.on(i,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",e+"-base",r),this._separator=n.DomUtil.create("div",e+"-separator",r),this._overlaysList=n.DomUtil.create("div",e+"-overlays",r),t.appendChild(r)},_addLayer:function(e,t,r){var i=n.Util.stamp(e);this._layers[i]={layer:e,name:t,overlay:r},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e=!1,t=!1;for(var n in this._layers)if(this._layers.hasOwnProperty(n)){var r=this._layers[n];this._addItem(r),t=t||r.overlay,e=e||!r.overlay}this._separator.style.display=t&&e?"":"none"},_addItem:function(e,t){var r=document.createElement("label"),i=document.createElement("input");e.overlay||(i.name="leaflet-base-layers"),i.type=e.overlay?"checkbox":"radio",i.layerId=n.Util.stamp(e.layer),i.defaultChecked=this._map.hasLayer(e.layer),n.DomEvent.on(i,"click",this._onInputClick,this);var s=document.createTextNode(" "+e.name);r.appendChild(i),r.appendChild(s);var o=e.overlay?this._overlaysList:this._baseLayersList;o.appendChild(r)},_onInputClick:function(){var e,t,n,r=this._form.getElementsByTagName("input"),i=r.length;for(e=0;e.5&&this._getLoadedTilesPercentage(e)<.5){e.style.visibility="hidden",e.empty=!0,this._stopLoadingImages(e);return}t||(t=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),t.style.zIndex=1),t.style[n.DomUtil.TRANSFORM]="",t.style.visibility="hidden",t.empty=!0,e.empty=!1,this._tilePane=this._panes.tilePane=t;var r=this._tileBg=e;r.transition||(r.transition=new n.Transition(r,{duration:.25,easing:"cubic-bezier(0.25,0.1,0.25,0.75)"}),r.transition.on("end",this._onZoomTransitionEnd,this)),this._stopLoadingImages(r)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;n Date: Mon, 30 Jul 2012 16:58:58 +0300 Subject: [PATCH 232/816] add MapMarker to plugins list --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 4c9e79af9d4..47c13da7e35 100644 --- a/plugins.md +++ b/plugins.md @@ -230,6 +230,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jan Marsch + + + Leaflet Maps Marker + + A Wordpress plugin that uses Leaflet and a set of its plugins for adding maps to your posts through a nice admin interface. + + Robert Harm + + leaflet-hash From 46eb40de6fa6d96b6469311e0af6bd01b2eb427e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 31 Jul 2012 11:11:04 +0300 Subject: [PATCH 233/816] update about 0.4.1 --- _posts/2012-07-30-leaflet-0-4-released.md | 9 +++++++++ download.md | 10 +++++----- reference.html | 5 +++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index da2c3516aa8..9342ac2e613 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -188,6 +188,15 @@ And, of course, thanks to my amazing company, [CloudMade](http://cloudmade.com), Sincerely,
      Vladimir Agafonkin, Leaflet maintainer. +
      + +**Update (July 31)**: 0.4.1 hotfix was released with the following bugs fixed: + + * Fixed a bug that caused marker shadows to appear as opaque black in IE6-8. [#850](https://github.com/CloudMade/Leaflet/issues/850) + * Fixed a bug with incorrect calculation of scale by the scale control. [#852](https://github.com/CloudMade/Leaflet/issues/852) + * Fixed broken L.tileLayer.wms class factory. [#856](https://github.com/CloudMade/Leaflet/issues/856) + * Improved retina detection for `TileLayer` `detectRetina` option. [#854](https://github.com/CloudMade/Leaflet/issues/854) + [LatLng]: ../../../reference.html#latlng [LatLngBounds]: ../../../reference.html#latlngbounds diff --git a/download.md b/download.md index b0d3e8791ac..0333b73f5f5 100644 --- a/download.md +++ b/download.md @@ -13,8 +13,8 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.4 - Stable version, released on July 30, 2012 + Leaflet 0.4.1 + Stable version, released on July 31, 2012 Leaflet 0.3.1 @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source diff --git a/reference.html b/reference.html index 8e82a0d1ad6..bc7a3c7b646 100644 --- a/reference.html +++ b/reference.html @@ -4366,6 +4366,11 @@

      L.Browser

      Boolean true for all browsers on touch devices. + + retina + Boolean + true for devices with Retina screens. + From e94052de42227397f7fbe435958adc3d23f9d294 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 31 Jul 2012 11:19:09 +0300 Subject: [PATCH 234/816] update docs for #857 --- reference.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index bc7a3c7b646..1abcb025b10 100644 --- a/reference.html +++ b/reference.html @@ -615,9 +615,11 @@

      Methods for Modifying Map State

      Pans the map by a given number of pixels (animated). - invalidateSize() + invalidateSize( + <Boolean> animate? ) + this - Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. + Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. If animate is true, map animates the update. setMaxBounds( From e37f4fd9f3910f64ff0b8f1d593371cccebc4542 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 31 Jul 2012 17:50:54 +0300 Subject: [PATCH 235/816] fix typo in layers control link --- examples/layers-control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/layers-control.md b/examples/layers-control.md index 5d3b7ebe550..0b85c3bf720 100644 --- a/examples/layers-control.md +++ b/examples/layers-control.md @@ -9,7 +9,7 @@ This tutorial will show you how to group several layers into one, and how to use
      -[View example on a separate page →](ayers-control-example.html) +[View example on a separate page →](layers-control-example.html) ### Layer Groups From fae9ceee363f66af1734c081c190c7ec68758ef1 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 1 Aug 2012 14:22:32 +0300 Subject: [PATCH 236/816] update cdn links to 0.4.2 --- download.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/download.md b/download.md index 0333b73f5f5..7549efc265a 100644 --- a/download.md +++ b/download.md @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From f58a5b0c5b35fbafc64828268168765bd13958ea Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 1 Aug 2012 14:26:22 +0300 Subject: [PATCH 237/816] update blogpost with 0.4.2 --- _posts/2012-07-30-leaflet-0-4-released.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index 9342ac2e613..464438242f2 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -197,6 +197,11 @@ Vladimir Agafonkin, Leaflet maintainer. * Fixed broken L.tileLayer.wms class factory. [#856](https://github.com/CloudMade/Leaflet/issues/856) * Improved retina detection for `TileLayer` `detectRetina` option. [#854](https://github.com/CloudMade/Leaflet/issues/854) +**Update (August 1)**: 0.4.2 hotfix was released with the following bugs fixed: + + * Fixed a bug where layers control radio buttons would not work correctly in IE7. [#862](https://github.com/CloudMade/Leaflet/pull/862) + * Fixed a bug where `FeatureGroup` `removeLayer` would unbind popups of removed layers even if the popups were not put by the group (affected [Leaflet.markercluster](https://github.com/danzel/Leaflet.markercluster) plugin). [#861](https://github.com/CloudMade/Leaflet/pull/861) + [LatLng]: ../../../reference.html#latlng [LatLngBounds]: ../../../reference.html#latlngbounds From ffa20b558c90f4bea040a193e10254d9275f1d9a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 1 Aug 2012 14:27:57 +0300 Subject: [PATCH 238/816] update download page with 0.4.2 --- download.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download.md b/download.md index 7549efc265a..ea84c884e8d 100644 --- a/download.md +++ b/download.md @@ -13,8 +13,8 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.4.1 - Stable version, released on July 31, 2012 + Leaflet 0.4.2 + Stable version, released on August 1, 2012 Leaflet 0.3.1 From f6efb08b4a9bd17e2046b31c22aa703b97b80b83 Mon Sep 17 00:00:00 2001 From: Eric Theise Date: Mon, 6 Aug 2012 08:59:08 -0300 Subject: [PATCH 239/816] Update reference.html Fixing typos ("preciously" should be "previously"), the default values of offset for L.Popup are (0,6), not (0,0). --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index bc7a3c7b646..7ff638feb8a 100644 --- a/reference.html +++ b/reference.html @@ -1354,7 +1354,7 @@ offset Point - Point(0, 0) + Point(0, 6) The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays. @@ -5197,7 +5197,7 @@

      Methods

      - - Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners preciously added in onAdd. Called on map.removeLayer(layer). + Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). From f41c68f4181a297ab3b62191fbd3f2a76058af65 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 12:44:50 +0300 Subject: [PATCH 240/816] update docs with 0.4.3 changes --- reference.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/reference.html b/reference.html index b148bb6e07c..6f0cefcf4bc 100644 --- a/reference.html +++ b/reference.html @@ -2635,6 +2635,16 @@

      Methods

      this Sets the given path options to each layer of the group that has a setStyle method. + + bringToFront() + this + Brings the layer group to the top of all other layers. + + + bringToBack() + this + Brings the layer group to the bottom of all other layers. +

      Events

      @@ -2693,6 +2703,8 @@

      L.GeoJSON

      } }).addTo(map);
      +

      Each feature layer created by it gets a feature property that links to the GeoJSON feature data the layer was created from (so that you can access its properties later).

      +

      Constructor

      @@ -2773,6 +2785,22 @@

      Methods

      + + + + + + + + + + + +
      Boolean Adds a GeoJSON object to the layer.
      setStyle( + <Function> style ) + thisChanges styles of GeoJSON vector layers with the given style function.
      resetStyle( + <Path> layer ) + thisResets the the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.

      Static methods

      From 76e76d02c210212cc83626637dc9dd6be47445f3 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 13:01:39 +0300 Subject: [PATCH 241/816] add Wall Street Journal link to frontpage --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index fe93e886b6d..c5aea67cd1b 100644 --- a/index.md +++ b/index.md @@ -9,7 +9,7 @@ Leaflet is a modern open-source JavaScript library for mobile-friendly interacti It is built from the ground up to work efficiently on both desktop and mobile platforms like iOS and Android, taking advantage of HTML5 and CSS3 on modern browsers. The focus is on usability, performance, small size, [A-grade][] browser support and [a simple API][] with convention over configuration. The OOP-based [code of the library][] is designed to be modular, extensible and very easy to understand. {: .usedby} -Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data.com](http://city-data.com) [Topix](http://topix.com/) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [CityMaps](http://www.citymaps.com) ... +Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [Meetup](http://www.meetup.com/) [WSJ](http://projects.wsj.com/campaign2012/maps/) [Geocaching](http://geocaching.com) [StreetEasy](http://streeteasy.com/) [Nestoria](http://www.nestoria.co.uk) [City-Data](http://city-data.com) [Topix](http://topix.com/) [Chartbeat](http://chartbeat.com/) [GIS Cloud](http://www.giscloud.com/) [CityMaps](http://www.citymaps.com) ...
      From f847e07c064dcebe1cf7742316ace634658fe6bd Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 13:01:56 +0300 Subject: [PATCH 242/816] update references to 0.4.3 --- download.md | 10 +++++----- reference.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/download.md b/download.md index ea84c884e8d..0de048e1708 100644 --- a/download.md +++ b/download.md @@ -13,8 +13,8 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.4.2 - Stable version, released on August 1, 2012 + Leaflet 0.4.3 + Stable version, released on August 7, 2012 Leaflet 0.3.1 @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source diff --git a/reference.html b/reference.html index 6f0cefcf4bc..c7ff9a76255 100644 --- a/reference.html +++ b/reference.html @@ -123,7 +123,7 @@

      Misc


      -

      This reference reflects Leaflet 0.4. You can find docs for the in-progress master version in reference.html of gh-pages-master branch

      +

      This reference reflects Leaflet 0.4.3. You can find docs for the in-progress master version in reference.html of gh-pages-master branch

      L.Map

      From 6b4d64a32030bf0be6c8b56310f5d24fab987b49 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 17:45:47 +0300 Subject: [PATCH 243/816] Added new choropleth map tutorial --- _layouts/default.html | 2 + docs/css/blueprint/screen.css | 8 +- docs/images/choropleth.png | Bin 0 -> 7976 bytes examples.md | 8 + examples/choropleth-example.html | 169 ++++++++++++++ examples/choropleth.md | 383 +++++++++++++++++++++++++++++++ examples/us-states.js | 54 +++++ 7 files changed, 620 insertions(+), 4 deletions(-) create mode 100644 docs/images/choropleth.png create mode 100644 examples/choropleth-example.html create mode 100644 examples/choropleth.md create mode 100644 examples/us-states.js diff --git a/_layouts/default.html b/_layouts/default.html index 40e947f9cf1..38e7ccb2b15 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -38,6 +38,8 @@ + {% if page.css %}{% endif %} + + + + + + diff --git a/examples/choropleth.md b/examples/choropleth.md new file mode 100644 index 00000000000..d280334473b --- /dev/null +++ b/examples/choropleth.md @@ -0,0 +1,383 @@ +--- +layout: tutorial +title: Interactive Choropleth Map +css: "#map { + height: 420px; + } + + .info { + padding: 6px 8px; + font: 14px/18px Arial, Helvetica, sans-serif; + background: white; + background: rgba(255,255,255,0.8); + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; + } + .info h4 { + margin: 0 0 5px; + color: #777; + } + + .legend { + text-align: left; + line-height: 18px; + color: #555; + } + .legend i { + width: 18px; + height: 18px; + float: left; + margin-right: 8px; + opacity: 0.7; + }" +--- + +## Interactive Choropleth Map + +This is a case study of creating a colorful interactive choropleth map of US States Population Density with the help of [GeoJSON](geojson.html) and some [custom controls](../reference.html#icontrol) (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so). + +The tutorial was inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet), created by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/). + +
      + +[View example on a separate page →](choropleth-example.html) + +### Data Source + +We'll be creating a visualization of population density per US state. As the amount of data (state shapes and the density value for each state) is not very big, the most convenient and simple way to store and then display it is [GeoJSON](geojson.html). + +Each feature of our GeoJSON data ([us-states.js](us-states.js)) will look like this: + + { + "type": "Feature", + "properties": { + "name": "Alabama", + "density": 94.65 + }, + "geometry": ... + ... + } + +The GeoJSON with state shapes was kindly shared by [Mike Bostock](http://bost.ocks.org/mike) of [D3](http://d3js.org/) fame, extended with density values from [this Wikipedia article](http://en.wikipedia.org/wiki/List_of_U.S._states_by_population_density) based on July 1st 2011 data from [US Census Bureau](http://www.census.gov/) and assigned to `statesData` JS variable. + +### Basic States Map + +Lets display our states data on a map with CloudMade tiles of style 22677 for nice grayscale tiles that look perfect as a background for visualizations: + + var map = L.map('map').setView([37.8, -96], 4); + + L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', { + key: ..., + attribution: ..., + styleId: 22677 + }).addTo(map); + + L.geoJson(statesData).addTo(map); + +
      + + +### Adding Some Color + +Now we need to color the states according to their population density. Choosing nice colors for a map can be tricky, but there's a great tool that can help with it --- [ColorBrewer](http://colorbrewer2.org/). Using the values we got from it, we create a function that returns a color based on population density: + + function getColor(d) { + return d > 1000 ? '#800026' : + d > 500 ? '#BD0026' : + d > 200 ? '#E31A1C' : + d > 100 ? '#FC4E2A' : + d > 50 ? '#FD8D3C' : + d > 20 ? '#FEB24C' : + d > 10 ? '#FED976' : + '#FFEDA0'; + } + +Next we define a styling function for our GeoJSON layer so that its `fillColor` depends on `feature.properties.density` property, also adjusting the appearance a bit and adding a nice touch with dashed stroke. + + function style(feature) { + return { + fillColor: getColor(feature.properties.density), + weight: 2, + opacity: 1, + color: 'white', + dashArray: '3', + fillOpacity: 0.7 + }; + } + + L.geoJson(statesData, {style: style}).addTo(map); + +Looks much better now! + +
      + + +### Adding Interaction + +Now lets make the states highlighted visually in some way when they are hovered with a mouse. First we'll define an event listener for layer `mouseover` event: + + function highlightFeature(e) { + var layer = e.target; + + layer.bringToFront().setStyle({ + weight: 5, + color: '#666', + dashArray: '', + fillOpacity: 0.7 + }); + } + +Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states. + +Next we'll define what happens on `mouseout`: + + function resetHighlight(e) { + geojson.resetStyle(e.target); + } + +The handy `geojson.resetStyle` method will reset the layer style to its default state (defined by our `style` function). For this to work, make sure our GeoJSON layer is accessible through the `geojson` variable by defining it before our listeners and assigning the layer to it later: + + var geojson; + // ... our listeners + geojson = L.geoJson(...); + +As an additional touch, lets define a `click` listener that zooms to the state: + + function zoomToFeature(e) { + map.fitBounds(e.target.getBounds()); + } + +Now we'll use the `onEachFeature` option to add the listeners on our state layers: + + function onEachFeature(feature, layer) { + layer.on({ + mouseover: highlightFeature, + mouseout: resetHighlight, + click: zoomToFeature + }); + } + + geojson = L.geoJson(statesData, { + style: style, + onEachFeature: onEachFeature + }).addTo(map); + +This makes the states highlight nicely on hover and gives us the ability to add other interactions inside our listeners. + +### Custom Info Control + +We could use the usual popups on click to show information about different states, but we'll choose a different route --- showing it on state hover inside a [custom control](../reference.html#icontrol). + +Here's the code for our control: + + var info = L.control(); + + info.onAdd = function (map) { + this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info" + this.update(); + return this._div; + }; + + // method that we will use to update the control based on feature properties passed + info.update = function (props) { + this._div.innerHTML = '

      US Population Density

      ' + (props ? + '' + props.name + '
      ' + props.density + ' people / mi2' + : 'Hover over a state'); + }; + + info.addTo(map); + +We need to update the control when the user hovers over a state, so we'll also modify our listeners as follows: + + function highlightFeature(e) { + ... + info.update(layer.feature.properties); + } + + function resetHighlight(e) { + ... + info.update(); + } + +The control also needs some CSS styles to look nice: + +{: .css} + .info { + padding: 6px 8px; + font: 14px/16px Arial, Helvetica, sans-serif; + background: white; + background: rgba(255,255,255,0.8); + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; + } + .info h4 { + margin: 0 0 5px; + color: #777; + } + +### Custom Legend Control + +Creating a control with a legend is easier, since it is static and doesn't change on state hover. JavaScript code: + + var legend = L.control({position: 'bottomright'}); + + legend.onAdd = function (map) { + + var div = L.DomUtil.create('div', 'info legend'), + grades = [0, 10, 20, 50, 100, 200, 500, 1000], + labels = []; + + // loop through our density intervals and generate a label with a colored square for each interval + for (var i = 0; i < grades.length; i++) { + div.innerHTML += + ' ' + + grades[i] + (grades[i + 1] ? '–' + grades[i + 1] + '
      ' : '+'); + } + + return div; + }; + + legend.addTo(map); + +CSS styles for the control (we also reuse the `info` class defined earlier): + +{: .css} + .legend { + line-height: 18px; + color: #555; + } + .legend i { + width: 18px; + height: 18px; + float: left; + margin-right: 8px; + opacity: 0.7; + } + +Enjoy the result on [the top of this page](#map) or on a [separate page](choropleth-example.html). + + + diff --git a/examples/us-states.js b/examples/us-states.js new file mode 100644 index 00000000000..7f6af2fb34b --- /dev/null +++ b/examples/us-states.js @@ -0,0 +1,54 @@ +var statesData = {"type":"FeatureCollection","features":[ +{"type":"Feature","id":"01","properties":{"name":"Alabama","density":94.65},"geometry":{"type":"Polygon","coordinates":[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}}, +{"type":"Feature","id":"02","properties":{"name":"Alaska","density":1.264},"geometry":{"type":"MultiPolygon","coordinates":[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[-187.107557,52.992929],[-187.293773,52.927205],[-187.304726,52.823143],[-188.90491,52.762897],[-188.642017,52.927205],[-188.642017,53.003883],[-187.107557,52.992929]]]]}}, +{"type":"Feature","id":"04","properties":{"name":"Arizona","density":57.05},"geometry":{"type":"Polygon","coordinates":[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}}, +{"type":"Feature","id":"05","properties":{"name":"Arkansas","density":56.43},"geometry":{"type":"Polygon","coordinates":[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}}, +{"type":"Feature","id":"06","properties":{"name":"California","density":241.7},"geometry":{"type":"Polygon","coordinates":[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}}, +{"type":"Feature","id":"08","properties":{"name":"Colorado","density":49.33},"geometry":{"type":"Polygon","coordinates":[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}}, +{"type":"Feature","id":"09","properties":{"name":"Connecticut","density":739.1},"geometry":{"type":"Polygon","coordinates":[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}}, +{"type":"Feature","id":"10","properties":{"name":"Delaware","density":464.3},"geometry":{"type":"Polygon","coordinates":[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}}, +{"type":"Feature","id":"11","properties":{"name":"District of Columbia","density":10065},"geometry":{"type":"Polygon","coordinates":[[[-77.035264,38.993869],[-76.909294,38.895284],[-77.040741,38.791222],[-77.117418,38.933623],[-77.035264,38.993869]]]}}, +{"type":"Feature","id":"12","properties":{"name":"Florida","density":353.4},"geometry":{"type":"Polygon","coordinates":[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}}, +{"type":"Feature","id":"13","properties":{"name":"Georgia","density":169.5},"geometry":{"type":"Polygon","coordinates":[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}}, +{"type":"Feature","id":"15","properties":{"name":"Hawaii","density":214.1},"geometry":{"type":"MultiPolygon","coordinates":[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}}, +{"type":"Feature","id":"16","properties":{"name":"Idaho","density":19.15},"geometry":{"type":"Polygon","coordinates":[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}}, +{"type":"Feature","id":"17","properties":{"name":"Illinois","density":231.5},"geometry":{"type":"Polygon","coordinates":[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}}, +{"type":"Feature","id":"18","properties":{"name":"Indiana","density":181.7},"geometry":{"type":"Polygon","coordinates":[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}}, +{"type":"Feature","id":"19","properties":{"name":"Iowa","density":54.81},"geometry":{"type":"Polygon","coordinates":[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}}, +{"type":"Feature","id":"20","properties":{"name":"Kansas","density":35.09},"geometry":{"type":"Polygon","coordinates":[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}}, +{"type":"Feature","id":"21","properties":{"name":"Kentucky","density":110},"geometry":{"type":"Polygon","coordinates":[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}}, +{"type":"Feature","id":"22","properties":{"name":"Louisiana","density":105},"geometry":{"type":"Polygon","coordinates":[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}}, +{"type":"Feature","id":"23","properties":{"name":"Maine","density":43.04},"geometry":{"type":"Polygon","coordinates":[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}}, +{"type":"Feature","id":"24","properties":{"name":"Maryland","density":596.3},"geometry":{"type":"MultiPolygon","coordinates":[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}}, +{"type":"Feature","id":"25","properties":{"name":"Massachusetts","density":840.2},"geometry":{"type":"Polygon","coordinates":[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}}, +{"type":"Feature","id":"26","properties":{"name":"Michigan","density":173.9},"geometry":{"type":"MultiPolygon","coordinates":[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}}, +{"type":"Feature","id":"27","properties":{"name":"Minnesota","density":67.14},"geometry":{"type":"Polygon","coordinates":[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}}, +{"type":"Feature","id":"28","properties":{"name":"Mississippi","density":63.50},"geometry":{"type":"Polygon","coordinates":[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}}, +{"type":"Feature","id":"29","properties":{"name":"Missouri","density":87.26},"geometry":{"type":"Polygon","coordinates":[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}}, +{"type":"Feature","id":"30","properties":{"name":"Montana","density":6.858},"geometry":{"type":"Polygon","coordinates":[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}}, +{"type":"Feature","id":"31","properties":{"name":"Nebraska","density":23.97},"geometry":{"type":"Polygon","coordinates":[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}}, +{"type":"Feature","id":"32","properties":{"name":"Nevada","density":24.80},"geometry":{"type":"Polygon","coordinates":[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}}, +{"type":"Feature","id":"33","properties":{"name":"New Hampshire","density":147},"geometry":{"type":"Polygon","coordinates":[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}}, +{"type":"Feature","id":"34","properties":{"name":"New Jersey","density":1189 },"geometry":{"type":"Polygon","coordinates":[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}}, +{"type":"Feature","id":"35","properties":{"name":"New Mexico","density":17.16},"geometry":{"type":"Polygon","coordinates":[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}}, +{"type":"Feature","id":"36","properties":{"name":"New York","density":412.3},"geometry":{"type":"Polygon","coordinates":[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}}, +{"type":"Feature","id":"37","properties":{"name":"North Carolina","density":198.2},"geometry":{"type":"Polygon","coordinates":[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}}, +{"type":"Feature","id":"38","properties":{"name":"North Dakota","density":9.916},"geometry":{"type":"Polygon","coordinates":[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}}, +{"type":"Feature","id":"39","properties":{"name":"Ohio","density":281.9},"geometry":{"type":"Polygon","coordinates":[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}}, +{"type":"Feature","id":"40","properties":{"name":"Oklahoma","density":55.22},"geometry":{"type":"Polygon","coordinates":[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}}, +{"type":"Feature","id":"41","properties":{"name":"Oregon","density":40.33},"geometry":{"type":"Polygon","coordinates":[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}}, +{"type":"Feature","id":"42","properties":{"name":"Pennsylvania","density":284.3},"geometry":{"type":"Polygon","coordinates":[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}}, +{"type":"Feature","id":"44","properties":{"name":"Rhode Island","density":1006 },"geometry":{"type":"MultiPolygon","coordinates":[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}}, +{"type":"Feature","id":"45","properties":{"name":"South Carolina","density":155.4},"geometry":{"type":"Polygon","coordinates":[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}}, +{"type":"Feature","id":"46","properties":{"name":"South Dakota","density":98.07},"geometry":{"type":"Polygon","coordinates":[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}}, +{"type":"Feature","id":"47","properties":{"name":"Tennessee","density":88.08},"geometry":{"type":"Polygon","coordinates":[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}}, +{"type":"Feature","id":"48","properties":{"name":"Texas","density":98.07},"geometry":{"type":"Polygon","coordinates":[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}}, +{"type":"Feature","id":"49","properties":{"name":"Utah","density":34.30},"geometry":{"type":"Polygon","coordinates":[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}}, +{"type":"Feature","id":"50","properties":{"name":"Vermont","density":67.73},"geometry":{"type":"Polygon","coordinates":[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}}, +{"type":"Feature","id":"51","properties":{"name":"Virginia","density":204.5},"geometry":{"type":"MultiPolygon","coordinates":[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-76.016553,37.95325],[-75.994645,37.95325],[-76.043938,37.95325],[-76.016553,37.95325]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}}, +{"type":"Feature","id":"53","properties":{"name":"Washington","density":102.6},"geometry":{"type":"MultiPolygon","coordinates":[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}}, +{"type":"Feature","id":"54","properties":{"name":"West Virginia","density":77.06},"geometry":{"type":"Polygon","coordinates":[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}}, +{"type":"Feature","id":"55","properties":{"name":"Wisconsin","density":105.2},"geometry":{"type":"Polygon","coordinates":[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}}, +{"type":"Feature","id":"56","properties":{"name":"Wyoming","density":5.851},"geometry":{"type":"Polygon","coordinates":[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}, +{"type":"Feature","id":"72","properties":{"name":"Puerto Rico","density":1082 },"geometry":{"type":"Polygon","coordinates":[[[-66.448338,17.984326],[-66.771478,18.006234],[-66.924832,17.929556],[-66.985078,17.973372],[-67.209633,17.956941],[-67.154863,18.19245],[-67.269879,18.362235],[-67.094617,18.515589],[-66.957694,18.488204],[-66.409999,18.488204],[-65.840398,18.433435],[-65.632274,18.367712],[-65.626797,18.203403],[-65.730859,18.186973],[-65.834921,18.017187],[-66.234737,17.929556],[-66.448338,17.984326]]]}} +]}; From f15dc88a4fedb11629ef3e50d663c9fce814a95c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 18:09:59 +0300 Subject: [PATCH 244/816] add 0.4.3 blog post, minor tutorials update --- _posts/2012-07-30-leaflet-0-4-released.md | 15 ------- ...-08-07-leaflet-0-4-3-and-a-new-tutorial.md | 43 +++++++++++++++++++ examples.md | 2 +- examples/choropleth.md | 2 +- 4 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 _posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index 464438242f2..79d603a2daf 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -188,21 +188,6 @@ And, of course, thanks to my amazing company, [CloudMade](http://cloudmade.com), Sincerely,
      Vladimir Agafonkin, Leaflet maintainer. -
      - -**Update (July 31)**: 0.4.1 hotfix was released with the following bugs fixed: - - * Fixed a bug that caused marker shadows to appear as opaque black in IE6-8. [#850](https://github.com/CloudMade/Leaflet/issues/850) - * Fixed a bug with incorrect calculation of scale by the scale control. [#852](https://github.com/CloudMade/Leaflet/issues/852) - * Fixed broken L.tileLayer.wms class factory. [#856](https://github.com/CloudMade/Leaflet/issues/856) - * Improved retina detection for `TileLayer` `detectRetina` option. [#854](https://github.com/CloudMade/Leaflet/issues/854) - -**Update (August 1)**: 0.4.2 hotfix was released with the following bugs fixed: - - * Fixed a bug where layers control radio buttons would not work correctly in IE7. [#862](https://github.com/CloudMade/Leaflet/pull/862) - * Fixed a bug where `FeatureGroup` `removeLayer` would unbind popups of removed layers even if the popups were not put by the group (affected [Leaflet.markercluster](https://github.com/danzel/Leaflet.markercluster) plugin). [#861](https://github.com/CloudMade/Leaflet/pull/861) - - [LatLng]: ../../../reference.html#latlng [LatLngBounds]: ../../../reference.html#latlngbounds [Point]: ../../../reference.html#point diff --git a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md new file mode 100644 index 00000000000..0e127c35d4f --- /dev/null +++ b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md @@ -0,0 +1,43 @@ +--- +layout: post +title: Leaflet 0.4.3 and a New Tutorial +description: Leaflet 0.4.3 released with several bugfixes and improvements, and comes with a new tutorial on creating a colorful interactive choropleth map. +--- + +Following the [Leaflet 0.4 release](leaflet-0-4-released.html), there were several minor bugfix releases over the past week, with Leaflet 0.4.3 released today. They contain fixes for some bugs that were discovered and also bring some improvements to the new GeoJSON API to make it even more flexible --- see the changelog below. + +I've also written [a new tutorial](../../../examples/choropleth.html), inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/about/staff/ryan-murphy/) by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet). It will show you step-by-step how to create a beautiful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of GeoJSON and custom controls, and hopefully convince more major news and government websites to switch to Leaflet. :) + +Grab the new Leaflet 0.4.3 at the [download page](../../../download.html). Enjoy! + +### 0.4.3 (August 7, 2012) + +#### Improvements + + * Improved `GeoJSON` `setStyle` to also accept function (like the corresponding option). + * Added `GeoJSON` `resetStyle(layer)`, useful for resetting hover state. + * Added `feature` property to layers created with `GeoJSON` (containing the GeoJSON feature data). + * Added `FeatureGroup` `bringToFront` and `bringToBack` methods (so that they would work for multipolys). + * Added optional `animate` argument to `Map` `invalidateSize` (by [@ajbeaven](https://github.com/ajbeaven)). [#857](https://github.com/CloudMade/Leaflet/pull/857) + +#### Bugfixes + + * Fixed a bug where tiles sometimes disappeared on initial map load on Android 2/3 (by [@danzel](https://github.com/danzel)). [#868](https://github.com/CloudMade/Leaflet/pull/868) + * Fixed a bug where map would occasionally flicker near the border on zoom or pan on Chrome. + * Fixed a bug where `Path` `bringToFront` and `bringToBack` didn't return `this`. + * Removed zoom out on Win/Meta key binding (since it interferes with global keyboard shortcuts). [#869](https://github.com/CloudMade/Leaflet/issues/869) + +### 0.4.2 (August 1, 2012) + + * Fixed a bug where layers control radio buttons would not work correctly in IE7 (by [@danzel](https://github.com/danzel)). [#862](https://github.com/CloudMade/Leaflet/pull/862) + * Fixed a bug where `FeatureGroup` `removeLayer` would unbind popups of removed layers even if the popups were not put by the group (affected [Leaflet.markercluster](https://github.com/danzel/Leaflet.markercluster) plugin) (by [@danzel](https://github.com/danzel)). [#861](https://github.com/CloudMade/Leaflet/pull/861) + +### 0.4.1 (July 31, 2012) + + * Fixed a bug that caused marker shadows appear as opaque black in IE6-8. [#850](https://github.com/CloudMade/Leaflet/issues/850) + * Fixed a bug with incorrect calculation of scale by the scale control. [#852](https://github.com/CloudMade/Leaflet/issues/852) + * Fixed broken L.tileLayer.wms class factory (by [@mattcurrie](https://github.com/mattcurrie)). [#856](https://github.com/CloudMade/Leaflet/issues/856) + * Improved retina detection for `TileLayer` `detectRetina` option (by [@sxua](https://github.com/sxua)). [#854](https://github.com/CloudMade/Leaflet/issues/854) + +Sincerely,
      +Vladimir Agafonkin, Leaflet maintainer. diff --git a/examples.md b/examples.md index d7dd895684b..ef7fe81bb65 100644 --- a/examples.md +++ b/examples.md @@ -40,7 +40,7 @@ In this tutorial, you'll learn how to create and interact with map vectors creat ### [Interactive Choropleth Map][7] -A case study of creating a colorful interactive choropleth map of US States Population Density with GeoJSON and some custom controls. News websites will love this. +A case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with GeoJSON and some custom controls. News websites will love this. *** [][6] diff --git a/examples/choropleth.md b/examples/choropleth.md index d280334473b..05374cf55d0 100644 --- a/examples/choropleth.md +++ b/examples/choropleth.md @@ -34,7 +34,7 @@ css: "#map { ## Interactive Choropleth Map -This is a case study of creating a colorful interactive choropleth map of US States Population Density with the help of [GeoJSON](geojson.html) and some [custom controls](../reference.html#icontrol) (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so). +This is a case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of [GeoJSON](geojson.html) and some [custom controls](../reference.html#icontrol) (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so). The tutorial was inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet), created by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/). From c4756638fefddf29e303dac359004416b9bcb4c6 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 18:16:00 +0300 Subject: [PATCH 245/816] fix Texas Tribune links --- _posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md | 2 +- examples/choropleth.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md index 0e127c35d4f..9b155631fd7 100644 --- a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md +++ b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md @@ -6,7 +6,7 @@ description: Leaflet 0.4.3 released with several bugfixes and improvements, and Following the [Leaflet 0.4 release](leaflet-0-4-released.html), there were several minor bugfix releases over the past week, with Leaflet 0.4.3 released today. They contain fixes for some bugs that were discovered and also bring some improvements to the new GeoJSON API to make it even more flexible --- see the changelog below. -I've also written [a new tutorial](../../../examples/choropleth.html), inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/about/staff/ryan-murphy/) by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet). It will show you step-by-step how to create a beautiful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of GeoJSON and custom controls, and hopefully convince more major news and government websites to switch to Leaflet. :) +I've also written [a new tutorial](../../../examples/choropleth.html), inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/library/data/us-senate-runoff-results-map/) by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet). It will show you step-by-step how to create a beautiful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of GeoJSON and custom controls, and hopefully convince more major news and government websites to switch to Leaflet. :) Grab the new Leaflet 0.4.3 at the [download page](../../../download.html). Enjoy! diff --git a/examples/choropleth.md b/examples/choropleth.md index 05374cf55d0..8b9a3061e00 100644 --- a/examples/choropleth.md +++ b/examples/choropleth.md @@ -36,7 +36,7 @@ css: "#map { This is a case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with the help of [GeoJSON](geojson.html) and some [custom controls](../reference.html#icontrol) (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so). -The tutorial was inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/about/staff/ryan-murphy/) (also powered by Leaflet), created by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/). +The tutorial was inspired by the [Texas Tribune US Senate Runoff Results map](http://www.texastribune.org/library/data/us-senate-runoff-results-map/) (also powered by Leaflet), created by [Ryan Murphy](http://www.texastribune.org/about/staff/ryan-murphy/).
      From 6fc2d96ddace1dfc60cdeccb8fee27f704d39730 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 7 Aug 2012 18:47:24 +0300 Subject: [PATCH 246/816] update with 0.4.4 --- _posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md | 2 ++ download.md | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md index 9b155631fd7..8518ab94afc 100644 --- a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md +++ b/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md @@ -10,6 +10,8 @@ I've also written [a new tutorial](../../../examples/choropleth.html), inspired Grab the new Leaflet 0.4.3 at the [download page](../../../download.html). Enjoy! +**update**: IE9 regression was discovered in 0.4.3, so I had to release 0.4.4 with a fix. Sorry! + ### 0.4.3 (August 7, 2012) #### Improvements diff --git a/download.md b/download.md index 0de048e1708..97de2d6e2f3 100644 --- a/download.md +++ b/download.md @@ -13,7 +13,7 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.4.3 + Leaflet 0.4.4 Stable version, released on August 7, 2012 @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From 69df53248e48e04fabc8df0b0f9f0de0af8f8452 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 8 Aug 2012 12:22:27 +0300 Subject: [PATCH 247/816] fix choropleth examples hover issue in IE --- examples/choropleth-example.html | 6 +++++- examples/choropleth.md | 14 +++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/choropleth-example.html b/examples/choropleth-example.html index d1302b375f1..6dac8d6080b 100644 --- a/examples/choropleth-example.html +++ b/examples/choropleth-example.html @@ -103,13 +103,17 @@ function highlightFeature(e) { var layer = e.target; - layer.bringToFront().setStyle({ + layer.setStyle({ weight: 5, color: '#666', dashArray: '', fillOpacity: 0.7 }); + if (!L.Browser.ie) { + layer.bringToFront(); + } + info.update(layer.feature.properties); } diff --git a/examples/choropleth.md b/examples/choropleth.md index 8b9a3061e00..ca5be2c2c1e 100644 --- a/examples/choropleth.md +++ b/examples/choropleth.md @@ -119,15 +119,19 @@ Now lets make the states highlighted visually in some way when they are hovered function highlightFeature(e) { var layer = e.target; - layer.bringToFront().setStyle({ + layer.setStyle({ weight: 5, color: '#666', dashArray: '', fillOpacity: 0.7 }); + + if (!L.Browser.ie) { + layer.bringToFront(); + } } -Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states. +Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states (but not for IE, since it has problems doing `bringToFront` on `mouseover`). Next we'll define what happens on `mouseout`: @@ -319,13 +323,17 @@ Enjoy the result on [the top of this page](#map) or on a [separate page](choropl function highlightFeature(e) { var layer = e.target; - layer.bringToFront().setStyle({ + layer.setStyle({ weight: 5, color: '#666', dashArray: '', fillOpacity: 0.7 }); + if (!L.Browser.ie) { + layer.bringToFront(); + } + info.update(layer.feature.properties); } From eb03c6b267e111dd74c85798071fdd93f5dc9dbf Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 8 Aug 2012 14:05:39 +0300 Subject: [PATCH 248/816] fix choropleth hover for Opera too --- examples/choropleth-example.html | 2 +- examples/choropleth.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/choropleth-example.html b/examples/choropleth-example.html index 6dac8d6080b..6c1295b6efc 100644 --- a/examples/choropleth-example.html +++ b/examples/choropleth-example.html @@ -110,7 +110,7 @@ fillOpacity: 0.7 }); - if (!L.Browser.ie) { + if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); } diff --git a/examples/choropleth.md b/examples/choropleth.md index ca5be2c2c1e..c0fc16703af 100644 --- a/examples/choropleth.md +++ b/examples/choropleth.md @@ -126,12 +126,12 @@ Now lets make the states highlighted visually in some way when they are hovered fillOpacity: 0.7 }); - if (!L.Browser.ie) { + if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); } } -Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states (but not for IE, since it has problems doing `bringToFront` on `mouseover`). +Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states (but not for IE or Opera, since they have problems doing `bringToFront` on `mouseover`). Next we'll define what happens on `mouseout`: From 20530e3d88de7de303d202a57e9e39c8f8c9f59c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 8 Aug 2012 14:23:19 +0300 Subject: [PATCH 249/816] fix choropleth example in Opera more --- examples/choropleth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/choropleth.md b/examples/choropleth.md index c0fc16703af..800dcd76c4f 100644 --- a/examples/choropleth.md +++ b/examples/choropleth.md @@ -330,7 +330,7 @@ Enjoy the result on [the top of this page](#map) or on a [separate page](choropl fillOpacity: 0.7 }); - if (!L.Browser.ie) { + if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); } From 9cd0ab6427b32f84f5d28f743a9322f73ec4536e Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 9 Aug 2012 01:12:05 +0300 Subject: [PATCH 250/816] remove markdotto github button that broke everything --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 38e7ccb2b15..84ef1a10819 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -54,7 +54,7 @@

      Leaflet

      An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps by CloudMade

      +

      The layer names can contain HTML, which allows you to add additional styling to the items:

      + +
      {"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
      + + +

      Events

      + +

      You can subscribe to the following events using these methods.

      + + + + + + + + + + + +
      EventDataDescription
      baselayerchangeLayerEvent + Fired when the base layer is changed through the control.

      L.Control.Scale

      @@ -4387,6 +4480,19 @@

      Class Factories

      };
      +

      Constructor Hooks

      + +

      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:

      + +
      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:

      + +
      MyClass.addInitHook('methodName', arg1, arg2, …);
      +

      L.Browser

      @@ -4412,6 +4518,11 @@

      L.Browser

      Boolean true for Internet Explorer 6. + + ie7 + Boolean + true for Internet Explorer 6. + webkit Boolean @@ -4422,7 +4533,7 @@

      L.Browser

      Boolean true for webkit-based browsers that support CSS 3D transformations. - + android Boolean true for Android mobile browser. + + android23 + Boolean + true for old Android stock browsers (2 and 3). + mobile Boolean @@ -4457,6 +4573,11 @@

      L.Browser

      Boolean true for all browsers on touch devices. + + msTouch + Boolean + true for browsers with Microsoft touch model (e.g. IE10). + retina Boolean @@ -4484,7 +4605,7 @@

      Methods

      Object - Merges the properties of the src object (or multiple objects) into dest object and returns the latter. + Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut. bind( @@ -4493,12 +4614,12 @@

      Methods

      Function - Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). + Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). Has an L.bind shortcut. stamp( <Object> obj ) String - Applies a unique key to the object and returns that key. + Applies a unique key to the object and returns that key. Has an L.stamp shortcut. + new L.PosAnimation() - Creates a Transition object tied to a particular element with the given options. + Creates a PosAnimation object. -

      Options

      +

      Methods

      - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + +
      OptionTypeDefaultMethodReturns Description
      durationNumber0.5Duration of the animation in seconds.
      easingString'ease'One of the timing functions for the animation.
      fpsNumber50Frames per second for the timer fallback (IE6-9).
      fakeStepIntervalNumber100How often to fire the step event during transition with a timer (as native transitions don't support such events).run( + <HTMLElement> element, + <Point> newPos, + <Number> duration?, + <Number> easeLinearity? ) + thisRun 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, 0.5 by default)
      @@ -5094,35 +5204,6 @@

      Events

      -

      Methods

      - - - - - - - - - - - - - -
      MethodReturnsDescription
      run( - <Object> properties ) - thisRun the animation with the given set of properties and their end values.
      - -

      Transition Properties

      - -

      An object literal of the following form:

      - -
      {
      -	'<style-property-1>': '<value-1>',
      -	'<style-property-2>': '<value-2>'
      -	// ...
      -}
      - -

      L.Draggable

      @@ -5208,7 +5289,7 @@

      Methods

      -

      Static Properties

      + @@ -5573,7 +5654,7 @@

      Defined 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). + 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). @@ -5598,7 +5679,7 @@

      Global Switches

      L_NO_TOUCH - Forces Leaflet to not use touch events even if it detects them. Particularly useful if you embed Leaflet inside a QT WebView (which exposes touch events even on desktop PCs). + Forces Leaflet to not use touch events even if it detects them. L_DISABLE_3D @@ -5622,4 +5703,4 @@

      L.version

      A constant that represents the Leaflet version in use.

      -

      L.version // returns "0.4" (or whatever version is currently in use)
      +
      L.version // returns "0.5" (or whatever version is currently in use)
      From 9cc33e2cf36b5473ca82724a45fed34e4e99632d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 17 Jan 2013 16:48:32 +0200 Subject: [PATCH 329/816] update download page and add 0.5 release post --- _posts/2013-01-17-leaflet-0-5-released.md | 24 +++++++++++++++++++++++ download.md | 14 ++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 _posts/2013-01-17-leaflet-0-5-released.md diff --git a/_posts/2013-01-17-leaflet-0-5-released.md b/_posts/2013-01-17-leaflet-0-5-released.md new file mode 100644 index 00000000000..c9630db2915 --- /dev/null +++ b/_posts/2013-01-17-leaflet-0-5-released.md @@ -0,0 +1,24 @@ +--- +layout: post +title: Leaflet 0.5 Released +description: Leaflet 0.5 released — with IE10 touch support, retina-enabled markers, better panning inertia, new zoom control and about a hundred of other improvements and bugfixes! +author: Vladimir Agafonkin +authorsite: http://agafonkin.com/en +--- + +Rejoice, everyone — after 4.5 months of development with [26 contributors involved](https://github.com/Leaflet/Leaflet/graphs/contributors?from=2012-08-30&to=2013-01-17&type=c) since the previous major release, I'm happy to announce the release of Leaflet 0.5 stable, hooray! + +0.5 highlights include IE10 touch devices and Metro apps support, retina-enabled markers, a much better panning inertia implementation, hand cursors for dragging and a new zoom control design. But the real power of this release comes with about a hundred of subtle improvements and bugfixes, improving usability, performance and overall "feel" of browsing the map even further. + +As always, you can find CDN links and downloads for the new release on the [download page](../../../download.html). + +The huge detailed list of changes is documented in the [changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). Be sure to read the "Breaking Changes" part of it before upgrading to avoid any issues! The [API reference](../../../reference.html) was updated to accomodate all the changes too. + +In other news, [Leaflet repository](https://github.com/Leaflet/Leaflet) has moved to [its own GitHub organization](https://github.com/Leaflet), along with the two of the most important plugins — [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) and [Leaflet.draw](https://github.com/Leaflet/Leaflet.draw). As some of you have noticed, this is one of the clues to a really nice upcoming announcement about Leaflet future — stay tuned. :) + +Thanks to everyone! It's absolutely breathtaking to see what the Leaflet community has achieved over the last months with all the contributions, amazing projects and demos, and I'm honestly proud to be a part of it. + +P.S. I also heard in a dream that everyone who tweets about the new Leaflet release will get an incredible luck boost for the next month. Sounds like true to me. + +Cheers,
      +Vladimir, Leaflet creator and maintainer. diff --git a/download.md b/download.md index 833ef96e348..baff1875dd5 100644 --- a/download.md +++ b/download.md @@ -13,12 +13,12 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.4.5 - Stable version, released on October 25, 2012 + Leaflet 0.5 + Stable version, released on January 17, 2013 - Leaflet 0.3.1 - Previous stable version, released on February 14, 2012 + Leaflet 0.4.5 + Previous stable version, released on October 25, 2012 Leaflet master @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From 89ae70b32e8c9b9398c108dd6a02d061c955c0ce Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 17 Jan 2013 16:50:07 +0200 Subject: [PATCH 330/816] add link to 0.5 blog post --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 3afb1a666cc..0b8a9e1845d 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- - +

      January 17, 2013 — Leaflet 0.5 Released — Read More in the Blog

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. From 10305963288fa349e2cd660b8fe26910d040fe4a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 18 Jan 2013 12:29:19 +0200 Subject: [PATCH 331/816] index, features and plugin page updates --- features.html | 17 +++++++++-------- index.md | 2 +- plugins.md | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/features.html b/features.html index f753579fba8..a96e467cdc1 100644 --- a/features.html +++ b/features.html @@ -44,10 +44,10 @@

      On Desktop Browsers

      -

      On Mobile Browsers (iOS, Android)

      +

      On Mobile Browsers

        -
      • Multi-touch zoom (iOS and Android 4+)
      • +
      • Multi-touch zoom (iOS, Android 4+, Win8)
      • Double tap zoom
      @@ -66,11 +66,12 @@

      For Layers

      Visual Features

        -
      • Zoom animation on modern browsers (except IE) (for all layers, including markers and vector layers)
      • +
      • Zoom animation (for all layers, including tile layers, markers and vector layers)
      • Panning animation
      • -
      • Smooth continuous zoom on iOS
      • +
      • Smooth continuous zoom on modern mobile devices
      • Tile and popup fade animation
      • Very nice default design for markers, popups and other map controls
      • +
      • Retina resolution support for tile layers and markers
      @@ -119,26 +120,26 @@

      On Desktop

    62. Firefox
    63. Safari 5+
    64. Opera 11.11+
    65. -
    66. IE 7–9
    67. +
    68. IE 7–10
    69. IE 6 (not perfect but accessible)
    70. On Mobile

        -
      • Safari for iOS 3/4/5+
      • +
      • Safari for iOS 3/4/5/6+
      • Android browser 2.2+, 3.1+, 4+
      • Chrome for Android 4+ and iOS
      • Firefox for Android
      • Other webkit-based browsers (webOS, Blackberry 7+, etc.)
      • -
      • IE for Windows Phone 7
      • +
      • IE10 for Win8-based devices

      Misc

        -
      • Extremely lightweight — around 26 KB of gzipped JS code
      • +
      • Extremely lightweight — around 28 KB of gzipped JS code
      • No external dependencies
      • Keeps your JS environment clean — no global or native prototypes pollution
      diff --git a/index.md b/index.md index 0b8a9e1845d..62545ef0a43 100644 --- a/index.md +++ b/index.md @@ -6,7 +6,7 @@ layout: default Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 27 KB of JS code, +Weighing just about 28 KB of JS code, it has all the [features][] most developers ever need for online maps. Leaflet is designed with _simplicity_, _performance_ and _usability_ in mind. diff --git a/plugins.md b/plugins.md index d071a4cee10..0878718a756 100644 --- a/plugins.md +++ b/plugins.md @@ -413,6 +413,8 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s +To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From 4e9490e71b1c08a77452ed5ea35e56284c71c6b4 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 4 Feb 2013 14:35:21 +0100 Subject: [PATCH 342/816] Add getWest/South/East/North to reference --- reference.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/reference.html b/reference.html index b45742080e3..a567dc32112 100644 --- a/reference.html +++ b/reference.html @@ -3131,6 +3131,26 @@

      Methods

      LatLng Returns the south-east point of the bounds. + + getWest() + Number + Returns the west longitude of the bounds. + + + getSouth() + Number + Returns the south latitude of the bounds. + + + getEast() + Number + Returns the east longitude of the bounds. + + + getNorth() + Number + Returns the north latitude of the bounds. + getCenter() LatLng From ae6c88dd1f616b9aff1f6df9c2434f611c7eb4ff Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 6 Feb 2013 15:12:49 +0200 Subject: [PATCH 343/816] add generated coverage to gitignore in stable --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b86ab6fc607..77024e967c3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp/**/* *.sublime-* _site dist/*.js +spec/coverage From 0dcbed845ea82dd3fe832de92563f95edf37f074 Mon Sep 17 00:00:00 2001 From: danzel Date: Mon, 4 Feb 2013 09:51:27 +1300 Subject: [PATCH 344/816] Make setRadius and updateStyle({radius: 123 }) work. --- src/layer/vector/CircleMarker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/vector/CircleMarker.js b/src/layer/vector/CircleMarker.js index f2a9e23e5c7..e1c8333ccb9 100644 --- a/src/layer/vector/CircleMarker.js +++ b/src/layer/vector/CircleMarker.js @@ -23,7 +23,7 @@ L.CircleMarker = L.Circle.extend({ }, setRadius: function (radius) { - this._radius = radius; + this.options.radius = this._radius = radius; return this.redraw(); } }); From 241cc7dc043c5bc35cce3904212920d60a933003 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 6 Feb 2013 15:21:29 +0200 Subject: [PATCH 345/816] backport the geojson featurecollection arrays fix --- src/layer/GeoJSON.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layer/GeoJSON.js b/src/layer/GeoJSON.js index 0d618a75c94..0a154a7e1b0 100644 --- a/src/layer/GeoJSON.js +++ b/src/layer/GeoJSON.js @@ -15,13 +15,13 @@ L.GeoJSON = L.FeatureGroup.extend({ }, addData: function (geojson) { - var features = L.Util.isArray(geojson) ? geojson : geojson.features, + var features = L.Util.isArray(geojson) ? geojson : geojson.features, i, len; if (features) { for (i = 0, len = features.length; i < len; i++) { // Only add this if geometry or geometries are set and not null - if (features[i].geometries || features[i].geometry) { + if (features[i].geometries || features[i].geometry || features[i].features) { this.addData(features[i]); } } From c1d410f2703f0832618c997225e7360f6a292c58 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 6 Feb 2013 15:25:26 +0200 Subject: [PATCH 346/816] bump version to 0.5.1 and update build --- dist/leaflet-src.js | 6 +++--- dist/leaflet.js | 4 ++-- src/Leaflet.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index 2da1987dfa9..c5b4c6d8465 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -23,7 +23,7 @@ if (typeof exports !== undefined + '') { window.L = L; } -L.version = '0.5'; +L.version = '0.5.1'; /* @@ -5317,7 +5317,7 @@ L.CircleMarker = L.Circle.extend({ }, setRadius: function (radius) { - this._radius = radius; + this.options.radius = this._radius = radius; return this.redraw(); } }); @@ -5441,7 +5441,7 @@ L.GeoJSON = L.FeatureGroup.extend({ if (features) { for (i = 0, len = features.length; i < len; i++) { // Only add this if geometry or geometries are set and not null - if (features[i].geometries || features[i].geometry) { + if (features[i].geometries || features[i].geometry || features[i].features) { this.addData(features[i]); } } diff --git a/dist/leaflet.js b/dist/leaflet.js index fa82c839150..bdf0b69e213 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -2,7 +2,7 @@ Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com (c) 2010-2013, Vladimir Agafonkin, CloudMade */ -(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.5",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(n+"="+t[n]);return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h[t[a]]=h[t[a]]||[],h[t[a]].push({action:e,context:i||this});return this},hasEventListeners:function(t){return s in this&&t in this[s]&&this[s][t].length>0},removeEventListener:function(t,e,i){var o,a,r,h,l,u=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a]))for(h=u[t[a]],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;for(var i=n.extend({type:t,target:this},e),o=this[s][t].slice(),a=0,r=o.length;r>a;a++)o[a].action.call(o[a].context||this,i);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=navigator.userAgent.toLowerCase(),h=-1!==r.indexOf("webkit"),l=-1!==r.indexOf("chrome"),u=-1!==r.indexOf("android"),c=-1!==r.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,p="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,m=e.documentElement,f=o&&"transition"in m.style,g="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,v="MozPerspective"in m.style,y="OTransition"in m.style,L=!t.L_DISABLE_3D&&(f||g||v||y),P=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in m)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,webkit:h,android:u,android23:c,chrome:l,ie3d:f,webkit3d:g,gecko3d:v,opera3d:y,any3d:L,mobile:_,mobileWebkit:_&&h,mobileWebkit3d:_&&g,mobileOpera:_&&t.opera,touch:P,msTouch:d,retina:p}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,i){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):isNaN(t)?t:new n.Point(t,e,i)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||0,s+=r.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!h||(s+=a.scrollWidth-a.clientWidth,h&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):isNaN(t)?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this._northEast.lat,this._southWest.lng)},getSouthEast:function(){return new n.LatLng(this._southWest.lat,this._northEast.lng)},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){var t=this._southWest,e=this._northEast;return[t.lng,t.lat,e.lng,e.lat].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_updateZoomLevels:function(){var t,e=1/0,n=-1/0;for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var o=this._zoomBoundLayers[t];isNaN(o.options.minZoom)||(e=Math.min(e,o.options.minZoom)),isNaN(o.options.maxZoom)||(n=Math.max(n,o.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e)},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var _=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(_),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,_=1e-7,d=c,p=.1;Math.abs(p)>_&&--d>0;)e=h*Math.sin(u),p=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=p;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){n.DomUtil.setOpacity(this._container,this.options.opacity);var t,e=this._tiles;if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l);this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o) +(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.5.1",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(n+"="+t[n]);return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h[t[a]]=h[t[a]]||[],h[t[a]].push({action:e,context:i||this});return this},hasEventListeners:function(t){return s in this&&t in this[s]&&this[s][t].length>0},removeEventListener:function(t,e,i){var o,a,r,h,l,u=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a]))for(h=u[t[a]],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;for(var i=n.extend({type:t,target:this},e),o=this[s][t].slice(),a=0,r=o.length;r>a;a++)o[a].action.call(o[a].context||this,i);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=navigator.userAgent.toLowerCase(),h=-1!==r.indexOf("webkit"),l=-1!==r.indexOf("chrome"),u=-1!==r.indexOf("android"),c=-1!==r.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,p="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,m=e.documentElement,f=o&&"transition"in m.style,g="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,v="MozPerspective"in m.style,y="OTransition"in m.style,L=!t.L_DISABLE_3D&&(f||g||v||y),P=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in m)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,webkit:h,android:u,android23:c,chrome:l,ie3d:f,webkit3d:g,gecko3d:v,opera3d:y,any3d:L,mobile:_,mobileWebkit:_&&h,mobileWebkit3d:_&&g,mobileOpera:_&&t.opera,touch:P,msTouch:d,retina:p}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,i){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):isNaN(t)?t:new n.Point(t,e,i)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||0,s+=r.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!h||(s+=a.scrollWidth-a.clientWidth,h&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):isNaN(t)?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this._northEast.lat,this._southWest.lng)},getSouthEast:function(){return new n.LatLng(this._southWest.lat,this._northEast.lng)},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){var t=this._southWest,e=this._northEast;return[t.lng,t.lat,e.lng,e.lat].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_updateZoomLevels:function(){var t,e=1/0,n=-1/0;for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var o=this._zoomBoundLayers[t];isNaN(o.options.minZoom)||(e=Math.min(e,o.options.minZoom)),isNaN(o.options.maxZoom)||(n=Math.max(n,o.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e)},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var _=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(_),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,_=1e-7,d=c,p=.1;Math.abs(p)>_&&--d>0;)e=h*Math.sin(u),p=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=p;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){n.DomUtil.setOpacity(this._container,this.options.opacity);var t,e=this._tiles;if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l);this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o) },_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return this._adjustTilePoint(t),n.Util.template(this._url,n.extend({s:this._getSubdomain(t),z:this._getZoomForUrl(),x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1)},_getSubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=n.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),n.tileLayer=function(t,e){return new n.TileLayer(t,e)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultWmsParams);i.width=i.height=e.detectRetina&&n.Browser.retina?2*this.options.tileSize:this.options.tileSize;for(var o in e)this.options.hasOwnProperty(o)||(i[o]=e[o]);this.wmsParams=i,n.setOptions(this,e)},onAdd:function(t){var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=t.options.crs.code,n.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){this._adjustTilePoint(t);var i=this._map,o=i.options.crs,s=this.options.tileSize,a=t.multiplyBy(s),r=a.add(new n.Point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(t)});return c+n.Util.getParamString(this.wmsParams,c)+"&bbox="+u},setParams:function(t,e){return n.extend(this.wmsParams,t),e||this.redraw(),this}}),n.tileLayer.wms=function(t,e){return new n.TileLayer.WMS(t,e)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(t){n.setOptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),n.tileLayer.canvas=function(t){return new n.TileLayer.Canvas(t)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latLngBounds(e),n.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&n.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,o=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/o)));i.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);n.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(t,e,i){return new n.ImageOverlay(t,e,i)},n.Icon=n.Class.extend({options:{className:""},initialize:function(t){n.setOptions(this,t)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(t){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(e);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,o=this.options,s=n.point(o[e+"Size"]);i="shadow"===e?n.point(o.shadowAnchor||o.iconAnchor):n.point(o.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+o.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t){var i;return n.Browser.ie6?(i=e.createElement("div"),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i=e.createElement("img"),i.src=t),i},_getIconUrl:function(t){return n.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),n.icon=function(t){return new n.Icon(t)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(12,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];n.Browser.retina&&"icon"===t&&(t+="@2x");var i=n.Icon.Default.imagePath;if(!i)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),n.Icon.Default.imagePath=function(){var t,i,n,o,s=e.getElementsByTagName("script"),a=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=s.length;i>t;t++)if(n=s[t].src,o=n.match(a))return n.split(a)[0]+"/images"}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){n.setOptions(this,e),this._latlng=n.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._removeIcon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=n.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this._map&&this._removeIcon(),this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createIcon(),t.title&&(this._icon.title=t.title),this._initInteraction(),s=1>this.options.opacity,n.DomUtil.addClass(this._icon,o),t.riseOnHover&&n.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this)),this._shadow||(this._shadow=t.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateOpacity();var a=this._map._panes;a.markerPane.appendChild(this._icon),this._shadow&&a.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var t=this._map._panes;this.options.riseOnHover&&n.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),t.markerPane.removeChild(this._icon),this._shadow&&t.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(t){n.DomUtil.setPosition(this._icon,t),this._shadow&&n.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.DomUtil.addClass(t,"leaflet-clickable"),n.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)n.DomEvent.on(t,e[i],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&n.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&n.DomEvent.preventDefault(t),"mousedown"!==t.type&&n.DomEvent.stopPropagation(t)},setOpacity:function(t){this.options.opacity=t,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),n.marker=function(t,e){return new n.Marker(t,e)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var t=e.createElement("div"),i=this.options;return i.html&&(t.innerHTML=i.html),i.bgPos&&(t.style.backgroundPosition=-i.bgPos.x+"px "+-i.bgPos.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}),n.divIcon=function(t){return new n.DivIcon(t)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:"",zoomAnimation:!0},initialize:function(t,e){n.setOptions(this,t),this._source=e,this._animated=n.Browser.any3d&&this.options.zoomAnimation},onAdd:function(t){this._map=t,this._container||this._initLayout(),this._updateContent();var e=t.options.fadeAnimation;e&&n.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on("viewreset",this._updatePosition,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),t.options.closePopupOnClick&&t.on("preclick",this._close,this),this._update(),e&&n.DomUtil.setOpacity(this._container,1)},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),t.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),t.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(t){return this._latlng=n.latLng(t),this._update(),this},setContent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=n.DomUtil.create("a",e+"-close-button",o),t.href="#close",t.innerHTML="×",n.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",o);n.DomEvent.disableClickPropagation(s),this._contentNode=n.DomUtil.create("div",e+"-content",s),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",o),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.DomUtil.addClass(t,a)):n.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);n.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,o=new n.Point(this._containerLeft,-e-this._containerBottom);this._animated&&o._add(n.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(o),a=this.options.autoPanPadding,r=t.getSize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panBy(new n.Point(h,l))}},_onCloseButtonClick:function(t){this._close(),n.DomEvent.stop(t)}}),n.popup=function(t,e){return new n.Popup(t,e)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(t,e){var i=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return i=i.add(n.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popup=new n.Popup(e,this).setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),n.Map.include({openPopup:function(t){return this.closePopup(),this._popup=t,this.addLayer(t).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removeLayer(t),this},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasOwnProperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)this._layers.hasOwnProperty(i)&&t.call(e,this._layers[i])},setZIndex:function(t){return this.invoke("setZIndex",t)}}),n.layerGroup=function(t){return new n.LayerGroup(t)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t.off(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new n.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof n.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer=t.target,t.target=this,this.fire(t.type,t)}}),n.featureGroup=function(t){return new n.FeatureGroup(t)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){n.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return n.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var t=n.Path.CLIP_PADDING,e=this.getSize(),i=n.DomUtil.getPosition(this._mapPane),o=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=o.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new n.Bounds(o,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!(!e.createElementNS||!e.createElementNS(n.Path.SVG_NS,"svg").createSVGRect),n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(n.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),o=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(o);this.fire(t.type,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&n.DomEvent.preventDefault(t),"mousemove"!==t.type&&n.DomEvent.stopPropagation(t)}}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;n.Browser.mobileWebkit&&r.removeChild(a),n.DomUtil.setPosition(a,e),a.setAttribute("width",o),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,o,s].join(" ")),n.Browser.mobileWebkit&&r.appendChild(a)}}}),n.Path.include({bindPopup:function(t,e){return(!this._popup||e)&&(this._popup=new n.Popup(e,this)),this._popup.setContent(t),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=!n.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");n.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/ *, */g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),n.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return n.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&this._map.off("click",this._onClick,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!n.Path._updateRequest&&(n.Path._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){n.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,o,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",{latlng:t.latlng,layerPoint:t.layerPoint,containerPoint:t.containerPoint,originalEvent:t})}}),n.Map.include(n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),o=this._pathRoot;n.DomUtil.setPosition(o,e),o.width=i.x,o.height=i.y,o.getContext("2d").translate(-e.x,-e.y)}}}),n.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.Point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.Point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.Point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.Point(h.x,t.y+r*(h.x-t.x)/a):i},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.Point(a,r)}},n.Polyline=n.Path.extend({initialize:function(t,e){n.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(n.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u]; -var _=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>_&&(o=_,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,_=[1,4,2,8],d=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=_[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)):(h._code&u&&(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1))},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),_=u/(e.inertiaDeceleration*r),d=c.multiplyBy(-_/2).round();n.Util.requestAnimFrame(function(){t.panBy(d,_,r)})}t.fire("dragend"),e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(p.push(t.pointerId),e=p.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=p.indexOf(t.pointerId);if(-1===e)return;p.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",_=this._touchstart,d=this._touchend,p=[];t[c+_+o]=s,t[c+d+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(_,s,!1),m.addEventListener(d,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Handler.PolyEdit=n.Handler.extend({options:{icon:new n.DivIcon({iconSize:new n.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,n.setOptions(this,e)},addHooks:function(){this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){this._poly._map&&(this._poly._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new n.LayerGroup),this._markers=[];var t,e,i,o,s=this._poly._latlngs;for(t=0,i=s.length;i>t;t++)o=this._createMarker(s[t],t),o.on("click",this._onMarkerClick,this),this._markers.push(o);var a,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||n.Polygon&&this._poly instanceof n.Polygon)&&(a=this._markers[e],r=this._markers[t],this._createMiddleMarker(a,r),this._updatePrevNext(a,r))},_createMarker:function(t,e){var i=new n.Marker(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("drag",this._onMarkerDrag,this),i.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(i),i},_fireEdit:function(){this._poly.fire("edit")},_onMarkerDrag:function(t){var e=t.target;n.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw()},_onMarkerClick:function(t){if(!(3>this._poly._latlngs.length)){var e=t.target,i=e._index;this._markerGroup.removeLayer(e),this._markers.splice(i,1),this._poly.spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(e._prev,e._next),e._middleLeft&&this._markerGroup.removeLayer(e._middleLeft),e._middleRight&&this._markerGroup.removeLayer(e._middleRight),e._prev&&e._next?this._createMiddleMarker(e._prev,e._next):e._prev?e._next||(e._prev._middleRight=null):e._next._middleLeft=null,this._poly.fire("edit")}},_updateIndexes:function(t,e){this._markerGroup.eachLayer(function(i){i._index>t&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,n,o,s=this._getMiddleLatLng(t,e),a=this._createMarker(s);a.setOpacity(.6),t._middleRight=e._middleLeft=a,n=function(){var n=e._index;a._index=n,a.off("click",i).on("click",this._onMarkerClick,this),s.lat=a.getLatLng().lat,s.lng=a.getLatLng().lng,this._poly.spliceLatLngs(n,0,s),this._markers.splice(n,0,a),a.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,a),this._updatePrevNext(a,e)},o=function(){a.off("dragstart",n,this),a.off("dragend",o,this),this._createMiddleMarker(t,a),this._createMiddleMarker(a,e)},i=function(){n.call(this),o.call(this),this._poly.fire("edit")},a.on("click",i,this).on("dragstart",n,this).on("dragend",o,this),this._markerGroup.addLayer(a)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.latLngToLayerPoint(t.getLatLng()),o=i.latLngToLayerPoint(e.getLatLng());return i.layerPointToLatLng(n._add(o)._divideBy(2))}}),n.Polyline.addInitHook(function(){n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this +var _=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>_&&(o=_,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,_=[1,4,2,8],d=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=_[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)):(h._code&u&&(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1))},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),_=u/(e.inertiaDeceleration*r),d=c.multiplyBy(-_/2).round();n.Util.requestAnimFrame(function(){t.panBy(d,_,r)})}t.fire("dragend"),e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(p.push(t.pointerId),e=p.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=p.indexOf(t.pointerId);if(-1===e)return;p.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",_=this._touchstart,d=this._touchend,p=[];t[c+_+o]=s,t[c+d+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(_,s,!1),m.addEventListener(d,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Handler.PolyEdit=n.Handler.extend({options:{icon:new n.DivIcon({iconSize:new n.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,n.setOptions(this,e)},addHooks:function(){this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){this._poly._map&&(this._poly._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new n.LayerGroup),this._markers=[];var t,e,i,o,s=this._poly._latlngs;for(t=0,i=s.length;i>t;t++)o=this._createMarker(s[t],t),o.on("click",this._onMarkerClick,this),this._markers.push(o);var a,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||n.Polygon&&this._poly instanceof n.Polygon)&&(a=this._markers[e],r=this._markers[t],this._createMiddleMarker(a,r),this._updatePrevNext(a,r))},_createMarker:function(t,e){var i=new n.Marker(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("drag",this._onMarkerDrag,this),i.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(i),i},_fireEdit:function(){this._poly.fire("edit")},_onMarkerDrag:function(t){var e=t.target;n.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw()},_onMarkerClick:function(t){if(!(3>this._poly._latlngs.length)){var e=t.target,i=e._index;this._markerGroup.removeLayer(e),this._markers.splice(i,1),this._poly.spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(e._prev,e._next),e._middleLeft&&this._markerGroup.removeLayer(e._middleLeft),e._middleRight&&this._markerGroup.removeLayer(e._middleRight),e._prev&&e._next?this._createMiddleMarker(e._prev,e._next):e._prev?e._next||(e._prev._middleRight=null):e._next._middleLeft=null,this._poly.fire("edit")}},_updateIndexes:function(t,e){this._markerGroup.eachLayer(function(i){i._index>t&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,n,o,s=this._getMiddleLatLng(t,e),a=this._createMarker(s);a.setOpacity(.6),t._middleRight=e._middleLeft=a,n=function(){var n=e._index;a._index=n,a.off("click",i).on("click",this._onMarkerClick,this),s.lat=a.getLatLng().lat,s.lng=a.getLatLng().lng,this._poly.spliceLatLngs(n,0,s),this._markers.splice(n,0,a),a.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,a),this._updatePrevNext(a,e)},o=function(){a.off("dragstart",n,this),a.off("dragend",o,this),this._createMiddleMarker(t,a),this._createMiddleMarker(a,e)},i=function(){n.call(this),o.call(this),this._poly.fire("edit")},a.on("click",i,this).on("dragstart",n,this).on("dragend",o,this),this._markerGroup.addLayer(a)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.latLngToLayerPoint(t.getLatLng()),o=i.latLngToLayerPoint(e.getLatLng());return i.layerPointToLatLng(n._add(o)._divideBy(2))}}),n.Polyline.addInitHook(function(){n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this },addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return n.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),n.control=function(t){return new n.Control(t)},n.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.DomUtil.create("div",a,o)}var e=this._controlCorners={},i="leaflet-",o=this._controlContainer=n.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i="leaflet-bar",o=i+"-part",s=n.DomUtil.create("div",e+" "+i);return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in "+o+" "+o+"-top",s,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out "+o+" "+o+"-bottom",s,this._zoomOut,this),t.on("zoomend",this._updateDisabled,this),s},onRemove:function(t){t.off("zoomend",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,o,s,a){var r=n.DomUtil.create("a",i,o);r.innerHTML=t,r.href="#",r.title=e;var h=n.DomEvent.stopPropagation;return n.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-control-zoom-disabled";n.DomUtil.removeClass(this._zoomInButton,e),n.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&n.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&n.DomUtil.addClass(this._zoomInButton,e)}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(t){return new n.Control.Zoom(t)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(t){n.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeAttribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasOwnProperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" — ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(t){return new n.Control.Attribution(t)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=n.DomUtil.create("div",e),o=this.options;return this._addScales(o,e,i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=n.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=n.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.Control.Scale(t)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){n.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var o in t)t.hasOwnProperty(o)&&this._addLayer(t[o],o);for(o in e)e.hasOwnProperty(o)&&this._addLayer(e[o],o,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=n.DomUtil.create("div",t);n.Browser.touch?n.DomEvent.on(e,"click",n.DomEvent.stopPropagation):(n.DomEvent.disableClickPropagation(e),n.DomEvent.on(e,"mousewheel",n.DomEvent.stopPropagation));var i=this._form=n.DomUtil.create("form",t+"-list");if(this.options.collapsed){n.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layersLink=n.DomUtil.create("a",t+"-toggle",e);o.href="#",o.title="Layers",n.Browser.touch?n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",this._expand,this):n.DomEvent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",t+"-base",i),this._separator=n.DomUtil.create("div",t+"-separator",i),this._overlaysList=n.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasOwnProperty(i)){var n=this._layers[i];this._addItem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onLayerChange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingClick&&this._update()},_createRadioElement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?(this._map.addLayer(i.layer),i.overlay||(n=i.layer)):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);n&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingClick=!1},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.Control.Layers(t,e,i)},n.PosAnimation=n.Class.extend({includes:n.Mixin.Events,run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this.fire("start"),t.style[n.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.DomEvent.on(t,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),n.DomUtil.setPosition(t,e),n.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inProgress&&(n.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),n.Util.falseFn(this._el.offsetWidth))},_transformRe:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getPos:function(){var e,i,o,s=this._el,a=t.getComputedStyle(s);return n.Browser.any3d?(o=a[n.DomUtil.TRANSFORM].match(this._transformRe),e=parseFloat(o[1]),i=parseFloat(o[2])):(e=parseFloat(a.left),i=parseFloat(a.top)),new n.Point(e,i,!0)},_onTransitionEnd:function(){n.DomEvent.off(this._el,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[n.DomUtil.TRANSITION]="",clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),n.Map.include({setView:function(t,e,i){e=this._limitZoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._panAnim&&this._panAnim.stop();var o=n?this._zoomToIfClose&&this._zoomToIfClose(t,e):this._panByIfClose(t);if(o)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e,i){if(t=n.point(t),!t.x&&!t.y)return this;this._panAnim||(this._panAnim=new n.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var o=n.DomUtil.getPosition(this._mapPane).subtract(t)._round();return this._panAnim.run(this._mapPane,o,e||.25,i),this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(t){var e=this._getCenterOffset(t)._floor();return this._offsetIsWithinView(e)?(this.panBy(e),!0):!1},_offsetIsWithinView:function(t,e){var i=e||1,n=this.getSize();return Math.abs(t.x)<=n.x*i&&Math.abs(t.y)<=n.y*i}}),n.PosAnimation=n.DomUtil.TRANSITION?n.PosAnimation:n.PosAnimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=n.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=n.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));n.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){n.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(t,e){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);if(!this._offsetIsWithinView(o,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getCenterLayerPoint().add(o);return this._prepareTileBg(),this._runAnimation(t,e,i,s),!0},_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(t,e,i,o,s){this._animateToCenter=t,this._animateToZoom=e,this._animatingZoom=!0,n.Draggable&&(n.Draggable._disabled=!0);var a=n.DomUtil.TRANSFORM,r=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(r.offsetWidth);var h=n.DomUtil.getScaleString(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_prepareTileBg:function(){var t=this._tilePane,e=this._tileBg;if(e&&this._getLoadedTilesPercentage(e)>.5&&.5>this._getLoadedTilesPercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stopLoadingImages(t),i;e||(e=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),e.style.zIndex=1),e.style[n.DomUtil.TRANSFORM]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilePane=this._panes.tilePane=e;var o=this._tileBg=t;n.DomUtil.addClass(o,"leaflet-zoom-animated"),this._stopLoadingImages(o)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,o,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.Util.falseFn,o.onerror=n.Util.falseFn,o.src=n.Util.emptyImageUrl,o.parentNode.removeChild(o))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),n.Util.falseFn(this._tileBg.offsetWidth),this._animatingZoom=!1,this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.Draggable&&(n.Draggable._disabled=!1)},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){this._animatingZoom||this.touchZoom._zooming||(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locationOptions=n.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n.bind(this._handleGeolocationResponse,this),i=n.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.LatLng(o,s),r=new n.LatLng(o-e,s-i),h=new n.LatLng(o+e,s+i),l=new n.LatLngBounds(r,h),u=this._locationOptions;if(u.setView){var c=Math.min(this.getBoundsZoom(l),u.maxZoom);this.setView(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document); \ No newline at end of file diff --git a/src/Leaflet.js b/src/Leaflet.js index 02889ee21df..eee635de765 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -19,4 +19,4 @@ if (typeof exports !== undefined + '') { window.L = L; } -L.version = '0.5'; +L.version = '0.5.1'; From d80551d1dc686552304bb9cb290a2f4ce083f939 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 6 Feb 2013 16:03:22 +0200 Subject: [PATCH 347/816] update links to 0.5.1 --- download.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/download.md b/download.md index baff1875dd5..9fe078d6a59 100644 --- a/download.md +++ b/download.md @@ -13,12 +13,12 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.5 - Stable version, released on January 17, 2013 + Leaflet 0.5.1 + Stable version, released on January 17, 2013 and last updated on February 6, 2013 Leaflet 0.4.5 - Previous stable version, released on October 25, 2012 + Previous stable version, released on July 30, 2012 and last updated on October 25, 2012 Leaflet master @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From 30ab98e3ae7c5cab9428a375e94a71f9267cf816 Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Fri, 15 Feb 2013 01:27:28 +0100 Subject: [PATCH 348/816] Document the zoomlevelschange event --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index bc92f0be3fe..45441be91db 100644 --- a/reference.html +++ b/reference.html @@ -509,6 +509,11 @@

      Events

      Event Fired when the map zoom changes. + + zoomlevelschange + Event + Fired when the number of zoomlevels on the map is changed due to adding or removing a layer. + autopanstart Event From 2f6b6d79bab778a19d819ada27d3617aa46af0ce Mon Sep 17 00:00:00 2001 From: Mattias Bengtsson Date: Fri, 15 Feb 2013 01:34:29 +0100 Subject: [PATCH 349/816] Add some missing (but not strictly mandatory) 's --- reference.html | 146 ++++++++++++++++++++++++------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/reference.html b/reference.html index 45441be91db..41af9619681 100644 --- a/reference.html +++ b/reference.html @@ -406,152 +406,152 @@

      Events

      click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the map. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the map. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the map. mouseup - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the map. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the map. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the map. mousemove - MouseEvent + MouseEvent Fired while the mouse moves over the map. contextmenu - MouseEvent + MouseEvent Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event. focus - Event + Event Fired when the user focuses the map either by tabbing to it or clicking/panning. blur - Event + Event Fired when the map looses focus. preclick - MouseEvent + MouseEvent Fired before mouse click on the map (sometimes useful when you want something to happen on click before any existing click handlers start running). load - Event + Event Fired when the map is initialized (when its center and zoom are set for the first time). viewreset - Event + Event Fired when the map needs to redraw its content (this usually happens on map zoom or load). Very useful for creating custom overlays. movestart - Event + Event Fired when the view of the map starts changing (e.g. user starts dragging the map). move - Event + Event Fired on any movement of the map view. moveend - Event + Event Fired when the view of the map ends changed (e.g. user stopped dragging the map). dragstart - Event + Event Fired when the user starts dragging the map. drag - Event + Event Fired repeatedly while the user drags the map. dragend - Event + Event Fired when the user stops dragging the map. zoomstart - Event + Event Fired when the map zoom is about to change (e.g. before zoom animation). zoomend - Event + Event Fired when the map zoom changes. zoomlevelschange - Event + Event Fired when the number of zoomlevels on the map is changed due to adding or removing a layer. autopanstart - Event + Event Fired when the map starts autopanning when opening a popup. layeradd - LayerEvent + LayerEvent Fired when a new layer is added to the map. layerremove - LayerEvent + LayerEvent Fired when some layer is removed from the map. baselayerchange - LayerEvent + LayerEvent Fired when the base layer is changed through the layer control. locationfound - LocationEvent + LocationEvent Fired when geolocation (using locate method) went successfully. locationerror - ErrorEvent + ErrorEvent Fired when geolocation (using locate method) failed. popupopen - PopupEvent + PopupEvent Fired when a popup is opened (using openPopup method). popupclose - PopupEvent + PopupEvent Fired when a popup is closed (using closePopup method). @@ -1141,52 +1141,52 @@

      Events

      click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the marker. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the marker. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the marker. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the marker. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the marker. dragstart - Event + Event Fired when the user starts dragging the marker. drag - Event + Event Fired repeatedly while the user drags the marker. dragend - Event + Event Fired when the user stops dragging the marker. move - Event + Event Fired when the marker is moved via setLatLng. New coordinate include in event arguments. remove - Event + Event Fired when the marker is removed from the map. @@ -1604,22 +1604,22 @@

      Events

      loading - Event + Event Fired when the tile layer starts loading tiles. load - Event + Event Fired when the tile layer loaded all visible tiles. tileload - Event + Event Fired when a tile loads. tileunload - Event + Event Fired when a tile is removed (e.g. when you have unloadInvisibleTiles on). @@ -2004,37 +2004,37 @@

      Events

      click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the object. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the object. mousedown - MouseEvent + MouseEvent Fired when the user pushes the mouse button on the object. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the object. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the object. contextmenu - MouseEvent + MouseEvent Fired when the user pushes the right mouse button on the object, prevents default browser context menu from showing if there are listeners on this event. remove - Event + Event Fired when the path is removed from the map. @@ -2697,32 +2697,32 @@

      Events

      click - MouseEvent + MouseEvent Fired when the user clicks (or taps) the group. dblclick - MouseEvent + MouseEvent Fired when the user double-clicks (or double-taps) the group. mouseover - MouseEvent + MouseEvent Fired when the mouse enters the group. mouseout - MouseEvent + MouseEvent Fired when the mouse leaves the group. mousemove - MouseEvent + MouseEvent Fired while the mouse moves over the layers of the group. contextmenu - MouseEvent + MouseEvent Fired when the user right-clicks on one of the layers. @@ -3327,12 +3327,12 @@

      Properties

      min - Point + Point The top left corner of the rectangle. max - Point + Point The bottom right corner of the rectangle. @@ -3454,12 +3454,12 @@

      Options

      iconSize - Point + Point Size of the icon image in pixels. iconAnchor - Point + Point 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. @@ -3474,17 +3474,17 @@

      Options

      shadowSize - Point + Point Size of the shadow image in pixels. shadowAnchor - Point + Point The coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor if not specified). popupAnchor - Point + Point The coordinates of the point from which popups will "open", relative to the icon anchor. @@ -3538,12 +3538,12 @@

      Options

      iconSize - Point + Point Size of the icon in pixels. Can be also set through CSS. iconAnchor - Point + Point 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. @@ -5092,17 +5092,17 @@

      Events

      start - Event + Event Fired when the animation starts. step - Event + Event Fired continuously during the animation. end - Event + Event Fired when the animation ends. @@ -5181,22 +5181,22 @@

      Events

      dragstart - Event + Event Fired when the dragging starts. predrag - Event + Event Fired continuously during dragging before each corresponding update of the element position. drag - Event + Event Fired continuously during dragging. dragend - Event + Event Fired when the dragging ends. From 331b8bbab40ae51456fc2005d753eee80bf1c5bb Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Fri, 15 Feb 2013 16:24:49 +1300 Subject: [PATCH 350/816] Adding initial draw for Leaflet.draw blog post. --- _posts/2013-02-00-guest-post-draw.md | 123 +++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 _posts/2013-02-00-guest-post-draw.md diff --git a/_posts/2013-02-00-guest-post-draw.md b/_posts/2013-02-00-guest-post-draw.md new file mode 100644 index 00000000000..599f38218b6 --- /dev/null +++ b/_posts/2013-02-00-guest-post-draw.md @@ -0,0 +1,123 @@ +--- +layout: post +title: Leaflet.draw 0.2 released +description: Leaflet.draw 0.2 released — brings vector drawing and editing tools to your Leaflet map. +author: Jacob Toye +authorsite: https://github.com/jacobtoye/ +--- + +Leaflet.draw was born from the need to provide users with the ability draw polygons on the map. Leaflet already provided a very nice way of editing existing polylines and polygons. The logical next step was to expand on this functionality to allow the creation of these layers, and ultimately the other vector layers. + +Upon release the immediate response from the Leaflet community was very positive. It became clear that progressing this tool to a state where users could edit and delete, as well as create. This is ultimately what Leaflet.draw 0.2 set out to do. + +After a few months of off and on development, with most of this spare time kindy sponsored by my employer Smartrak, we proudly present Leaflet.draw 0.2 your one stop plugin for drawing, editing and deleting vectors and markers on Leaflet maps :) + +
      + +### Features + +Leaflet.draw is designed to not only be easy for end users to use, but also for developers to integrate. + + * Easily draw shapes on your map with easy to use tools all specifically designed for the particular shape. + * Super ccustomizable: + * Customize the styles of each shape to fit in with your maps theme. + * Pick and choose the which tools you want to use. + * Roll your own by simply using the drawing and editing handlers. + * Event based system allows you to perform any necessary actions when shapes are created, edited or deleted. + +### How to use + +Leaflet.draw is very simple to drop into you Leaflet application. The following example will add both the draw and edit toolbars to a map: + +// create a map in the "map" div, set the view to a given place and zoom +var map = L.map('map').setView([51.505, -0.09], 13); + +// add an OpenStreetMap tile layer +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' +}).addTo(map); + +// Initialize the FeatureGroup to store editable layers +var drawnItems = new L.FeatureGroup(); +map.addLayer(drawnItems); + +// Initialize the draw control and pass it the FeatureGroup of editable layers +var drawControl = new L.Control.Draw({ + edit: { + featureGroup: drawnItems + } +}); +map.addControl(drawControl); + +#### Handling newly created layers + +Once you have successfully added the Leaflet.draw plugin your map you will want to respond to the different actions users can trigger. + +map.on('draw:created', function (e) { + var type = e.layerType, + layer = e.layer; + + if (type === 'marker') { + // Do marker specific actions + } + + // Do whatever else you need to. (save to db, add to map etc) + drawnItems.addLayer(layer); +}); + +map.on('draw:edited', function () { + // Update db to save latest changes. +}); + +map.on('draw:deleted', function () { + // Update db to save latest changes. +}); + +See the Leaflet.draw README for more details on how to configure the plugin. + +### Thanks + +First and foremost I would like to thank my employer Smartrak, without their positive attitude to open source software I would not have had the time to complete this plugin. + +The Leaflet developer community have been great in support this plugin through inspiration, pull requests and issue reports. Special thanks to: @mourner, @danzel, @brunob, @tnightingale, and @shramov. + +I really look forward to the future of Leaflet. It already is the best JavaScript mapping library around, and with such a great developer community support it's bound to be an amazing journey! + + + + + + \ No newline at end of file From f664da6ebcd9acb2f7c166092fcc32ccd529ae00 Mon Sep 17 00:00:00 2001 From: Jeremy Iglehart Date: Fri, 15 Feb 2013 15:44:10 -0500 Subject: [PATCH 351/816] Fixed typo reference.html contructor = constructor "If specify your own **contructor** for the control" "If specify your own ***constructor*** for the control" --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index a567dc32112..cf2c7eff4c6 100644 --- a/reference.html +++ b/reference.html @@ -5494,7 +5494,7 @@

      Custom Control Example

      map.addControl(new MyControl());
      -

      If specify your own contructor for the control, you'll also probably want to process options properly:

      +

      If specify your own constructor for the control, you'll also probably want to process options properly:

      var MyControl = L.Control.extend({
       	initialize: function (foo, options) {
      
      From 074224656d60914ed35eff1c016933e1ab33ef18 Mon Sep 17 00:00:00 2001
      From: jacobtoye 
      Date: Mon, 18 Feb 2013 15:34:03 +1300
      Subject: [PATCH 352/816] Rename Leaflet.draw guest post and update content.
      
      ---
       _posts/2013-02-00-guest-post-draw.md | 123 -------------------------
       _posts/2013-02-15-guest-post-draw.md | 131 +++++++++++++++++++++++++++
       2 files changed, 131 insertions(+), 123 deletions(-)
       delete mode 100644 _posts/2013-02-00-guest-post-draw.md
       create mode 100644 _posts/2013-02-15-guest-post-draw.md
      
      diff --git a/_posts/2013-02-00-guest-post-draw.md b/_posts/2013-02-00-guest-post-draw.md
      deleted file mode 100644
      index 599f38218b6..00000000000
      --- a/_posts/2013-02-00-guest-post-draw.md
      +++ /dev/null
      @@ -1,123 +0,0 @@
      ----
      -layout: post
      -title: Leaflet.draw 0.2 released
      -description: Leaflet.draw 0.2 released — brings vector drawing and editing tools to your Leaflet map.
      -author: Jacob Toye
      -authorsite: https://github.com/jacobtoye/
      ----
      -
      -Leaflet.draw was born from the need to provide users with the ability draw polygons on the map. Leaflet already provided a very nice way of editing existing polylines and polygons. The logical next step was to expand on this functionality to allow the creation of these layers, and ultimately the other vector layers.
      -
      -Upon release the immediate response from the Leaflet community was very positive. It became clear that progressing this tool to a state where users could edit and delete, as well as create. This is ultimately what Leaflet.draw 0.2 set out to do.
      -
      -After a few months of off and on development, with most of this spare time kindy sponsored by my employer Smartrak, we proudly present Leaflet.draw 0.2 your one stop plugin for drawing, editing and deleting vectors and markers on Leaflet maps :)
      -
      -
      - -### Features - -Leaflet.draw is designed to not only be easy for end users to use, but also for developers to integrate. - - * Easily draw shapes on your map with easy to use tools all specifically designed for the particular shape. - * Super ccustomizable: - * Customize the styles of each shape to fit in with your maps theme. - * Pick and choose the which tools you want to use. - * Roll your own by simply using the drawing and editing handlers. - * Event based system allows you to perform any necessary actions when shapes are created, edited or deleted. - -### How to use - -Leaflet.draw is very simple to drop into you Leaflet application. The following example will add both the draw and edit toolbars to a map: - -// create a map in the "map" div, set the view to a given place and zoom -var map = L.map('map').setView([51.505, -0.09], 13); - -// add an OpenStreetMap tile layer -L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' -}).addTo(map); - -// Initialize the FeatureGroup to store editable layers -var drawnItems = new L.FeatureGroup(); -map.addLayer(drawnItems); - -// Initialize the draw control and pass it the FeatureGroup of editable layers -var drawControl = new L.Control.Draw({ - edit: { - featureGroup: drawnItems - } -}); -map.addControl(drawControl); - -#### Handling newly created layers - -Once you have successfully added the Leaflet.draw plugin your map you will want to respond to the different actions users can trigger. - -map.on('draw:created', function (e) { - var type = e.layerType, - layer = e.layer; - - if (type === 'marker') { - // Do marker specific actions - } - - // Do whatever else you need to. (save to db, add to map etc) - drawnItems.addLayer(layer); -}); - -map.on('draw:edited', function () { - // Update db to save latest changes. -}); - -map.on('draw:deleted', function () { - // Update db to save latest changes. -}); - -See the Leaflet.draw README for more details on how to configure the plugin. - -### Thanks - -First and foremost I would like to thank my employer Smartrak, without their positive attitude to open source software I would not have had the time to complete this plugin. - -The Leaflet developer community have been great in support this plugin through inspiration, pull requests and issue reports. Special thanks to: @mourner, @danzel, @brunob, @tnightingale, and @shramov. - -I really look forward to the future of Leaflet. It already is the best JavaScript mapping library around, and with such a great developer community support it's bound to be an amazing journey! - - - - - - \ No newline at end of file diff --git a/_posts/2013-02-15-guest-post-draw.md b/_posts/2013-02-15-guest-post-draw.md new file mode 100644 index 00000000000..7828103a137 --- /dev/null +++ b/_posts/2013-02-15-guest-post-draw.md @@ -0,0 +1,131 @@ +--- +layout: post +title: Leaflet.draw 0.2 released +description: Leaflet.draw 0.2 released — brings vector drawing and editing tools to your Leaflet map. +author: Jacob Toye +authorsite: https://github.com/jacobtoye/ +--- + +Leaflet.draw was born from the need to provide users with the ability draw polygons on the map. Leaflet already provided a very nice way of editing existing polylines and polygons. The logical next step was to expand on this functionality to allow the creation of these layers, and ultimately the other vector layers. + +Upon release the immediate response from the Leaflet community was very positive. It became clear that progressing this tool to a state where users could edit and delete, as well as create. This is ultimately what Leaflet.draw 0.2 set out to do. + +After a few months of off and on development, with most of this spare time kindy sponsored by my employer Smartrak, we proudly present Leaflet.draw 0.2 your one stop plugin for drawing, editing and deleting vectors and markers on Leaflet maps :) + +You can download the latest version from the github repo. Any bugs you come across please report them on the issues page. + +
      + +{:#plugin-features} +### Features + +Leaflet.draw is designed to not only be easy for end users to use, but also for developers to integrate. + + * Draw shapes on your map with easy to use drawing tools. + * Edit and delete vectors and markers. + * Super ccustomizable: + * Customize the styles of each shape to fit in with your maps theme. + * Pick and choose the which tools you want to use. + * Roll your own by simply using the drawing and editing handlers. + * Event based system allows you to perform any necessary actions when shapes are created, edited or deleted. + +### How to use + +Leaflet.draw is very simple to drop into you Leaflet application. The following example will add both the draw and edit toolbars to a map: + + // create a map in the "map" div, set the view to a given place and zoom + var map = L.map('map').setView([175.30867, -37.77914], 13); + + // add an OpenStreetMap tile layer + L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' + }).addTo(map); + + // Initialize the FeatureGroup to store editable layers + var drawnItems = new L.FeatureGroup(); + map.addLayer(drawnItems); + + // Initialize the draw control and pass it the FeatureGroup of editable layers + var drawControl = new L.Control.Draw({ + edit: { + featureGroup: drawnItems + } + }); + map.addControl(drawControl); + +#### Handling newly created layers + +Once you have successfully added the Leaflet.draw plugin your map you will want to respond to the different actions users can trigger. + + map.on('draw:created', function (e) { + var type = e.layerType, + layer = e.layer; + + if (type === 'marker') { + // Do marker specific actions + } + + // Do whatever else you need to. (save to db, add to map etc) + drawnItems.addLayer(layer); + }); + + map.on('draw:edited', function () { + // Update db to save latest changes. + }); + + map.on('draw:deleted', function () { + // Update db to save latest changes. + }); + +See the Leaflet.draw README for more details on how to configure the plugin. + +### Thanks + +First and foremost I would like to thank my employer Smartrak, without their positive attitude to open source software I would not have had the time to complete this plugin. + +The Leaflet developer community have been great in support this plugin through inspiration, pull requests and issue reports. Special thanks to: @mourner, @danzel, @brunob, @tnightingale, and @shramov. + +### Closing + +I've had a great time implementing this plugin. I hope you enjoy using it. If you have a question or just want to say hi, send me an email at jacob.toye@gmail.com. + +Cheers, +Jacob Toye + + + + + + \ No newline at end of file From c436dbb54e02f3973c87556c970bf94a189e176a Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Mon, 18 Feb 2013 15:34:47 +1300 Subject: [PATCH 353/816] Add in Leaflet.draw file for testing. [TEMP] --- dist/images/spritesheet.png | Bin 0 -> 2777 bytes dist/leaflet.draw.css | 217 ++++++++++++++++++++++++++++++++++++ dist/leaflet.draw.ie.css | 44 ++++++++ 3 files changed, 261 insertions(+) create mode 100644 dist/images/spritesheet.png create mode 100644 dist/leaflet.draw.css create mode 100644 dist/leaflet.draw.ie.css diff --git a/dist/images/spritesheet.png b/dist/images/spritesheet.png new file mode 100644 index 0000000000000000000000000000000000000000..168c31e6b39b4975c121edb2d2e0975bafa7d4ac GIT binary patch literal 2777 zcmbVOdpJ~iAD^NNk|KqQX~-hXoG}K&l*yUd8H~#yV#$~}7>pS+2SZP_pn*mlN3p@#jLw~(6 z2%Cr-Ok#nwuUyEAj0uHdAqk6(jg2*rwJ;ZmLa>01jm?4%Jl+hEFcZf`!fc6Iq*#AZ z0|<#ZBAyWD2_n%88reaDXqb#aEdAmFU&v&BQyeM&8Ym=WSP5H*1=FBLvj`Ikfg99KmjM34@JTZkc>gz zm~(kt5(OX~E5I#O01L#S z0wLPL!xHVyi{uJo#S6*#;wuP=crg%{CKB+`pQB6S{S7+>|G&Kcg5~}{5yK+JU>8c` zze;6s3#q?_>9@j17T;P2ibVQFgfzys?q(MhYJ~~|q6ua))3n!OX6RmBh>t;?*&OO$=L8H+O zmM2aP1P+=7;!e_6E!RkG48#Chs|?i>8^NH3E!s$9t6#(W`YooW&bnEdnP&kBn%KrU zbLV+HWB%uv*j;SUk;&Xw*f9zpP7Sc@Ka=>>wzdX)U$tE8p_FYqqflOR zexX>_e{Egfc6wf!$J>kS}6BwR=c(}DMF)`8q{qI|Un>JpliIbOB9b{ut zR_P42I%Y>y`d%n?cXyXx;dL5hH5;g^sxs>8>R7I>YHLk2ZofNXs1Bbw*#Gi!a9if| zYBe<{1qFq|td&0mu91nhe3$(r5Ej0rVr^<`@EgmX9Yyu^J2b%ShV~V;YkZ$2EK@18 zjeXTLUOa8)dxie7eCc2C!w04bU`I!XVB3Qi6r+yS{!5a3nYZ`7f6X=}z5&r|dXi_s zlJ;~=_DJ-|#j2--si`Sri{MtRXg#Tc%G&bFm$ObAdld$>fKgFVkIdE|A?$q@@nY`7 zn>>Gif5yEWU0q$5Q@<*)^d;5RGMOwI0Dwx5^9`{=n@!RgV&r2j=5B>0R}_dDkFW5u z{E}G5IDOe;GEeo!23b!^LvK}hJvr{rp$)WS^zGUd?k`41+cH)ZlZ~@gP^4Qs+RBMG*Zo-!ht;n?vs0 zxl=XyYMZGk?BP}&_3SYG>T&hi?CfeRDiV`C1I`-Ul?bc+7gy1-337dpbroH#R!VXUZ+8=bxL6mY0whcbrnEkN`qZ+s*!2VkgV_&^72<7e{mhDKvXa8W!jkgx2}9^RQC-e9Z^vtb zf%Wl@rFHqHarq>DvWoiJn3uiL%R9yn=2zohSFlo0v+>>)3Jt4YVxrHj`0xYyzWu|K zNnHYyKcDXzKXoMZp{@z|M}GHFXe26Zt^yqEuZb0GHd#_#zxB_C?#$kb3%*rj z5di`HGqel2(%e$3gSF`sp2I@xwAcPWxsNUDy0O6v47u@ZQ&E}_(;+Y!+5OH=Mcr7d zwY~k*%Io<(v*`G$L&`GgX4@F$*$Me^AxHZsX>x`xIo|P-$A^iSy`^P)x|qe15fAB; zHwqo&%h+`-&yzhXyB<97emPKI&)VW{&{tfUIlQ*IYa$ekE3Ml_wU!wb1=R1~r&2ek zeT;s4tn2)NonaLRR%RxU13E7K53yBL+5!so|XF_n|Gqd zJvPrjX-vEYCxqOLcaPiT-4uT^NU`bJ^3;zF)=BdI?`L>=p}I-50;sQ(n;*q5enF*Q z)6dJx!x!l2=&;faWoby)5Wtf2je+;hj;7WM2^DR@HMWBO+JV)ZtY4c$IEDLyZkx#j zdyI@diZaq<#sq|ikLT{M-=XAQtyXkA{8pM~TTcdd>a?^tkv6BXrM6QvHF&Gd($Z4O ze{{93K6<>{SH89Egk%-q<>h6&apT4TCB>yv90>VfmX8e%4!XYn)o;kxDx&A!qrN`= zK|RLyGp=&!%;dm{AP#5Ne9!NjielU14+wiBlAewH_~Gqn=j^M#nhnYH>Dj-g$H_+6 zy}~n?U~JOGK30l-?xDa9B2#r`3viTT$~^Jz;fmFVX7|xXIy03r!CLKS+BsR~ zG6T7ysiQz6&vyk-v6~>v|8CG|t#M(2c>hO1hL*=_>>p>`=bD3qoTFdsy#utIk#i^Y lW*| Date: Mon, 18 Feb 2013 15:43:04 +1300 Subject: [PATCH 354/816] Update Leaflet to master for testing [TEMP] --- dist/leaflet-src.js | 582 +++++++++++++++++++------------------------- dist/leaflet.css | 84 +++---- dist/leaflet.ie.css | 6 - dist/leaflet.js | 8 +- 4 files changed, 288 insertions(+), 392 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index c5b4c6d8465..c707e942053 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -23,7 +23,7 @@ if (typeof exports !== undefined + '') { window.L = L; } -L.version = '0.5.1'; +L.version = '0.6-dev'; /* @@ -109,7 +109,7 @@ L.Util = { var params = []; for (var i in obj) { if (obj.hasOwnProperty(i)) { - params.push(i + '=' + obj[i]); + params.push(encodeURIComponent(i) + '=' + encodeURIComponent(obj[i])); } } return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); @@ -253,6 +253,7 @@ L.Class.extend = function (props) { proto._initHooks = []; var parent = this; + NewClass.__super__ = parent.prototype; // add method for calling all hooks proto.callInitHooks = function () { @@ -307,10 +308,12 @@ L.Mixin = {}; L.Mixin.Events = { addEventListener: function (types, fn, context) { // (String, Function[, Object]) or (Object[, Object]) + var events = this[key] = this[key] || {}, - type, i, len; + type, i, len, evt, + contextId, objKey, objLenKey, eventsObj; - // Types can be a map of types/handlers + // types can be a map of types/handlers if (typeof types === 'object') { for (type in types) { if (types.hasOwnProperty(type)) { @@ -321,26 +324,50 @@ L.Mixin.Events = { return this; } + // types can be a string of space-separated words types = L.Util.splitWords(types); for (i = 0, len = types.length; i < len; i++) { - events[types[i]] = events[types[i]] || []; - events[types[i]].push({ + evt = { action: fn, context: context || this - }); + }; + contextId = context && context._leaflet_id; + + if (contextId) { + // store listeners of a particular context in a separate hash (if it has an id) + // gives a major performance boost when removing thousands of map layers + + objKey = types[i] + '_idx', + objLenKey = objKey + '_len', + eventsObj = events[objKey] = events[objKey] || {}; + + if (eventsObj[contextId]) { + eventsObj[contextId].push(evt); + } else { + eventsObj[contextId] = [evt]; + events[objLenKey] = (events[objLenKey] || 0) + 1; + } + + } else { + events[types[i]] = events[types[i]] || []; + events[types[i]].push(evt); + } } return this; }, hasEventListeners: function (type) { // (String) -> Boolean - return (key in this) && (type in this[key]) && (this[key][type].length > 0); + return (key in this) && + (((type in this[key]) && this[key][type].length > 0) || + (this[key][type + '_idx_len'] > 0)); }, removeEventListener: function (types, fn, context) { // (String[, Function, Object]) or (Object[, Object]) var events = this[key], - type, i, len, listeners, j; + type, i, len, listeners, j, + contextId, objKey, objLenKey; if (typeof types === 'object') { for (type in types) { @@ -348,25 +375,35 @@ L.Mixin.Events = { this.removeEventListener(type, types[type], fn); } } - return this; } types = L.Util.splitWords(types); for (i = 0, len = types.length; i < len; i++) { - if (this.hasEventListeners(types[i])) { - listeners = events[types[i]]; + + // if the context has an id, use it to find the listeners + contextId = context && context._leaflet_id; + objKey = types[i] + '_idx'; + + if (contextId && events[objKey]) { + listeners = events[objKey][contextId] || []; + } else { + listeners = events[types[i]] || []; + } for (j = listeners.length - 1; j >= 0; j--) { - if ( - (!fn || listeners[j].action === fn) && - (!context || (listeners[j].context === context)) - ) { + if ((!fn || listeners[j].action === fn) && (!context || (listeners[j].context === context))) { listeners.splice(j, 1); } } + + if (contextId && listeners.length === 0) { + objLenKey = objKey + '_len'; + delete events[objKey][contextId]; + events[objLenKey] = (events[objLenKey] || 1) - 1; + } } } @@ -378,15 +415,36 @@ L.Mixin.Events = { return this; } - var event = L.extend({ + var event = L.Util.extend({ type: type, target: this }, data); - var listeners = this[key][type].slice(); + var listeners, i, len, eventsObj, contextId; + + if (this[key][type]) { + listeners = this[key][type].slice(); + + for (i = 0, len = listeners.length; i < len; i++) { + listeners[i].action.call(listeners[i].context || this, event); + } + } + + // fire event for the context-indexed listeners as well + + eventsObj = this[key][type + '_idx']; - for (var i = 0, len = listeners.length; i < len; i++) { - listeners[i].action.call(listeners[i].context || this, event); + if (eventsObj) { + for (contextId in eventsObj) { + if (eventsObj.hasOwnProperty(contextId)) { + listeners = eventsObj[contextId]; + if (listeners) { + for (i = 0, len = listeners.length; i < len; i++) { + listeners[i].action.call(listeners[i].context || this, event); + } + } + } + } } return this; @@ -407,6 +465,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; var ie = !!window.ActiveXObject, ie6 = ie && !window.XMLHttpRequest, ie7 = ie && !document.querySelector, + ielt9 = ie && !document.addEventListener, // terrible browser detection to work around Safari / iOS / Android browser bugs ua = navigator.userAgent.toLowerCase(), @@ -463,6 +522,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; ie: ie, ie6: ie6, ie7: ie7, + ielt9: ielt9, webkit: webkit, android: android, @@ -595,7 +655,7 @@ L.point = function (x, y, round) { if (L.Util.isArray(x)) { return new L.Point(x[0], x[1]); } - if (isNaN(x)) { + if (x === undefined || x === null) { return x; } return new L.Point(x, y, round); @@ -763,6 +823,7 @@ L.DomUtil = { left = 0, el = element, docBody = document.body, + docEl = document.documentElement, pos, ie7 = L.Browser.ie7; @@ -779,8 +840,8 @@ L.DomUtil = { if (el.offsetParent === docBody && pos === 'absolute') { break; } if (pos === 'fixed') { - top += docBody.scrollTop || 0; - left += docBody.scrollLeft || 0; + top += docBody.scrollTop || docEl.scrollTop || 0; + left += docBody.scrollLeft || docEl.scrollLeft || 0; break; } el = el.offsetParent; @@ -1050,7 +1111,7 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe if (L.Util.isArray(a)) { return new L.LatLng(a[0], a[1]); } - if (isNaN(a)) { + if (a === undefined || a === null) { return a; } return new L.LatLng(a, b); @@ -1126,11 +1187,27 @@ L.LatLngBounds.prototype = { }, getNorthWest: function () { - return new L.LatLng(this._northEast.lat, this._southWest.lng); + return new L.LatLng(this.getNorth(), this.getWest()); }, getSouthEast: function () { - return new L.LatLng(this._southWest.lat, this._northEast.lng); + return new L.LatLng(this.getSouth(), this.getEast()); + }, + + getWest: function () { + return this._southWest.lng; + }, + + getSouth: function () { + return this._southWest.lat; + }, + + getEast: function () { + return this._northEast.lng; + }, + + getNorth: function () { + return this._northEast.lat; }, contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean @@ -1170,10 +1247,7 @@ L.LatLngBounds.prototype = { }, toBBoxString: function () { - var sw = this._southWest, - ne = this._northEast; - - return [sw.lng, sw.lat, ne.lng, ne.lat].join(','); + return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(','); }, equals: function (bounds) { // (LatLngBounds) @@ -1523,6 +1597,8 @@ L.Map = L.Class.extend({ }, hasLayer: function (layer) { + if (!layer) { return false; } + var id = L.stamp(layer); return this._layers.hasOwnProperty(id); }, @@ -1540,15 +1616,17 @@ L.Map = L.Class.extend({ var offset = oldSize._subtract(this.getSize())._divideBy(2)._round(); - if (animate === true) { - this.panBy(offset); - } else { - this._rawPanBy(offset); + if ((offset.x !== 0) || (offset.y !== 0)) { + if (animate === true) { + this.panBy(offset); + } else { + this._rawPanBy(offset); - this.fire('move'); + this.fire('move'); - clearTimeout(this._sizeTimer); - this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); + clearTimeout(this._sizeTimer); + this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); + } } return this; }, @@ -1859,10 +1937,15 @@ L.Map = L.Class.extend({ L.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset)); }, + _getZoomSpan: function () { + return this.getMaxZoom() - this.getMinZoom(); + }, + _updateZoomLevels: function () { var i, minZoom = Infinity, - maxZoom = -Infinity; + maxZoom = -Infinity, + oldZoomSpan = this._getZoomSpan(); for (i in this._zoomBoundLayers) { if (this._zoomBoundLayers.hasOwnProperty(i)) { @@ -1882,6 +1965,10 @@ L.Map = L.Class.extend({ this._layersMaxZoom = maxZoom; this._layersMinZoom = minZoom; } + + if (oldZoomSpan !== this._getZoomSpan()) { + this.fire("zoomlevelschange"); + } }, // map events @@ -2270,12 +2357,20 @@ L.TileLayer = L.Class.extend({ }, _updateOpacity: function () { - L.DomUtil.setOpacity(this._container, this.options.opacity); - - // stupid webkit hack to force redrawing of tiles var i, tiles = this._tiles; + if (L.Browser.ielt9) { + for (i in tiles) { + if (tiles.hasOwnProperty(i)) { + L.DomUtil.setOpacity(tiles[i], this.options.opacity); + } + } + } else { + L.DomUtil.setOpacity(this._container, this.options.opacity); + } + + // stupid webkit hack to force redrawing of tiles if (L.Browser.webkit) { for (i in tiles) { if (tiles.hasOwnProperty(i)) { @@ -2500,11 +2595,9 @@ L.TileLayer = L.Class.extend({ // image-specific code (override to implement e.g. Canvas or SVG tile layer) getTileUrl: function (tilePoint) { - this._adjustTilePoint(tilePoint); - return L.Util.template(this._url, L.extend({ s: this._getSubdomain(tilePoint), - z: this._getZoomForUrl(), + z: tilePoint.z, x: tilePoint.x, y: tilePoint.y }, this.options)); @@ -2527,6 +2620,8 @@ L.TileLayer = L.Class.extend({ if (this.options.tms) { tilePoint.y = limit - tilePoint.y - 1; } + + tilePoint.z = this._getZoomForUrl(); }, _getSubdomain: function (tilePoint) { @@ -2555,6 +2650,10 @@ L.TileLayer = L.Class.extend({ _createTile: function () { var tile = this._tileImg.cloneNode(false); tile.onselectstart = tile.onmousemove = L.Util.falseFn; + + if (L.Browser.ielt9 && this.options.opacity !== undefined) { + L.DomUtil.setOpacity(tile, this.options.opacity); + } return tile; }, @@ -2563,15 +2662,16 @@ L.TileLayer = L.Class.extend({ tile.onload = this._tileOnLoad; tile.onerror = this._tileOnError; + this._adjustTilePoint(tilePoint); tile.src = this.getTileUrl(tilePoint); }, - _tileLoaded: function () { - this._tilesToLoad--; - if (!this._tilesToLoad) { - this.fire('load'); - } - }, + _tileLoaded: function () { + this._tilesToLoad--; + if (!this._tilesToLoad) { + this.fire('load'); + } + }, _tileOnLoad: function () { var layer = this._layer; @@ -2602,8 +2702,8 @@ L.TileLayer = L.Class.extend({ this.src = newUrl; } - layer._tileLoaded(); - } + layer._tileLoaded(); + } }); L.tileLayer = function (url, options) { @@ -2661,8 +2761,6 @@ L.TileLayer.WMS = L.TileLayer.extend({ getTileUrl: function (tilePoint, zoom) { // (Point, Number) -> String - this._adjustTilePoint(tilePoint); - var map = this._map, crs = map.options.crs, tileSize = this.options.tileSize, @@ -2719,6 +2817,7 @@ L.TileLayer.Canvas = L.TileLayer.extend({ this._redrawTile(tiles[i]); } } + return this; }, _redrawTile: function (tile) { @@ -3038,14 +3137,15 @@ L.Icon.Default.imagePath = (function () { var scripts = document.getElementsByTagName('script'), leafletRe = /\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/; - var i, len, src, matches; + var i, len, src, matches, path; for (i = 0, len = scripts.length; i < len; i++) { src = scripts[i].src; matches = src.match(leafletRe); if (matches) { - return src.split(leafletRe)[0] + '/images'; + path = src.split(leafletRe)[0]; + return (path ? path + '/' : '') + 'images'; } } }()); @@ -3644,7 +3744,7 @@ L.popup = function (options, source) { L.Marker.include({ openPopup: function () { - if (this._popup && this._map) { + if (this._popup && this._map && !this._map.hasLayer(this._popup)) { this._popup.setLatLng(this._latlng); this._map.openPopup(this._popup); } @@ -3677,9 +3777,21 @@ L.Marker.include({ .on('move', this._movePopup, this); } - this._popup = new L.Popup(options, this) - .setContent(content); + if (content instanceof L.Popup) { + L.setOptions(content, options); + this._popup = content; + } else { + this._popup = new L.Popup(options, this) + .setContent(content); + } + + return this; + }, + setPopupContent: function (content) { + if (this._popup) { + this._popup.setContent(content); + } return this; }, @@ -3766,6 +3878,13 @@ L.LayerGroup = L.Class.extend({ return this; }, + hasLayer: function (layer) { + if (!layer) { return false; } + + var id = L.stamp(layer); + return this._layers.hasOwnProperty(id); + }, + clearLayers: function () { this.eachLayer(this.removeLayer, this); return this; @@ -3891,7 +4010,9 @@ L.FeatureGroup = L.LayerGroup.extend({ }, _propagateEvent: function (e) { - e.layer = e.target; + if (!e.layer) { + e.layer = e.target; + } e.target = this; this.fire(e.type, e); @@ -4083,6 +4204,12 @@ L.Path = L.Path.extend({ if (this.options.fill) { this._path.setAttribute('fill-rule', 'evenodd'); } + if (this.options.pointerEvents) { + this._path.setAttribute('pointer-events', this.options.pointerEvents); + } + if (!this.options.clickable && !this.options.pointerEvents) { + this._path.setAttribute('pointer-events', 'none'); + } this._updateStyle(); }, @@ -4243,12 +4370,15 @@ L.Path.include({ bindPopup: function (content, options) { - if (!this._popup || options) { - this._popup = new L.Popup(options, this); + if (content instanceof L.Popup) { + this._popup = content; + } else { + if (!this._popup || options) { + this._popup = new L.Popup(options, this); + } + this._popup.setContent(content); } - this._popup.setContent(content); - if (!this._popupHandlersAdded) { this .on('click', this._openPopup, this) @@ -4818,7 +4948,7 @@ L.LineUtil = { /* - * L.Polygon is used to display polylines on a map. + * L.Polyline is used to display polylines on a map. */ L.Polyline = L.Path.extend({ @@ -5063,6 +5193,13 @@ L.Polygon = L.Polyline.extend({ this._latlngs = this._convertLatLngs(latlngs[0]); this._holes = latlngs.slice(1); } + + // filter out last point if its equal to the first one + latlngs = this._latlngs; + + if (latlngs[0].equals(latlngs[latlngs.length - 1])) { + latlngs.pop(); + } }, projectLatlngs: function () { @@ -5615,6 +5752,13 @@ L.DomEvent = { obj.addEventListener(newType, handler, false); + } else if (type === 'click' && L.Browser.android) { + originalHandler = handler; + handler = function (e) { + return L.DomEvent._filterClick(e, originalHandler); + }; + + obj.addEventListener(type, handler, false); } else { obj.addEventListener(type, handler, false); } @@ -5753,6 +5897,23 @@ L.DomEvent = { } } return e; + }, + + // this solves a bug in Android WebView where a single touch triggers two click events. + _filterClick: function (e, handler) { + var elapsed = L.DomEvent._lastClick && (e.timeStamp - L.DomEvent._lastClick); + + // are they closer together than 400ms yet more than 100ms? + // Android typically triggers them ~300ms apart while multiple listeners + // on the same event should be triggered far faster. + + if (elapsed && elapsed > 100 && elapsed < 400) { + L.DomEvent.stop(e); + return; + } + L.DomEvent._lastClick = e.timeStamp; + + return handler(e); } }; @@ -6098,6 +6259,8 @@ L.Map.Drag = L.Handler.extend({ noInertia = !options.inertia || delay > options.inertiaThreshold || !this._positions[0]; + map.fire('dragend'); + if (noInertia) { map.fire('moveend'); @@ -6117,12 +6280,10 @@ L.Map.Drag = L.Handler.extend({ offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); L.Util.requestAnimFrame(function () { - map.panBy(offset, decelerationDuration, ease); + map.panBy(offset, decelerationDuration, ease, true); }); } - map.fire('dragend'); - if (options.maxBounds) { // TODO predrag validation instead of animation L.Util.requestAnimFrame(this._panInsideMaxBounds, map, true, map._container); @@ -6909,257 +7070,6 @@ L.Handler.MarkerDrag = L.Handler.extend({ }); -/* - * L.Handler.PolyEdit is an editing handler for polylines and polygons. - */ - -L.Handler.PolyEdit = L.Handler.extend({ - options: { - icon: new L.DivIcon({ - iconSize: new L.Point(8, 8), - className: 'leaflet-div-icon leaflet-editing-icon' - }) - }, - - initialize: function (poly, options) { - this._poly = poly; - L.setOptions(this, options); - }, - - addHooks: function () { - if (this._poly._map) { - if (!this._markerGroup) { - this._initMarkers(); - } - this._poly._map.addLayer(this._markerGroup); - } - }, - - removeHooks: function () { - if (this._poly._map) { - this._poly._map.removeLayer(this._markerGroup); - delete this._markerGroup; - delete this._markers; - } - }, - - updateMarkers: function () { - this._markerGroup.clearLayers(); - this._initMarkers(); - }, - - _initMarkers: function () { - if (!this._markerGroup) { - this._markerGroup = new L.LayerGroup(); - } - this._markers = []; - - var latlngs = this._poly._latlngs, - i, j, len, marker; - - // TODO refactor holes implementation in Polygon to support it here - - for (i = 0, len = latlngs.length; i < len; i++) { - - marker = this._createMarker(latlngs[i], i); - marker.on('click', this._onMarkerClick, this); - this._markers.push(marker); - } - - var markerLeft, markerRight; - - for (i = 0, j = len - 1; i < len; j = i++) { - if (i === 0 && !(L.Polygon && (this._poly instanceof L.Polygon))) { - continue; - } - - markerLeft = this._markers[j]; - markerRight = this._markers[i]; - - this._createMiddleMarker(markerLeft, markerRight); - this._updatePrevNext(markerLeft, markerRight); - } - }, - - _createMarker: function (latlng, index) { - var marker = new L.Marker(latlng, { - draggable: true, - icon: this.options.icon - }); - - marker._origLatLng = latlng; - marker._index = index; - - marker.on('drag', this._onMarkerDrag, this); - marker.on('dragend', this._fireEdit, this); - - this._markerGroup.addLayer(marker); - - return marker; - }, - - _fireEdit: function () { - this._poly.fire('edit'); - }, - - _onMarkerDrag: function (e) { - var marker = e.target; - - L.extend(marker._origLatLng, marker._latlng); - - if (marker._middleLeft) { - marker._middleLeft.setLatLng(this._getMiddleLatLng(marker._prev, marker)); - } - if (marker._middleRight) { - marker._middleRight.setLatLng(this._getMiddleLatLng(marker, marker._next)); - } - - this._poly.redraw(); - }, - - _onMarkerClick: function (e) { - // we want to remove the marker on click, but if latlng count < 3, polyline would be invalid - if (this._poly._latlngs.length < 3) { return; } - - var marker = e.target, - i = marker._index; - - // remove the marker - this._markerGroup.removeLayer(marker); - this._markers.splice(i, 1); - this._poly.spliceLatLngs(i, 1); - this._updateIndexes(i, -1); - - // update prev/next links of adjacent markers - this._updatePrevNext(marker._prev, marker._next); - - // remove ghost markers near the removed marker - if (marker._middleLeft) { - this._markerGroup.removeLayer(marker._middleLeft); - } - if (marker._middleRight) { - this._markerGroup.removeLayer(marker._middleRight); - } - - // create a ghost marker in place of the removed one - if (marker._prev && marker._next) { - this._createMiddleMarker(marker._prev, marker._next); - - } else if (!marker._prev) { - marker._next._middleLeft = null; - - } else if (!marker._next) { - marker._prev._middleRight = null; - } - - this._poly.fire('edit'); - }, - - _updateIndexes: function (index, delta) { - this._markerGroup.eachLayer(function (marker) { - if (marker._index > index) { - marker._index += delta; - } - }); - }, - - _createMiddleMarker: function (marker1, marker2) { - var latlng = this._getMiddleLatLng(marker1, marker2), - marker = this._createMarker(latlng), - onClick, - onDragStart, - onDragEnd; - - marker.setOpacity(0.6); - - marker1._middleRight = marker2._middleLeft = marker; - - onDragStart = function () { - var i = marker2._index; - - marker._index = i; - - marker - .off('click', onClick) - .on('click', this._onMarkerClick, this); - - latlng.lat = marker.getLatLng().lat; - latlng.lng = marker.getLatLng().lng; - this._poly.spliceLatLngs(i, 0, latlng); - this._markers.splice(i, 0, marker); - - marker.setOpacity(1); - - this._updateIndexes(i, 1); - marker2._index++; - this._updatePrevNext(marker1, marker); - this._updatePrevNext(marker, marker2); - }; - - onDragEnd = function () { - marker.off('dragstart', onDragStart, this); - marker.off('dragend', onDragEnd, this); - - this._createMiddleMarker(marker1, marker); - this._createMiddleMarker(marker, marker2); - }; - - onClick = function () { - onDragStart.call(this); - onDragEnd.call(this); - this._poly.fire('edit'); - }; - - marker - .on('click', onClick, this) - .on('dragstart', onDragStart, this) - .on('dragend', onDragEnd, this); - - this._markerGroup.addLayer(marker); - }, - - _updatePrevNext: function (marker1, marker2) { - if (marker1) { - marker1._next = marker2; - } - if (marker2) { - marker2._prev = marker1; - } - }, - - _getMiddleLatLng: function (marker1, marker2) { - var map = this._poly._map, - p1 = map.latLngToLayerPoint(marker1.getLatLng()), - p2 = map.latLngToLayerPoint(marker2.getLatLng()); - - return map.layerPointToLatLng(p1._add(p2)._divideBy(2)); - } -}); - -L.Polyline.addInitHook(function () { - - if (L.Handler.PolyEdit) { - this.editing = new L.Handler.PolyEdit(this); - - if (this.options.editable) { - this.editing.enable(); - } - } - - this.on('add', function () { - if (this.editing && this.editing.enabled()) { - this.editing.addHooks(); - } - }); - - this.on('remove', function () { - if (this.editing && this.editing.enabled()) { - this.editing.removeHooks(); - } - }); -}); - - /* * L.Control is a base class for implementing map controls. Handles positioning. * All other controls extend from this class. @@ -7278,31 +7188,22 @@ L.Control.Zoom = L.Control.extend({ onAdd: function (map) { var zoomName = 'leaflet-control-zoom', - barName = 'leaflet-bar', - partName = barName + '-part', - container = L.DomUtil.create('div', zoomName + ' ' + barName); + container = L.DomUtil.create('div', zoomName + ' leaflet-bar'); this._map = map; - this._zoomInButton = this._createButton('+', 'Zoom in', - zoomName + '-in ' + - partName + ' ' + - partName + '-top', - container, this._zoomIn, this); + this._zoomInButton = this._createButton( + '+', 'Zoom in', zoomName + '-in', container, this._zoomIn, this); + this._zoomOutButton = this._createButton( + '-', 'Zoom out', zoomName + '-out', container, this._zoomOut, this); - this._zoomOutButton = this._createButton('-', 'Zoom out', - zoomName + '-out ' + - partName + ' ' + - partName + '-bottom', - container, this._zoomOut, this); - - map.on('zoomend', this._updateDisabled, this); + map.on('zoomend baselayerchange', this._updateDisabled, this); return container; }, onRemove: function (map) { - map.off('zoomend', this._updateDisabled, this); + map.off('zoomend baselayerchange', this._updateDisabled, this); }, _zoomIn: function (e) { @@ -7333,7 +7234,7 @@ L.Control.Zoom = L.Control.extend({ _updateDisabled: function () { var map = this._map, - className = 'leaflet-control-zoom-disabled'; + className = 'leaflet-disabled'; L.DomUtil.removeClass(this._zoomInButton, className); L.DomUtil.removeClass(this._zoomOutButton, className); @@ -7812,9 +7713,12 @@ L.Control.Layers = L.Control.extend({ this._map.addLayer(obj.layer); if (!obj.overlay) { baseLayer = obj.layer; + } else { + this._map.fire('overlayadd', {layer: obj}); } } else if (!input.checked && this._map.hasLayer(obj.layer)) { this._map.removeLayer(obj.layer); + this._map.fire('overlayremove', {layer: obj}); } } @@ -7951,7 +7855,7 @@ L.Map.include({ return this; }, - panBy: function (offset, duration, easeLinearity) { + panBy: function (offset, duration, easeLinearity, moving) { offset = L.point(offset); if (!(offset.x || offset.y)) { @@ -7967,7 +7871,9 @@ L.Map.include({ }, this); } - this.fire('movestart'); + if (moving !== true) { + this.fire('movestart'); + } L.DomUtil.addClass(this._mapPane, 'leaflet-pan-anim'); diff --git a/dist/leaflet.css b/dist/leaflet.css index ea3da39071f..2410992d83c 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -191,37 +191,58 @@ /* general toolbar styles */ .leaflet-bar { - box-shadow: 0 0 8px rgba(0,0,0,0.4); - border: 1px solid #888; - -webkit-border-radius: 5px; - border-radius: 5px; + box-shadow: 0 1px 7px rgba(0,0,0,0.65); + -webkit-border-radius: 4px; + border-radius: 4px; } -.leaflet-bar-part { - background-color: rgba(255, 255, 255, 0.8); - border-bottom: 1px solid #aaa; +.leaflet-bar a { + 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-part-top { +.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 { -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } -.leaflet-bar-part-bottom { +.leaflet-bar a:last-child { -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom: none; } +.leaflet-bar a.leaflet-disabled { + cursor: default; + background-color: #f4f4f4; + color: #bbb; + } .leaflet-touch .leaflet-bar { -webkit-border-radius: 10px; border-radius: 10px; } -.leaflet-touch .leaflet-bar-part { - border-bottom: 4px solid rgba(0,0,0,0.3); +.leaflet-touch .leaflet-bar a { + width: 30px; + height: 30px; } -.leaflet-touch .leaflet-bar-part-top { +.leaflet-touch .leaflet-bar a:first-child { -webkit-border-radius: 7px 7px 0 0; border-radius: 7px 7px 0 0; } -.leaflet-touch .leaflet-bar-part-bottom { +.leaflet-touch .leaflet-bar a:last-child { -webkit-border-radius: 0 0 7px 7px; border-radius: 0 0 7px 7px; border-bottom: none; @@ -234,48 +255,23 @@ margin-left: 13px; margin-top: 12px; } -.leaflet-control-zoom a { - width: 22px; - height: 22px; - text-align: center; - text-decoration: none; - color: black; - } -.leaflet-control-zoom a, -.leaflet-control-layers-toggle { - background-position: 50% 50%; - background-repeat: no-repeat; - display: block; - } -.leaflet-control-zoom a:hover { - background-color: #fff; - color: #777; - } .leaflet-control-zoom-in { - font: bold 18px/24px Arial, Helvetica, sans-serif; + font: bold 18px 'Lucida Console', Monaco, monospace; } .leaflet-control-zoom-out { - font: bold 23px/20px Tahoma, Verdana, sans-serif; - } -.leaflet-control-zoom a.leaflet-control-zoom-disabled { - cursor: default; - background-color: rgba(255, 255, 255, 0.8); - color: #bbb; + font: bold 22px 'Lucida Console', Monaco, monospace; } -.leaflet-touch .leaflet-control-zoom a { - width: 30px; - height: 30px; - } .leaflet-touch .leaflet-control-zoom-in { - font-size: 24px; - line-height: 29px; + font-size: 22px; + line-height: 30px; } .leaflet-touch .leaflet-control-zoom-out { font-size: 28px; - line-height: 24px; + line-height: 30px; } + /* layers control */ .leaflet-control-layers { diff --git a/dist/leaflet.ie.css b/dist/leaflet.ie.css index b59c8144e6c..14b84b691e9 100644 --- a/dist/leaflet.ie.css +++ b/dist/leaflet.ie.css @@ -35,12 +35,6 @@ .leaflet-control-layers { border: 3px solid #999; } -.leaflet-control-zoom a { - background-color: #eee; - } -.leaflet-control-zoom a:hover { - background-color: #fff; - } .leaflet-control-layers-toggle { } .leaflet-control-attribution, diff --git a/dist/leaflet.js b/dist/leaflet.js index bdf0b69e213..82693aab7c0 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -2,7 +2,7 @@ Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com (c) 2010-2013, Vladimir Agafonkin, CloudMade */ -(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.5.1",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(n+"="+t[n]);return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h[t[a]]=h[t[a]]||[],h[t[a]].push({action:e,context:i||this});return this},hasEventListeners:function(t){return s in this&&t in this[s]&&this[s][t].length>0},removeEventListener:function(t,e,i){var o,a,r,h,l,u=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a]))for(h=u[t[a]],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;for(var i=n.extend({type:t,target:this},e),o=this[s][t].slice(),a=0,r=o.length;r>a;a++)o[a].action.call(o[a].context||this,i);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=navigator.userAgent.toLowerCase(),h=-1!==r.indexOf("webkit"),l=-1!==r.indexOf("chrome"),u=-1!==r.indexOf("android"),c=-1!==r.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,p="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,m=e.documentElement,f=o&&"transition"in m.style,g="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,v="MozPerspective"in m.style,y="OTransition"in m.style,L=!t.L_DISABLE_3D&&(f||g||v||y),P=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in m)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,webkit:h,android:u,android23:c,chrome:l,ie3d:f,webkit3d:g,gecko3d:v,opera3d:y,any3d:L,mobile:_,mobileWebkit:_&&h,mobileWebkit3d:_&&g,mobileOpera:_&&t.opera,touch:P,msTouch:d,retina:p}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,i){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):isNaN(t)?t:new n.Point(t,e,i)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||0,s+=r.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!h||(s+=a.scrollWidth-a.clientWidth,h&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):isNaN(t)?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this._northEast.lat,this._southWest.lng)},getSouthEast:function(){return new n.LatLng(this._southWest.lat,this._northEast.lng)},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){var t=this._southWest,e=this._northEast;return[t.lng,t.lat,e.lng,e.lat].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_updateZoomLevels:function(){var t,e=1/0,n=-1/0;for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var o=this._zoomBoundLayers[t];isNaN(o.options.minZoom)||(e=Math.min(e,o.options.minZoom)),isNaN(o.options.maxZoom)||(n=Math.max(n,o.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e)},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var _=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(_),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,_=1e-7,d=c,p=.1;Math.abs(p)>_&&--d>0;)e=h*Math.sin(u),p=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=p;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){n.DomUtil.setOpacity(this._container,this.options.opacity);var t,e=this._tiles;if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l);this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o) -},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return this._adjustTilePoint(t),n.Util.template(this._url,n.extend({s:this._getSubdomain(t),z:this._getZoomForUrl(),x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1)},_getSubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=n.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),n.tileLayer=function(t,e){return new n.TileLayer(t,e)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultWmsParams);i.width=i.height=e.detectRetina&&n.Browser.retina?2*this.options.tileSize:this.options.tileSize;for(var o in e)this.options.hasOwnProperty(o)||(i[o]=e[o]);this.wmsParams=i,n.setOptions(this,e)},onAdd:function(t){var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=t.options.crs.code,n.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){this._adjustTilePoint(t);var i=this._map,o=i.options.crs,s=this.options.tileSize,a=t.multiplyBy(s),r=a.add(new n.Point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(t)});return c+n.Util.getParamString(this.wmsParams,c)+"&bbox="+u},setParams:function(t,e){return n.extend(this.wmsParams,t),e||this.redraw(),this}}),n.tileLayer.wms=function(t,e){return new n.TileLayer.WMS(t,e)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(t){n.setOptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),n.tileLayer.canvas=function(t){return new n.TileLayer.Canvas(t)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latLngBounds(e),n.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&n.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,o=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/o)));i.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);n.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(t,e,i){return new n.ImageOverlay(t,e,i)},n.Icon=n.Class.extend({options:{className:""},initialize:function(t){n.setOptions(this,t)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(t){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(e);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,o=this.options,s=n.point(o[e+"Size"]);i="shadow"===e?n.point(o.shadowAnchor||o.iconAnchor):n.point(o.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+o.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t){var i;return n.Browser.ie6?(i=e.createElement("div"),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i=e.createElement("img"),i.src=t),i},_getIconUrl:function(t){return n.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),n.icon=function(t){return new n.Icon(t)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(12,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];n.Browser.retina&&"icon"===t&&(t+="@2x");var i=n.Icon.Default.imagePath;if(!i)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),n.Icon.Default.imagePath=function(){var t,i,n,o,s=e.getElementsByTagName("script"),a=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=s.length;i>t;t++)if(n=s[t].src,o=n.match(a))return n.split(a)[0]+"/images"}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){n.setOptions(this,e),this._latlng=n.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._removeIcon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=n.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this._map&&this._removeIcon(),this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createIcon(),t.title&&(this._icon.title=t.title),this._initInteraction(),s=1>this.options.opacity,n.DomUtil.addClass(this._icon,o),t.riseOnHover&&n.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this)),this._shadow||(this._shadow=t.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateOpacity();var a=this._map._panes;a.markerPane.appendChild(this._icon),this._shadow&&a.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var t=this._map._panes;this.options.riseOnHover&&n.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),t.markerPane.removeChild(this._icon),this._shadow&&t.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(t){n.DomUtil.setPosition(this._icon,t),this._shadow&&n.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.DomUtil.addClass(t,"leaflet-clickable"),n.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)n.DomEvent.on(t,e[i],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&n.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&n.DomEvent.preventDefault(t),"mousedown"!==t.type&&n.DomEvent.stopPropagation(t)},setOpacity:function(t){this.options.opacity=t,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),n.marker=function(t,e){return new n.Marker(t,e)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var t=e.createElement("div"),i=this.options;return i.html&&(t.innerHTML=i.html),i.bgPos&&(t.style.backgroundPosition=-i.bgPos.x+"px "+-i.bgPos.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}),n.divIcon=function(t){return new n.DivIcon(t)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:"",zoomAnimation:!0},initialize:function(t,e){n.setOptions(this,t),this._source=e,this._animated=n.Browser.any3d&&this.options.zoomAnimation},onAdd:function(t){this._map=t,this._container||this._initLayout(),this._updateContent();var e=t.options.fadeAnimation;e&&n.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on("viewreset",this._updatePosition,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),t.options.closePopupOnClick&&t.on("preclick",this._close,this),this._update(),e&&n.DomUtil.setOpacity(this._container,1)},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),t.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),t.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(t){return this._latlng=n.latLng(t),this._update(),this},setContent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=n.DomUtil.create("a",e+"-close-button",o),t.href="#close",t.innerHTML="×",n.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",o);n.DomEvent.disableClickPropagation(s),this._contentNode=n.DomUtil.create("div",e+"-content",s),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",o),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.DomUtil.addClass(t,a)):n.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);n.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,o=new n.Point(this._containerLeft,-e-this._containerBottom);this._animated&&o._add(n.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(o),a=this.options.autoPanPadding,r=t.getSize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panBy(new n.Point(h,l))}},_onCloseButtonClick:function(t){this._close(),n.DomEvent.stop(t)}}),n.popup=function(t,e){return new n.Popup(t,e)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(t,e){var i=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return i=i.add(n.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popup=new n.Popup(e,this).setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),n.Map.include({openPopup:function(t){return this.closePopup(),this._popup=t,this.addLayer(t).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removeLayer(t),this},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasOwnProperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)this._layers.hasOwnProperty(i)&&t.call(e,this._layers[i])},setZIndex:function(t){return this.invoke("setZIndex",t)}}),n.layerGroup=function(t){return new n.LayerGroup(t)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t.off(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new n.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof n.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer=t.target,t.target=this,this.fire(t.type,t)}}),n.featureGroup=function(t){return new n.FeatureGroup(t)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){n.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return n.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var t=n.Path.CLIP_PADDING,e=this.getSize(),i=n.DomUtil.getPosition(this._mapPane),o=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=o.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new n.Bounds(o,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!(!e.createElementNS||!e.createElementNS(n.Path.SVG_NS,"svg").createSVGRect),n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(n.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),o=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(o);this.fire(t.type,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&n.DomEvent.preventDefault(t),"mousemove"!==t.type&&n.DomEvent.stopPropagation(t)}}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;n.Browser.mobileWebkit&&r.removeChild(a),n.DomUtil.setPosition(a,e),a.setAttribute("width",o),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,o,s].join(" ")),n.Browser.mobileWebkit&&r.appendChild(a)}}}),n.Path.include({bindPopup:function(t,e){return(!this._popup||e)&&(this._popup=new n.Popup(e,this)),this._popup.setContent(t),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=!n.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");n.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/ *, */g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),n.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return n.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&this._map.off("click",this._onClick,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!n.Path._updateRequest&&(n.Path._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){n.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,o,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",{latlng:t.latlng,layerPoint:t.layerPoint,containerPoint:t.containerPoint,originalEvent:t})}}),n.Map.include(n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),o=this._pathRoot;n.DomUtil.setPosition(o,e),o.width=i.x,o.height=i.y,o.getContext("2d").translate(-e.x,-e.y)}}}),n.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.Point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.Point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.Point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.Point(h.x,t.y+r*(h.x-t.x)/a):i},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.Point(a,r)}},n.Polyline=n.Path.extend({initialize:function(t,e){n.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(n.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u]; -var _=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>_&&(o=_,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,_=[1,4,2,8],d=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=_[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)):(h._code&u&&(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1))},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),_=u/(e.inertiaDeceleration*r),d=c.multiplyBy(-_/2).round();n.Util.requestAnimFrame(function(){t.panBy(d,_,r)})}t.fire("dragend"),e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(p.push(t.pointerId),e=p.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=p.indexOf(t.pointerId);if(-1===e)return;p.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",_=this._touchstart,d=this._touchend,p=[];t[c+_+o]=s,t[c+d+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(_,s,!1),m.addEventListener(d,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Handler.PolyEdit=n.Handler.extend({options:{icon:new n.DivIcon({iconSize:new n.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,n.setOptions(this,e)},addHooks:function(){this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){this._poly._map&&(this._poly._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new n.LayerGroup),this._markers=[];var t,e,i,o,s=this._poly._latlngs;for(t=0,i=s.length;i>t;t++)o=this._createMarker(s[t],t),o.on("click",this._onMarkerClick,this),this._markers.push(o);var a,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||n.Polygon&&this._poly instanceof n.Polygon)&&(a=this._markers[e],r=this._markers[t],this._createMiddleMarker(a,r),this._updatePrevNext(a,r))},_createMarker:function(t,e){var i=new n.Marker(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("drag",this._onMarkerDrag,this),i.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(i),i},_fireEdit:function(){this._poly.fire("edit")},_onMarkerDrag:function(t){var e=t.target;n.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw()},_onMarkerClick:function(t){if(!(3>this._poly._latlngs.length)){var e=t.target,i=e._index;this._markerGroup.removeLayer(e),this._markers.splice(i,1),this._poly.spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(e._prev,e._next),e._middleLeft&&this._markerGroup.removeLayer(e._middleLeft),e._middleRight&&this._markerGroup.removeLayer(e._middleRight),e._prev&&e._next?this._createMiddleMarker(e._prev,e._next):e._prev?e._next||(e._prev._middleRight=null):e._next._middleLeft=null,this._poly.fire("edit")}},_updateIndexes:function(t,e){this._markerGroup.eachLayer(function(i){i._index>t&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,n,o,s=this._getMiddleLatLng(t,e),a=this._createMarker(s);a.setOpacity(.6),t._middleRight=e._middleLeft=a,n=function(){var n=e._index;a._index=n,a.off("click",i).on("click",this._onMarkerClick,this),s.lat=a.getLatLng().lat,s.lng=a.getLatLng().lng,this._poly.spliceLatLngs(n,0,s),this._markers.splice(n,0,a),a.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,a),this._updatePrevNext(a,e)},o=function(){a.off("dragstart",n,this),a.off("dragend",o,this),this._createMiddleMarker(t,a),this._createMiddleMarker(a,e)},i=function(){n.call(this),o.call(this),this._poly.fire("edit")},a.on("click",i,this).on("dragstart",n,this).on("dragend",o,this),this._markerGroup.addLayer(a)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.latLngToLayerPoint(t.getLatLng()),o=i.latLngToLayerPoint(e.getLatLng());return i.layerPointToLatLng(n._add(o)._divideBy(2))}}),n.Polyline.addInitHook(function(){n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this -},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return n.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),n.control=function(t){return new n.Control(t)},n.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.DomUtil.create("div",a,o)}var e=this._controlCorners={},i="leaflet-",o=this._controlContainer=n.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i="leaflet-bar",o=i+"-part",s=n.DomUtil.create("div",e+" "+i);return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in "+o+" "+o+"-top",s,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out "+o+" "+o+"-bottom",s,this._zoomOut,this),t.on("zoomend",this._updateDisabled,this),s},onRemove:function(t){t.off("zoomend",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,o,s,a){var r=n.DomUtil.create("a",i,o);r.innerHTML=t,r.href="#",r.title=e;var h=n.DomEvent.stopPropagation;return n.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-control-zoom-disabled";n.DomUtil.removeClass(this._zoomInButton,e),n.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&n.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&n.DomUtil.addClass(this._zoomInButton,e)}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(t){return new n.Control.Zoom(t)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(t){n.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeAttribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasOwnProperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" — ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(t){return new n.Control.Attribution(t)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=n.DomUtil.create("div",e),o=this.options;return this._addScales(o,e,i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=n.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=n.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.Control.Scale(t)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){n.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var o in t)t.hasOwnProperty(o)&&this._addLayer(t[o],o);for(o in e)e.hasOwnProperty(o)&&this._addLayer(e[o],o,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=n.DomUtil.create("div",t);n.Browser.touch?n.DomEvent.on(e,"click",n.DomEvent.stopPropagation):(n.DomEvent.disableClickPropagation(e),n.DomEvent.on(e,"mousewheel",n.DomEvent.stopPropagation));var i=this._form=n.DomUtil.create("form",t+"-list");if(this.options.collapsed){n.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layersLink=n.DomUtil.create("a",t+"-toggle",e);o.href="#",o.title="Layers",n.Browser.touch?n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",this._expand,this):n.DomEvent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",t+"-base",i),this._separator=n.DomUtil.create("div",t+"-separator",i),this._overlaysList=n.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasOwnProperty(i)){var n=this._layers[i];this._addItem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onLayerChange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingClick&&this._update()},_createRadioElement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?(this._map.addLayer(i.layer),i.overlay||(n=i.layer)):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);n&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingClick=!1},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.Control.Layers(t,e,i)},n.PosAnimation=n.Class.extend({includes:n.Mixin.Events,run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this.fire("start"),t.style[n.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.DomEvent.on(t,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),n.DomUtil.setPosition(t,e),n.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inProgress&&(n.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),n.Util.falseFn(this._el.offsetWidth))},_transformRe:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getPos:function(){var e,i,o,s=this._el,a=t.getComputedStyle(s);return n.Browser.any3d?(o=a[n.DomUtil.TRANSFORM].match(this._transformRe),e=parseFloat(o[1]),i=parseFloat(o[2])):(e=parseFloat(a.left),i=parseFloat(a.top)),new n.Point(e,i,!0)},_onTransitionEnd:function(){n.DomEvent.off(this._el,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[n.DomUtil.TRANSITION]="",clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),n.Map.include({setView:function(t,e,i){e=this._limitZoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._panAnim&&this._panAnim.stop();var o=n?this._zoomToIfClose&&this._zoomToIfClose(t,e):this._panByIfClose(t);if(o)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e,i){if(t=n.point(t),!t.x&&!t.y)return this;this._panAnim||(this._panAnim=new n.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var o=n.DomUtil.getPosition(this._mapPane).subtract(t)._round();return this._panAnim.run(this._mapPane,o,e||.25,i),this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(t){var e=this._getCenterOffset(t)._floor();return this._offsetIsWithinView(e)?(this.panBy(e),!0):!1},_offsetIsWithinView:function(t,e){var i=e||1,n=this.getSize();return Math.abs(t.x)<=n.x*i&&Math.abs(t.y)<=n.y*i}}),n.PosAnimation=n.DomUtil.TRANSITION?n.PosAnimation:n.PosAnimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=n.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=n.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));n.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){n.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(t,e){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);if(!this._offsetIsWithinView(o,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getCenterLayerPoint().add(o);return this._prepareTileBg(),this._runAnimation(t,e,i,s),!0},_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(t,e,i,o,s){this._animateToCenter=t,this._animateToZoom=e,this._animatingZoom=!0,n.Draggable&&(n.Draggable._disabled=!0);var a=n.DomUtil.TRANSFORM,r=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(r.offsetWidth);var h=n.DomUtil.getScaleString(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_prepareTileBg:function(){var t=this._tilePane,e=this._tileBg;if(e&&this._getLoadedTilesPercentage(e)>.5&&.5>this._getLoadedTilesPercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stopLoadingImages(t),i;e||(e=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),e.style.zIndex=1),e.style[n.DomUtil.TRANSFORM]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilePane=this._panes.tilePane=e;var o=this._tileBg=t;n.DomUtil.addClass(o,"leaflet-zoom-animated"),this._stopLoadingImages(o)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,o,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.Util.falseFn,o.onerror=n.Util.falseFn,o.src=n.Util.emptyImageUrl,o.parentNode.removeChild(o))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),n.Util.falseFn(this._tileBg.offsetWidth),this._animatingZoom=!1,this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.Draggable&&(n.Draggable._disabled=!1)},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){this._animatingZoom||this.touchZoom._zooming||(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locationOptions=n.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n.bind(this._handleGeolocationResponse,this),i=n.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.LatLng(o,s),r=new n.LatLng(o-e,s-i),h=new n.LatLng(o+e,s+i),l=new n.LatLngBounds(r,h),u=this._locationOptions;if(u.setView){var c=Math.min(this.getBoundsZoom(l),u.maxZoom);this.setView(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document); \ No newline at end of file +(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.6-dev",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return e.__super__=a.prototype,o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h,l,u,c,p,_=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h={action:e,context:i||this},l=i&&i._leaflet_id,l?(u=t[a]+"_idx",c=u+"_len",p=_[u]=_[u]||{},p[l]?p[l].push(h):(p[l]=[h],_[c]=(_[c]||0)+1)):(_[t[a]]=_[t[a]]||[],_[t[a]].push(h));return this},hasEventListeners:function(t){return s in this&&(t in this[s]&&this[s][t].length>0||this[s][t+"_idx_len"]>0)},removeEventListener:function(t,e,i){var o,a,r,h,l,u,c,p,_=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a])){for(u=i&&i._leaflet_id,c=t[a]+"_idx",h=u&&_[c]?_[c][u]||[]:_[t[a]]||[],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);u&&0===h.length&&(p=c+"_len",delete _[c][u],_[p]=(_[p]||1)-1)}return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,o,a,r,h,l=n.Util.extend({type:t,target:this},e);if(this[s][t])for(i=this[s][t].slice(),o=0,a=i.length;a>o;o++)i[o].action.call(i[o].context||this,l);if(r=this[s][t+"_idx"])for(h in r)if(r.hasOwnProperty(h)&&(i=r[h]))for(o=0,a=i.length;a>o;o++)i[o].action.call(i[o].context||this,l);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=o&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,m="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,f=e.documentElement,g=o&&"transition"in f.style,v="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,y="MozPerspective"in f.style,P="OTransition"in f.style,L=!t.L_DISABLE_3D&&(g||v||y||P),w=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in f)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,ielt9:r,webkit:l,android:c,android23:p,chrome:u,ie3d:g,webkit3d:v,gecko3d:y,opera3d:P,any3d:L,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&v,mobileOpera:_&&t.opera,touch:w,msTouch:d,retina:m}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,o){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):t===i||null===t?t:new n.Point(t,e,o)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=e.documentElement,l=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):t===i||null===t?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new n.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var p=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(p),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,p=1e-7,_=c,d=.1;Math.abs(d)>p&&--_>0;)e=h*Math.sin(u),d=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=d;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(n.Browser.ielt9)for(t in e)e.hasOwnProperty(t)&&n.DomUtil.setOpacity(e[t],this.options.opacity);else n.DomUtil.setOpacity(this._container,this.options.opacity);if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l); +this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return n.Util.template(this._url,n.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=n.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,n.Browser.ielt9&&this.options.opacity!==i&&n.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),n.tileLayer=function(t,e){return new n.TileLayer(t,e)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultWmsParams);i.width=i.height=e.detectRetina&&n.Browser.retina?2*this.options.tileSize:this.options.tileSize;for(var o in e)this.options.hasOwnProperty(o)||(i[o]=e[o]);this.wmsParams=i,n.setOptions(this,e)},onAdd:function(t){var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=t.options.crs.code,n.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,o=i.options.crs,s=this.options.tileSize,a=t.multiplyBy(s),r=a.add(new n.Point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(t)});return c+n.Util.getParamString(this.wmsParams,c)+"&bbox="+u},setParams:function(t,e){return n.extend(this.wmsParams,t),e||this.redraw(),this}}),n.tileLayer.wms=function(t,e){return new n.TileLayer.WMS(t,e)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(t){n.setOptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),n.tileLayer.canvas=function(t){return new n.TileLayer.Canvas(t)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latLngBounds(e),n.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&n.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,o=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/o)));i.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);n.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(t,e,i){return new n.ImageOverlay(t,e,i)},n.Icon=n.Class.extend({options:{className:""},initialize:function(t){n.setOptions(this,t)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(t){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(e);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,o=this.options,s=n.point(o[e+"Size"]);i="shadow"===e?n.point(o.shadowAnchor||o.iconAnchor):n.point(o.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+o.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t){var i;return n.Browser.ie6?(i=e.createElement("div"),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i=e.createElement("img"),i.src=t),i},_getIconUrl:function(t){return n.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),n.icon=function(t){return new n.Icon(t)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(12,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];n.Browser.retina&&"icon"===t&&(t+="@2x");var i=n.Icon.Default.imagePath;if(!i)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),n.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){n.setOptions(this,e),this._latlng=n.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._removeIcon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=n.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this._map&&this._removeIcon(),this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createIcon(),t.title&&(this._icon.title=t.title),this._initInteraction(),s=1>this.options.opacity,n.DomUtil.addClass(this._icon,o),t.riseOnHover&&n.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this)),this._shadow||(this._shadow=t.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateOpacity();var a=this._map._panes;a.markerPane.appendChild(this._icon),this._shadow&&a.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var t=this._map._panes;this.options.riseOnHover&&n.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),t.markerPane.removeChild(this._icon),this._shadow&&t.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(t){n.DomUtil.setPosition(this._icon,t),this._shadow&&n.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.DomUtil.addClass(t,"leaflet-clickable"),n.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)n.DomEvent.on(t,e[i],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&n.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&n.DomEvent.preventDefault(t),"mousedown"!==t.type&&n.DomEvent.stopPropagation(t)},setOpacity:function(t){this.options.opacity=t,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),n.marker=function(t,e){return new n.Marker(t,e)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var t=e.createElement("div"),i=this.options;return i.html&&(t.innerHTML=i.html),i.bgPos&&(t.style.backgroundPosition=-i.bgPos.x+"px "+-i.bgPos.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}),n.divIcon=function(t){return new n.DivIcon(t)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:"",zoomAnimation:!0},initialize:function(t,e){n.setOptions(this,t),this._source=e,this._animated=n.Browser.any3d&&this.options.zoomAnimation},onAdd:function(t){this._map=t,this._container||this._initLayout(),this._updateContent();var e=t.options.fadeAnimation;e&&n.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on("viewreset",this._updatePosition,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),t.options.closePopupOnClick&&t.on("preclick",this._close,this),this._update(),e&&n.DomUtil.setOpacity(this._container,1)},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),t.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),t.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(t){return this._latlng=n.latLng(t),this._update(),this},setContent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=n.DomUtil.create("a",e+"-close-button",o),t.href="#close",t.innerHTML="×",n.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",o);n.DomEvent.disableClickPropagation(s),this._contentNode=n.DomUtil.create("div",e+"-content",s),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",o),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.DomUtil.addClass(t,a)):n.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);n.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,o=new n.Point(this._containerLeft,-e-this._containerBottom);this._animated&&o._add(n.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(o),a=this.options.autoPanPadding,r=t.getSize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panBy(new n.Point(h,l))}},_onCloseButtonClick:function(t){this._close(),n.DomEvent.stop(t)}}),n.popup=function(t,e){return new n.Popup(t,e)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(t,e){var i=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return i=i.add(n.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof n.Popup?(n.setOptions(t,e),this._popup=t):this._popup=new n.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),n.Map.include({openPopup:function(t){return this.closePopup(),this._popup=t,this.addLayer(t).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removeLayer(t),this},hasLayer:function(t){if(!t)return!1;var e=n.stamp(t);return this._layers.hasOwnProperty(e)},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasOwnProperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)this._layers.hasOwnProperty(i)&&t.call(e,this._layers[i])},setZIndex:function(t){return this.invoke("setZIndex",t)}}),n.layerGroup=function(t){return new n.LayerGroup(t)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t.off(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new n.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof n.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),n.featureGroup=function(t){return new n.FeatureGroup(t)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){n.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return n.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var t=n.Path.CLIP_PADDING,e=this.getSize(),i=n.DomUtil.getPosition(this._mapPane),o=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=o.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new n.Bounds(o,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!(!e.createElementNS||!e.createElementNS(n.Path.SVG_NS,"svg").createSVGRect),n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(n.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),o=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(o);this.fire(t.type,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&n.DomEvent.preventDefault(t),"mousemove"!==t.type&&n.DomEvent.stopPropagation(t)}}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;n.Browser.mobileWebkit&&r.removeChild(a),n.DomUtil.setPosition(a,e),a.setAttribute("width",o),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,o,s].join(" ")),n.Browser.mobileWebkit&&r.appendChild(a)}}}),n.Path.include({bindPopup:function(t,e){return t instanceof n.Popup?this._popup=t:((!this._popup||e)&&(this._popup=new n.Popup(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=!n.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");n.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/ *, */g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),n.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return n.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&this._map.off("click",this._onClick,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!n.Path._updateRequest&&(n.Path._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){n.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,o,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",{latlng:t.latlng,layerPoint:t.layerPoint,containerPoint:t.containerPoint,originalEvent:t})}}),n.Map.include(n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),o=this._pathRoot;n.DomUtil.setPosition(o,e),o.width=i.x,o.height=i.y,o.getContext("2d").translate(-e.x,-e.y)}}}),n.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i); +for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.Point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.Point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.Point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.Point(h.x,t.y+r*(h.x-t.x)/a):i},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.Point(a,r)}},n.Polyline=n.Path.extend({initialize:function(t,e){n.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(n.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var p=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>p&&(o=p,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,p=[1,4,2,8],_=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=_._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=p[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=_._getEdgeIntersection(h,r,u,e),c._code=_._getBitCode(c,e),i.push(c)):(h._code&u&&(c=_._getEdgeIntersection(h,r,u,e),c._code=_._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1)),t=this._latlngs,t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):"click"===e&&n.Browser.android?(r=a,a=function(t){return n.DomEvent._filterClick(t,r)},t.addEventListener(e,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var o=n.DomEvent._lastClick&&t.timeStamp-n.DomEvent._lastClick;return o&&o>100&&400>o?(n.DomEvent.stop(t),i):(n.DomEvent._lastClick=t.timeStamp,e(t))}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(t.fire("dragend"),o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),p=u/(e.inertiaDeceleration*r),_=c.multiplyBy(-p/2).round();n.Util.requestAnimFrame(function(){t.panBy(_,p,r,!0)})}e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(d.push(t.pointerId),e=d.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=d.indexOf(t.pointerId);if(-1===e)return;d.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",p=this._touchstart,_=this._touchend,d=[];t[c+p+o]=s,t[c+_+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(p,s,!1),m.addEventListener(_,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return n.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),n.control=function(t){return new n.Control(t)},n.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.DomUtil.create("div",a,o)}var e=this._controlCorners={},i="leaflet-",o=this._controlContainer=n.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=n.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend baselayerchange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend baselayerchange",this._updateDisabled,this) +},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,o,s,a){var r=n.DomUtil.create("a",i,o);r.innerHTML=t,r.href="#",r.title=e;var h=n.DomEvent.stopPropagation;return n.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";n.DomUtil.removeClass(this._zoomInButton,e),n.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&n.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&n.DomUtil.addClass(this._zoomInButton,e)}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(t){return new n.Control.Zoom(t)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(t){n.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeAttribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasOwnProperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" — ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(t){return new n.Control.Attribution(t)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=n.DomUtil.create("div",e),o=this.options;return this._addScales(o,e,i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=n.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=n.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.Control.Scale(t)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){n.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var o in t)t.hasOwnProperty(o)&&this._addLayer(t[o],o);for(o in e)e.hasOwnProperty(o)&&this._addLayer(e[o],o,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=n.DomUtil.create("div",t);n.Browser.touch?n.DomEvent.on(e,"click",n.DomEvent.stopPropagation):(n.DomEvent.disableClickPropagation(e),n.DomEvent.on(e,"mousewheel",n.DomEvent.stopPropagation));var i=this._form=n.DomUtil.create("form",t+"-list");if(this.options.collapsed){n.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layersLink=n.DomUtil.create("a",t+"-toggle",e);o.href="#",o.title="Layers",n.Browser.touch?n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",this._expand,this):n.DomEvent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",t+"-base",i),this._separator=n.DomUtil.create("div",t+"-separator",i),this._overlaysList=n.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasOwnProperty(i)){var n=this._layers[i];this._addItem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onLayerChange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingClick&&this._update()},_createRadioElement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?(this._map.addLayer(i.layer),i.overlay?this._map.fire("overlayadd",{layer:i}):n=i.layer):!e.checked&&this._map.hasLayer(i.layer)&&(this._map.removeLayer(i.layer),this._map.fire("overlayremove",{layer:i}));n&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingClick=!1},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.Control.Layers(t,e,i)},n.PosAnimation=n.Class.extend({includes:n.Mixin.Events,run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this.fire("start"),t.style[n.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.DomEvent.on(t,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),n.DomUtil.setPosition(t,e),n.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inProgress&&(n.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),n.Util.falseFn(this._el.offsetWidth))},_transformRe:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getPos:function(){var e,i,o,s=this._el,a=t.getComputedStyle(s);return n.Browser.any3d?(o=a[n.DomUtil.TRANSFORM].match(this._transformRe),e=parseFloat(o[1]),i=parseFloat(o[2])):(e=parseFloat(a.left),i=parseFloat(a.top)),new n.Point(e,i,!0)},_onTransitionEnd:function(){n.DomEvent.off(this._el,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[n.DomUtil.TRANSITION]="",clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),n.Map.include({setView:function(t,e,i){e=this._limitZoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._panAnim&&this._panAnim.stop();var o=n?this._zoomToIfClose&&this._zoomToIfClose(t,e):this._panByIfClose(t);if(o)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e,i,o){if(t=n.point(t),!t.x&&!t.y)return this;this._panAnim||(this._panAnim=new n.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o!==!0&&this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var s=n.DomUtil.getPosition(this._mapPane).subtract(t)._round();return this._panAnim.run(this._mapPane,s,e||.25,i),this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(t){var e=this._getCenterOffset(t)._floor();return this._offsetIsWithinView(e)?(this.panBy(e),!0):!1},_offsetIsWithinView:function(t,e){var i=e||1,n=this.getSize();return Math.abs(t.x)<=n.x*i&&Math.abs(t.y)<=n.y*i}}),n.PosAnimation=n.DomUtil.TRANSITION?n.PosAnimation:n.PosAnimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=n.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=n.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));n.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){n.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(t,e){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);if(!this._offsetIsWithinView(o,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getCenterLayerPoint().add(o);return this._prepareTileBg(),this._runAnimation(t,e,i,s),!0},_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(t,e,i,o,s){this._animateToCenter=t,this._animateToZoom=e,this._animatingZoom=!0,n.Draggable&&(n.Draggable._disabled=!0);var a=n.DomUtil.TRANSFORM,r=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(r.offsetWidth);var h=n.DomUtil.getScaleString(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_prepareTileBg:function(){var t=this._tilePane,e=this._tileBg;if(e&&this._getLoadedTilesPercentage(e)>.5&&.5>this._getLoadedTilesPercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stopLoadingImages(t),i;e||(e=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),e.style.zIndex=1),e.style[n.DomUtil.TRANSFORM]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilePane=this._panes.tilePane=e;var o=this._tileBg=t;n.DomUtil.addClass(o,"leaflet-zoom-animated"),this._stopLoadingImages(o)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,o,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.Util.falseFn,o.onerror=n.Util.falseFn,o.src=n.Util.emptyImageUrl,o.parentNode.removeChild(o))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),n.Util.falseFn(this._tileBg.offsetWidth),this._animatingZoom=!1,this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.Draggable&&(n.Draggable._disabled=!1)},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){this._animatingZoom||this.touchZoom._zooming||(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locationOptions=n.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n.bind(this._handleGeolocationResponse,this),i=n.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.LatLng(o,s),r=new n.LatLng(o-e,s-i),h=new n.LatLng(o+e,s+i),l=new n.LatLngBounds(r,h),u=this._locationOptions;if(u.setView){var c=Math.min(this.getBoundsZoom(l),u.maxZoom);this.setView(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document); \ No newline at end of file From 37dd65ff6d338345d7ffaba16d76336aad94f095 Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Mon, 18 Feb 2013 15:47:38 +1300 Subject: [PATCH 355/816] Minor article touch ups. --- _posts/2013-02-15-guest-post-draw.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2013-02-15-guest-post-draw.md b/_posts/2013-02-15-guest-post-draw.md index 7828103a137..6db3d58112f 100644 --- a/_posts/2013-02-15-guest-post-draw.md +++ b/_posts/2013-02-15-guest-post-draw.md @@ -81,9 +81,9 @@ See the Leafle ### Thanks -First and foremost I would like to thank my employer Smartrak, without their positive attitude to open source software I would not have had the time to complete this plugin. +First and foremost I would like to thank my employer Smartrak. Without their attitude to open source software I would not have had the time to complete this plugin. -The Leaflet developer community have been great in support this plugin through inspiration, pull requests and issue reports. Special thanks to: @mourner, @danzel, @brunob, @tnightingale, and @shramov. +The Leaflet developer community have been great in supporting this plugin through inspiration, pull requests and issue reports. Special thanks to: @mourner, @danzel, @brunob, @tnightingale, @Starefossen, and @shramov. ### Closing From edd04491d5b2c38d8e50977550e8380de1759b53 Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Wed, 20 Feb 2013 11:18:31 +1300 Subject: [PATCH 356/816] Remove built draw files and replacing with links gh-pages. --- _posts/2013-02-15-guest-post-draw.md | 22 +-- dist/images/spritesheet.png | Bin 2777 -> 0 bytes dist/leaflet.draw.css | 217 --------------------------- dist/leaflet.draw.ie.css | 44 ------ 4 files changed, 11 insertions(+), 272 deletions(-) delete mode 100644 dist/images/spritesheet.png delete mode 100644 dist/leaflet.draw.css delete mode 100644 dist/leaflet.draw.ie.css diff --git a/_posts/2013-02-15-guest-post-draw.md b/_posts/2013-02-15-guest-post-draw.md index 6db3d58112f..a8729c4be20 100644 --- a/_posts/2013-02-15-guest-post-draw.md +++ b/_posts/2013-02-15-guest-post-draw.md @@ -89,12 +89,12 @@ The Leaflet developer community have been great in supporting this plugin throug I've had a great time implementing this plugin. I hope you enjoy using it. If you have a question or just want to say hi, send me an email at jacob.toye@gmail.com. -Cheers, +Cheers, Jacob Toye - - - + + + \ No newline at end of file diff --git a/dist/images/spritesheet.png b/dist/images/spritesheet.png deleted file mode 100644 index 168c31e6b39b4975c121edb2d2e0975bafa7d4ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2777 zcmbVOdpJ~iAD^NNk|KqQX~-hXoG}K&l*yUd8H~#yV#$~}7>pS+2SZP_pn*mlN3p@#jLw~(6 z2%Cr-Ok#nwuUyEAj0uHdAqk6(jg2*rwJ;ZmLa>01jm?4%Jl+hEFcZf`!fc6Iq*#AZ z0|<#ZBAyWD2_n%88reaDXqb#aEdAmFU&v&BQyeM&8Ym=WSP5H*1=FBLvj`Ikfg99KmjM34@JTZkc>gz zm~(kt5(OX~E5I#O01L#S z0wLPL!xHVyi{uJo#S6*#;wuP=crg%{CKB+`pQB6S{S7+>|G&Kcg5~}{5yK+JU>8c` zze;6s3#q?_>9@j17T;P2ibVQFgfzys?q(MhYJ~~|q6ua))3n!OX6RmBh>t;?*&OO$=L8H+O zmM2aP1P+=7;!e_6E!RkG48#Chs|?i>8^NH3E!s$9t6#(W`YooW&bnEdnP&kBn%KrU zbLV+HWB%uv*j;SUk;&Xw*f9zpP7Sc@Ka=>>wzdX)U$tE8p_FYqqflOR zexX>_e{Egfc6wf!$J>kS}6BwR=c(}DMF)`8q{qI|Un>JpliIbOB9b{ut zR_P42I%Y>y`d%n?cXyXx;dL5hH5;g^sxs>8>R7I>YHLk2ZofNXs1Bbw*#Gi!a9if| zYBe<{1qFq|td&0mu91nhe3$(r5Ej0rVr^<`@EgmX9Yyu^J2b%ShV~V;YkZ$2EK@18 zjeXTLUOa8)dxie7eCc2C!w04bU`I!XVB3Qi6r+yS{!5a3nYZ`7f6X=}z5&r|dXi_s zlJ;~=_DJ-|#j2--si`Sri{MtRXg#Tc%G&bFm$ObAdld$>fKgFVkIdE|A?$q@@nY`7 zn>>Gif5yEWU0q$5Q@<*)^d;5RGMOwI0Dwx5^9`{=n@!RgV&r2j=5B>0R}_dDkFW5u z{E}G5IDOe;GEeo!23b!^LvK}hJvr{rp$)WS^zGUd?k`41+cH)ZlZ~@gP^4Qs+RBMG*Zo-!ht;n?vs0 zxl=XyYMZGk?BP}&_3SYG>T&hi?CfeRDiV`C1I`-Ul?bc+7gy1-337dpbroH#R!VXUZ+8=bxL6mY0whcbrnEkN`qZ+s*!2VkgV_&^72<7e{mhDKvXa8W!jkgx2}9^RQC-e9Z^vtb zf%Wl@rFHqHarq>DvWoiJn3uiL%R9yn=2zohSFlo0v+>>)3Jt4YVxrHj`0xYyzWu|K zNnHYyKcDXzKXoMZp{@z|M}GHFXe26Zt^yqEuZb0GHd#_#zxB_C?#$kb3%*rj z5di`HGqel2(%e$3gSF`sp2I@xwAcPWxsNUDy0O6v47u@ZQ&E}_(;+Y!+5OH=Mcr7d zwY~k*%Io<(v*`G$L&`GgX4@F$*$Me^AxHZsX>x`xIo|P-$A^iSy`^P)x|qe15fAB; zHwqo&%h+`-&yzhXyB<97emPKI&)VW{&{tfUIlQ*IYa$ekE3Ml_wU!wb1=R1~r&2ek zeT;s4tn2)NonaLRR%RxU13E7K53yBL+5!so|XF_n|Gqd zJvPrjX-vEYCxqOLcaPiT-4uT^NU`bJ^3;zF)=BdI?`L>=p}I-50;sQ(n;*q5enF*Q z)6dJx!x!l2=&;faWoby)5Wtf2je+;hj;7WM2^DR@HMWBO+JV)ZtY4c$IEDLyZkx#j zdyI@diZaq<#sq|ikLT{M-=XAQtyXkA{8pM~TTcdd>a?^tkv6BXrM6QvHF&Gd($Z4O ze{{93K6<>{SH89Egk%-q<>h6&apT4TCB>yv90>VfmX8e%4!XYn)o;kxDx&A!qrN`= zK|RLyGp=&!%;dm{AP#5Ne9!NjielU14+wiBlAewH_~Gqn=j^M#nhnYH>Dj-g$H_+6 zy}~n?U~JOGK30l-?xDa9B2#r`3viTT$~^Jz;fmFVX7|xXIy03r!CLKS+BsR~ zG6T7ysiQz6&vyk-v6~>v|8CG|t#M(2c>hO1hL*=_>>p>`=bD3qoTFdsy#utIk#i^Y lW*| Date: Wed, 20 Feb 2013 11:19:31 +1300 Subject: [PATCH 357/816] Renaming blog post to get the date right. --- ...013-02-15-guest-post-draw.md => 2013-02-20-guest-post-draw.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{2013-02-15-guest-post-draw.md => 2013-02-20-guest-post-draw.md} (100%) diff --git a/_posts/2013-02-15-guest-post-draw.md b/_posts/2013-02-20-guest-post-draw.md similarity index 100% rename from _posts/2013-02-15-guest-post-draw.md rename to _posts/2013-02-20-guest-post-draw.md From 51130a814a8412ce0dd9fcfb94ab33d250166d31 Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Wed, 20 Feb 2013 15:11:54 +1300 Subject: [PATCH 358/816] Revert "Update Leaflet to master for testing [TEMP]" This reverts commit c3eea648bdf2aa3c38cce7bb5c20a94e3e7be267. --- dist/leaflet-src.js | 582 +++++++++++++++++++++++++------------------- dist/leaflet.css | 84 ++++--- dist/leaflet.ie.css | 6 + dist/leaflet.js | 8 +- 4 files changed, 392 insertions(+), 288 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index c707e942053..c5b4c6d8465 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -23,7 +23,7 @@ if (typeof exports !== undefined + '') { window.L = L; } -L.version = '0.6-dev'; +L.version = '0.5.1'; /* @@ -109,7 +109,7 @@ L.Util = { var params = []; for (var i in obj) { if (obj.hasOwnProperty(i)) { - params.push(encodeURIComponent(i) + '=' + encodeURIComponent(obj[i])); + params.push(i + '=' + obj[i]); } } return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); @@ -253,7 +253,6 @@ L.Class.extend = function (props) { proto._initHooks = []; var parent = this; - NewClass.__super__ = parent.prototype; // add method for calling all hooks proto.callInitHooks = function () { @@ -308,12 +307,10 @@ L.Mixin = {}; L.Mixin.Events = { addEventListener: function (types, fn, context) { // (String, Function[, Object]) or (Object[, Object]) - var events = this[key] = this[key] || {}, - type, i, len, evt, - contextId, objKey, objLenKey, eventsObj; + type, i, len; - // types can be a map of types/handlers + // Types can be a map of types/handlers if (typeof types === 'object') { for (type in types) { if (types.hasOwnProperty(type)) { @@ -324,50 +321,26 @@ L.Mixin.Events = { return this; } - // types can be a string of space-separated words types = L.Util.splitWords(types); for (i = 0, len = types.length; i < len; i++) { - evt = { + events[types[i]] = events[types[i]] || []; + events[types[i]].push({ action: fn, context: context || this - }; - contextId = context && context._leaflet_id; - - if (contextId) { - // store listeners of a particular context in a separate hash (if it has an id) - // gives a major performance boost when removing thousands of map layers - - objKey = types[i] + '_idx', - objLenKey = objKey + '_len', - eventsObj = events[objKey] = events[objKey] || {}; - - if (eventsObj[contextId]) { - eventsObj[contextId].push(evt); - } else { - eventsObj[contextId] = [evt]; - events[objLenKey] = (events[objLenKey] || 0) + 1; - } - - } else { - events[types[i]] = events[types[i]] || []; - events[types[i]].push(evt); - } + }); } return this; }, hasEventListeners: function (type) { // (String) -> Boolean - return (key in this) && - (((type in this[key]) && this[key][type].length > 0) || - (this[key][type + '_idx_len'] > 0)); + return (key in this) && (type in this[key]) && (this[key][type].length > 0); }, removeEventListener: function (types, fn, context) { // (String[, Function, Object]) or (Object[, Object]) var events = this[key], - type, i, len, listeners, j, - contextId, objKey, objLenKey; + type, i, len, listeners, j; if (typeof types === 'object') { for (type in types) { @@ -375,35 +348,25 @@ L.Mixin.Events = { this.removeEventListener(type, types[type], fn); } } + return this; } types = L.Util.splitWords(types); for (i = 0, len = types.length; i < len; i++) { - if (this.hasEventListeners(types[i])) { - // if the context has an id, use it to find the listeners - contextId = context && context._leaflet_id; - objKey = types[i] + '_idx'; - - if (contextId && events[objKey]) { - listeners = events[objKey][contextId] || []; - } else { - listeners = events[types[i]] || []; - } + if (this.hasEventListeners(types[i])) { + listeners = events[types[i]]; for (j = listeners.length - 1; j >= 0; j--) { - if ((!fn || listeners[j].action === fn) && (!context || (listeners[j].context === context))) { + if ( + (!fn || listeners[j].action === fn) && + (!context || (listeners[j].context === context)) + ) { listeners.splice(j, 1); } } - - if (contextId && listeners.length === 0) { - objLenKey = objKey + '_len'; - delete events[objKey][contextId]; - events[objLenKey] = (events[objLenKey] || 1) - 1; - } } } @@ -415,36 +378,15 @@ L.Mixin.Events = { return this; } - var event = L.Util.extend({ + var event = L.extend({ type: type, target: this }, data); - var listeners, i, len, eventsObj, contextId; - - if (this[key][type]) { - listeners = this[key][type].slice(); - - for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].action.call(listeners[i].context || this, event); - } - } - - // fire event for the context-indexed listeners as well - - eventsObj = this[key][type + '_idx']; + var listeners = this[key][type].slice(); - if (eventsObj) { - for (contextId in eventsObj) { - if (eventsObj.hasOwnProperty(contextId)) { - listeners = eventsObj[contextId]; - if (listeners) { - for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].action.call(listeners[i].context || this, event); - } - } - } - } + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].action.call(listeners[i].context || this, event); } return this; @@ -465,7 +407,6 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; var ie = !!window.ActiveXObject, ie6 = ie && !window.XMLHttpRequest, ie7 = ie && !document.querySelector, - ielt9 = ie && !document.addEventListener, // terrible browser detection to work around Safari / iOS / Android browser bugs ua = navigator.userAgent.toLowerCase(), @@ -522,7 +463,6 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; ie: ie, ie6: ie6, ie7: ie7, - ielt9: ielt9, webkit: webkit, android: android, @@ -655,7 +595,7 @@ L.point = function (x, y, round) { if (L.Util.isArray(x)) { return new L.Point(x[0], x[1]); } - if (x === undefined || x === null) { + if (isNaN(x)) { return x; } return new L.Point(x, y, round); @@ -823,7 +763,6 @@ L.DomUtil = { left = 0, el = element, docBody = document.body, - docEl = document.documentElement, pos, ie7 = L.Browser.ie7; @@ -840,8 +779,8 @@ L.DomUtil = { if (el.offsetParent === docBody && pos === 'absolute') { break; } if (pos === 'fixed') { - top += docBody.scrollTop || docEl.scrollTop || 0; - left += docBody.scrollLeft || docEl.scrollLeft || 0; + top += docBody.scrollTop || 0; + left += docBody.scrollLeft || 0; break; } el = el.offsetParent; @@ -1111,7 +1050,7 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe if (L.Util.isArray(a)) { return new L.LatLng(a[0], a[1]); } - if (a === undefined || a === null) { + if (isNaN(a)) { return a; } return new L.LatLng(a, b); @@ -1187,27 +1126,11 @@ L.LatLngBounds.prototype = { }, getNorthWest: function () { - return new L.LatLng(this.getNorth(), this.getWest()); + return new L.LatLng(this._northEast.lat, this._southWest.lng); }, getSouthEast: function () { - return new L.LatLng(this.getSouth(), this.getEast()); - }, - - getWest: function () { - return this._southWest.lng; - }, - - getSouth: function () { - return this._southWest.lat; - }, - - getEast: function () { - return this._northEast.lng; - }, - - getNorth: function () { - return this._northEast.lat; + return new L.LatLng(this._southWest.lat, this._northEast.lng); }, contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean @@ -1247,7 +1170,10 @@ L.LatLngBounds.prototype = { }, toBBoxString: function () { - return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(','); + var sw = this._southWest, + ne = this._northEast; + + return [sw.lng, sw.lat, ne.lng, ne.lat].join(','); }, equals: function (bounds) { // (LatLngBounds) @@ -1597,8 +1523,6 @@ L.Map = L.Class.extend({ }, hasLayer: function (layer) { - if (!layer) { return false; } - var id = L.stamp(layer); return this._layers.hasOwnProperty(id); }, @@ -1616,17 +1540,15 @@ L.Map = L.Class.extend({ var offset = oldSize._subtract(this.getSize())._divideBy(2)._round(); - if ((offset.x !== 0) || (offset.y !== 0)) { - if (animate === true) { - this.panBy(offset); - } else { - this._rawPanBy(offset); + if (animate === true) { + this.panBy(offset); + } else { + this._rawPanBy(offset); - this.fire('move'); + this.fire('move'); - clearTimeout(this._sizeTimer); - this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); - } + clearTimeout(this._sizeTimer); + this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); } return this; }, @@ -1937,15 +1859,10 @@ L.Map = L.Class.extend({ L.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset)); }, - _getZoomSpan: function () { - return this.getMaxZoom() - this.getMinZoom(); - }, - _updateZoomLevels: function () { var i, minZoom = Infinity, - maxZoom = -Infinity, - oldZoomSpan = this._getZoomSpan(); + maxZoom = -Infinity; for (i in this._zoomBoundLayers) { if (this._zoomBoundLayers.hasOwnProperty(i)) { @@ -1965,10 +1882,6 @@ L.Map = L.Class.extend({ this._layersMaxZoom = maxZoom; this._layersMinZoom = minZoom; } - - if (oldZoomSpan !== this._getZoomSpan()) { - this.fire("zoomlevelschange"); - } }, // map events @@ -2357,20 +2270,12 @@ L.TileLayer = L.Class.extend({ }, _updateOpacity: function () { + L.DomUtil.setOpacity(this._container, this.options.opacity); + + // stupid webkit hack to force redrawing of tiles var i, tiles = this._tiles; - if (L.Browser.ielt9) { - for (i in tiles) { - if (tiles.hasOwnProperty(i)) { - L.DomUtil.setOpacity(tiles[i], this.options.opacity); - } - } - } else { - L.DomUtil.setOpacity(this._container, this.options.opacity); - } - - // stupid webkit hack to force redrawing of tiles if (L.Browser.webkit) { for (i in tiles) { if (tiles.hasOwnProperty(i)) { @@ -2595,9 +2500,11 @@ L.TileLayer = L.Class.extend({ // image-specific code (override to implement e.g. Canvas or SVG tile layer) getTileUrl: function (tilePoint) { + this._adjustTilePoint(tilePoint); + return L.Util.template(this._url, L.extend({ s: this._getSubdomain(tilePoint), - z: tilePoint.z, + z: this._getZoomForUrl(), x: tilePoint.x, y: tilePoint.y }, this.options)); @@ -2620,8 +2527,6 @@ L.TileLayer = L.Class.extend({ if (this.options.tms) { tilePoint.y = limit - tilePoint.y - 1; } - - tilePoint.z = this._getZoomForUrl(); }, _getSubdomain: function (tilePoint) { @@ -2650,10 +2555,6 @@ L.TileLayer = L.Class.extend({ _createTile: function () { var tile = this._tileImg.cloneNode(false); tile.onselectstart = tile.onmousemove = L.Util.falseFn; - - if (L.Browser.ielt9 && this.options.opacity !== undefined) { - L.DomUtil.setOpacity(tile, this.options.opacity); - } return tile; }, @@ -2662,16 +2563,15 @@ L.TileLayer = L.Class.extend({ tile.onload = this._tileOnLoad; tile.onerror = this._tileOnError; - this._adjustTilePoint(tilePoint); tile.src = this.getTileUrl(tilePoint); }, - _tileLoaded: function () { - this._tilesToLoad--; - if (!this._tilesToLoad) { - this.fire('load'); - } - }, + _tileLoaded: function () { + this._tilesToLoad--; + if (!this._tilesToLoad) { + this.fire('load'); + } + }, _tileOnLoad: function () { var layer = this._layer; @@ -2702,8 +2602,8 @@ L.TileLayer = L.Class.extend({ this.src = newUrl; } - layer._tileLoaded(); - } + layer._tileLoaded(); + } }); L.tileLayer = function (url, options) { @@ -2761,6 +2661,8 @@ L.TileLayer.WMS = L.TileLayer.extend({ getTileUrl: function (tilePoint, zoom) { // (Point, Number) -> String + this._adjustTilePoint(tilePoint); + var map = this._map, crs = map.options.crs, tileSize = this.options.tileSize, @@ -2817,7 +2719,6 @@ L.TileLayer.Canvas = L.TileLayer.extend({ this._redrawTile(tiles[i]); } } - return this; }, _redrawTile: function (tile) { @@ -3137,15 +3038,14 @@ L.Icon.Default.imagePath = (function () { var scripts = document.getElementsByTagName('script'), leafletRe = /\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/; - var i, len, src, matches, path; + var i, len, src, matches; for (i = 0, len = scripts.length; i < len; i++) { src = scripts[i].src; matches = src.match(leafletRe); if (matches) { - path = src.split(leafletRe)[0]; - return (path ? path + '/' : '') + 'images'; + return src.split(leafletRe)[0] + '/images'; } } }()); @@ -3744,7 +3644,7 @@ L.popup = function (options, source) { L.Marker.include({ openPopup: function () { - if (this._popup && this._map && !this._map.hasLayer(this._popup)) { + if (this._popup && this._map) { this._popup.setLatLng(this._latlng); this._map.openPopup(this._popup); } @@ -3777,21 +3677,9 @@ L.Marker.include({ .on('move', this._movePopup, this); } - if (content instanceof L.Popup) { - L.setOptions(content, options); - this._popup = content; - } else { - this._popup = new L.Popup(options, this) - .setContent(content); - } - - return this; - }, + this._popup = new L.Popup(options, this) + .setContent(content); - setPopupContent: function (content) { - if (this._popup) { - this._popup.setContent(content); - } return this; }, @@ -3878,13 +3766,6 @@ L.LayerGroup = L.Class.extend({ return this; }, - hasLayer: function (layer) { - if (!layer) { return false; } - - var id = L.stamp(layer); - return this._layers.hasOwnProperty(id); - }, - clearLayers: function () { this.eachLayer(this.removeLayer, this); return this; @@ -4010,9 +3891,7 @@ L.FeatureGroup = L.LayerGroup.extend({ }, _propagateEvent: function (e) { - if (!e.layer) { - e.layer = e.target; - } + e.layer = e.target; e.target = this; this.fire(e.type, e); @@ -4204,12 +4083,6 @@ L.Path = L.Path.extend({ if (this.options.fill) { this._path.setAttribute('fill-rule', 'evenodd'); } - if (this.options.pointerEvents) { - this._path.setAttribute('pointer-events', this.options.pointerEvents); - } - if (!this.options.clickable && !this.options.pointerEvents) { - this._path.setAttribute('pointer-events', 'none'); - } this._updateStyle(); }, @@ -4370,15 +4243,12 @@ L.Path.include({ bindPopup: function (content, options) { - if (content instanceof L.Popup) { - this._popup = content; - } else { - if (!this._popup || options) { - this._popup = new L.Popup(options, this); - } - this._popup.setContent(content); + if (!this._popup || options) { + this._popup = new L.Popup(options, this); } + this._popup.setContent(content); + if (!this._popupHandlersAdded) { this .on('click', this._openPopup, this) @@ -4948,7 +4818,7 @@ L.LineUtil = { /* - * L.Polyline is used to display polylines on a map. + * L.Polygon is used to display polylines on a map. */ L.Polyline = L.Path.extend({ @@ -5193,13 +5063,6 @@ L.Polygon = L.Polyline.extend({ this._latlngs = this._convertLatLngs(latlngs[0]); this._holes = latlngs.slice(1); } - - // filter out last point if its equal to the first one - latlngs = this._latlngs; - - if (latlngs[0].equals(latlngs[latlngs.length - 1])) { - latlngs.pop(); - } }, projectLatlngs: function () { @@ -5752,13 +5615,6 @@ L.DomEvent = { obj.addEventListener(newType, handler, false); - } else if (type === 'click' && L.Browser.android) { - originalHandler = handler; - handler = function (e) { - return L.DomEvent._filterClick(e, originalHandler); - }; - - obj.addEventListener(type, handler, false); } else { obj.addEventListener(type, handler, false); } @@ -5897,23 +5753,6 @@ L.DomEvent = { } } return e; - }, - - // this solves a bug in Android WebView where a single touch triggers two click events. - _filterClick: function (e, handler) { - var elapsed = L.DomEvent._lastClick && (e.timeStamp - L.DomEvent._lastClick); - - // are they closer together than 400ms yet more than 100ms? - // Android typically triggers them ~300ms apart while multiple listeners - // on the same event should be triggered far faster. - - if (elapsed && elapsed > 100 && elapsed < 400) { - L.DomEvent.stop(e); - return; - } - L.DomEvent._lastClick = e.timeStamp; - - return handler(e); } }; @@ -6259,8 +6098,6 @@ L.Map.Drag = L.Handler.extend({ noInertia = !options.inertia || delay > options.inertiaThreshold || !this._positions[0]; - map.fire('dragend'); - if (noInertia) { map.fire('moveend'); @@ -6280,10 +6117,12 @@ L.Map.Drag = L.Handler.extend({ offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); L.Util.requestAnimFrame(function () { - map.panBy(offset, decelerationDuration, ease, true); + map.panBy(offset, decelerationDuration, ease); }); } + map.fire('dragend'); + if (options.maxBounds) { // TODO predrag validation instead of animation L.Util.requestAnimFrame(this._panInsideMaxBounds, map, true, map._container); @@ -7070,6 +6909,257 @@ L.Handler.MarkerDrag = L.Handler.extend({ }); +/* + * L.Handler.PolyEdit is an editing handler for polylines and polygons. + */ + +L.Handler.PolyEdit = L.Handler.extend({ + options: { + icon: new L.DivIcon({ + iconSize: new L.Point(8, 8), + className: 'leaflet-div-icon leaflet-editing-icon' + }) + }, + + initialize: function (poly, options) { + this._poly = poly; + L.setOptions(this, options); + }, + + addHooks: function () { + if (this._poly._map) { + if (!this._markerGroup) { + this._initMarkers(); + } + this._poly._map.addLayer(this._markerGroup); + } + }, + + removeHooks: function () { + if (this._poly._map) { + this._poly._map.removeLayer(this._markerGroup); + delete this._markerGroup; + delete this._markers; + } + }, + + updateMarkers: function () { + this._markerGroup.clearLayers(); + this._initMarkers(); + }, + + _initMarkers: function () { + if (!this._markerGroup) { + this._markerGroup = new L.LayerGroup(); + } + this._markers = []; + + var latlngs = this._poly._latlngs, + i, j, len, marker; + + // TODO refactor holes implementation in Polygon to support it here + + for (i = 0, len = latlngs.length; i < len; i++) { + + marker = this._createMarker(latlngs[i], i); + marker.on('click', this._onMarkerClick, this); + this._markers.push(marker); + } + + var markerLeft, markerRight; + + for (i = 0, j = len - 1; i < len; j = i++) { + if (i === 0 && !(L.Polygon && (this._poly instanceof L.Polygon))) { + continue; + } + + markerLeft = this._markers[j]; + markerRight = this._markers[i]; + + this._createMiddleMarker(markerLeft, markerRight); + this._updatePrevNext(markerLeft, markerRight); + } + }, + + _createMarker: function (latlng, index) { + var marker = new L.Marker(latlng, { + draggable: true, + icon: this.options.icon + }); + + marker._origLatLng = latlng; + marker._index = index; + + marker.on('drag', this._onMarkerDrag, this); + marker.on('dragend', this._fireEdit, this); + + this._markerGroup.addLayer(marker); + + return marker; + }, + + _fireEdit: function () { + this._poly.fire('edit'); + }, + + _onMarkerDrag: function (e) { + var marker = e.target; + + L.extend(marker._origLatLng, marker._latlng); + + if (marker._middleLeft) { + marker._middleLeft.setLatLng(this._getMiddleLatLng(marker._prev, marker)); + } + if (marker._middleRight) { + marker._middleRight.setLatLng(this._getMiddleLatLng(marker, marker._next)); + } + + this._poly.redraw(); + }, + + _onMarkerClick: function (e) { + // we want to remove the marker on click, but if latlng count < 3, polyline would be invalid + if (this._poly._latlngs.length < 3) { return; } + + var marker = e.target, + i = marker._index; + + // remove the marker + this._markerGroup.removeLayer(marker); + this._markers.splice(i, 1); + this._poly.spliceLatLngs(i, 1); + this._updateIndexes(i, -1); + + // update prev/next links of adjacent markers + this._updatePrevNext(marker._prev, marker._next); + + // remove ghost markers near the removed marker + if (marker._middleLeft) { + this._markerGroup.removeLayer(marker._middleLeft); + } + if (marker._middleRight) { + this._markerGroup.removeLayer(marker._middleRight); + } + + // create a ghost marker in place of the removed one + if (marker._prev && marker._next) { + this._createMiddleMarker(marker._prev, marker._next); + + } else if (!marker._prev) { + marker._next._middleLeft = null; + + } else if (!marker._next) { + marker._prev._middleRight = null; + } + + this._poly.fire('edit'); + }, + + _updateIndexes: function (index, delta) { + this._markerGroup.eachLayer(function (marker) { + if (marker._index > index) { + marker._index += delta; + } + }); + }, + + _createMiddleMarker: function (marker1, marker2) { + var latlng = this._getMiddleLatLng(marker1, marker2), + marker = this._createMarker(latlng), + onClick, + onDragStart, + onDragEnd; + + marker.setOpacity(0.6); + + marker1._middleRight = marker2._middleLeft = marker; + + onDragStart = function () { + var i = marker2._index; + + marker._index = i; + + marker + .off('click', onClick) + .on('click', this._onMarkerClick, this); + + latlng.lat = marker.getLatLng().lat; + latlng.lng = marker.getLatLng().lng; + this._poly.spliceLatLngs(i, 0, latlng); + this._markers.splice(i, 0, marker); + + marker.setOpacity(1); + + this._updateIndexes(i, 1); + marker2._index++; + this._updatePrevNext(marker1, marker); + this._updatePrevNext(marker, marker2); + }; + + onDragEnd = function () { + marker.off('dragstart', onDragStart, this); + marker.off('dragend', onDragEnd, this); + + this._createMiddleMarker(marker1, marker); + this._createMiddleMarker(marker, marker2); + }; + + onClick = function () { + onDragStart.call(this); + onDragEnd.call(this); + this._poly.fire('edit'); + }; + + marker + .on('click', onClick, this) + .on('dragstart', onDragStart, this) + .on('dragend', onDragEnd, this); + + this._markerGroup.addLayer(marker); + }, + + _updatePrevNext: function (marker1, marker2) { + if (marker1) { + marker1._next = marker2; + } + if (marker2) { + marker2._prev = marker1; + } + }, + + _getMiddleLatLng: function (marker1, marker2) { + var map = this._poly._map, + p1 = map.latLngToLayerPoint(marker1.getLatLng()), + p2 = map.latLngToLayerPoint(marker2.getLatLng()); + + return map.layerPointToLatLng(p1._add(p2)._divideBy(2)); + } +}); + +L.Polyline.addInitHook(function () { + + if (L.Handler.PolyEdit) { + this.editing = new L.Handler.PolyEdit(this); + + if (this.options.editable) { + this.editing.enable(); + } + } + + this.on('add', function () { + if (this.editing && this.editing.enabled()) { + this.editing.addHooks(); + } + }); + + this.on('remove', function () { + if (this.editing && this.editing.enabled()) { + this.editing.removeHooks(); + } + }); +}); + + /* * L.Control is a base class for implementing map controls. Handles positioning. * All other controls extend from this class. @@ -7188,22 +7278,31 @@ L.Control.Zoom = L.Control.extend({ onAdd: function (map) { var zoomName = 'leaflet-control-zoom', - container = L.DomUtil.create('div', zoomName + ' leaflet-bar'); + barName = 'leaflet-bar', + partName = barName + '-part', + container = L.DomUtil.create('div', zoomName + ' ' + barName); this._map = map; - this._zoomInButton = this._createButton( - '+', 'Zoom in', zoomName + '-in', container, this._zoomIn, this); - this._zoomOutButton = this._createButton( - '-', 'Zoom out', zoomName + '-out', container, this._zoomOut, this); + this._zoomInButton = this._createButton('+', 'Zoom in', + zoomName + '-in ' + + partName + ' ' + + partName + '-top', + container, this._zoomIn, this); - map.on('zoomend baselayerchange', this._updateDisabled, this); + this._zoomOutButton = this._createButton('-', 'Zoom out', + zoomName + '-out ' + + partName + ' ' + + partName + '-bottom', + container, this._zoomOut, this); + + map.on('zoomend', this._updateDisabled, this); return container; }, onRemove: function (map) { - map.off('zoomend baselayerchange', this._updateDisabled, this); + map.off('zoomend', this._updateDisabled, this); }, _zoomIn: function (e) { @@ -7234,7 +7333,7 @@ L.Control.Zoom = L.Control.extend({ _updateDisabled: function () { var map = this._map, - className = 'leaflet-disabled'; + className = 'leaflet-control-zoom-disabled'; L.DomUtil.removeClass(this._zoomInButton, className); L.DomUtil.removeClass(this._zoomOutButton, className); @@ -7713,12 +7812,9 @@ L.Control.Layers = L.Control.extend({ this._map.addLayer(obj.layer); if (!obj.overlay) { baseLayer = obj.layer; - } else { - this._map.fire('overlayadd', {layer: obj}); } } else if (!input.checked && this._map.hasLayer(obj.layer)) { this._map.removeLayer(obj.layer); - this._map.fire('overlayremove', {layer: obj}); } } @@ -7855,7 +7951,7 @@ L.Map.include({ return this; }, - panBy: function (offset, duration, easeLinearity, moving) { + panBy: function (offset, duration, easeLinearity) { offset = L.point(offset); if (!(offset.x || offset.y)) { @@ -7871,9 +7967,7 @@ L.Map.include({ }, this); } - if (moving !== true) { - this.fire('movestart'); - } + this.fire('movestart'); L.DomUtil.addClass(this._mapPane, 'leaflet-pan-anim'); diff --git a/dist/leaflet.css b/dist/leaflet.css index 2410992d83c..ea3da39071f 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -191,58 +191,37 @@ /* general toolbar styles */ .leaflet-bar { - box-shadow: 0 1px 7px rgba(0,0,0,0.65); - -webkit-border-radius: 4px; - border-radius: 4px; + box-shadow: 0 0 8px rgba(0,0,0,0.4); + border: 1px solid #888; + -webkit-border-radius: 5px; + border-radius: 5px; } -.leaflet-bar a { - 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-part { + background-color: rgba(255, 255, 255, 0.8); + border-bottom: 1px solid #aaa; } -.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 { +.leaflet-bar-part-top { -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } -.leaflet-bar a:last-child { +.leaflet-bar-part-bottom { -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom: none; } -.leaflet-bar a.leaflet-disabled { - cursor: default; - background-color: #f4f4f4; - color: #bbb; - } .leaflet-touch .leaflet-bar { -webkit-border-radius: 10px; border-radius: 10px; } -.leaflet-touch .leaflet-bar a { - width: 30px; - height: 30px; +.leaflet-touch .leaflet-bar-part { + border-bottom: 4px solid rgba(0,0,0,0.3); } -.leaflet-touch .leaflet-bar a:first-child { +.leaflet-touch .leaflet-bar-part-top { -webkit-border-radius: 7px 7px 0 0; border-radius: 7px 7px 0 0; } -.leaflet-touch .leaflet-bar a:last-child { +.leaflet-touch .leaflet-bar-part-bottom { -webkit-border-radius: 0 0 7px 7px; border-radius: 0 0 7px 7px; border-bottom: none; @@ -255,23 +234,48 @@ margin-left: 13px; margin-top: 12px; } +.leaflet-control-zoom a { + width: 22px; + height: 22px; + text-align: center; + text-decoration: none; + color: black; + } +.leaflet-control-zoom a, +.leaflet-control-layers-toggle { + background-position: 50% 50%; + background-repeat: no-repeat; + display: block; + } +.leaflet-control-zoom a:hover { + background-color: #fff; + color: #777; + } .leaflet-control-zoom-in { - font: bold 18px 'Lucida Console', Monaco, monospace; + font: bold 18px/24px Arial, Helvetica, sans-serif; } .leaflet-control-zoom-out { - font: bold 22px 'Lucida Console', Monaco, monospace; + font: bold 23px/20px Tahoma, Verdana, sans-serif; + } +.leaflet-control-zoom a.leaflet-control-zoom-disabled { + cursor: default; + background-color: rgba(255, 255, 255, 0.8); + color: #bbb; } +.leaflet-touch .leaflet-control-zoom a { + width: 30px; + height: 30px; + } .leaflet-touch .leaflet-control-zoom-in { - font-size: 22px; - line-height: 30px; + font-size: 24px; + line-height: 29px; } .leaflet-touch .leaflet-control-zoom-out { font-size: 28px; - line-height: 30px; + line-height: 24px; } - /* layers control */ .leaflet-control-layers { diff --git a/dist/leaflet.ie.css b/dist/leaflet.ie.css index 14b84b691e9..b59c8144e6c 100644 --- a/dist/leaflet.ie.css +++ b/dist/leaflet.ie.css @@ -35,6 +35,12 @@ .leaflet-control-layers { border: 3px solid #999; } +.leaflet-control-zoom a { + background-color: #eee; + } +.leaflet-control-zoom a:hover { + background-color: #fff; + } .leaflet-control-layers-toggle { } .leaflet-control-attribution, diff --git a/dist/leaflet.js b/dist/leaflet.js index 82693aab7c0..bdf0b69e213 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -2,7 +2,7 @@ Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com (c) 2010-2013, Vladimir Agafonkin, CloudMade */ -(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.6-dev",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return e.__super__=a.prototype,o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h,l,u,c,p,_=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h={action:e,context:i||this},l=i&&i._leaflet_id,l?(u=t[a]+"_idx",c=u+"_len",p=_[u]=_[u]||{},p[l]?p[l].push(h):(p[l]=[h],_[c]=(_[c]||0)+1)):(_[t[a]]=_[t[a]]||[],_[t[a]].push(h));return this},hasEventListeners:function(t){return s in this&&(t in this[s]&&this[s][t].length>0||this[s][t+"_idx_len"]>0)},removeEventListener:function(t,e,i){var o,a,r,h,l,u,c,p,_=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a])){for(u=i&&i._leaflet_id,c=t[a]+"_idx",h=u&&_[c]?_[c][u]||[]:_[t[a]]||[],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);u&&0===h.length&&(p=c+"_len",delete _[c][u],_[p]=(_[p]||1)-1)}return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,o,a,r,h,l=n.Util.extend({type:t,target:this},e);if(this[s][t])for(i=this[s][t].slice(),o=0,a=i.length;a>o;o++)i[o].action.call(i[o].context||this,l);if(r=this[s][t+"_idx"])for(h in r)if(r.hasOwnProperty(h)&&(i=r[h]))for(o=0,a=i.length;a>o;o++)i[o].action.call(i[o].context||this,l);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=o&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,m="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,f=e.documentElement,g=o&&"transition"in f.style,v="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,y="MozPerspective"in f.style,P="OTransition"in f.style,L=!t.L_DISABLE_3D&&(g||v||y||P),w=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in f)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,ielt9:r,webkit:l,android:c,android23:p,chrome:u,ie3d:g,webkit3d:v,gecko3d:y,opera3d:P,any3d:L,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&v,mobileOpera:_&&t.opera,touch:w,msTouch:d,retina:m}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,o){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):t===i||null===t?t:new n.Point(t,e,o)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=e.documentElement,l=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):t===i||null===t?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new n.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var p=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(p),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,p=1e-7,_=c,d=.1;Math.abs(d)>p&&--_>0;)e=h*Math.sin(u),d=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=d;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(n.Browser.ielt9)for(t in e)e.hasOwnProperty(t)&&n.DomUtil.setOpacity(e[t],this.options.opacity);else n.DomUtil.setOpacity(this._container,this.options.opacity);if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l); -this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return n.Util.template(this._url,n.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=n.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,n.Browser.ielt9&&this.options.opacity!==i&&n.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),n.tileLayer=function(t,e){return new n.TileLayer(t,e)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultWmsParams);i.width=i.height=e.detectRetina&&n.Browser.retina?2*this.options.tileSize:this.options.tileSize;for(var o in e)this.options.hasOwnProperty(o)||(i[o]=e[o]);this.wmsParams=i,n.setOptions(this,e)},onAdd:function(t){var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=t.options.crs.code,n.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,o=i.options.crs,s=this.options.tileSize,a=t.multiplyBy(s),r=a.add(new n.Point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(t)});return c+n.Util.getParamString(this.wmsParams,c)+"&bbox="+u},setParams:function(t,e){return n.extend(this.wmsParams,t),e||this.redraw(),this}}),n.tileLayer.wms=function(t,e){return new n.TileLayer.WMS(t,e)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(t){n.setOptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),n.tileLayer.canvas=function(t){return new n.TileLayer.Canvas(t)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latLngBounds(e),n.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&n.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,o=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/o)));i.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);n.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(t,e,i){return new n.ImageOverlay(t,e,i)},n.Icon=n.Class.extend({options:{className:""},initialize:function(t){n.setOptions(this,t)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(t){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(e);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,o=this.options,s=n.point(o[e+"Size"]);i="shadow"===e?n.point(o.shadowAnchor||o.iconAnchor):n.point(o.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+o.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t){var i;return n.Browser.ie6?(i=e.createElement("div"),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i=e.createElement("img"),i.src=t),i},_getIconUrl:function(t){return n.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),n.icon=function(t){return new n.Icon(t)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(12,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];n.Browser.retina&&"icon"===t&&(t+="@2x");var i=n.Icon.Default.imagePath;if(!i)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),n.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){n.setOptions(this,e),this._latlng=n.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._removeIcon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=n.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this._map&&this._removeIcon(),this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createIcon(),t.title&&(this._icon.title=t.title),this._initInteraction(),s=1>this.options.opacity,n.DomUtil.addClass(this._icon,o),t.riseOnHover&&n.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this)),this._shadow||(this._shadow=t.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateOpacity();var a=this._map._panes;a.markerPane.appendChild(this._icon),this._shadow&&a.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var t=this._map._panes;this.options.riseOnHover&&n.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),t.markerPane.removeChild(this._icon),this._shadow&&t.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(t){n.DomUtil.setPosition(this._icon,t),this._shadow&&n.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.DomUtil.addClass(t,"leaflet-clickable"),n.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)n.DomEvent.on(t,e[i],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&n.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&n.DomEvent.preventDefault(t),"mousedown"!==t.type&&n.DomEvent.stopPropagation(t)},setOpacity:function(t){this.options.opacity=t,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),n.marker=function(t,e){return new n.Marker(t,e)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var t=e.createElement("div"),i=this.options;return i.html&&(t.innerHTML=i.html),i.bgPos&&(t.style.backgroundPosition=-i.bgPos.x+"px "+-i.bgPos.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}),n.divIcon=function(t){return new n.DivIcon(t)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:"",zoomAnimation:!0},initialize:function(t,e){n.setOptions(this,t),this._source=e,this._animated=n.Browser.any3d&&this.options.zoomAnimation},onAdd:function(t){this._map=t,this._container||this._initLayout(),this._updateContent();var e=t.options.fadeAnimation;e&&n.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on("viewreset",this._updatePosition,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),t.options.closePopupOnClick&&t.on("preclick",this._close,this),this._update(),e&&n.DomUtil.setOpacity(this._container,1)},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),t.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),t.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(t){return this._latlng=n.latLng(t),this._update(),this},setContent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=n.DomUtil.create("a",e+"-close-button",o),t.href="#close",t.innerHTML="×",n.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",o);n.DomEvent.disableClickPropagation(s),this._contentNode=n.DomUtil.create("div",e+"-content",s),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",o),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.DomUtil.addClass(t,a)):n.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);n.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,o=new n.Point(this._containerLeft,-e-this._containerBottom);this._animated&&o._add(n.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(o),a=this.options.autoPanPadding,r=t.getSize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panBy(new n.Point(h,l))}},_onCloseButtonClick:function(t){this._close(),n.DomEvent.stop(t)}}),n.popup=function(t,e){return new n.Popup(t,e)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(t,e){var i=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return i=i.add(n.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof n.Popup?(n.setOptions(t,e),this._popup=t):this._popup=new n.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),n.Map.include({openPopup:function(t){return this.closePopup(),this._popup=t,this.addLayer(t).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removeLayer(t),this},hasLayer:function(t){if(!t)return!1;var e=n.stamp(t);return this._layers.hasOwnProperty(e)},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasOwnProperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)this._layers.hasOwnProperty(i)&&t.call(e,this._layers[i])},setZIndex:function(t){return this.invoke("setZIndex",t)}}),n.layerGroup=function(t){return new n.LayerGroup(t)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t.off(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new n.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof n.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),n.featureGroup=function(t){return new n.FeatureGroup(t)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){n.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return n.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var t=n.Path.CLIP_PADDING,e=this.getSize(),i=n.DomUtil.getPosition(this._mapPane),o=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=o.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new n.Bounds(o,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!(!e.createElementNS||!e.createElementNS(n.Path.SVG_NS,"svg").createSVGRect),n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(n.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),o=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(o);this.fire(t.type,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&n.DomEvent.preventDefault(t),"mousemove"!==t.type&&n.DomEvent.stopPropagation(t)}}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;n.Browser.mobileWebkit&&r.removeChild(a),n.DomUtil.setPosition(a,e),a.setAttribute("width",o),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,o,s].join(" ")),n.Browser.mobileWebkit&&r.appendChild(a)}}}),n.Path.include({bindPopup:function(t,e){return t instanceof n.Popup?this._popup=t:((!this._popup||e)&&(this._popup=new n.Popup(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=!n.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");n.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/ *, */g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),n.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return n.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&this._map.off("click",this._onClick,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!n.Path._updateRequest&&(n.Path._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){n.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,o,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",{latlng:t.latlng,layerPoint:t.layerPoint,containerPoint:t.containerPoint,originalEvent:t})}}),n.Map.include(n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),o=this._pathRoot;n.DomUtil.setPosition(o,e),o.width=i.x,o.height=i.y,o.getContext("2d").translate(-e.x,-e.y)}}}),n.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i); -for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.Point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.Point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.Point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.Point(h.x,t.y+r*(h.x-t.x)/a):i},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.Point(a,r)}},n.Polyline=n.Path.extend({initialize:function(t,e){n.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(n.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var p=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>p&&(o=p,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,p=[1,4,2,8],_=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=_._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=p[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=_._getEdgeIntersection(h,r,u,e),c._code=_._getBitCode(c,e),i.push(c)):(h._code&u&&(c=_._getEdgeIntersection(h,r,u,e),c._code=_._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1)),t=this._latlngs,t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):"click"===e&&n.Browser.android?(r=a,a=function(t){return n.DomEvent._filterClick(t,r)},t.addEventListener(e,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var o=n.DomEvent._lastClick&&t.timeStamp-n.DomEvent._lastClick;return o&&o>100&&400>o?(n.DomEvent.stop(t),i):(n.DomEvent._lastClick=t.timeStamp,e(t))}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(t.fire("dragend"),o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),p=u/(e.inertiaDeceleration*r),_=c.multiplyBy(-p/2).round();n.Util.requestAnimFrame(function(){t.panBy(_,p,r,!0)})}e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(d.push(t.pointerId),e=d.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=d.indexOf(t.pointerId);if(-1===e)return;d.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",p=this._touchstart,_=this._touchend,d=[];t[c+p+o]=s,t[c+_+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(p,s,!1),m.addEventListener(_,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return n.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),n.control=function(t){return new n.Control(t)},n.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.DomUtil.create("div",a,o)}var e=this._controlCorners={},i="leaflet-",o=this._controlContainer=n.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=n.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend baselayerchange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend baselayerchange",this._updateDisabled,this) -},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,o,s,a){var r=n.DomUtil.create("a",i,o);r.innerHTML=t,r.href="#",r.title=e;var h=n.DomEvent.stopPropagation;return n.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";n.DomUtil.removeClass(this._zoomInButton,e),n.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&n.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&n.DomUtil.addClass(this._zoomInButton,e)}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(t){return new n.Control.Zoom(t)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(t){n.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeAttribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasOwnProperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" — ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(t){return new n.Control.Attribution(t)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=n.DomUtil.create("div",e),o=this.options;return this._addScales(o,e,i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=n.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=n.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.Control.Scale(t)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){n.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var o in t)t.hasOwnProperty(o)&&this._addLayer(t[o],o);for(o in e)e.hasOwnProperty(o)&&this._addLayer(e[o],o,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=n.DomUtil.create("div",t);n.Browser.touch?n.DomEvent.on(e,"click",n.DomEvent.stopPropagation):(n.DomEvent.disableClickPropagation(e),n.DomEvent.on(e,"mousewheel",n.DomEvent.stopPropagation));var i=this._form=n.DomUtil.create("form",t+"-list");if(this.options.collapsed){n.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layersLink=n.DomUtil.create("a",t+"-toggle",e);o.href="#",o.title="Layers",n.Browser.touch?n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",this._expand,this):n.DomEvent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",t+"-base",i),this._separator=n.DomUtil.create("div",t+"-separator",i),this._overlaysList=n.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasOwnProperty(i)){var n=this._layers[i];this._addItem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onLayerChange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingClick&&this._update()},_createRadioElement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?(this._map.addLayer(i.layer),i.overlay?this._map.fire("overlayadd",{layer:i}):n=i.layer):!e.checked&&this._map.hasLayer(i.layer)&&(this._map.removeLayer(i.layer),this._map.fire("overlayremove",{layer:i}));n&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingClick=!1},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.Control.Layers(t,e,i)},n.PosAnimation=n.Class.extend({includes:n.Mixin.Events,run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this.fire("start"),t.style[n.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.DomEvent.on(t,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),n.DomUtil.setPosition(t,e),n.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inProgress&&(n.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),n.Util.falseFn(this._el.offsetWidth))},_transformRe:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getPos:function(){var e,i,o,s=this._el,a=t.getComputedStyle(s);return n.Browser.any3d?(o=a[n.DomUtil.TRANSFORM].match(this._transformRe),e=parseFloat(o[1]),i=parseFloat(o[2])):(e=parseFloat(a.left),i=parseFloat(a.top)),new n.Point(e,i,!0)},_onTransitionEnd:function(){n.DomEvent.off(this._el,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[n.DomUtil.TRANSITION]="",clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),n.Map.include({setView:function(t,e,i){e=this._limitZoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._panAnim&&this._panAnim.stop();var o=n?this._zoomToIfClose&&this._zoomToIfClose(t,e):this._panByIfClose(t);if(o)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e,i,o){if(t=n.point(t),!t.x&&!t.y)return this;this._panAnim||(this._panAnim=new n.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o!==!0&&this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var s=n.DomUtil.getPosition(this._mapPane).subtract(t)._round();return this._panAnim.run(this._mapPane,s,e||.25,i),this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(t){var e=this._getCenterOffset(t)._floor();return this._offsetIsWithinView(e)?(this.panBy(e),!0):!1},_offsetIsWithinView:function(t,e){var i=e||1,n=this.getSize();return Math.abs(t.x)<=n.x*i&&Math.abs(t.y)<=n.y*i}}),n.PosAnimation=n.DomUtil.TRANSITION?n.PosAnimation:n.PosAnimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=n.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=n.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));n.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){n.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(t,e){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);if(!this._offsetIsWithinView(o,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getCenterLayerPoint().add(o);return this._prepareTileBg(),this._runAnimation(t,e,i,s),!0},_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(t,e,i,o,s){this._animateToCenter=t,this._animateToZoom=e,this._animatingZoom=!0,n.Draggable&&(n.Draggable._disabled=!0);var a=n.DomUtil.TRANSFORM,r=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(r.offsetWidth);var h=n.DomUtil.getScaleString(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_prepareTileBg:function(){var t=this._tilePane,e=this._tileBg;if(e&&this._getLoadedTilesPercentage(e)>.5&&.5>this._getLoadedTilesPercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stopLoadingImages(t),i;e||(e=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),e.style.zIndex=1),e.style[n.DomUtil.TRANSFORM]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilePane=this._panes.tilePane=e;var o=this._tileBg=t;n.DomUtil.addClass(o,"leaflet-zoom-animated"),this._stopLoadingImages(o)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,o,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.Util.falseFn,o.onerror=n.Util.falseFn,o.src=n.Util.emptyImageUrl,o.parentNode.removeChild(o))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),n.Util.falseFn(this._tileBg.offsetWidth),this._animatingZoom=!1,this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.Draggable&&(n.Draggable._disabled=!1)},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){this._animatingZoom||this.touchZoom._zooming||(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locationOptions=n.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n.bind(this._handleGeolocationResponse,this),i=n.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.LatLng(o,s),r=new n.LatLng(o-e,s-i),h=new n.LatLng(o+e,s+i),l=new n.LatLngBounds(r,h),u=this._locationOptions;if(u.setView){var c=Math.min(this.getBoundsZoom(l),u.maxZoom);this.setView(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document); \ No newline at end of file +(function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.L,n={},n.noConflict=function(){return t.L=o,this},t.L=n),n.version="0.5.1",n.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitExecByInterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,setTimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},splitWords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getParamString:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&i.push(n+"="+t[n]);return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasOwnProperty(i))throw Error("No value provided for variable "+t);return n})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new Date,n=Math.max(0,16-(i-s));return s=i+n,t.setTimeout(e,n)}var s=0,a=t.requestAnimationFrame||e("RequestAnimationFrame")||o,r=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};n.Util.requestAnimFrame=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.Util.cancelAnimFrame=function(e){e&&r.call(t,e)}}(),n.extend=n.Util.extend,n.bind=n.Util.bind,n.stamp=n.Util.stamp,n.setOptions=n.Util.setOptions,n.Class=function(){},n.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.Util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._initHooks=[];var a=this;return o.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;e>t;t++)o._initHooks[t].call(this)}},e},n.Class.include=function(t){n.extend(this.prototype,t)},n.Class.mergeOptions=function(t){n.extend(this.prototype.options,t)},n.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(t,e,i){var o,a,r,h=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.addEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)h[t[a]]=h[t[a]]||[],h[t[a]].push({action:e,context:i||this});return this},hasEventListeners:function(t){return s in this&&t in this[s]&&this[s][t].length>0},removeEventListener:function(t,e,i){var o,a,r,h,l,u=this[s];if("object"==typeof t){for(o in t)t.hasOwnProperty(o)&&this.removeEventListener(o,t[o],e);return this}for(t=n.Util.splitWords(t),a=0,r=t.length;r>a;a++)if(this.hasEventListeners(t[a]))for(h=u[t[a]],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);return this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;for(var i=n.extend({type:t,target:this},e),o=this[s][t].slice(),a=0,r=o.length;r>a;a++)o[a].action.call(o[a].context||this,i);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var o=!!t.ActiveXObject,s=o&&!t.XMLHttpRequest,a=o&&!e.querySelector,r=navigator.userAgent.toLowerCase(),h=-1!==r.indexOf("webkit"),l=-1!==r.indexOf("chrome"),u=-1!==r.indexOf("android"),c=-1!==r.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,p="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,m=e.documentElement,f=o&&"transition"in m.style,g="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,v="MozPerspective"in m.style,y="OTransition"in m.style,L=!t.L_DISABLE_3D&&(f||g||v||y),P=!t.L_NO_TOUCH&&function(){var t="ontouchstart";if(d||t in m)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();n.Browser={ie:o,ie6:s,ie7:a,webkit:h,android:u,android23:c,chrome:l,ie3d:f,webkit3d:g,gecko3d:v,opera3d:y,any3d:L,mobile:_,mobileWebkit:_&&h,mobileWebkit3d:_&&g,mobileOpera:_&&t.opera,touch:P,msTouch:d,retina:p}}(),n.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},n.Point.prototype={clone:function(){return new n.Point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(t,e,i){return t instanceof n.Point?t:n.Util.isArray(t)?new n.Point(t[0],t[1]):isNaN(t)?t:new n.Point(t,e,i)},n.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.Bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.Point?n.point(t):n.bounds(t),t instanceof n.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.Bounds?t:new n.Bounds(t,e)},n.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=n.Browser.ie7;do{if(o+=a.offsetTop||0,s+=a.offsetLeft||0,o+=parseInt(n.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(n.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=n.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrollTop||0,s+=r.scrollLeft||0;break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;o-=a.scrollTop||0,s-=a.scrollLeft||0,n.DomUtil.documentIsLtr()||!n.Browser.webkit&&!h||(s+=a.scrollWidth-a.clientWidth,h&&"hidden"!==n.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==n.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new n.Point(s,o)},documentIsLtr:function(){return n.DomUtil._docIsLtrCached||(n.DomUtil._docIsLtrCached=!0,n.DomUtil._docIsLtr="ltr"===n.DomUtil.getStyle(e.body,"direction")),n.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},disableTextSelection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.Util.falseFn)},enableTextSelection:function(){e.onselectstart===n.Util.falseFn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasClass:function(t,e){return t.className.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){n.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){function i(t,i){return i===e?"":t}t.className=t.className.replace(/(\S+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=n.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getScaleString:function(t,e){var i=n.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),o=" scale("+t+") ";return i+o},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&n.Browser.any3d?(t.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(e),n.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},n.DomUtil.TRANSFORM=n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),n.DomUtil.TRANSITION=n.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),n.DomUtil.TRANSITION_END="webkitTransition"===n.DomUtil.TRANSITION||"OTransition"===n.DomUtil.TRANSITION?n.DomUtil.TRANSITION+"End":"transitionend",n.LatLng=function(t,e){var i=parseFloat(t),n=parseFloat(e);if(isNaN(i)||isNaN(n))throw Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(t){if(!t)return!1;t=n.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n.LatLng.MAX_MARGIN>=e},toString:function(t){return"LatLng("+n.Util.formatNum(this.lat,t)+", "+n.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=n.latLng(t);var e=6378137,i=n.LatLng.DEG_TO_RAD,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(o/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.LatLng(this.lat,i)}},n.latLng=function(t,e){return t instanceof n.LatLng?t:n.Util.isArray(t)?new n.LatLng(t[0],t[1]):isNaN(t)?t:new n.LatLng(t,e)},n.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.LatLngBounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t),t instanceof n.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new n.LatLng(t.lat,t.lng),this._northEast=new n.LatLng(t.lat,t.lng)):t instanceof n.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new n.LatLngBounds(new n.LatLng(e.lat-o,e.lng-s),new n.LatLng(i.lat+o,i.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this._northEast.lat,this._southWest.lng)},getSouthEast:function(){return new n.LatLng(this._southWest.lat,this._northEast.lng)},contains:function(t){t="number"==typeof t[0]||t instanceof n.LatLng?n.latLng(t):n.latLngBounds(t);var e,i,o=this._southWest,s=this._northEast;return t instanceof n.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latLngBounds(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},toBBoxString:function(){var t=this._southWest,e=this._northEast;return[t.lng,t.lat,e.lng,e.lat].join(",")},equals:function(t){return t?(t=n.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},n.latLngBounds=function(t,e){return!t||t instanceof n.LatLngBounds?t:new n.LatLngBounds(t,e)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new n.Point(s,a)},unproject:function(t){var e=n.LatLng.RAD_TO_DEG,i=t.x*e,o=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new n.LatLng(o,i)}},n.Projection.LonLat={project:function(t){return new n.Point(t.lng,t.lat)},unproject:function(t){return new n.LatLng(t.y,t.x)}},n.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},n.CRS.Simple=n.extend({},n.CRS,{projection:n.Projection.LonLat,transformation:new n.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),n.CRS.EPSG3857=n.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),n.CRS.EPSG900913=n.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(t,e){e=n.setOptions(this,e),this._initContainer(t),this._initLayout(),this.callInitHooks(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(n.latLng(e.center),e.zoom,!0),this._initLayers(e.layers)},setView:function(t,e){return this._resetView(n.latLng(t),this._limitZoom(e)),this},setZoom:function(t){return this.setView(this.getCenter(),t)},zoomIn:function(t){return this.setZoom(this._zoom+(t||1))},zoomOut:function(t){return this.setZoom(this._zoom-(t||1))},fitBounds:function(t){var e=this.getBoundsZoom(t);return this.setView(n.latLngBounds(t).getCenter(),e)},fitWorld:function(){var t=new n.LatLng(-60,-170),e=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(t,e))},panTo:function(t){return this.setView(t,this._zoom)},panBy:function(t){return this.fire("movestart"),this._rawPanBy(n.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=n.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(e>this._zoom?this.setView(t.getCenter(),e):this.panInsideBounds(t)),this},panInsideBounds:function(t){t=n.latLngBounds(t);var e=this.getBounds(),i=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),s=this.project(t.getSouthWest()),a=this.project(t.getNorthEast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new n.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(n.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(n.point(t),e)},layerPointToLatLng:function(t){var e=n.point(t).add(this._initialTopLeftPoint);return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(n.latLng(t))._round();return e._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(t){return n.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return n.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(n.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(t)))},mouseEventToContainerPoint:function(t){return n.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=n.DomUtil.get(t);if(e._leaflet)throw Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;n.DomUtil.addClass(t,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(t,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(t,"leaflet-fade-anim");var e=n.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(t.markerPane,e),n.DomUtil.addClass(t.shadowPane,e),n.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return n.DomUtil.create("div",t,e||this._panes.objectsPane)},_initLayers:function(t){t=t?n.Util.isArray(t)?t:[t]:[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawPanBy:function(t){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_updateZoomLevels:function(){var t,e=1/0,n=-1/0;for(t in this._zoomBoundLayers)if(this._zoomBoundLayers.hasOwnProperty(t)){var o=this._zoomBoundLayers[t];isNaN(o.options.minZoom)||(e=Math.min(e,o.options.minZoom)),isNaN(o.options.maxZoom)||(n=Math.max(n,o.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e)},_initEvents:function(){if(n.DomEvent){n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.DomEvent.on(this._container,o[e],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(t,"resize",this._onResize,this)}},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&n.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),o=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(o);this.fire(e,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.bind(this._clearTileBg,this),500))},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),n.map=function(t,e){return new n.Map(t,e)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(t){var e=n.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=o*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var _=Math.tan(.5*(.5*Math.PI-h))/c;return h=-a*Math.log(_),new n.Point(r,h)},unproject:function(t){for(var e,i=n.LatLng.RAD_TO_DEG,o=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/o,r=s/o,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/s),u=Math.PI/2-2*Math.atan(l),c=15,_=1e-7,d=c,p=.1;Math.abs(p)>_&&--d>0;)e=h*Math.sin(u),p=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=p;return new n.LatLng(u*i,a)}},n.CRS.EPSG3395=n.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var t=n.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new n.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(t,e){e=n.setOptions(this,e),e.detectRetina&&n.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._initContainer(),this._createTileProto(),t.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){n.DomUtil.setOpacity(this._container,this.options.opacity);var t,e=this._tiles;if(n.Browser.webkit)for(t in e)e.hasOwnProperty(t)&&(e[t].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var t=this._map._panes.tilePane;(!this._container||t.empty)&&(this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),t.appendChild(this._container),1>this.options.opacity&&this._updateOpacity())},_resetCallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasOwnProperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),t&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||this.options.minZoom>e)){var o=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),s=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),a=new n.Bounds(o,s);this._addTilesFromCenterOut(a),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(a)}}},_addTilesFromCenterOut:function(t){var i,o,s,a=[],r=t.getCenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.Point(o,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,o=0;h>o;o++)this._addTile(a[o],l);this._container.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousWorld){var e=this._getWrapTileNum();if(this.options.noWrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasOwnProperty(o)&&(e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removeTile(o))},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(n.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._container&&this._container.removeChild(e),n.Browser.android||(e.src=n.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),o=this._getTile();n.DomUtil.setPosition(o,i,n.Browser.chrome||n.Browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadTile(o,t),o.parentNode!==this._container&&e.appendChild(o) +},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return this._adjustTilePoint(t),n.Util.template(this._url,n.extend({s:this._getSubdomain(t),z:this._getZoomForUrl(),x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1)},_getSubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=n.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),n.tileLayer=function(t,e){return new n.TileLayer(t,e)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultWmsParams);i.width=i.height=e.detectRetina&&n.Browser.retina?2*this.options.tileSize:this.options.tileSize;for(var o in e)this.options.hasOwnProperty(o)||(i[o]=e[o]);this.wmsParams=i,n.setOptions(this,e)},onAdd:function(t){var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=t.options.crs.code,n.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){this._adjustTilePoint(t);var i=this._map,o=i.options.crs,s=this.options.tileSize,a=t.multiplyBy(s),r=a.add(new n.Point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(t)});return c+n.Util.getParamString(this.wmsParams,c)+"&bbox="+u},setParams:function(t,e){return n.extend(this.wmsParams,t),e||this.redraw(),this}}),n.tileLayer.wms=function(t,e){return new n.TileLayer.WMS(t,e)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(t){n.setOptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=n.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),n.tileLayer.canvas=function(t){return new n.TileLayer.Canvas(t)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latLngBounds(e),n.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&n.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,o=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/o)));i.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);n.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(t,e,i){return new n.ImageOverlay(t,e,i)},n.Icon=n.Class.extend({options:{className:""},initialize:function(t){n.setOptions(this,t)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(t){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(e);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,o=this.options,s=n.point(o[e+"Size"]);i="shadow"===e?n.point(o.shadowAnchor||o.iconAnchor):n.point(o.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+o.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t){var i;return n.Browser.ie6?(i=e.createElement("div"),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i=e.createElement("img"),i.src=t),i},_getIconUrl:function(t){return n.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),n.icon=function(t){return new n.Icon(t)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(12,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];n.Browser.retina&&"icon"===t&&(t+="@2x");var i=n.Icon.Default.imagePath;if(!i)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),n.Icon.Default.imagePath=function(){var t,i,n,o,s=e.getElementsByTagName("script"),a=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=s.length;i>t;t++)if(n=s[t].src,o=n.match(a))return n.split(a)[0]+"/images"}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){n.setOptions(this,e),this._latlng=n.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._removeIcon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=n.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this._map&&this._removeIcon(),this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createIcon(),t.title&&(this._icon.title=t.title),this._initInteraction(),s=1>this.options.opacity,n.DomUtil.addClass(this._icon,o),t.riseOnHover&&n.DomEvent.on(this._icon,"mouseover",this._bringToFront,this).on(this._icon,"mouseout",this._resetZIndex,this)),this._shadow||(this._shadow=t.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateOpacity();var a=this._map._panes;a.markerPane.appendChild(this._icon),this._shadow&&a.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var t=this._map._panes;this.options.riseOnHover&&n.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),t.markerPane.removeChild(this._icon),this._shadow&&t.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(t){n.DomUtil.setPosition(this._icon,t),this._shadow&&n.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.DomUtil.addClass(t,"leaflet-clickable"),n.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)n.DomEvent.on(t,e[i],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&n.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&n.DomEvent.preventDefault(t),"mousedown"!==t.type&&n.DomEvent.stopPropagation(t)},setOpacity:function(t){this.options.opacity=t,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),n.marker=function(t,e){return new n.Marker(t,e)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var t=e.createElement("div"),i=this.options;return i.html&&(t.innerHTML=i.html),i.bgPos&&(t.style.backgroundPosition=-i.bgPos.x+"px "+-i.bgPos.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}),n.divIcon=function(t){return new n.DivIcon(t)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:"",zoomAnimation:!0},initialize:function(t,e){n.setOptions(this,t),this._source=e,this._animated=n.Browser.any3d&&this.options.zoomAnimation},onAdd:function(t){this._map=t,this._container||this._initLayout(),this._updateContent();var e=t.options.fadeAnimation;e&&n.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on("viewreset",this._updatePosition,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),t.options.closePopupOnClick&&t.on("preclick",this._close,this),this._update(),e&&n.DomUtil.setOpacity(this._container,1)},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),t.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),t.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(t){return this._latlng=n.latLng(t),this._update(),this},setContent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=n.DomUtil.create("a",e+"-close-button",o),t.href="#close",t.innerHTML="×",n.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",o);n.DomEvent.disableClickPropagation(s),this._contentNode=n.DomUtil.create("div",e+"-content",s),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",o),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.DomUtil.addClass(t,a)):n.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);n.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,o=new n.Point(this._containerLeft,-e-this._containerBottom);this._animated&&o._add(n.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(o),a=this.options.autoPanPadding,r=t.getSize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panBy(new n.Point(h,l))}},_onCloseButtonClick:function(t){this._close(),n.DomEvent.stop(t)}}),n.popup=function(t,e){return new n.Popup(t,e)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(t,e){var i=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return i=i.add(n.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openPopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popup=new n.Popup(e,this).setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),n.Map.include({openPopup:function(t){return this.closePopup(),this._popup=t,this.addLayer(t).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removeLayer(t),this},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasOwnProperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)this._layers.hasOwnProperty(i)&&t.call(e,this._layers[i])},setZIndex:function(t){return this.invoke("setZIndex",t)}}),n.layerGroup=function(t){return new n.LayerGroup(t)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu"},addLayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t.off(n.FeatureGroup.EVENTS,this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new n.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof n.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer=t.target,t.target=this,this.fire(t.type,t)}}),n.featureGroup=function(t){return new n.FeatureGroup(t)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){n.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return n.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var t=n.Path.CLIP_PADDING,e=this.getSize(),i=n.DomUtil.getPosition(this._mapPane),o=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=o.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new n.Bounds(o,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!(!e.createElementNS||!e.createElementNS(n.Path.SVG_NS,"svg").createSVGRect),n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(n.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),o=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(o);this.fire(t.type,{latlng:s,layerPoint:o,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&n.DomEvent.preventDefault(t),"mousemove"!==t.type&&n.DomEvent.stopPropagation(t)}}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;n.Browser.mobileWebkit&&r.removeChild(a),n.DomUtil.setPosition(a,e),a.setAttribute("width",o),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,o,s].join(" ")),n.Browser.mobileWebkit&&r.appendChild(a)}}}),n.Path.include({bindPopup:function(t,e){return(!this._popup||e)&&(this._popup=new n.Popup(e,this)),this._popup.setContent(t),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=!n.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");n.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/ *, */g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),n.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return n.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&this._map.off("click",this._onClick,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!n.Path._updateRequest&&(n.Path._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){n.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,o,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",{latlng:t.latlng,layerPoint:t.layerPoint,containerPoint:t.containerPoint,originalEvent:t})}}),n.Map.include(n.Path.SVG&&!t.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),o=this._pathRoot;n.DomUtil.setPosition(o,e),o.width=i.x,o.height=i.y,o.getContext("2d").translate(-e.x,-e.y)}}}),n.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.Point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.Point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.Point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.Point(h.x,t.y+r*(h.x-t.x)/a):i},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.Point(a,r)}},n.Polyline=n.Path.extend({initialize:function(t,e){n.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(n.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u]; +var _=n.LineUtil._sqClosestPointOnSegment(t,e,i,!0);o>_&&(o=_,a=n.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(o)),a},getBounds:function(){var t,e,i=new n.LatLngBounds,o=this.getLatLngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertLatLngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.Util.isArray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latLng(t[e])}return t},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=n.Path.VML,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,o,s=this._originalPoints,a=s.length;if(this.options.noClip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathViewport,l=n.LineUtil;for(t=0,e=0;a-1>t;t++)o=l.clipSegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=n.LineUtil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this))}}),n.polyline=function(t,e){return new n.Polyline(t,e)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(t,e){var i,o,s,a,r,h,l,u,c,_=[1,4,2,8],d=n.LineUtil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getBitCode(t[o],e);for(a=0;4>a;a++){for(u=_[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)):(h._code&u&&(c=d._getEdgeIntersection(h,r,u,e),c._code=d._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(t,e){n.Polyline.prototype.initialize.call(this,t,e),t&&n.Util.isArray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1))},projectLatlngs:function(){if(n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=n.Polyline.prototype._getPathPartStr.call(this,t);return e+(n.Browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.Polygon(t,e)},function(){function t(t){return n.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}n.MultiPolyline=t(n.Polyline),n.MultiPolygon=t(n.Polygon),n.multiPolyline=function(t,e){return new n.MultiPolyline(t,e)},n.multiPolygon=function(t,e){return new n.MultiPolygon(t,e)}}(),n.Rectangle=n.Polygon.extend({initialize:function(t,e){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=n.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),n.rectangle=function(t,e){return new n.Rectangle(t,e)},n.Circle=n.Path.extend({initialize:function(t,e,i){n.Path.prototype.initialize.call(this,i),this._latlng=n.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=n.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=new n.LatLng(this._latlng.lat,this._latlng.lng-t),i=this._map.latLngToLayerPoint(e);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-i.x),1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng,o=new n.LatLng(i.lat-e,i.lng-t),s=new n.LatLng(i.lat+e,i.lng+t);return new n.LatLngBounds(o,s)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.LineUtil.pointToSegmentDistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(t,e){n.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o=n.Util.isArray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.addData(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.GeoJSON.geometryToLayer(t,s.pointToLayer);return a.feature=t,a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(n.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),n.extend(n.GeoJSON,{geometryToLayer:function(t,e){var i,o,s,a,r,h="Feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"Point":return i=this.coordsToLatLng(l),e?e(t,i):new n.Marker(i);case"MultiPoint":for(s=0,a=l.length;a>s;s++)i=this.coordsToLatLng(l[s]),r=e?e(t,i):new n.Marker(i),u.push(r);return new n.FeatureGroup(u);case"LineString":return o=this.coordsToLatLngs(l),new n.Polyline(o);case"Polygon":return o=this.coordsToLatLngs(l,1),new n.Polygon(o);case"MultiLineString":return o=this.coordsToLatLngs(l,1),new n.MultiPolyline(o);case"MultiPolygon":return o=this.coordsToLatLngs(l,2),new n.MultiPolygon(o);case"GeometryCollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometryToLayer({geometry:h.geometries[s],type:"Feature",properties:t.properties},e),u.push(r);return new n.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t,e){var i=parseFloat(t[e?0:1]),o=parseFloat(t[e?1:0]);return new n.LatLng(i,o)},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):this.coordsToLatLng(t[o],i),a.push(n);return a}}),n.geoJson=function(t,e){return new n.GeoJSON(t,e)},n.DomEvent={addListener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.DomEvent._getEvent())},n.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,a,l):(n.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,a,l),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",a,!1),t.addEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.DomEvent._checkMouse(t,e)?r(e):i},t.addEventListener(h,a,!1)):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[u]=a,this))},removeListener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,o):n.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,o):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=n.DomEvent.stopPropagation,i=n.Draggable.START.length-1;i>=0;i--)n.DomEvent.addListener(t,n.Draggable.START[i],e);return n.DomEvent.addListener(t,"click",e).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return n.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var o=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+o.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+o.scrollTop+s.scrollTop,h=new n.Point(a,r);return i?h._subtract(n.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"},TAP_TOLERANCE:15},initialize:function(t,e,i){this._element=t,this._dragStartTarget=e||t,this._longPress=i&&!n.Browser.msTouch},enable:function(){if(!this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.on(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.Draggable.START.length-1;t>=0;t--)n.DomEvent.off(this._dragStartTarget,n.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!(!n.Browser.touch&&t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t),n.Draggable._disabled))){if(this._simulateClick=!0,t.touches&&t.touches.length>1)return this._simulateClick=!1,clearTimeout(this._longPressTimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.Browser.touch&&"a"===s.tagName.toLowerCase()&&n.DomUtil.addClass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new n.Point(o.clientX,o.clientY),this._startPos=this._newPos=n.DomUtil.getPosition(this._element),t.touches&&1===t.touches.length&&n.Browser.touch&&this._longPress&&(this._longPressTimeout=setTimeout(n.bind(function(){var t=this._newPos&&this._newPos.distanceTo(this._startPos)||0;n.Draggable.TAP_TOLERANCE>t&&(this._simulateClick=!1,this._onUp(),this._simulateEvent("contextmenu",o))},this),1e3)),n.DomEvent.on(e,n.Draggable.MOVE[t.type],this._onMove,this),n.DomEvent.on(e,n.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.Point(e.clientX,e.clientY),o=i.subtract(this._startPoint);(o.x||o.y)&&(n.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=n.DomUtil.getPosition(this._element).subtract(o),n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(o),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){var i;if(clearTimeout(this._longPressTimeout),this._simulateClick&&t.changedTouches){var o=t.changedTouches[0],s=o.target,a=this._newPos&&this._newPos.distanceTo(this._startPos)||0;"a"===s.tagName.toLowerCase()&&n.DomUtil.removeClass(s,"leaflet-active"),n.Draggable.TAP_TOLERANCE>a&&(i=o)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor());for(var r in n.Draggable.MOVE)n.Draggable.MOVE.hasOwnProperty(r)&&(n.DomEvent.off(e,n.Draggable.MOVE[r],this._onMove),n.DomEvent.off(e,n.Draggable.END[r],this._onUp));this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateEvent("click",i))},_setMovingCursor:function(){n.DomUtil.addClass(e.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(e.body,"leaflet-dragging")},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),n.Handler=n.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:n.Browser.touch?32:18,easeLinearity:.25,longPress:!0,worldCopyJump:!1}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.Draggable(t._mapPane,t._container,t.options.longPress),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(o)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo(new n.Point(0,0)),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),_=u/(e.inertiaDeceleration*r),d=c.multiplyBy(-_/2).round();n.Util.requestAnimFrame(function(){t.panBy(d,_,r)})}t.fire("dragend"),e.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,t,!0,t._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setView(t.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!0}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(t){var e=n.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n.bind(this._performZoom,this),i),n.DomEvent.preventDefault(t),n.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();if(e=e>0?Math.ceil(e):Math.round(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e){var n=i+e,o=this._getCenterForScrollWheelZoom(n);t.setView(o,n)}},_getCenterForScrollWheelZoom:function(t){var e=this._map,i=e.getZoomScale(t),n=e.getSize()._divideBy(2),o=this._lastMousePos._subtract(n)._multiplyBy(1-1/i),s=e._getTopLeftPoint()._add(n)._add(o);return e.unproject(s)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.extend(n.DomEvent,{_touchstart:n.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:n.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,o){function s(t){var e;if(n.Browser.msTouch?(p.push(t.pointerId),e=p.length):e=t.touches.length,!(e>1)){var i=Date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.Browser.msTouch){var e=p.indexOf(t.pointerId);if(-1===e)return;p.splice(e,1)}if(l){if(n.Browser.msTouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",_=this._touchstart,d=this._touchend,p=[];t[c+_+o]=s,t[c+d+o]=a;var m=n.Browser.msTouch?e.documentElement:t;return t.addEventListener(_,s,!1),m.addEventListener(d,a,!1),n.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var o="_leaflet_";return t.removeEventListener(this._touchstart,t[o+this._touchstart+i],!1),(n.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[o+this._touchend+i],!1),n.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[o+this._touchend+i],!1),this}}),n.extend(n.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addEventListener("MSPointerDown",r,!1),!this._msDocumentListener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener("MSPointerUp",h,!1),e.documentElement.addEventListener("MSPointerCancel",h,!1),this._msDocumentListener=!0}return this},addMsTouchListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._msTouches;return t[s+"touchmove"+n]=o,t.addEventListener("MSPointerMove",o,!1),this},addMsTouchListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._msTouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener("MSPointerUp",a,!1),t.addEventListener("MSPointerCancel",a,!1),this},removeMsTouchListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener("MSPointerDown",o,!1);break;case"touchmove":t.removeEventListener("MSPointerMove",o,!1);break;case"touchend":t.removeEventListener("MSPointerUp",o,!1),t.removeEventListener("MSPointerCancel",o,!1)}return this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var o=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=o.add(s)._divideBy(2),this._startDist=o.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),n.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseEventToLayerPoint(t.touches[0]),o=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(o)/this._startDist,this._delta=i._add(o)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(this._moved||(n.DomUtil.addClass(e._mapPane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e);t.fire("zoomanim",{center:i,zoom:t.getScaleZoom(this._scale)}),t._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),o=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runAnimation(o,h,t.getZoomScale(h)/this._scale,i,!0)}},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).preventDefault(t),this._map.fire("boxzoomstart"),i)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,o=this._map.mouseEventToLayerPoint(t),s=o.subtract(e),a=new n.Point(Math.min(o.x,e.x),Math.min(o.y,e.y));n.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_onMouseUp:function(t){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp);var i=this._map,o=i.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(o)){var s=new n.LatLngBounds(i.layerPointToLatLng(this._startLayerPoint),i.layerPointToLatLng(o));i.fitBounds(s),i.fire("boxzoomend",{boxZoomBounds:s})}}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),n.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;n.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){n.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(this._panKeys.hasOwnProperty(e))i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds);else{if(!this._zoomKeys.hasOwnProperty(e))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}n.DomEvent.stop(t)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.Draggable(t,t).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=n.DomUtil.getPosition(t._icon),o=t._map.layerPointToLatLng(i);e&&n.DomUtil.setPosition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Handler.PolyEdit=n.Handler.extend({options:{icon:new n.DivIcon({iconSize:new n.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,n.setOptions(this,e)},addHooks:function(){this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){this._poly._map&&(this._poly._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new n.LayerGroup),this._markers=[];var t,e,i,o,s=this._poly._latlngs;for(t=0,i=s.length;i>t;t++)o=this._createMarker(s[t],t),o.on("click",this._onMarkerClick,this),this._markers.push(o);var a,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||n.Polygon&&this._poly instanceof n.Polygon)&&(a=this._markers[e],r=this._markers[t],this._createMiddleMarker(a,r),this._updatePrevNext(a,r))},_createMarker:function(t,e){var i=new n.Marker(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on("drag",this._onMarkerDrag,this),i.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(i),i},_fireEdit:function(){this._poly.fire("edit")},_onMarkerDrag:function(t){var e=t.target;n.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next)),this._poly.redraw()},_onMarkerClick:function(t){if(!(3>this._poly._latlngs.length)){var e=t.target,i=e._index;this._markerGroup.removeLayer(e),this._markers.splice(i,1),this._poly.spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(e._prev,e._next),e._middleLeft&&this._markerGroup.removeLayer(e._middleLeft),e._middleRight&&this._markerGroup.removeLayer(e._middleRight),e._prev&&e._next?this._createMiddleMarker(e._prev,e._next):e._prev?e._next||(e._prev._middleRight=null):e._next._middleLeft=null,this._poly.fire("edit")}},_updateIndexes:function(t,e){this._markerGroup.eachLayer(function(i){i._index>t&&(i._index+=e)})},_createMiddleMarker:function(t,e){var i,n,o,s=this._getMiddleLatLng(t,e),a=this._createMarker(s);a.setOpacity(.6),t._middleRight=e._middleLeft=a,n=function(){var n=e._index;a._index=n,a.off("click",i).on("click",this._onMarkerClick,this),s.lat=a.getLatLng().lat,s.lng=a.getLatLng().lng,this._poly.spliceLatLngs(n,0,s),this._markers.splice(n,0,a),a.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,a),this._updatePrevNext(a,e)},o=function(){a.off("dragstart",n,this),a.off("dragend",o,this),this._createMiddleMarker(t,a),this._createMiddleMarker(a,e)},i=function(){n.call(this),o.call(this),this._poly.fire("edit")},a.on("click",i,this).on("dragstart",n,this).on("dragend",o,this),this._markerGroup.addLayer(a)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,n=i.latLngToLayerPoint(t.getLatLng()),o=i.latLngToLayerPoint(e.getLatLng());return i.layerPointToLatLng(n._add(o)._divideBy(2))}}),n.Polyline.addInitHook(function(){n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(t){n.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this +},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return n.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),n.control=function(t){return new n.Control(t)},n.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.DomUtil.create("div",a,o)}var e=this._controlCorners={},i="leaflet-",o=this._controlContainer=n.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i="leaflet-bar",o=i+"-part",s=n.DomUtil.create("div",e+" "+i);return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in "+o+" "+o+"-top",s,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out "+o+" "+o+"-bottom",s,this._zoomOut,this),t.on("zoomend",this._updateDisabled,this),s},onRemove:function(t){t.off("zoomend",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,o,s,a){var r=n.DomUtil.create("a",i,o);r.innerHTML=t,r.href="#",r.title=e;var h=n.DomEvent.stopPropagation;return n.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-control-zoom-disabled";n.DomUtil.removeClass(this._zoomInButton,e),n.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&n.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&n.DomUtil.addClass(this._zoomInButton,e)}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(t){return new n.Control.Zoom(t)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by Leaflet'},initialize:function(t){n.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeAttribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasOwnProperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" — ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(t){return new n.Control.Attribution(t)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=n.DomUtil.create("div",e),o=this.options;return this._addScales(o,e,i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=n.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=n.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.Control.Scale(t)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){n.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var o in t)t.hasOwnProperty(o)&&this._addLayer(t[o],o);for(o in e)e.hasOwnProperty(o)&&this._addLayer(e[o],o,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=n.DomUtil.create("div",t);n.Browser.touch?n.DomEvent.on(e,"click",n.DomEvent.stopPropagation):(n.DomEvent.disableClickPropagation(e),n.DomEvent.on(e,"mousewheel",n.DomEvent.stopPropagation));var i=this._form=n.DomUtil.create("form",t+"-list");if(this.options.collapsed){n.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layersLink=n.DomUtil.create("a",t+"-toggle",e);o.href="#",o.title="Layers",n.Browser.touch?n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",this._expand,this):n.DomEvent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",t+"-base",i),this._separator=n.DomUtil.create("div",t+"-separator",i),this._overlaysList=n.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasOwnProperty(i)){var n=this._layers[i];this._addItem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onLayerChange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingClick&&this._update()},_createRadioElement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?(this._map.addLayer(i.layer),i.overlay||(n=i.layer)):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);n&&(this._map.setZoom(this._map.getZoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingClick=!1},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.Control.Layers(t,e,i)},n.PosAnimation=n.Class.extend({includes:n.Mixin.Events,run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this.fire("start"),t.style[n.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.DomEvent.on(t,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),n.DomUtil.setPosition(t,e),n.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inProgress&&(n.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),n.Util.falseFn(this._el.offsetWidth))},_transformRe:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getPos:function(){var e,i,o,s=this._el,a=t.getComputedStyle(s);return n.Browser.any3d?(o=a[n.DomUtil.TRANSFORM].match(this._transformRe),e=parseFloat(o[1]),i=parseFloat(o[2])):(e=parseFloat(a.left),i=parseFloat(a.top)),new n.Point(e,i,!0)},_onTransitionEnd:function(){n.DomEvent.off(this._el,n.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[n.DomUtil.TRANSITION]="",clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),n.Map.include({setView:function(t,e,i){e=this._limitZoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._panAnim&&this._panAnim.stop();var o=n?this._zoomToIfClose&&this._zoomToIfClose(t,e):this._panByIfClose(t);if(o)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e,i){if(t=n.point(t),!t.x&&!t.y)return this;this._panAnim||(this._panAnim=new n.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var o=n.DomUtil.getPosition(this._mapPane).subtract(t)._round();return this._panAnim.run(this._mapPane,o,e||.25,i),this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(t){var e=this._getCenterOffset(t)._floor();return this._offsetIsWithinView(e)?(this.panBy(e),!0):!1},_offsetIsWithinView:function(t,e){var i=e||1,n=this.getSize();return Math.abs(t.x)<=n.x*i&&Math.abs(t.y)<=n.y*i}}),n.PosAnimation=n.DomUtil.TRANSITION?n.PosAnimation:n.PosAnimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=n.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=n.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));n.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){n.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(t,e){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);if(!this._offsetIsWithinView(o,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getCenterLayerPoint().add(o);return this._prepareTileBg(),this._runAnimation(t,e,i,s),!0},_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(t,e,i,o,s){this._animateToCenter=t,this._animateToZoom=e,this._animatingZoom=!0,n.Draggable&&(n.Draggable._disabled=!0);var a=n.DomUtil.TRANSFORM,r=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(r.offsetWidth);var h=n.DomUtil.getScaleString(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_prepareTileBg:function(){var t=this._tilePane,e=this._tileBg;if(e&&this._getLoadedTilesPercentage(e)>.5&&.5>this._getLoadedTilesPercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stopLoadingImages(t),i;e||(e=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),e.style.zIndex=1),e.style[n.DomUtil.TRANSFORM]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilePane=this._panes.tilePane=e;var o=this._tileBg=t;n.DomUtil.addClass(o,"leaflet-zoom-animated"),this._stopLoadingImages(o)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,o,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.Util.falseFn,o.onerror=n.Util.falseFn,o.src=n.Util.emptyImageUrl,o.parentNode.removeChild(o))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),n.Util.falseFn(this._tileBg.offsetWidth),this._animatingZoom=!1,this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.Draggable&&(n.Draggable._disabled=!1)},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){this._animatingZoom||this.touchZoom._zooming||(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locationOptions=n.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n.bind(this._handleGeolocationResponse,this),i=n.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.LatLng(o,s),r=new n.LatLng(o-e,s-i),h=new n.LatLng(o+e,s+i),l=new n.LatLngBounds(r,h),u=this._locationOptions;if(u.setView){var c=Math.min(this.getBoundsZoom(l),u.maxZoom);this.setView(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document); \ No newline at end of file From e07330e4d11a20224e1e3b6fda1b7f184a2bbfc4 Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Wed, 20 Feb 2013 15:12:42 +1300 Subject: [PATCH 359/816] Bring in the master version of Leaflet for this page. + fix typo --- _posts/2013-02-20-guest-post-draw.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/_posts/2013-02-20-guest-post-draw.md b/_posts/2013-02-20-guest-post-draw.md index a8729c4be20..072b619b0d3 100644 --- a/_posts/2013-02-20-guest-post-draw.md +++ b/_posts/2013-02-20-guest-post-draw.md @@ -23,7 +23,7 @@ Leaflet.draw is designed to not only be easy for end users to use, but also for * Draw shapes on your map with easy to use drawing tools. * Edit and delete vectors and markers. - * Super ccustomizable: + * Super customizable: * Customize the styles of each shape to fit in with your maps theme. * Pick and choose the which tools you want to use. * Roll your own by simply using the drawing and editing handlers. @@ -89,11 +89,16 @@ The Leaflet developer community have been great in supporting this plugin throug I've had a great time implementing this plugin. I hope you enjoy using it. If you have a question or just want to say hi, send me an email at jacob.toye@gmail.com. -Cheers, +Cheers, Jacob Toye + - + + + + \ No newline at end of file + diff --git a/index.md b/index.md index 75f62902be1..8bef6b402b2 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- -

      January 17, 2013 — Leaflet 0.5 Released — Read More in the Blog

      + Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. From e46de94873b65951673b7b99734329d8f975f77a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 20 Feb 2013 19:19:16 +0200 Subject: [PATCH 363/816] add link to Leaflet.draw at the top --- _posts/2013-02-20-guest-post-draw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-02-20-guest-post-draw.md b/_posts/2013-02-20-guest-post-draw.md index 886edea015c..0797fac266e 100644 --- a/_posts/2013-02-20-guest-post-draw.md +++ b/_posts/2013-02-20-guest-post-draw.md @@ -8,7 +8,7 @@ authorsite: https://github.com/jacobtoye/ _This is a guest post from Jacob Toye, an active Leaflet contributor and also the author of the most sophisticated vector drawing and editing plugin out there, which is presented in this post._ -Leaflet.draw was born from the need to provide users with the ability draw polygons on the map. Leaflet already provided a very nice way of editing existing polylines and polygons. The logical next step was to expand on this functionality to allow the creation of these layers, and ultimately the other vector layers. +[Leaflet.draw](https://github.com/Leaflet/Leaflet.draw/) was born from the need to provide users with the ability draw polygons on the map. Leaflet already provided a very nice way of editing existing polylines and polygons. The logical next step was to expand on this functionality to allow the creation of these layers, and ultimately the other vector layers. Upon release the immediate response from the Leaflet community was very positive. It became clear that the next step would be progressing this tool to a state where users could edit and delete shapes in addition to creating them. This is ultimately what Leaflet.draw 0.2 set out to do. From fa26e62a12645461fbef65eccab9f3211909a087 Mon Sep 17 00:00:00 2001 From: Louis Galipeau Date: Fri, 22 Feb 2013 10:11:56 -0400 Subject: [PATCH 364/816] Added alternative heatmap layer plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 2531a83d871..27996c7a50c 100644 --- a/plugins.md +++ b/plugins.md @@ -80,6 +80,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Sun Ning + + + heatmap.js + + JavaScript Library for HTML5 canvas based heatmaps + + Patrick Wied + + Leaflet.MultiTileLayer From 31b6d0b81ae8a8f75bcc613e688dba6d3735c293 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Sat, 23 Feb 2013 16:46:52 -0500 Subject: [PATCH 365/816] fixed link --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 27996c7a50c..bc3a420f381 100644 --- a/plugins.md +++ b/plugins.md @@ -210,7 +210,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - leaflet-providers + leaflet-providers Contains configurations for various free tile providers — OSM, OpenCycleMap, MapQuest, Mapbox Streets, Stamen, Esri, etc. From 173a5bf00cdea3e542682a6abe818455de5d6220 Mon Sep 17 00:00:00 2001 From: Maxime Hadjinlian Date: Mon, 25 Feb 2013 21:22:08 +0100 Subject: [PATCH 366/816] Add leaflet.bouncemarker to plugins page leaflet.bouncemarker make a marker bounce when its added to a map. Signed-off-by: Maxime Hadjinlian --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index bc3a420f381..f3987f907bd 100644 --- a/plugins.md +++ b/plugins.md @@ -152,6 +152,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Calvin Metcalf + + + Leaflet.BounceMarker + + Make a marker bounce when you add it to a map. + + Maxime Hadjinlian + + From 42904288c9aa055aca8fc6bb3e975aaa1750a841 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 26 Feb 2013 18:41:59 +0200 Subject: [PATCH 367/816] add package.json for publishing on npm --- package.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 00000000000..97851c72166 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "leaflet", + "version": "0.5.1", + "description": "JavaScript library for mobile-friendly interactive maps", + "dependencies": { + "jshint": "~0.9.1", + "uglify-js": "~2.2.3", + "jake": "latest" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/Leaflet/Leaflet.git" + }, + "keywords": ["gis", "map"] +} From 938e8833ef50f93c70670421dc5cef1e5b1b0bb0 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 1 Mar 2013 14:20:24 -0500 Subject: [PATCH 368/816] Auto-link h2s with ids in documentation. --- _layouts/default.html | 12 +++++++ docs/css/screen.css | 21 ++++++++++++ docs/images/sprite.png | Bin 0 -> 2018 bytes docs/images/sprite.svg | 75 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 docs/images/sprite.png create mode 100644 docs/images/sprite.svg diff --git a/_layouts/default.html b/_layouts/default.html index f1fc5cbd940..1f28492dcda 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -167,6 +167,18 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv } })(); + (function () { + var headers = document.getElementsByTagName('h2'); + + for (var i = 0, len = headers.length; i < len; i++) { + if (headers[i].id) { + headers[i].onclick = function() { + window.location.hash = '#' + this.id; + }; + } + } + })(); + hljs.initHighlighting(); diff --git a/docs/css/screen.css b/docs/css/screen.css index 50b6f280849..4dc277ae8fa 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -76,7 +76,28 @@ h2 { -webkit-border-radius: 5px; text-shadow: 0 -1px 1px rgba(0,0,0,0.35); + + cursor: pointer; + } + +h2[id]:before { + content:'Permalink'; + display:inline-block; + margin:0px 5px 0px -35px; + width:30px; + height:20px; + line-height:20px; + vertical-align:baseline; + background:url(../images/sprite.png) -0px -0px no-repeat; + opacity:0.2; + border-radius:50%; + text-indent:-9999px; + border-radius:50%; + overflow:hidden; } + +h2[id]:hover:before { opacity:1; } + .api-page h2 { margin-top: 2.5em; } diff --git a/docs/images/sprite.png b/docs/images/sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..bcbb751aad5415c6793f787769768c0e829d402e GIT binary patch literal 2018 zcmeHIiBr=@6kZMmqzXzolq1weLOqCxcyRGz+YcKgY!8H#ZiQOrCn#P-&4-72j<{pin3cnzUUKIW#>j=9h4}++fZd z>g)|97xHwmS%(ofVpm0${1~q*OKKbTRxafrPggA6uii5$PX9)Ng{HCUhx7CED(kyH zf#!#mjFaSiUrtLn(WDfUo^~oJX@(0?ByXAJaU>FZxp})~Mts$nvrXJAI_p4Z(i@AiuC2 zRd++9_2#fP+W|9jO9ly!feVwifJhm;8qD)x%?vd+H&-EpQOPJt=a9}$S&}HbK_H-Z zW*S?b@ZZH($a`LWxHjsky+BAzOnupacxlr)z#J5YdQD@VRum>0goTPvzL+# z@@{V%Xl9MQxcW}dU>zGJk#ZKJ;I&a<1@N1hb=nSQv!!)gAo-wX}G7F}JhoDA?8 zhU(JxNf3u4vhFBpU^b#kI_hN?sHO>dIi-piPKY%5ILNCL2idzoX8hs7^*u%kD(7N{<{5OtI(0dcBP|paDb6F?eGD#}N;ed2BjeWIDsqe^6^{Y4p<8B8V*19rNw!-P za#vby?`> z3Bp4@Z(saSPHMysfX7Sg1;UnVnuZtQEM`>H$jw|!bXqE%{^3&oPzMX+YV}2_C?2~y z(q^(Yv%0pHN$pdplr9}vkKR~|HGMeZa|O-)yb~JDdhFJ8R_1J9QH_VL!)`u&L)(MM z_m2h^Zjx-bf4Ys-niXBj%gg)!5Q*6FJFRS{#E7^GaW@O&WCse#ExBXH z#>RW)iPGaJ91-ER!c3YnRV9n&CpsKxI@=eo8-~Nx@4m867>ASdk@xQ1gH!JH(;8J} zd3iwk?3=9Mpuj+nyLEMQPa}6S+lA&J2WHh#eSq<~j{S>n|B&&2_*c#UZ*!$xwJ4bG U2#RcVhyP;$9SZWP^p5=bPj#3yX#fBK literal 0 HcmV?d00001 diff --git a/docs/images/sprite.svg b/docs/images/sprite.svg new file mode 100644 index 00000000000..847976e6b83 --- /dev/null +++ b/docs/images/sprite.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + From 603fecc6cd26a7e13a61b7219c1410fdc682dca7 Mon Sep 17 00:00:00 2001 From: arthur-e Date: Tue, 5 Mar 2013 18:30:07 -0500 Subject: [PATCH 369/816] Added Wicket to the plug-ins list (plugins.md) --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index f3987f907bd..d5ddf4cce85 100644 --- a/plugins.md +++ b/plugins.md @@ -280,6 +280,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Maxime Petazzoni + + + Wicket + + A modest library for translating between Well-Known Text (WKT) and Leaflet geometry objects (e.g. between L.marker() instances and "POINT()" strings). + + K. Arthur Endsley + + From 79a15d7de27c98cc88a4cdb6f0d6c5365691d712 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 6 Mar 2013 12:14:14 +0100 Subject: [PATCH 370/816] Add Leaflet.TextPath plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index f3987f907bd..66075fbced1 100644 --- a/plugins.md +++ b/plugins.md @@ -161,6 +161,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Maxime Hadjinlian + + + Leaflet.TextPath + + Allows you to draw text along Polylines. + + Mathieu Leplatre + + From 5643fb8a9fc85816ac81657c5eb2ab81691d1f78 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Thu, 7 Mar 2013 10:27:10 +0100 Subject: [PATCH 371/816] Add Leaflet.Spin plugin --- plugins.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins.md b/plugins.md index 2b5427f9259..904e00dbfcd 100644 --- a/plugins.md +++ b/plugins.md @@ -437,6 +437,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Yohan Boniface + + + Leaflet.Spin + + Shows a nice spinner on the map using Spin.js, + for asynchronous data load, like with Leaflet Ajax. + + Mathieu Leplatre + + From badd8742652b18ecd8a9abc5fe6bf48261334d00 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Fri, 8 Mar 2013 10:50:56 +0100 Subject: [PATCH 372/816] Add Leaflet.LayerIndex plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 904e00dbfcd..4d750df6729 100644 --- a/plugins.md +++ b/plugins.md @@ -512,6 +512,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Calvin Metcalf + + + Leaflet.LayerIndex + + An efficient spatial index for features and layers, using RTree.js. + + Mathieu Leplatre + + To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From c128d519b312843f41b9ceee87f670c3bdc6b81b Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Wed, 13 Mar 2013 13:43:33 -0400 Subject: [PATCH 373/816] moved 2 of my plugins to a joint org --- plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index 4d750df6729..fc37d56128d 100644 --- a/plugins.md +++ b/plugins.md @@ -145,7 +145,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet.Sprite + Leaflet.Sprite Use sprite based icons in your markers. @@ -505,7 +505,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet.CSS + Leaflet.CSS Add the main Leaflet CSS files (or any css) from within JavaScript, be gone conditional comments. From 0b60d9de8f6ad0a2bf735de2d24a07e4f00d8afe Mon Sep 17 00:00:00 2001 From: lvoogdt Date: Sat, 16 Mar 2013 01:25:40 +0100 Subject: [PATCH 374/816] Added Awesome-Markers plugin to plugins.md --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index fc37d56128d..5d88b7c40b2 100644 --- a/plugins.md +++ b/plugins.md @@ -170,6 +170,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet.Awesome-Markers + + Colorful & iconic markers based on the Font Awesome icons. + + Lennard Voogdt + + From b0aaf9df82354e1932bb3a93e6800c4dd5842ce2 Mon Sep 17 00:00:00 2001 From: Alexander Parshin Date: Sun, 17 Mar 2013 06:13:59 +0400 Subject: [PATCH 375/816] Misprint in event name --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 2f32b12c70d..6efa00232b0 100644 --- a/reference.html +++ b/reference.html @@ -1614,12 +1614,12 @@

      Events

      tileload - Event + TileEvent Fired when a tile loads. tileunload - Event + TileEvent Fired when a tile is removed (e.g. when you have unloadInvisibleTiles on). From 69b26c0888cc3bd4c87ea9b357667b3a7e6351f2 Mon Sep 17 00:00:00 2001 From: Karsten Hinz Date: Mon, 18 Mar 2013 00:04:15 +0100 Subject: [PATCH 376/816] Added control-osm-geocoder plugin to plugins.md --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5d88b7c40b2..53b4968b8ef 100644 --- a/plugins.md +++ b/plugins.md @@ -400,6 +400,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Stephan Meijer + + + Leaflet Control OSM Geocoder + + A simple geocoder that uses the OpenstreetMap gecoder Nominatim to locate places. + + Karsten Hinz + + leaflet-search From 835d4a57138b5aba479d8895b2ecdbc195968917 Mon Sep 17 00:00:00 2001 From: Scott Fairgrieve Date: Mon, 18 Mar 2013 08:44:50 -0400 Subject: [PATCH 377/816] Added link to the Data Visualization Framework --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5d88b7c40b2..6271fbdab9f 100644 --- a/plugins.md +++ b/plugins.md @@ -179,6 +179,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Lennard Voogdt + + + Leaflet Data Visualization Framework + + New markers, layers, and utility classes for easy thematic mapping and data visualization. + + Scott Fairgrieve + + From 8df44d56ee6239b00be20a25df7b616cf5b90cdd Mon Sep 17 00:00:00 2001 From: Lennard Voogdt Date: Tue, 19 Mar 2013 09:25:39 +0100 Subject: [PATCH 378/816] AwesomeMarkers works with bootstrap and retina displays --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index e5375698921..dd997908678 100644 --- a/plugins.md +++ b/plugins.md @@ -174,7 +174,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.Awesome-Markers - Colorful & iconic markers based on the Font Awesome icons. + Colorful, iconic & retina-proof markers based on the Font Awesome icons/Twitter Bootstrap icons Lennard Voogdt From bd5963ecc6b317fa504cfa82dd7c206a44a8becf Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Tue, 19 Mar 2013 16:57:55 +0100 Subject: [PATCH 379/816] Add Leaflet.RestoreView --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index dd997908678..c4725c6c77e 100644 --- a/plugins.md +++ b/plugins.md @@ -474,6 +474,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet.RestoreView + + Stores and restores map view using localStorage. + + Mathieu Leplatre + + From 350969839d9ae142307b966813426afe89f1188e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 22 Mar 2013 16:25:20 +0200 Subject: [PATCH 380/816] update CloudMade register link --- examples/layers-control.md | 2 +- examples/mobile.md | 2 +- examples/quick-start.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/layers-control.md b/examples/layers-control.md index d5c2eeac1be..aea7892311d 100644 --- a/examples/layers-control.md +++ b/examples/layers-control.md @@ -33,7 +33,7 @@ Leaflet has a nice little control that allows your users control what layers the There are two types of layers --- base layers that are mutually exclusive (only one can be visible on your map), e.g. tile layers, and overlays --- all the other stuff you put over the base layers. In this example, we want to have two base layers (minimal and night-style base map) to switch between, and two overlays to switch on and off --- a pink motorways overlay and city markers (those we created earlier). Lets create those layers and add the default ones to the map: -
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/API-key/{styleId}/256/{z}/{x}/{y}.png',
      +
      var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/API-key/{styleId}/256/{z}/{x}/{y}.png',
       	cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade';
       
       var minimal   = L.tileLayer(cloudmadeUrl, {styleId: 22677, attribution: cloudmadeAttribution}),
      diff --git a/examples/mobile.md b/examples/mobile.md
      index 045be0956ce..b249c2641a1 100644
      --- a/examples/mobile.md
      +++ b/examples/mobile.md
      @@ -32,7 +32,7 @@ We'll now initialize the map in the JavaScript code exactly like we did in the [
       
       
      var map = L.map('map');
       
      -L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
      +L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
       	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
       	maxZoom: 18
       }).addTo(map);
      diff --git a/examples/quick-start.md b/examples/quick-start.md index 02aad6a1b47..bdff33c8704 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -52,9 +52,9 @@ By default (as we didn't pass any options when creating the map instance), all m Note that `setView` call also returns the map object --- most Leaflet methods act like this when they don't return an explicit value, which allows convenient jQuery-like method chaining. -Next we'll add a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at [CloudMade](http://cloudmade.com/register)), the attribution text and the maximum zoom level of the layer: +Next we'll add a tile layer to add to our map, in this case it's a CloudMade tile layer with Fresh style. Creating a tile layer usually involves setting the URL template for the tile images (get yours at [CloudMade](http://account.cloudmade.com/register)), the attribution text and the maximum zoom level of the layer: -
      L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
      +
      L.tileLayer('http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png', {
       	attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
       	maxZoom: 18
       }).addTo(map);
      From b25d89dcf999359e5e16151b2587786d5f4898a1 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 22 Mar 2013 16:25:28 +0200 Subject: [PATCH 381/816] update CloudMade API key --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 1f28492dcda..07db2917e39 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -45,7 +45,7 @@ 'CC-BY-SA, ' + 'Imagery © CloudMade'; - CM_URL = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png'; + CM_URL = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/{styleId}/256/{z}/{x}/{y}.png'; OSM_URL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; OSM_ATTRIB = '© OpenStreetMap contributors'; From 91b02675699bbc205490fdbbd151f619eaf4742b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 28 Mar 2013 12:55:06 -0400 Subject: [PATCH 382/816] Add leaflet-pip --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index c4725c6c77e..3ea4006615b 100644 --- a/plugins.md +++ b/plugins.md @@ -557,6 +557,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet-pip + + Simple point in polygon calculation using point-in-polygon. + + Tom MacWright + + To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From dbb66404cfc6f930e7bf5788253fafa3f2defa9e Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Fri, 29 Mar 2013 14:03:25 +0400 Subject: [PATCH 383/816] TileLayer.Grayscale for plugins.md --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3ea4006615b..ae46897e6cb 100644 --- a/plugins.md +++ b/plugins.md @@ -188,6 +188,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Scott Fairgrieve + + + TileLayer.Grayscale + + A regular TileLayer with grayscale makeover. + + Ilya Zverev + + From c8c76e3a8fbda1871002df58ac99079447e38d7a Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 3 Apr 2013 17:56:02 +0300 Subject: [PATCH 384/816] Add Leaflet.FileLayer plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index ae46897e6cb..aa9129adf41 100644 --- a/plugins.md +++ b/plugins.md @@ -492,6 +492,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet.FileLayer + + Loads files (GeoJSON, GPX, KML) into the map using the HTML5 FileReader API (i.e. locally without server). + + Mathieu Leplatre + + From 5c00606a1da309b19aa44394a7277f2dc5b13656 Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 11 Apr 2013 13:50:05 +0300 Subject: [PATCH 385/816] Fixed typo reference.html You = Use --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index cf2c7eff4c6..1d4df11bebd 100644 --- a/reference.html +++ b/reference.html @@ -1121,7 +1121,7 @@

      Options

      zIndexOffset Number 0 - By default, marker images zIndex is set automatically based on its latitude. You 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). + 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). opacity From 5ba1fd53a889badb50bfb336084eff1c8f170974 Mon Sep 17 00:00:00 2001 From: Glen Robertson Date: Mon, 15 Apr 2013 14:17:50 +1200 Subject: [PATCH 386/816] Added GeoJSON tile layer to plugins. --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index aa9129adf41..528a6d27383 100644 --- a/plugins.md +++ b/plugins.md @@ -197,6 +197,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ilya Zverev + + + TileLayer.GeoJSON + + A TileLayer for GeoJSON tiles (requires JQuery). + + Glen Robertson + + From 8a357ad7f33f8a4630b3e976b1b3abb18f811371 Mon Sep 17 00:00:00 2001 From: Alexander Parshin Date: Tue, 16 Apr 2013 23:37:16 +0400 Subject: [PATCH 387/816] Extend description of L.TileLayer.Canvas --- reference.html | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/reference.html b/reference.html index 1d4df11bebd..15a1774f0ca 100644 --- a/reference.html +++ b/reference.html @@ -1838,6 +1838,22 @@

      Constructor

      +

      Options

      + + + + + + + + + + + + + +
      OptionTypeDefaultDescription
      asyncBooleanfalseIndicates that tiles will be drawn asynchronously. tileDrawn method should be called for each tile after drawing completion.
      +

      Methods

      @@ -1846,7 +1862,7 @@

      Methods

      - + - - - - + + + +
      Returns Description
      drawTile( <HTMLCanvasElement> canvas, <Point> tilePoint, @@ -1855,10 +1871,10 @@

      Methods

      this You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.
      redraw()thisCalling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas
      tileDrawn( <HTMLCanvasElement> canvas )-If async option is defined, this function should be called for each tile after drawing completion. canvas is the same canvas element, that was passed to drawTile.
      From 33b44332fc08b340e9343a9ea1a431f3a6471177 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 23 Apr 2013 12:21:49 +0300 Subject: [PATCH 388/816] make subdomain in url template description clearer, close #1441 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 15a1774f0ca..eee31c26a43 100644 --- a/reference.html +++ b/reference.html @@ -1498,7 +1498,7 @@

      URL template

      'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'
      -

      {s} means one of the randomly chosen subdomains (their range is specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

      +

      {s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, {x} and {y} — tile coordinates.

      You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

      From a2e120285ee6b7ec2d0f6b1eae4aa43a29f67da9 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 23 Apr 2013 12:24:50 +0300 Subject: [PATCH 389/816] disable permalink icon on all h2 headers except on API page --- docs/css/screen.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 4dc277ae8fa..afa4cf71150 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -80,7 +80,7 @@ h2 { cursor: pointer; } -h2[id]:before { +.api-page h2[id]:before { content:'Permalink'; display:inline-block; margin:0px 5px 0px -35px; @@ -96,7 +96,7 @@ h2[id]:before { overflow:hidden; } -h2[id]:hover:before { opacity:1; } +.api-page h2[id]:hover:before { opacity:1; } .api-page h2 { margin-top: 2.5em; From 9245ceeb2214eb36e86f038bff5da69e98136441 Mon Sep 17 00:00:00 2001 From: danzel Date: Mon, 29 Apr 2013 10:24:10 +1200 Subject: [PATCH 390/816] Mention that the baselayerchange event is fired on the map object. Fixes #1625 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index eee31c26a43..dd81658d80e 100644 --- a/reference.html +++ b/reference.html @@ -4003,7 +4003,7 @@

      Layer Config

      Events

      -

      You can subscribe to the following events using these methods.

      +

      You can subscribe to the following events on the map object using these methods.

      From 3608f5c0d9a813f75ef8b5b8c8e50cba33ee0cdc Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Wed, 1 May 2013 12:27:43 +0300 Subject: [PATCH 391/816] Link to actual heatmap.js for Leaflet page Also note that the implementation in heatmap.js supports large datasets. --- plugins.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index 528a6d27383..3434a0c96e0 100644 --- a/plugins.md +++ b/plugins.md @@ -82,9 +82,11 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s From 410bc4b86e56b1270e03fc56748f2ed77c8ac7a1 Mon Sep 17 00:00:00 2001 From: Didji Date: Fri, 3 May 2013 12:44:49 +0300 Subject: [PATCH 392/816] Update reference.html ie7 property's description in Browser section was "true for Internet Explorer 6." instead of "true for Internet Explorer 7." --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index dd81658d80e..2e7b9290ddd 100644 --- a/reference.html +++ b/reference.html @@ -4557,7 +4557,7 @@

      L.Browser

      - + From 2f6bcc358bb056976c5e4f70d14f4e70be6230c6 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Fri, 3 May 2013 12:52:25 +0300 Subject: [PATCH 393/816] Add Leaflet.GeometryUtil plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3434a0c96e0..8a8e82278e1 100644 --- a/plugins.md +++ b/plugins.md @@ -595,6 +595,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Tom MacWright + + +
      - heatmap.js + heatmap.js - JavaScript Library for HTML5 canvas based heatmaps + JavaScript Library for HTML5 canvas based heatmaps. + + Its Leaflet layer implementation supports large datasets because it is tile based and uses a quadtree index to store the data. Patrick Wied
      ie7 Booleantrue for Internet Explorer 6.true for Internet Explorer 7.
      webkit
      + Leaflet.GeometryUtil + + A collection of utilities for Leaflet geometries (linear referencing, etc.) + + Benjamin Becquet, Mathieu Leplatre +
      To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From fc9d767789042b8361802d7129d45ad319c05859 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Fri, 3 May 2013 12:55:35 +0300 Subject: [PATCH 394/816] Add Leaflet.Snap plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3434a0c96e0..e5e75579361 100644 --- a/plugins.md +++ b/plugins.md @@ -512,6 +512,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet.Snap + + Enable snapping between layers. + + Mathieu Leplatre + + From 5e34ca6ea23e88286339e24f0f6f435f928cdd18 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Fri, 3 May 2013 13:04:24 +0300 Subject: [PATCH 395/816] Clearer description of Leaflet.Snap purpose Thanks @mourner! --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index e5e75579361..53e4ed54416 100644 --- a/plugins.md +++ b/plugins.md @@ -516,7 +516,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.Snap - Enable snapping between layers. + Enables snapping of draggable markers to polylines and other layers. Mathieu Leplatre From 7edc17d2facc2a04576e7b8075c11a3f03564dcb Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Fri, 3 May 2013 19:43:12 -0700 Subject: [PATCH 396/816] Fix some typos and link to the locate method --- reference.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference.html b/reference.html index 2e7b9290ddd..4053d5fd5b9 100644 --- a/reference.html +++ b/reference.html @@ -532,12 +532,12 @@

      Events

      locationfound LocationEvent - Fired when geolocation (using locate method) went successfully. + Fired when geolocation (using the locate method) went successfully. locationerror ErrorEvent - Fired when geolocation (using locate method) failed. + Fired when geolocation (using the locate method) failed. popupopen @@ -633,12 +633,12 @@

      Methods for Modifying Map State

      this Restricts the map view to the given bounds (see map maxBounds option). - + locate( <Locate options> options? ) this - Tries to locate the user using Geolocation API, firing locationfound event with location data on success or locationerror event on failure, and optionally sets the map view to the user location with respect to detection accuracy (or to the world view if geolocation failed). See Locate options for more details. + Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). See Locate options for more details. stopLocate() From 9efded6f509932c73ebc85bae56e1df657574447 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Fri, 3 May 2013 19:56:43 -0700 Subject: [PATCH 397/816] Improve documentation for geocoding plugins Will create a separate patch for grouping geocoding plugins together. --- plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins.md b/plugins.md index a2ce04f2f20..506d77073fc 100644 --- a/plugins.md +++ b/plugins.md @@ -423,8 +423,8 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet GeoSearch - Small plugin that brings address searching/lookup (aka geosearching) to Leaflet.
      - Comes with support for Google, Bing, Esri and Openlayers. (easy extendible) + Small geocoding plugin that brings address searching/lookup (aka geosearching) to Leaflet.
      + Comes with support for Google, OpenStreetMap Nominatim, Bing, Esri and Nokia. Eeasily extensible. Stephan Meijer @@ -433,7 +433,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet Control OSM Geocoder - A simple geocoder that uses the OpenstreetMap gecoder Nominatim to locate places. + A simple geocoder that uses OpenstreetMap Nominatim to locate places by address. Karsten Hinz From 5e0a4b59e61ce9e89142ae4a7ae2ec96373f8689 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Sat, 4 May 2013 02:34:41 -0700 Subject: [PATCH 398/816] Proposing grouping geocoding plugins under one heading --- plugins.md | 67 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/plugins.md b/plugins.md index 506d77073fc..dbf7b4d696b 100644 --- a/plugins.md +++ b/plugins.md @@ -282,15 +282,6 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s AZGS - - - Leaflet Control Bing Geocoder - - A simple geocoder control that uses Bing to locate places. - - Samuel Piquet - - Leaflet.encoded @@ -339,6 +330,45 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s +### Geocoding (address lookup, a.k.a. geosearching) + + + + + + + + + + + + + + + + +
      PluginDescriptionMaintainer
      + Leaflet GeoSearch + + Small geocoding plugin that brings address searching/lookup (aka geosearching) to Leaflet.
      + Comes with support for Google, OpenStreetMap Nominatim, Bing, Esri and Nokia. Eeasily extensible. +
      + Stephan Meijer +
      + Leaflet Control OSM Geocoder + + A simple geocoder that uses OpenstreetMap Nominatim to locate places by address. + + Karsten Hinz +
      + Leaflet Control Bing Geocoder + + A simple geocoder control that uses Bing to locate places. + + Samuel Piquet +
      + + ### Controls and Interaction @@ -419,25 +449,6 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bruno B - - - - - - @@ -1076,7 +1075,6 @@

      Constructor

      @@ -1097,7 +1095,7 @@

      Options

      - + @@ -1345,7 +1343,6 @@

      Constructor

      @@ -1484,7 +1481,6 @@

      Constructor

      @@ -1735,7 +1731,6 @@

      Constructor

      @@ -1831,7 +1826,6 @@

      Constructor

      <TileLayer options> options? ) @@ -1906,7 +1900,6 @@

      Constructor

      @@ -2219,7 +2212,6 @@

      Constructor

      @@ -2321,7 +2313,6 @@

      Constructor

      @@ -2352,7 +2343,6 @@

      Constructor

      @@ -2383,7 +2373,6 @@

      Constructor

      @@ -2420,7 +2409,6 @@

      Constructor

      @@ -2471,7 +2459,6 @@

      Constructor

      @@ -2536,7 +2523,6 @@

      Constructor

      @@ -2594,7 +2580,6 @@

      Constructor

      @@ -2678,7 +2663,6 @@

      Constructor

      @@ -2812,7 +2796,6 @@

      Constructor

      @@ -2961,7 +2944,6 @@

      Constructor

      @@ -3092,7 +3074,6 @@

      Constructor

      @@ -3104,7 +3085,6 @@

      Constructor

      <LatLng[]> latlngs ) @@ -3255,7 +3235,6 @@

      Constructor

      @@ -3386,7 +3365,6 @@

      Constructor

      @@ -3399,7 +3377,6 @@

      Constructor

      @@ -3521,7 +3498,6 @@

      Constructor

      @@ -3615,7 +3591,6 @@

      Constructor

      @@ -3677,7 +3652,6 @@

      Constructor

      @@ -3784,7 +3758,6 @@

      Constructor

      @@ -3827,7 +3800,6 @@

      Constructor

      @@ -3918,7 +3890,6 @@

      Constructor

      <Control.Layers options> options? ) @@ -4038,7 +4009,6 @@

      Constructor

      From 3a801666f4de9c5fd82264bebf21a90e26f6fc81 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Tue, 7 May 2013 16:00:56 -0400 Subject: [PATCH 400/816] more consistancy --- reference.html | 440 ++++++++++++++++++++----------------------------- 1 file changed, 175 insertions(+), 265 deletions(-) diff --git a/reference.html b/reference.html index a86d0c5d13f..16553138323 100644 --- a/reference.html +++ b/reference.html @@ -9,7 +9,7 @@

      Map

      @@ -125,7 +125,7 @@

      Misc


      This reference reflects Leaflet 0.5. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

      -

      L.Map

      +

      L.map

      The central class of the API — it is used to create a map on a page and manipulate it.

      @@ -137,24 +137,20 @@

      Usage example

      zoom: 13 }); -

      Constructor

      +

      Creation

      - Leaflet GeoSearch - - Small geocoding plugin that brings address searching/lookup (aka geosearching) to Leaflet.
      - Comes with support for Google, OpenStreetMap Nominatim, Bing, Esri and Nokia. Eeasily extensible. -
      - Stephan Meijer -
      - Leaflet Control OSM Geocoder - - A simple geocoder that uses OpenstreetMap Nominatim to locate places by address. - - Karsten Hinz -
      leaflet-search From 43147f84aa4bc4185d06b6df95fa7840fa8b3b05 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Tue, 7 May 2013 12:44:29 -0400 Subject: [PATCH 399/816] per #1430 no new in documentation --- reference.html | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/reference.html b/reference.html index 4053d5fd5b9..a86d0c5d13f 100644 --- a/reference.html +++ b/reference.html @@ -152,7 +152,6 @@

      Constructor

      - new L.Map()
      L.map()
      - new L.Marker()
      L.marker()
      icon L.Icon *Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default.Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to L.icon.Default() by default.
      clickable - new L.Popup()
      L.popup()
      - new L.TileLayer()
      L.tileLayer()
      - new L.TileLayer.WMS()
      L.tileLayer.wms()
      - new L.TileLayer.Canvas()
      L.tileLayer.canvas()
      Instantiates a Canvas tile layer object given an options object (optionally). - new L.ImageOverlay()
      L.imageOverlay()
      - new L.Polyline()
      L.polyline()
      - new L.MultiPolyline()
      L.multiPolyline()
      - new L.Polygon()
      L.polygon()
      - new L.MultiPolygon()
      L.multiPolygon()
      - new L.Rectangle()
      L.rectangle()
      - new L.Circle()
      L.circle()
      - new L.CircleMarker()
      L.circleMarker()
      - new L.LayerGroup()
      L.layerGroup()
      - new L.FeatureGroup()
      L.featureGroup()
      - new L.GeoJSON()
      L.geoJson()
      - new L.LatLng()
      L.latLng()
      L.latLng([])
      - new L.LatLngBounds()
      L.latLngBounds()
      L.latLngBounds([])
      - new L.LatLngBounds()
      L.latLngBounds()
      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. - new L.Point()
      L.point()
      L.point([])
      - new L.Bounds()
      L.bounds()
      L.bounds([])
      - new L.Bounds()
      L.bounds()
      - new L.Icon()
      L.icon()
      - new L.DivIcon()
      L.divIcon()
      - new L.Control()
      L.control()
      - new L.Control.Zoom()
      L.control.zoom()
      - new L.Control.Attribution()
      L.control.attribution()
      - new L.Control.Layers()
      L.control.layers()
      Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. - new L.Control.Scale()
      L.control.scale()
      - - + - - - +
      ConstructorUsageCreation Description
      L.Map( + L.map( <HTMLElement|String> id, <Map options> options? ) - L.map() - Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
      @@ -1054,30 +1050,26 @@

      Map Panes

      -

      L.Marker

      +

      L.marker

      Used to put markers on the map.

      L.marker([50.5, 30.5]).addTo(map);
      -

      Constructor

      +

      Creation

      - - + + - - -
      ConstructorUsageCreationDescription
      L.Marker( + L.marker( <LatLng> latlng, <Marker options> options? ) - L.marker() - Instantiates a Marker object given a geographical point and optionally an options object.
      @@ -1093,7 +1085,7 @@

      Options

      icon - L.Icon + L.icon * Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to L.icon.Default() by default. @@ -1314,7 +1306,7 @@

      Interaction handlers

      - +

      Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.

      @@ -1328,23 +1320,20 @@

      Usage example

      .setContent('<p>Hello world!<br />This is a nice popup.</p>') .openOn(map);
      -

      Constructor

      +

      Creation

      - - + + - - @@ -1455,7 +1444,7 @@

      Methods

      -

      L.TileLayer

      +

      L.tileLayer

      Used to load and display tile layers on the map, implements ILayer interface.

      @@ -1466,23 +1455,20 @@

      Usage example

      styleId: 997 }).addTo(map); -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Popup( + L.popup( <Popup options> options?, <object> source? ) - L.popup() - Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.
      - - + + - - @@ -1703,7 +1689,7 @@

      Methods

      -

      L.TileLayer.WMS

      +

      L.tileLayer.wms

      Used to display WMS services as tile layers on the map. Extends TileLayer.

      @@ -1716,23 +1702,19 @@

      Usage example

      attribution: "Weather data © 2012 IEM Nexrad" }); -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.TileLayer( + L.tileLayer( <String> urlTemplate, <TileLayer options> options? ) - L.tileLayer() - Instantiates a tile layer object given a URL template and optionally an options object.
      - - + + - - - + @@ -1800,7 +1782,7 @@

      Methods

      ConstructorUsageCreationDescription
      L.TileLayer.WMS( + L.tileLayer.wms( <String> baseUrl, <TileLayer.WMS options> options ) - - L.tileLayer.wms() - Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
      -

      L.TileLayer.Canvas

      +

      L.tileLayer.canvas

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer.

      @@ -1813,21 +1795,19 @@

      Usage example

      // draw something on the tile canvas }
      -

      Constructor

      +

      Creation

      - - + + - - +
      ConstructorUsageCreationDescription
      L.TileLayer.Canvas( + L.tileLayer.canvas( <TileLayer options> options? ) - L.tileLayer.canvas() - Instantiates a Canvas tile layer object given an options object (optionally).
      @@ -1873,7 +1853,7 @@

      Methods

      -

      L.ImageOverlay

      +

      L.imageOverlay

      Used to load and display a single image over specific bounds of the map, implements ILayer interface.

      @@ -1884,12 +1864,12 @@

      Usage example

      L.imageOverlay(imageUrl, imageBounds).addTo(map);
      -

      Constructor

      +

      Creation

      - - + + @@ -1899,9 +1879,6 @@

      Constructor

      <ImageOverlay options> options? ) - @@ -1959,7 +1936,7 @@

      Methods

      ConstructorUsageCreationDescription
      - L.imageOverlay() - Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.
      -

      L.Path

      +

      L.path

      An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly.

      Options

      @@ -2186,7 +2163,7 @@

      Static properties

      -

      L.Polyline

      +

      L.polyline

      A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      @@ -2197,23 +2174,20 @@

      Usage example

      // zoom the map to the polyline map.fitBounds(polyline.getBounds());

      -

      Constructor

      +

      Creation

      - - + + - - @@ -2294,16 +2268,16 @@

      Methods

      -

      L.MultiPolyline

      +

      L.multiPolyline

      Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Polyline( + L.polyline( <LatLng[]> latlngs, <Polyline options> options? ) - L.polyline() - Instantiates a polyline object given an array of geographical points and optionally an options object.
      - - + + @@ -2312,9 +2286,7 @@

      Constructor

      <Polyline options> options? ) - + @@ -2322,29 +2294,26 @@

      Constructor

      -

      L.Polygon

      +

      L.polygon

      A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

      Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.

      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      - L.multiPolyline() - Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
      - - + + - - @@ -2354,33 +2323,30 @@

      Constructor

      -

      L.MultiPolygon

      +

      L.multiPolygon

      Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Polygon( + L.polygon( <LatLng[]> latlngs, <Polyline options> options? ) - L.polygon() - Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.
      - - + + - -
      ConstructorUsageCreationDescription
      L.MultiPolygon( + L.multiPolygon( <LatLng[][]> latlngs, <Polyline options> options? ) - L.multiPolygon() - Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).
      -

      L.Rectangle

      +

      L.rectangle

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      @@ -2394,23 +2360,20 @@

      Usage example

      // zoom the map to the rectangle bounds map.fitBounds(bounds);
      -

      Constructor

      +

      Creation

      - - + + - - @@ -2437,30 +2400,27 @@

      Methods

      ConstructorUsageCreationDescription
      L.Rectangle( + L.rectangle( <LatLngBounds> bounds, <Path options> options? ) - L.rectangle() - Instantiates a rectangle object with the given geographical bounds and optionally an options object.
      -

      L.Circle

      +

      L.circle

      A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      L.circle([50.5, 30.5], 200).addTo(map);
      -

      Constructor

      +

      Creation

      - - + + - - @@ -2504,28 +2464,25 @@

      Methods

      -

      L.CircleMarker

      +

      L.circleMarker

      A circle of a fixed size with radius specified in pixels. Extends Circle. Use Map#addLayer to add it to the map.

      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Circle( + L.circle( <LatLng> latlng, <Number> radius, <Path options> options? ) - L.circle() - Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.
      - - + + - - - +
      ConstructorUsageCreationDescription
      L.CircleMarker( + L.circleMarker( <LatLng> latlng, <Path options> options? ) - L.circleMarker() - Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
      @@ -2558,7 +2515,7 @@

      Methods

      -

      L.LayerGroup

      +

      L.layerGroup

      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. Implements ILayer interface.

      @@ -2566,12 +2523,11 @@

      L.LayerGroup

      .addLayer(polyline) .addTo(map);
      -

      Constructor

      +

      Creation

      - - + @@ -2579,9 +2535,6 @@

      Constructor

      <ILayer[]> layers? ) - @@ -2640,31 +2593,29 @@

      Methods

      -

      L.FeatureGroup

      +

      L.featureGroup

      -

      Extended LayerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

      +

      Extended layerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

      L.featureGroup([marker1, marker2, polyline])
       	.bindPopup('Hello world!')
       	.on('click', function() { alert('Clicked on a group!'); })
       	.addTo(map);
      -

      Constructor

      +

      Creation

      ConstructorUsageCreation Description
      - L.layerGroup() - Create a layer group, optionally given an initial set of layers.
      - - + + - - + @@ -2672,7 +2623,7 @@

      Constructor

      Methods

      -

      Has all LayerGroup methods and additionally:

      +

      Has all layerGroup methods and additionally:

      ConstructorUsageCreationDescription
      L.FeatureGroup( + L.featureGroup( <ILayer[]> layers? ) - L.featureGroup() - Create a layer group, optionally given an initial set of layers.
      @@ -2766,7 +2717,7 @@

      Events

      -

      L.GeoJSON

      +

      L.geoJson

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.

      @@ -2781,24 +2732,19 @@

      L.GeoJSON

      Each feature layer created by it gets a feature property that links to the GeoJSON feature data the layer was created from (so that you can access its properties later).

      -

      Constructor

      +

      Creation

      - - + - - -
      ConstructorUsageCreation Description
      L.GeoJSON( + L.geoJson( <Object> geojson?, <GeoJSON options> options? ) - L.geoJson() - Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.
      @@ -2919,35 +2865,31 @@

      Static methods

      -

      L.LatLng

      +

      L.latLng

      Represents a geographical point with a certain latitude and longitude.

      -
      var latlng = new L.LatLng(50.5, 30.5);
      +
      var latlng = L.latLng(50.5, 30.5);

      All Leaflet methods that accept LatLng objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:

      map.panTo([50, 30]);
      -map.panTo(new L.LatLng(50, 30));
      +map.panTo(L.latLng(50, 30));
      -

      Constructor

      +

      Creation

      - - + + - - - +
      ConstructorUsageCreationDescription
      L.LatLng( + L.latLng( <Number> latitude, <Number> longitude ) - L.latLng()
      - L.latLng([]) -
      Creates an object representing a geographical point with the given latitude and longitude.
      @@ -3044,12 +2986,12 @@

      Constants

      -

      L.LatLngBounds

      +

      L.latLngBounds

      Represents a rectangular geographical area on a map.

      -
      var southWest = new L.LatLng(40.712, -74.227),
      -	northEast = new L.LatLng(40.774, -74.125),
      -	bounds = new L.LatLngBounds(southWest, northEast);
      +
      var southWest = L.latLng(40.712, -74.227),
      +	northEast = L.latLng(40.774, -74.125),
      +	bounds = L.latLngBounds(southWest, northEast);

      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:

      @@ -3058,35 +3000,29 @@

      L.LatLngBounds

      [40.774, -74.125] ]);
      -

      Constructor

      +

      Creation

      - - + - + - + - - +
      ConstructorUsageCreation Description
      - L.LatLngBounds( + L.latLngBounds( <LatLng> southWest, <LatLng> northEast ) - L.latLngBounds()
      - L.latLngBounds([]) -
      Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.Creates a latLngBounds object by defining south-west and north-east corners of the rectangle.
      L.LatLngBounds( + L.latLngBounds( <LatLng[]> latlngs ) - L.latLngBounds() - 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.
      @@ -3209,35 +3145,31 @@

      Methods

      -

      L.Point

      +

      L.point

      Represents a point with x and y coordinates in pixels.

      -
      var point = new L.Point(200, 300);
      +
      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:

      map.panBy([200, 300]);
      -map.panBy(new L.Point(200, 300));
      +map.panBy( L.point(200, 300));
      -

      Constructor

      +

      Creation

      - + - - @@ -3339,46 +3271,40 @@

      Methods

      -

      L.Bounds

      +

      L.bounds

      Represents a rectangular area in pixel coordinates.

      -
      var p1 = new L.Point(10, 10),
      -	p2 = new L.Point(40, 60),
      -	bounds = new L.Bounds(p1, p2);
      +
      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:

      otherBounds.intersects([[10, 10], [40, 60]]);
      -

      Constructor

      +

      Creation

      ConstructorCreation Usage Description
      L.Point( + L.point( <Number> x, <Number> y, <Boolean> round? ) - L.point()
      - L.point([]) -
      Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
      - - + + - - - - + @@ -3464,7 +3390,7 @@

      Methods

      ConstructorUsageCreationDescription
      L.Bounds( + L.bounds( <Point> topLeft, <Point> bottomRight ) - L.bounds()
      - L.bounds([]) -
      Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).
      L.Bounds( + L.bounds( <Point[]> points ) - L.bounds() - Creates a Bounds object defined by the points it contains.
      -

      L.Icon

      +

      L.icon

      Represents an icon to provide when creating a marker.

      @@ -3484,23 +3410,20 @@

      L.Icon

      L.Icon.Default extends L.Icon and is the blue icon Leaflet uses for markers by default.

      -

      Constructor

      +

      Creation

      - - + + - - - +
      ConstructorUsageCreationDescription
      L.Icon( + L.icon( <Icon options> options ) - L.icon() - Creates an icon instance with the given options.
      @@ -3566,7 +3489,7 @@

      Options

      -

      L.DivIcon

      +

      L.divIcon

      Represents a lightweight icon for markers that uses a simple div element instead of an image.

      @@ -3577,22 +3500,20 @@

      L.DivIcon

      By default, it has a 'leaflet-div-icon' class and is styled as a little white square with a shadow.

      -

      Constructor

      +

      Creation

      - - + + - - + @@ -3631,7 +3552,7 @@

      Options

      -

      L.Control

      +

      L.control

      The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:

      @@ -3639,21 +3560,19 @@

      L.Control

      // the same as map.addControl(control); -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.DivIcon( + L.divIcon( <DivIcon options> options ) - L.divIcon() - Creates a div icon instance with the given options.
      - - + + - - + @@ -3741,25 +3660,22 @@

      Control Positions

      ConstructorUsageCreationDescription
      L.Control( + L.control( <Control options> options? ) - L.control() - Creates a control with the given options.
      -

      L.Control.Zoom

      +

      L.control.zoom

      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 to false. Extends Control.

      -

      Constructor

      +

      Creation

      - - + + - - @@ -3783,25 +3699,23 @@

      Options

      -

      L.Control.Attribution

      +

      L.control.attribution

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Extends Control.

      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Control.Zoom( + L.control.zoom( <Control.Zoom options> options? ) - L.control.zoom() - Creates a zoom control.
      - - + + - - + @@ -3860,7 +3774,7 @@

      Methods

      ConstructorUsageCreationDescription
      L.Control.Attribution( + L.control.attribution( <Control.Attribution options> options? ) - L.control.attribution() - Creates an attribution control.
      -

      L.Control.Layers

      +

      L.control.layers

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

      @@ -3876,22 +3790,20 @@

      L.Control.Layers

      L.control.layers(baseLayers, overlays).addTo(map);
      -

      Constructor

      +

      Creation

      - - + + - - +
      ConstructorUsageCreationDescription
      L.Control.Layers( + L.control.layers( <Layer Config> baseLayers?, <Layer Config> overlays?, <Control.Layers options> options? ) - L.control.layers() - Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes.
      @@ -3990,27 +3902,25 @@

      Events

      -

      L.Control.Scale

      +

      L.control.scale

      A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Implements IControl interface.

      L.control.scale().addTo(map);
      -

      Constructor

      +

      Creation

      - - + + - - + @@ -4730,16 +4640,16 @@

      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.

      var transformation = new L.Transformation(2, 5, -1, 10),
      -	p = new L.Point(1, 2),
      -	p2 = transformation.transform(p), // new L.Point(7, 8)
      -	p3 = transformation.untransform(p2); // new L.Point(1, 2)
      +	p = L.point(1, 2),
      +	p2 = transformation.transform(p), //  L.point(7, 8)
      +	p3 = transformation.untransform(p2); //  L.point(1, 2)
       
      -

      Constructor

      +

      Creation

      ConstructorUsageCreationDescription
      L.Control.Scale( + L.control.scale( <Control.Scale options> options? ) - L.control.scale() - Creates an scale control with the given options.
      - + @@ -5143,11 +5053,11 @@

      L.PosAnimation

      var fx = new L.PosAnimation();
       fx.run(el, [300, 500], 0.5);
      -

      Constructor

      +

      Creation

      ConstructorCreation Usage Description
      - + @@ -5220,11 +5130,11 @@

      L.Draggable

      draggable.enable(); -

      Constructor

      +

      Creation

      ConstructorCreation Usage Description
      - + From 407733fdb5a62175d1c5d5b5349eece78f2aa41f Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 8 May 2013 13:17:55 +0300 Subject: [PATCH 401/816] update heading on plugins page, #1649 --- plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index dbf7b4d696b..186a0c55a7c 100644 --- a/plugins.md +++ b/plugins.md @@ -85,7 +85,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s heatmap.js
      ConstructorCreation Usage Description
      JavaScript Library for HTML5 canvas based heatmaps. - + Its Leaflet layer implementation supports large datasets because it is tile based and uses a quadtree index to store the data. Patrick Wied @@ -330,7 +330,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
      -### Geocoding (address lookup, a.k.a. geosearching) +### Geocoding (Address Lookup) From f9ebcf5fd06177c546dc09200ee981951c4655aa Mon Sep 17 00:00:00 2001 From: yarik ponomarenko Date: Thu, 9 May 2013 16:07:56 +0300 Subject: [PATCH 402/816] HTMLElement was indicated as allowable type of content in L.Popup.setContent() In accordance with https://github.com/Leaflet/Leaflet/issues/9 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 6efa00232b0..55963020ac9 100644 --- a/reference.html +++ b/reference.html @@ -1423,7 +1423,7 @@

      Methods

      From 59f8bfe1c1ffb9c0f44ce1da65793dc4afe57840 Mon Sep 17 00:00:00 2001 From: dwilhelm89 Date: Mon, 20 May 2013 22:50:55 +0200 Subject: [PATCH 403/816] Added Time Slider plugin to dynamically add/remove layers --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 186a0c55a7c..ce2adbdb35e 100644 --- a/plugins.md +++ b/plugins.md @@ -532,6 +532,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + +
      setContent( - <String> htmlContent ) + <String|HTMLElement> htmlContent ) this
      + Leaflet Time-Slider + + The Leaflet Time-Slider enables you to dynamically add and remove Markers on a map by using a JQuery UI slider + + Dennis Wilhelm +
      From a16dd5cd559a98becac8ead8f19d5e6b37e97f22 Mon Sep 17 00:00:00 2001 From: Ardhi Lukianto Date: Tue, 21 May 2013 15:45:05 +0700 Subject: [PATCH 404/816] Add Leaflet.MousePosition control --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index ce2adbdb35e..b9d98e7a631 100644 --- a/plugins.md +++ b/plugins.md @@ -541,6 +541,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Dennis Wilhelm + + + Leaflet MousePosition Control + + A decent MousePosition control for Leaflet + + Ardhi Lukianto + + From 9de1b8d8d6c0391f2e5f9c1dc763c4666da57844 Mon Sep 17 00:00:00 2001 From: Ardhi Lukianto Date: Tue, 21 May 2013 15:45:59 +0700 Subject: [PATCH 405/816] Update plugins.md --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index b9d98e7a631..597b31e1ab7 100644 --- a/plugins.md +++ b/plugins.md @@ -543,7 +543,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet MousePosition Control + Leaflet.MousePosition A decent MousePosition control for Leaflet From 2e3e36260906fb06a01163d76d5d670a9c1c5ba6 Mon Sep 17 00:00:00 2001 From: stefano cudini Date: Wed, 22 May 2013 00:04:42 +0200 Subject: [PATCH 406/816] update description L.Control.Search in plugins page --- plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index ce2adbdb35e..328eccb0a42 100644 --- a/plugins.md +++ b/plugins.md @@ -453,9 +453,9 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s leaflet-search - Simple Leaflet Control for searching markers by attribute. + A control for search Markers/Features location by custom property in LayerGroup/GeoJSON. Support AJAX/JSONP, Autocompletion and 3rd party service - Stefano Cudini + Stefano Cudini From 1ee249dbec5f1a79ddff7cb43edc963b49545f1b Mon Sep 17 00:00:00 2001 From: Ardhi Lukianto Date: Wed, 22 May 2013 07:11:05 +0700 Subject: [PATCH 407/816] Update description --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 597b31e1ab7..85086e90b71 100644 --- a/plugins.md +++ b/plugins.md @@ -545,7 +545,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.MousePosition - A decent MousePosition control for Leaflet + A simple MousePosition control that displays geographic coordinates of the mouse pointer, as it is moved about the map Ardhi Lukianto From cc113ff778f971eadc026bef36669fad99a517f1 Mon Sep 17 00:00:00 2001 From: Michael Dougherty Date: Tue, 28 May 2013 15:18:19 -0600 Subject: [PATCH 408/816] added 'overlayadd' and 'overlayremove' descriptions (closes #1709) --- reference.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 4053d5fd5b9..d2c6b0b47a8 100644 --- a/reference.html +++ b/reference.html @@ -527,7 +527,17 @@

      Events

      baselayerchange LayerEvent - Fired when the base layer is changed through the layer control. + Fired when the base layer is changed through the layer control. + + + overlayadd + LayerEvent + Fired when an overlay is selected through the layer control. + + + overlayremove + LayerEvent + Fired when an overlay is deselected through the layer control. locationfound @@ -4016,6 +4026,16 @@

      Events

      LayerEvent Fired when the base layer is changed through the control. + + overlayadd + LayerEvent + Fired when an overlay is selected through the control. + + + overlayremove + LayerEvent + Fired when an overlay is deselected through the control. + From e44da8691b609846d64b81043289bdd4f2928a10 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 29 May 2013 01:23:44 -0300 Subject: [PATCH 409/816] Fix typo in noConflict section --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 4053d5fd5b9..8717fce1789 100644 --- a/reference.html +++ b/reference.html @@ -5725,7 +5725,7 @@

      Global Switches

      L.noConflict()

      -

      This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      +

      This method restores the L global variable to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      // L points to some other library
       ...
      
      From 918b57e95bf2e5714341f4630d3c386ba664f845 Mon Sep 17 00:00:00 2001
      From: Yohan Boniface 
      Date: Wed, 29 May 2013 12:59:26 +0200
      Subject: [PATCH 410/816] Add Leaflet.RevealOSM plugin
      
      ---
       plugins.md | 9 +++++++++
       1 file changed, 9 insertions(+)
      
      diff --git a/plugins.md b/plugins.md
      index 328eccb0a42..8ace55465f3 100644
      --- a/plugins.md
      +++ b/plugins.md
      @@ -541,6 +541,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
       			Dennis Wilhelm
       		
       	
      +	
      +		
      +			Leaflet.RevealOSM
      +		
      +			Very simple but extendable Leaflet plugin to display OSM POIs data on map click.
      +		
      +			Yohan Boniface
      +		
      +	
       
       
       
      
      From c4c37a40c0cf6468cd46972b0c81d6c79b5152b0 Mon Sep 17 00:00:00 2001
      From: Yohan Boniface 
      Date: Wed, 29 May 2013 13:00:53 +0200
      Subject: [PATCH 411/816] Add Leaflet.i18n plugin
      
      ---
       plugins.md | 9 +++++++++
       1 file changed, 9 insertions(+)
      
      diff --git a/plugins.md b/plugins.md
      index 8ace55465f3..49e874073bd 100644
      --- a/plugins.md
      +++ b/plugins.md
      @@ -642,6 +642,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s
       			Benjamin Becquet, Mathieu Leplatre
       		
       	
      +	
      +		
      +			Leaflet.i18n
      +		
      +			Internationalization for Leaflet plugins.
      +		
      +			Yohan Boniface
      +		
      +	
       
       
       To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file).
      
      From 9643e0b2d6a9a3294b927552ca9db74728706c6b Mon Sep 17 00:00:00 2001
      From: Steve 
      Date: Thu, 30 May 2013 13:08:55 -0300
      Subject: [PATCH 412/816] Fix wrong word (Number instead of Point) in
       closestPointonSegment
      
      Issue #1720
      ---
       reference.html | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/reference.html b/reference.html
      index 5a2ab7ca0d8..3002d7ab363 100644
      --- a/reference.html
      +++ b/reference.html
      @@ -4882,7 +4882,7 @@ 

      Methods

      <Point> p2 )
      - Number + Point Returns the closest point from a point p on a segment p1 to p2. From 95cb21af57607e9dfa69c4f1e8026e115a64e8f3 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 4 Jun 2013 14:37:02 +0300 Subject: [PATCH 413/816] fix jekyll 1.0 config --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index fb96b8041a7..dbbd68f211a 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ -exclude: build, debug, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, DOCS-TODO.md +exclude: [build, debug, node_modules, spec, src, CNAME, Jakefile.js, reference-tpl.html, CHANGELOG.md, README.md, LICENSE, DOCS-TODO.md] markdown: kramdown From 9e1f3bdc20f9df5337390260762fa2352c52100a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 4 Jun 2013 15:15:50 +0300 Subject: [PATCH 414/816] rename section titles; rename creation column to factory --- reference.html | 218 ++++++++++++++++++++++++------------------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/reference.html b/reference.html index a89808db0ec..8ae779137ef 100644 --- a/reference.html +++ b/reference.html @@ -125,7 +125,7 @@

      Misc


      This reference reflects Leaflet 0.5. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

      -

      L.map

      +

      Map

      The central class of the API — it is used to create a map on a page and manipulate it.

      @@ -141,7 +141,7 @@

      Creation

      - + @@ -150,7 +150,7 @@

      Creation

      <Map options> options? ) - +
      CreationFactory Description
      Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.
      @@ -1060,7 +1060,7 @@

      Map Panes

      -

      L.marker

      +

      Marker

      Used to put markers on the map.

      @@ -1070,8 +1070,8 @@

      Creation

      - - + + @@ -1095,9 +1095,9 @@

      Options

      - + - + @@ -1316,7 +1316,7 @@

      Interaction handlers

      - +

      Used to open popups in certain places of the map. Use Map#openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map#addLayer to open as many as you want.

      @@ -1334,8 +1334,8 @@

      Creation

      CreationFactoryDescription
      iconL.iconL.Icon *Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to L.icon.Default() by default.Icon class to use for rendering the marker. See Icon documentation for details on how to customize the marker icon. Set to new L.Icon.Default() by default.
      clickable
      - - + + @@ -1454,7 +1454,7 @@

      Methods

      -

      L.tileLayer

      +

      TileLayer

      Used to load and display tile layers on the map, implements ILayer interface.

      @@ -1469,8 +1469,8 @@

      Creation

      CreationFactoryDescription
      - - + + @@ -1699,7 +1699,7 @@

      Methods

      -

      L.tileLayer.wms

      +

      TileLayer.WMS

      Used to display WMS services as tile layers on the map. Extends TileLayer.

      @@ -1716,7 +1716,7 @@

      Creation

      CreationFactoryDescription
      - + @@ -1724,7 +1724,7 @@

      Creation

      @@ -1792,7 +1792,7 @@

      Methods

      CreationFactory Description
      L.tileLayer.wms( <String> baseUrl, <TileLayer.WMS options> options ) - + Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
      -

      L.tileLayer.canvas

      +

      TileLayer.Canvas

      Used to create Canvas-based tile layers where tiles get drawn on the browser side. Extends TileLayer.

      @@ -1809,15 +1809,15 @@

      Creation

      - - + + - +
      CreationFactoryDescription
      L.tileLayer.canvas( <TileLayer options> options? ) Instantiates a Canvas tile layer object given an options object (optionally).
      @@ -1863,7 +1863,7 @@

      Methods

      -

      L.imageOverlay

      +

      ImageOverlay

      Used to load and display a single image over specific bounds of the map, implements ILayer interface.

      @@ -1878,8 +1878,8 @@

      Creation

      - - + + @@ -1946,7 +1946,7 @@

      Methods

      CreationFactoryDescription
      -

      L.path

      +

      Path

      An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly.

      Options

      @@ -2173,7 +2173,7 @@

      Static properties

      -

      L.polyline

      +

      Polyline

      A class for drawing polyline overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      @@ -2188,8 +2188,8 @@

      Creation

      - - + + @@ -2278,7 +2278,7 @@

      Methods

      -

      L.multiPolyline

      +

      MultiPolyline

      Extends FeatureGroup to allow creating multi-polylines (single layer that consists of several polylines that share styling/popup).

      @@ -2286,17 +2286,17 @@

      Creation

      CreationFactoryDescription
      - - + + - - + @@ -2304,7 +2304,7 @@

      Creation

      -

      L.polygon

      +

      Polygon

      A class for drawing polygon overlays on a map. Extends Polyline. Use Map#addLayer to add it to the map.

      @@ -2314,8 +2314,8 @@

      Creation

      CreationFactoryDescription
      L.MultiPolyline( + L.multiPolyline( <LatLng[][]> latlngs, <Polyline options> options? ) Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.
      - - + + @@ -2333,7 +2333,7 @@

      Creation

      -

      L.multiPolygon

      +

      MultiPolygon

      Extends FeatureGroup to allow creating multi-polygons (single layer that consists of several polygons that share styling/popup).

      @@ -2341,8 +2341,8 @@

      Creation

      CreationFactoryDescription
      - - + + @@ -2356,7 +2356,7 @@

      Creation

      CreationFactoryDescription
      -

      L.rectangle

      +

      Rectangle

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      @@ -2374,7 +2374,7 @@

      Creation

      - + @@ -2410,7 +2410,7 @@

      Methods

      CreationFactory Description
      -

      L.circle

      +

      Circle

      A class for drawing circle overlays on a map. Extends Path. Use Map#addLayer to add it to the map.

      @@ -2420,8 +2420,8 @@

      Creation

      - - + + @@ -2474,7 +2474,7 @@

      Methods

      -

      L.circleMarker

      +

      CircleMarker

      A circle of a fixed size with radius specified in pixels. Extends Circle. Use Map#addLayer to add it to the map.

      @@ -2482,8 +2482,8 @@

      Creation

      CreationFactoryDescription
      - - + + @@ -2492,7 +2492,7 @@

      Creation

      <Path options> options? ) - +
      CreationFactoryDescription
      Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.
      @@ -2525,7 +2525,7 @@

      Methods

      -

      L.layerGroup

      +

      LayerGroup

      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. Implements ILayer interface.

      @@ -2537,7 +2537,7 @@

      Creation

      - + @@ -2603,7 +2603,7 @@

      Methods

      -

      L.featureGroup

      +

      FeatureGroup

      Extended layerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

      @@ -2616,8 +2616,8 @@

      Creation

      CreationFactory Description
      - - + + @@ -2625,7 +2625,7 @@

      Creation

      <ILayer[]> layers? ) - + @@ -2727,7 +2727,7 @@

      Events

      CreationFactoryDescription
      Create a layer group, optionally given an initial set of layers.
      -

      L.geoJson

      +

      GeoJson

      Represents a GeoJSON layer. Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.

      @@ -2746,7 +2746,7 @@

      Creation

      - + @@ -2875,7 +2875,7 @@

      Static methods

      -

      L.latLng

      +

      LatLng

      Represents a geographical point with a certain latitude and longitude.

      var latlng = L.latLng(50.5, 30.5);
      @@ -2889,8 +2889,8 @@

      Creation

      CreationFactory Description
      - - + + @@ -2899,7 +2899,7 @@

      Creation

      <Number> longitude ) - +
      CreationFactoryDescription
      Creates an object representing a geographical point with the given latitude and longitude.
      @@ -2996,7 +2996,7 @@

      Constants

      -

      L.latLngBounds

      +

      LatLngBounds

      Represents a rectangular geographical area on a map.

      var southWest = L.latLng(40.712, -74.227),
      @@ -3014,7 +3014,7 @@ 

      Creation

      - + @@ -3024,7 +3024,7 @@

      Creation

      <LatLng> northEast ) - + @@ -3032,7 +3032,7 @@

      Creation

      - +
      CreationFactory Description
      Creates a latLngBounds object by defining south-west and north-east corners of the rectangle.
      L.latLngBounds( <LatLng[]> latlngs ) 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.
      @@ -3155,7 +3155,7 @@

      Methods

      -

      L.point

      +

      Point

      Represents a point with x and y coordinates in pixels.

      @@ -3170,7 +3170,7 @@

      Creation

      - + @@ -3281,7 +3281,7 @@

      Methods

      -

      L.bounds

      +

      Bounds

      Represents a rectangular area in pixel coordinates.

      var p1 = L.point(10, 10),
      @@ -3296,7 +3296,7 @@ 

      Creation

      CreationFactory Usage Description
      - + @@ -3314,7 +3314,7 @@

      Creation

      <Point[]> points )
      - + @@ -3400,7 +3400,7 @@

      Methods

      CreationFactory Description
      Creates a Bounds object defined by the points it contains.
      -

      L.icon

      +

      Icon

      Represents an icon to provide when creating a marker.

      @@ -3424,8 +3424,8 @@

      Creation

      - - + + @@ -3433,7 +3433,7 @@

      Creation

      <Icon options> options ) - +
      CreationFactoryDescription
      Creates an icon instance with the given options.
      @@ -3499,7 +3499,7 @@

      Options

      -

      L.divIcon

      +

      DivIcon

      Represents a lightweight icon for markers that uses a simple div element instead of an image.

      @@ -3514,8 +3514,8 @@

      Creation

      - - + + @@ -3523,7 +3523,7 @@

      Creation

      <DivIcon options> options ) - + @@ -3562,7 +3562,7 @@

      Options

      -

      L.control

      +

      Control

      The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:

      @@ -3573,8 +3573,8 @@

      L.control

      Creation

      CreationFactoryDescription
      Creates a div icon instance with the given options.
      - - + + @@ -3582,7 +3582,7 @@

      Creation

      <Control options> options? ) - + @@ -3670,14 +3670,14 @@

      Control Positions

      CreationFactoryDescription
      Creates a control with the given options.
      -

      L.control.zoom

      +

      Control.zoom

      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 to false. Extends Control.

      Creation

      - + @@ -3709,14 +3709,14 @@

      Options

      -

      L.control.attribution

      +

      Control.Attribution

      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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Extends Control.

      Creation

      CreationFactory Description
      - + @@ -3725,7 +3725,7 @@

      Creation

      <Control.Attribution options> options? ) - + @@ -3784,7 +3784,7 @@

      Methods

      CreationFactory Description
      Creates an attribution control.
      -

      L.control.layers

      +

      Control.Layers

      The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the detailed example). Extends Control.

      @@ -3803,8 +3803,8 @@

      L.control.layers

      Creation

      - - + + @@ -3813,7 +3813,7 @@

      Creation

      <Layer Config> overlays?, <Control.Layers options> options? ) - +
      CreationFactoryDescription
      Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes.
      @@ -3922,7 +3922,7 @@

      Events

      -

      L.control.scale

      +

      Control.Scale

      A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Implements IControl interface.

      @@ -3931,8 +3931,8 @@

      L.control.scale

      Creation

      - - + + @@ -3940,7 +3940,7 @@

      Creation

      <Control.Scale options> options? ) - + @@ -4275,7 +4275,7 @@ -

      L.Class

      +

      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.

      @@ -4430,7 +4430,7 @@

      Constructor Hooks

      MyClass.addInitHook('methodName', arg1, arg2, …);
      -

      L.Browser

      +

      Browser

      A namespace with properties for browser/feature detection used by Leaflet internally.

      @@ -4522,7 +4522,7 @@

      L.Browser

      CreationFactoryDescription
      Creates an scale control with the given options.
      -

      L.Util

      +

      Util

      Various utility functions, used by Leaflet internally.

      @@ -4655,7 +4655,7 @@

      Properties

      -

      L.Transformation

      +

      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.

      @@ -4669,7 +4669,7 @@

      Creation

      - + @@ -4722,7 +4722,7 @@

      Methods

      -

      L.LineUtil

      +

      LineUtil

      Various utility functions for polyine points processing, used by Leaflet internally to make polylines lightning-fast.

      @@ -4781,7 +4781,7 @@

      Methods

      -

      L.PolyUtil

      +

      PolyUtil

      Various utility functions for polygon geometries.

      @@ -4808,7 +4808,7 @@

      Methods

      -

      L.DomEvent

      +

      DomEvent

      Utility functions to work with the DOM events, used by Leaflet internally.

      @@ -4900,7 +4900,7 @@

      Methods

      -

      L.DomUtil

      +

      DomUtil

      Utility functions to work with the DOM tree, used by Leaflet internally.

      @@ -5066,7 +5066,7 @@

      Properties

      -

      L.PosAnimation

      +

      PosAnimation

      Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.

      @@ -5077,7 +5077,7 @@

      Creation

      CreationFactory Usage Description
      - + @@ -5142,7 +5142,7 @@

      Events

      -

      L.Draggable

      +

      Draggable

      A class for making DOM elements draggable (including touch support). Used internally for map and marker dragging.

      @@ -5154,7 +5154,7 @@

      Creation

      CreationFactory Usage Description
      - + @@ -5623,7 +5623,7 @@

      Global Switches

      CreationFactory Usage Description
      -

      L.noConflict()

      +

      noConflict

      This method restores the L global variable to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace so you can put it elsewhere, like this:

      @@ -5635,7 +5635,7 @@

      L.noConflict()

      // now L points to that other library again, and you can use Leaflet.Map etc.
      -

      L.version

      +

      version

      A constant that represents the Leaflet version in use.

      From 18e0061450a4b1602822ba3f6c7950fd1ef07688 Mon Sep 17 00:00:00 2001 From: vogdb Date: Tue, 4 Jun 2013 17:46:57 +0400 Subject: [PATCH 415/816] Add Leaflet.SelectLayers plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 13f42428fef..f77d186c7ba 100644 --- a/plugins.md +++ b/plugins.md @@ -559,6 +559,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ardhi Lukianto + + + Leaflet.SelectLayers + + a Leaflet plugin which adds new control to switch between different layers on the map. New control replaces L.Control.Layers radio button panel with select tag. + + vogdb + + From 7e080fa263c33388de9d2fcc21d82a2d46e75746 Mon Sep 17 00:00:00 2001 From: Felix Bache Date: Tue, 4 Jun 2013 22:44:52 +0200 Subject: [PATCH 416/816] Add Leaflet.Coordinates plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 49e874073bd..efdd0e04fa7 100644 --- a/plugins.md +++ b/plugins.md @@ -550,6 +550,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Yohan Boniface + + + Leaflet.Coordinates + + A simple Leaflet plugin viewing the mouse LatLng-coordinates. Also views a marker with coordinate popup on userinput. + + Felix Bache + + From ace70493e5359e38f1d1f2aa15b0c344d89481cc Mon Sep 17 00:00:00 2001 From: Felix Bache Date: Tue, 4 Jun 2013 22:44:52 +0200 Subject: [PATCH 417/816] Add Leaflet.Coordinates plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index f77d186c7ba..dd8de2d0ef4 100644 --- a/plugins.md +++ b/plugins.md @@ -568,6 +568,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s vogdb + + + Leaflet.Coordinates + + A simple Leaflet plugin viewing the mouse LatLng-coordinates. Also views a marker with coordinate popup on userinput. + + Felix Bache + + From 0e2c75e982e66b62e6dfa115268427cc31007dec Mon Sep 17 00:00:00 2001 From: Andrey Geonya Date: Thu, 6 Jun 2013 18:55:01 +0300 Subject: [PATCH 418/816] Update reference.html --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 3002d7ab363..4da1952677e 100644 --- a/reference.html +++ b/reference.html @@ -2397,7 +2397,7 @@

      Constructor

      L.multiPolygon() - Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline). + Instantiates a multi-polygon object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline). From d2ecc7b96c2d160751aa055e15612ad41d3f023f Mon Sep 17 00:00:00 2001 From: Felix Bache Date: Tue, 18 Jun 2013 19:59:47 +0200 Subject: [PATCH 419/816] Add Leaflet.Elevation plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index dd8de2d0ef4..46108531820 100644 --- a/plugins.md +++ b/plugins.md @@ -577,6 +577,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Felix Bache + + + Leaflet.Elevation + + A Leaflet plugin to a interactive height profiles of GeoJSON lines using d3. + + Felix Bache + + From b4b26bdd6a2d7576b75aec4f64e80b34e03fb84f Mon Sep 17 00:00:00 2001 From: Felix Bache Date: Tue, 18 Jun 2013 20:04:38 +0200 Subject: [PATCH 420/816] Typo fixed --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 46108531820..171823059eb 100644 --- a/plugins.md +++ b/plugins.md @@ -581,7 +581,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.Elevation - A Leaflet plugin to a interactive height profiles of GeoJSON lines using d3. + A Leaflet plugin to view interactive height profiles of GeoJSON lines using d3. Felix Bache From c308bc1ce4b3886aa950f36ec726b17f14163666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Thu, 20 Jun 2013 02:20:25 +0200 Subject: [PATCH 421/816] Added zoomify plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 171823059eb..75efde2d9d7 100644 --- a/plugins.md +++ b/plugins.md @@ -208,6 +208,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Glen Robertson + + + TileLayer.Zoomify + + A TileLayer for Zoomify images. + + Bjørn Sandvik + + From 88e5124e54168584deaf4bf0e3724362037759e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Fri, 21 Jun 2013 18:58:42 +0200 Subject: [PATCH 422/816] Added Leaflet.Sync plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 75efde2d9d7..b04426930f4 100644 --- a/plugins.md +++ b/plugins.md @@ -595,6 +595,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Felix Bache + + + Leaflet.Sync + + Synchronized view of two maps. + + Bjørn Sandvik + + From 728ddb82d4cee27468c68a77880c80941618a371 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 24 Jun 2013 13:32:56 -0400 Subject: [PATCH 423/816] Fixes #1741 - adds documentation for setLatLngs + getLatLngs for Multi* --- reference.html | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/reference.html b/reference.html index 41af9619681..8992598892c 100644 --- a/reference.html +++ b/reference.html @@ -2278,6 +2278,37 @@

      Constructor

      +

      Methods

      + +

      MultiPolylines accept all Polyline methods but +have different behavior around their coordinate contents since they can contain +multiple line features:

      + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setLatLngs( + <LatLng[][]> latlngs ) + thisReplace all lines and their paths with the given array of arrays of + geographical points.
      getLatLngs()<LatLng[][]> latlngs + Returns an array of arrays of geographical points in each line.
      + +

      L.Polygon

      @@ -2339,6 +2370,36 @@

      Constructor

      +

      Methods

      + +

      MultiPolygons accept all Polyline methods but +have different behavior around their coordinate contents since they can contain +multiple polygon features:

      + + + + + + + + + + + + + + + + + + + +
      MethodReturnsDescription
      setLatLngs( + <LatLng[][]> latlngs ) + thisReplace all polygons and their paths with the given array of arrays of + geographical points.
      getLatLngs()<LatLng[][]> latlngs + Returns an array of arrays of geographical points in each polygon.
      +

      L.Rectangle

      A class for drawing rectangle overlays on a map. Extends Polygon. Use Map#addLayer to add it to the map.

      From f3b4fb5469e91e166a2dc6f2fff77d42ad799233 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 25 Jun 2013 10:14:11 -0400 Subject: [PATCH 424/816] fix facebook like button misposition --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 07db2917e39..708a736ad0f 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -67,7 +67,7 @@

      An Open-Source JavaScript Library for Mobile-Friendly Interactiv - +
      -

      This reference reflects Leaflet 0.5. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

      +

      This reference reflects Leaflet 0.6.
      +Docs for the previous stable version (0.5) are available in the source form (see instructions for running docs).

      L.Map

      From 951addabcd071067a49eaef442e218ab47e254cd Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 09:08:40 -0400 Subject: [PATCH 430/816] finish 0.6 docs --- reference.html | 132 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 40 deletions(-) diff --git a/reference.html b/reference.html index a21dbf886f0..b2d358c2454 100644 --- a/reference.html +++ b/reference.html @@ -398,6 +398,12 @@

      Animation options

      depends Whether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android. + + zoomAnimationThreshold + Number + 4 + Won't animate zoom if the zoom difference exceeds this value. + markerZoomAnimation Boolean @@ -602,51 +608,63 @@

      Methods for Modifying Map State

      setView( <LatLng> center, <Number> zoom, - <Boolean> forceReset? ) + <zoom/pan options> options? ) this - Sets the view of the map (geographical center and zoom). If forceReset is set to true, the map is reloaded even if it's eligible for pan or zoom animation (false by default). + Sets the view of the map (geographical center and zoom) with the given animation options. setZoom( - <Number> zoom ) + <Number> zoom, + <zoom options> options? ) this Sets the zoom of the map. - zoomIn( <Number> delta? ) + zoomIn( + <Number> delta?, + <zoom options> options? ) + this Increases the zoom of the map by delta (1 by default). - zoomOut( <Number> delta? ) + zoomOut( + <Number> delta?, + <zoom options> options? ) + this Decreases the zoom of the map by delta (1 by default). setZoomAround( <LatLng> latlng, - <Number> zoom ) + <Number> zoom, + <zoom options> options? ) this Zooms the map while keeping a specified point on the map stationary (e.g. used internally for scroll zoom and double-click zoom). fitBounds( - <LatLngBounds> bounds ) + <LatLngBounds> bounds, + <fitBounds options> options? ) this Sets a map view that contains the given geographical bounds with the maximum zoom level possible. - fitWorld() + fitWorld( + <fitBounds options> options? ) + this Sets a map view that mostly contains the whole world with the maximum zoom level possible. panTo( - <LatLng> latlng ) + <LatLng> latlng, + <pan options> options? ) this Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. @@ -660,17 +678,19 @@

      Methods for Modifying Map State

      panBy( - <Point> point ) + <Point> point, + <pan options> options? ) this Pans the map by a given number of pixels (animated). invalidateSize( - <Boolean> animate? ) + <Boolean> options?, + <zoom/pan options> options? ) this - Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically. If animate is true, map animates the update. + Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. setMaxBounds( @@ -1011,7 +1031,7 @@

      Locate options

      -

      zoom/pan options

      +

      Zoom/pan options

      @@ -1026,6 +1046,12 @@

      zoom/pan options

      + + + + + + @@ -1033,14 +1059,14 @@

      zoom/pan options

      - - - - + + + +
      false If true, the map view will be completely reset (without any animations).
      panpan options-Sets the options for the panning (without the zoom change) if it occurs.
      zoom zoom options Sets the options for the zoom change if it occurs.
      zoomzoom options-Sets the options for the panning (without the zoom change) if it occurs.animateBoolean-An equivalent of passing animate to both zoom and pan options (see below).
      -

      zoom/pan options

      +

      Pan options

      @@ -1050,26 +1076,51 @@

      zoom/pan options

      - + + + + + + + + + + + + + + + + + + + - + +
      Description
      resetanimateBoolean-If true, panning will always be animated if possible. If false, it will not animate panning, either resetting the map view if panning more than a screen away, or just setting a new offset for the map pane (except for `panBy` which always does the latter).
      durationNumber0.25Duration of animated panning.
      easeLinearityNumber0.25The curvature factor of panning animation easing (third parameter of the Cubic Bezier curve). 1.0 means linear animation, the less the more bowed the curve.
      noMoveStart Boolean falseIf true, the map view will be completely reset (without any animations).If true, panning won't fire movestart event on start (used internally for panning inertia).
      + +

      Zoom options

      + + - - - - + + + + - - + + - +
      zoomzoom options-Sets the options for the zoom change if it occurs.OptionTypeDefaultDescription
      zoomzoom optionsanimateBoolean -Sets the options for the panning (without the zoom change) if it occurs.If not specified, zoom animation will happen if the zoom origin is inside the current view. If true, the map will attempt animating zoom disregarding where zoom origin is. Setting false will make it always reset the view completely without animation.
      -

      zoom/pan options

      +

      fitBounds options

      + +

      The same as zoom/pan options and additionally:

      @@ -1079,25 +1130,26 @@

      zoom/pan options

      - - - - + + + - - - - + + + - - - - + + +
      Description
      resetBooleanfalseIf true, the map view will be completely reset (without any animations).paddingTopLeftPoint[0, 0] + Sets the amount of padding in the top left corner of a map container that shouldn't be accounted for when setting the view to fit bounds. Useful if you have some control overlays on the map like a sidebar and you don't want them to obscure objects you're zooming to.
      zoomzoom options-Sets the options for the zoom change if it occurs.paddingBottomRightPoint[0, 0] + The same for bottom right corner of the map.
      zoomzoom options-Sets the options for the panning (without the zoom change) if it occurs.paddingPoint[0, 0] + Equivalent of setting both top left and bottom right padding to the same value.
      +

      Properties

      Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

      From f1342d32ef5467c4565518d15798ad6d613af4a2 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 09:13:19 -0400 Subject: [PATCH 431/816] update download links --- download.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/download.md b/download.md index 9fe078d6a59..a11958cdf68 100644 --- a/download.md +++ b/download.md @@ -13,15 +13,15 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.5.1 - Stable version, released on January 17, 2013 and last updated on February 6, 2013 + Leaflet 0.6 + Stable version, released on June 26, 2013 - Leaflet 0.4.5 - Previous stable version, released on July 30, 2012 and last updated on October 25, 2012 + Leaflet 0.5.1 + Previous stable version, released on January 17, 2013 and last updated on February 6, 2013 - Leaflet master + Leaflet master In-progress version, developed on the master branch @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source @@ -50,9 +50,7 @@ Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and 2. Run the following commands in the command line:
      npm install -g jake
      -npm install jshint
      -npm install uglify-js
      -
      +npm install
      Now that you have everything installed, run `jake` inside the Leaflet directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and compress it to the `dist` folder. From 524d32179bbdd76d809792664a931f1f6487cff4 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 11:01:43 -0400 Subject: [PATCH 432/816] post title fixes (capitalized) --- ...2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md | 2 +- _posts/2013-02-20-guest-post-draw.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md b/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md index c044b56786b..d5ea237ed50 100644 --- a/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md +++ b/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md @@ -1,6 +1,6 @@ --- layout: post -title: Leaflet 0.4.5 bugfix release and plans for 0.5 +title: Leaflet 0.4.5 Bugfix Release and Plans for 0.5 description: Leaflet 0.4.5 released, containing a small but important zoom animation bugfix for upcoming Chrome 23+ (currently beta) and IE10. Work on future 0.5 release goes on! author: Vladimir Agafonkin authorsite: http://agafonkin.com/en diff --git a/_posts/2013-02-20-guest-post-draw.md b/_posts/2013-02-20-guest-post-draw.md index 0797fac266e..9a0587813c0 100644 --- a/_posts/2013-02-20-guest-post-draw.md +++ b/_posts/2013-02-20-guest-post-draw.md @@ -1,6 +1,6 @@ --- layout: post -title: Leaflet.draw 0.2 released +title: Leaflet.draw 0.2 Released description: Leaflet.draw 0.2 released — brings vector drawing and editing tools to your Leaflet map. author: Jacob Toye authorsite: https://github.com/jacobtoye/ From 08b66c7f5fe9f767d5f614c88648b9232c62d2d8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 11:05:57 -0400 Subject: [PATCH 433/816] website updates, release blog post --- ...flet-0-6-released-dc-code-sprint-mapbox.md | 24 +++++++++++++++++++ features.html | 2 +- index.md | 8 +++---- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 _posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md new file mode 100644 index 00000000000..ff1712bc6fa --- /dev/null +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -0,0 +1,24 @@ +--- +layout: post +title: Leaflet 0.6 Released, Code Sprint in DC with MapBox +description: Leaflet 0.6 released — with nicer controls, better usability and tons of API improvements and various bugfixes — more than 120 changes! The first ever Leaflet Code Sprint happening in Washington, DC with the MapBox team +author: Vladimir Agafonkin +authorsite: http://agafonkin.com/en +--- + +_Leaflet 0.6 released — with nicer controls, better usability and tons of API improvements and various bugfixes — more than 120 changes! The first ever Leaflet Code Sprint happening in Washington, DC with the MapBox team..._ + +After 5 months of active development with [36 contributors involved](https://github.com/Leaflet/Leaflet/graphs/contributors?from=2013-01-18&to=2013-06-26&type=c) since the previous major version, today I'm excited to finally announce the **release of Leaflet 0.6** stable. + +0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ changes**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. + +The final push for the release (last 2 days) was a part of the first ever **Leaflet Code Sprint**, organized in Washington DC by the amazing [MapBox](http://mapbox.com), a company responsible for perhaps the greatest innovations and awesome tools in the geospatial world of recent years. The sprint will go on for a week and there are many more awesome improvements to come in upcoming days (and lots of partying as well). + +Special thanks go to [Universal Mind](http://universalmind.com/), my awesome employer and sponsor of Leaflet development for the past 5 months, to the most active contributors — [John Firebaugh](https://github.com/jfirebaugh) and [Tom MacWright](https://github.com/tmcw) of [MapBox](http://mapbox.com), [Dave Leaver](https://github.com/danzel) and [Jacob Toye](https://github.com/jacobtoye) of [Smartrak](http://www.smartrak.co.nz/), [Steve Kashis](https://github.com/snkashis) of [CaerusGeo](http://www.caerusgeo.com/), and to everyone else involved in contributions, bug reports, mailing list, Twitter, making awesome apps, etc. You're such an amazing community! I'm really happy to be a part of it. + +Grab the CDN links or downloads for the new release on the [download page](../../../download.html) as always. Enjoy! And be sure try it out and report any regressions in your apps so that we can patch them up immediately. + +P.S. Everyone who tweets/posts about the new Leaflet release or why he loves Leaflet over the next few days will get a karma boost of over 9000 points. I heard that from a passing monk in Georgetown yesterday, true story! + +Cheers,
      +Vladimir, Leaflet creator and maintainer. diff --git a/features.html b/features.html index a96e467cdc1..08b049bcfb2 100644 --- a/features.html +++ b/features.html @@ -139,7 +139,7 @@

      On Mobile

      Misc

        -
      • Extremely lightweight — around 28 KB of gzipped JS code
      • +
      • Extremely lightweight — around 31 KB of gzipped JS code
      • No external dependencies
      • Keeps your JS environment clean — no global or native prototypes pollution
      diff --git a/index.md b/index.md index 8bef6b402b2..0c988ea77fc 100644 --- a/index.md +++ b/index.md @@ -2,11 +2,11 @@ layout: default --- - +

      June 26, 2013 — Leaflet 0.6 Released, Code Sprint in DC with MapBox — Read More in the Blog

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 28 KB of JS code, +Weighing just about 31 KB of JS code, it has all the [features][] most developers ever need for online maps. Leaflet is designed with _simplicity_, _performance_ and _usability_ in mind. @@ -20,13 +20,13 @@ Used by: [Flickr](http://flickr.com/map) [foursquare](https://foursquare.com/) [craigslist](http://t.co/V4EiURIA) +[Data.gov](http://data.gov) [IGN](http://www.ign.com/wikis/the-elder-scrolls-5-skyrim/interactive-maps/Skyrim) [Wikimedia](http://blog.wikimedia.org/2012/04/05/new-wikipedia-app-for-ios-and-an-update-for-our-android-app/) [OSM](http://openstreetmap.org) [Meetup](http://www.meetup.com/) [WSJ](http://projects.wsj.com/campaign2012/maps/) -[Geocaching](http://geocaching.com) -[StreetEasy](http://streeteasy.com/) +[MapBox](http://mapbox.com) [CloudMade](http://cloudmade.com) [CartoDB](http://cartodb.com) [GIS Cloud](http://www.giscloud.com/) From e306733ac8ed7135b7325eb0a8fac8bdd544eca3 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 11:16:14 -0400 Subject: [PATCH 434/816] bigger font and minor tweaks --- docs/css/screen.css | 7 +++++++ index.md | 4 ++-- reference.html | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index afa4cf71150..01668fc2dda 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -149,6 +149,13 @@ p code, td:last-child code { color: #666; } +p, ul, ol, table { + font-size: 13px; +} +code { + font-size: 12px; +} + /*.api-page td:last-child pre { margin-top: 0.5em; }*/ diff --git a/index.md b/index.md index 0c988ea77fc..ce9f5978fe2 100644 --- a/index.md +++ b/index.md @@ -6,14 +6,14 @@ layout: default Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 31 KB of JS code, +Weighing just about 31 KB of JS, it has all the [features][] most developers ever need for online maps. 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 still being accessible on older ones. It can be extended with many [plugins][], has a beautiful, easy to use and [well-documented API][] -and a simple, readable [source code][] that is a joy to [contribute][] to. +and a simple, readable [source code][] that is a joy to [contribute][] to. {: .usedby} Used by: diff --git a/reference.html b/reference.html index b2d358c2454..c5ef982b904 100644 --- a/reference.html +++ b/reference.html @@ -5,7 +5,7 @@ ---
      -
      +

      Map

      • Usage example
      • @@ -80,7 +80,7 @@

        Controls

        Events

        Utility

        From db2f28fef4a1caef7f96b258920950d878c81659 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 11:47:27 -0400 Subject: [PATCH 435/816] fix Steve's name in the blog post --- .../2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index ff1712bc6fa..6fff0738b92 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -10,11 +10,11 @@ _Leaflet 0.6 released — with nicer controls, better usability and tons of After 5 months of active development with [36 contributors involved](https://github.com/Leaflet/Leaflet/graphs/contributors?from=2013-01-18&to=2013-06-26&type=c) since the previous major version, today I'm excited to finally announce the **release of Leaflet 0.6** stable. -0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ changes**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. +0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ total**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. The final push for the release (last 2 days) was a part of the first ever **Leaflet Code Sprint**, organized in Washington DC by the amazing [MapBox](http://mapbox.com), a company responsible for perhaps the greatest innovations and awesome tools in the geospatial world of recent years. The sprint will go on for a week and there are many more awesome improvements to come in upcoming days (and lots of partying as well). -Special thanks go to [Universal Mind](http://universalmind.com/), my awesome employer and sponsor of Leaflet development for the past 5 months, to the most active contributors — [John Firebaugh](https://github.com/jfirebaugh) and [Tom MacWright](https://github.com/tmcw) of [MapBox](http://mapbox.com), [Dave Leaver](https://github.com/danzel) and [Jacob Toye](https://github.com/jacobtoye) of [Smartrak](http://www.smartrak.co.nz/), [Steve Kashis](https://github.com/snkashis) of [CaerusGeo](http://www.caerusgeo.com/), and to everyone else involved in contributions, bug reports, mailing list, Twitter, making awesome apps, etc. You're such an amazing community! I'm really happy to be a part of it. +Special thanks go to [Universal Mind](http://universalmind.com/), my awesome employer and sponsor of Leaflet development for the past 5 months, to the most active contributors — [John Firebaugh](https://github.com/jfirebaugh) and [Tom MacWright](https://github.com/tmcw) of [MapBox](http://mapbox.com), [Dave Leaver](https://github.com/danzel) and [Jacob Toye](https://github.com/jacobtoye) of [Smartrak](http://www.smartrak.co.nz/), [Steve Kashishian](https://github.com/snkashis) of [CaerusGeo](http://www.caerusgeo.com/), and to everyone else involved in contributions, bug reports, mailing list, Twitter, making awesome apps, etc. You're such an amazing community! I'm really happy to be a part of it. Grab the CDN links or downloads for the new release on the [download page](../../../download.html) as always. Enjoy! And be sure try it out and report any regressions in your apps so that we can patch them up immediately. From bbc466762abd254f072aef38574714e9a999c6c5 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 12:26:16 -0400 Subject: [PATCH 436/816] add a note about GitHub and Mapbox.js --- .../2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index 6fff0738b92..60f2bbdea54 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -12,7 +12,9 @@ After 5 months of active development with [36 contributors involved](https://git 0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ total**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. -The final push for the release (last 2 days) was a part of the first ever **Leaflet Code Sprint**, organized in Washington DC by the amazing [MapBox](http://mapbox.com), a company responsible for perhaps the greatest innovations and awesome tools in the geospatial world of recent years. The sprint will go on for a week and there are many more awesome improvements to come in upcoming days (and lots of partying as well). +The final push for the release (last 2 days) was a part of the first ever **Leaflet Code Sprint**, organized in Washington DC by the amazing [MapBox](http://mapbox.com), a company responsible for perhaps the greatest innovations and awesome tools in the geospatial world of recent years, now [using Leaflet for its JS API](mapbox.com/blog/mapbox-js-with-leaflet/) too. The sprint will go on for a week and there are many more awesome improvements to come in upcoming days (and lots of partying as well). + +On a related note, even GitHub itself is now [using Leaflet for GeoJSON visualizations](https://github.com/blog/1541-geojson-rendering-improvements), along with [Leaflet.markercluster](github.com/Leaflet/Leaflet.markercluster) & MapBox tiles! How cool is that? Special thanks go to [Universal Mind](http://universalmind.com/), my awesome employer and sponsor of Leaflet development for the past 5 months, to the most active contributors — [John Firebaugh](https://github.com/jfirebaugh) and [Tom MacWright](https://github.com/tmcw) of [MapBox](http://mapbox.com), [Dave Leaver](https://github.com/danzel) and [Jacob Toye](https://github.com/jacobtoye) of [Smartrak](http://www.smartrak.co.nz/), [Steve Kashishian](https://github.com/snkashis) of [CaerusGeo](http://www.caerusgeo.com/), and to everyone else involved in contributions, bug reports, mailing list, Twitter, making awesome apps, etc. You're such an amazing community! I'm really happy to be a part of it. From d498f442e821c40c7238ac8111dec52641ffacf8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Jun 2013 12:34:56 -0400 Subject: [PATCH 437/816] mention saving to geojson in release post --- _posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index 60f2bbdea54..4f6a1ad006d 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -10,7 +10,7 @@ _Leaflet 0.6 released — with nicer controls, better usability and tons of After 5 months of active development with [36 contributors involved](https://github.com/Leaflet/Leaflet/graphs/contributors?from=2013-01-18&to=2013-06-26&type=c) since the previous major version, today I'm excited to finally announce the **release of Leaflet 0.6** stable. -0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ total**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. +0.6 highlights include nicer controls, lots of interaction usability improvements, many new API methods, events and options, ability to save layers as [GeoJSON](http://en.wikipedia.org/wiki/GeoJSON), much better test infrastructure and TONS of bugfixes that made Leaflet significantly more reliable. Checkout the huge detailed list of changes (**120+ total**!) [in the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md). The [API reference](../../../reference.html) was also updated to reflect all these changes. The final push for the release (last 2 days) was a part of the first ever **Leaflet Code Sprint**, organized in Washington DC by the amazing [MapBox](http://mapbox.com), a company responsible for perhaps the greatest innovations and awesome tools in the geospatial world of recent years, now [using Leaflet for its JS API](mapbox.com/blog/mapbox-js-with-leaflet/) too. The sprint will go on for a week and there are many more awesome improvements to come in upcoming days (and lots of partying as well). From e03567f7963d6a757a676060b3ed18ab561b81e1 Mon Sep 17 00:00:00 2001 From: Ishmael Smyrnow Date: Wed, 26 Jun 2013 14:30:50 -0400 Subject: [PATCH 438/816] Add Leaflet.GroupedLayerControl to plugin list --- plugins.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index b04426930f4..4bbd9c062c8 100644 --- a/plugins.md +++ b/plugins.md @@ -603,7 +603,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bjørn Sandvik - + + + + Leaflet.GroupedLayerControl + + Leaflet layer control with support for grouping overlays together. + + Ishmael Smyrnow + + From 00123f1327f5a1c54d68be7757e466d54bd5e6ad Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 27 Jun 2013 10:47:20 -0400 Subject: [PATCH 439/816] update links to 0.6.1 and a note in the blog post --- ...06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 2 ++ download.md | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index 4f6a1ad006d..5891156f134 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -20,6 +20,8 @@ Special thanks go to [Universal Mind](http://universalmind.com/), my awesome emp Grab the CDN links or downloads for the new release on the [download page](../../../download.html) as always. Enjoy! And be sure try it out and report any regressions in your apps so that we can patch them up immediately. +**update** (June 27): 0.6.1 released with a couple of regressions fixed (particularly the one with FF scroll-zooming too fast). + P.S. Everyone who tweets/posts about the new Leaflet release or why he loves Leaflet over the next few days will get a karma boost of over 9000 points. I heard that from a passing monk in Georgetown yesterday, true story! Cheers,
        diff --git a/download.md b/download.md index a11958cdf68..db13bf96aac 100644 --- a/download.md +++ b/download.md @@ -13,8 +13,8 @@ Besides the library itself, the download package contains full source code, unit Description - Leaflet 0.6 - Stable version, released on June 26, 2013 + Leaflet 0.6.1 + Stable version, released on June 26, 2013 and last updated on June 27, 2013 Leaflet 0.5.1 @@ -35,12 +35,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this code in the `head` section of your HTML: - + - + ### Building Leaflet from the Source From 946647257d95a8d6295eeefd900e85b6cc44e14d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jun 2013 14:30:40 -0400 Subject: [PATCH 440/816] First swipe at a member reference link --- reference.html | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/reference.html b/reference.html index c5ef982b904..496d72a1389 100644 --- a/reference.html +++ b/reference.html @@ -168,7 +168,7 @@

        Options

        Map State Options

        - +
        @@ -221,7 +221,7 @@

        Map State Options

        Interaction Options

        -
        Option Type
        +
        @@ -292,7 +292,7 @@

        Interaction Options

        Keyboard Navigation Options

        -
        Option Type
        +
        @@ -321,7 +321,7 @@

        Keyboard Navigation Options

        Panning Inertia Options

        -
        Option Type
        +
        @@ -356,7 +356,7 @@

        Panning Inertia Options

        Control options

        -
        Option Type
        +
        @@ -379,7 +379,7 @@

        Control options

        Animation options

        -
        Option Type
        +
        @@ -417,7 +417,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Option Type
        +
        @@ -598,7 +598,7 @@

        Events

        Methods for Modifying Map State

        -
        Event Data
        +
        @@ -720,7 +720,7 @@

        Methods for Modifying Map State

        Methods for Getting Map State

        -
        Method Returns
        +
        @@ -780,7 +780,7 @@

        Methods for Getting Map State

        Methods for Layers and Controls

        -
        Method Returns
        +
        @@ -858,7 +858,7 @@

        Methods for Layers and Controls

        Conversion Methods

        -
        Method Returns
        +
        @@ -6294,3 +6294,16 @@

        L.version

        A constant that represents the Leaflet version in use.

        L.version // returns "0.5" (or whatever version is currently in use)
        + + From a6360cc91e5a8e442694978afb5e1d130f832681 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jun 2013 14:49:02 -0400 Subject: [PATCH 441/816] Add links to all sections, do lowercase with dashes --- reference.html | 252 ++++++++++++++++++++++++------------------------- 1 file changed, 126 insertions(+), 126 deletions(-) diff --git a/reference.html b/reference.html index 496d72a1389..14a9eb5046f 100644 --- a/reference.html +++ b/reference.html @@ -958,7 +958,7 @@

        Conversion Methods

        Other Methods

        -
        Method Returns
        +
        @@ -969,12 +969,12 @@

        Other Methods

        - + - + @@ -985,7 +985,7 @@

        Other Methods

        Locate options

        -
        Method Returns HTMLElement Returns the container element of the map.
        getPanes() MapPanes Returns an object with different map panes (to render overlays in).
        whenReady( <Function> fn, <Object> context? )
        +
        @@ -1033,7 +1033,7 @@

        Locate options

        Zoom/pan options

        -
        Option Type
        +
        @@ -1068,7 +1068,7 @@

        Zoom/pan options

        Pan options

        -
        Option Type
        +
        @@ -1103,7 +1103,7 @@

        Pan options

        Zoom options

        -
        Option Type
        +
        @@ -1122,7 +1122,7 @@

        fitBounds options

        The same as zoom/pan options and additionally:

        -
        Option Type
        +
        @@ -1160,7 +1160,7 @@

        Properties

        map.attributionControl.addAttribution("Earthquake data &copy; GeoNames");
        -
        Option Type
        +
        @@ -1218,7 +1218,7 @@

        Map Panes

        An object literal (returned by map.getPanes) that contains different map panes that you can use to put your custom overlays in. The difference is mostly in zIndex order that such overlays get.

        -
        Property Type
        +
        @@ -1270,7 +1270,7 @@

        L.Marker

        Constructor

        -
        Property Type
        +
        @@ -1293,7 +1293,7 @@

        Constructor

        Options

        -
        Constructor Usage
        +
        @@ -1360,7 +1360,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Option Type
        +
        @@ -1435,7 +1435,7 @@

        Events

        Methods

        -
        Event Data
        +
        @@ -1543,7 +1543,7 @@

        Interaction handlers

        marker.dragging.disable();
        -
        Method Returns
        +
        @@ -1574,7 +1574,7 @@

        Usage example

        Constructor

        -
        Property Type
        +
        @@ -1597,7 +1597,7 @@

        Constructor

        -
        Constructor Usage
        +
        @@ -1670,7 +1670,7 @@

        Methods

        -
        Option Type
        +
        @@ -1725,7 +1725,7 @@

        Usage example

        Constructor

        -
        Method Returns
        +
        @@ -1760,7 +1760,7 @@

        URL template

        Options

        -
        Constructor Usage
        +
        @@ -1875,7 +1875,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Option Type
        +
        @@ -1905,7 +1905,7 @@

        Events

        Methods

        -
        Event Data
        +
        @@ -1982,7 +1982,7 @@

        Usage example

        Constructor

        -
        Method Returns
        +
        @@ -2007,7 +2007,7 @@

        Options

        Includes all TileLayer options and additionally:

        -
        Constructor Usage
        +
        @@ -2054,7 +2054,7 @@

        Options

        Methods

        -
        Option Type
        +
        @@ -2086,7 +2086,7 @@

        Usage example

        Constructor

        -
        Method Returns
        +
        @@ -2105,7 +2105,7 @@

        Constructor

        Constructor Usage

        Options

        - +
        @@ -2122,7 +2122,7 @@

        Options

        Methods

        -
        Option Type
        +
        @@ -2158,7 +2158,7 @@

        Usage example

        Constructor

        -
        Method Returns
        +
        @@ -2181,7 +2181,7 @@

        Constructor

        Constructor Usage

        Options

        - +
        @@ -2197,7 +2197,7 @@

        Options

        Option Type

        Methods

        - +
        @@ -2236,7 +2236,7 @@

        L.Path

        An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly.

        Options

        -
        Method Returns
        +
        @@ -2309,7 +2309,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Option Type
        +
        @@ -2368,7 +2368,7 @@

        Events

        Event Data

        Methods

        - +
        @@ -2450,7 +2450,7 @@

        Methods

        Method Returns

        Static properties

        - +
        @@ -2497,7 +2497,7 @@

        Usage example

        Constructor

        -
        Constant Type
        +
        @@ -2522,7 +2522,7 @@

        Options

        You can use Path options and additionally the following options:

        -
        Constructor Usage
        +
        @@ -2547,7 +2547,7 @@

        Methods

        You can use Path methods and additionally the following methods:

        -
        Option Type
        +
        @@ -2604,7 +2604,7 @@

        L.MultiPolyline

        Constructor

        -
        Method Returns
        +
        @@ -2632,7 +2632,7 @@

        Methods

        have different behavior around their coordinate contents since they can contain multiple line features:

        -
        Constructor Usage
        +
        @@ -2671,7 +2671,7 @@

        L.Polygon

        Constructor

        -
        Method Returns
        +
        @@ -2696,7 +2696,7 @@

        Methods

        Polygon has the same options and methods as Polyline, with the following differences:

        -
        Constructor Usage
        +
        @@ -2716,7 +2716,7 @@

        L.MultiPolygon

        Constructor

        -
        Method Returns
        +
        @@ -2743,7 +2743,7 @@

        Methods

        have different behavior around their coordinate contents since they can contain multiple polygon features:

        -
        Constructor Usage
        +
        @@ -2788,7 +2788,7 @@

        Usage example

        Constructor

        -
        Method Returns
        +
        @@ -2813,7 +2813,7 @@

        Methods

        You can use Path methods and additionally the following methods:

        -
        Constructor Usage
        +
        @@ -2838,7 +2838,7 @@

        L.Circle

        Constructor

        -
        Method Returns
        +
        @@ -2862,7 +2862,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -2909,7 +2909,7 @@

        L.CircleMarker

        Constructor

        -
        Method Returns
        +
        @@ -2932,7 +2932,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -2973,7 +2973,7 @@

        L.LayerGroup

        Constructor

        -
        Method Returns
        +
        @@ -2995,7 +2995,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -3091,7 +3091,7 @@

        L.FeatureGroup

        Constructor

        -
        Method Returns
        +
        @@ -3115,7 +3115,7 @@

        Methods

        Has all LayerGroup methods and additionally:

        -
        Constructor Usage
        +
        @@ -3158,7 +3158,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Method Returns
        +
        @@ -3224,7 +3224,7 @@

        L.GeoJSON

        Constructor

        -
        Event Data
        +
        @@ -3247,7 +3247,7 @@

        Constructor

        Options

        -
        Constructor Usage
        +
        @@ -3295,7 +3295,7 @@

        Options

        Methods

        -
        Option Description
        +
        @@ -3329,7 +3329,7 @@

        Methods

        Static methods

        -
        Method Returns
        +
        @@ -3382,7 +3382,7 @@

        L.LatLng

        Constructor

        -
        Method Returns
        +
        @@ -3406,7 +3406,7 @@

        Constructor

        Properties

        -
        Constructor Usage
        +
        @@ -3426,7 +3426,7 @@

        Properties

        Methods

        -
        Property Type
        +
        @@ -3466,7 +3466,7 @@

        Methods

        Constants

        -
        Method Returns
        +
        @@ -3512,7 +3512,7 @@

        L.LatLngBounds

        Constructor

        -
        Constant Type
        +
        @@ -3547,7 +3547,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -3676,7 +3676,7 @@

        L.Point

        Constructor

        -
        Method Returns
        +
        @@ -3700,7 +3700,7 @@

        Constructor

        Properties

        -
        Constructor Usage
        +
        @@ -3720,7 +3720,7 @@

        Properties

        Methods

        -
        Property Type
        +
        @@ -3807,7 +3807,7 @@

        L.Bounds

        Constructor

        -
        Method Returns
        +
        @@ -3843,7 +3843,7 @@

        Constructor

        Properties

        -
        Constructor Usage
        +
        @@ -3863,7 +3863,7 @@

        Properties

        Methods

        -
        Property Type
        +
        @@ -3943,7 +3943,7 @@

        L.Icon

        Constructor

        -
        Method Returns
        +
        @@ -3965,7 +3965,7 @@

        Constructor

        Options

        -
        Constructor Usage
        +
        @@ -4037,7 +4037,7 @@

        L.DivIcon

        Constructor

        -
        Option Type
        +
        @@ -4059,7 +4059,7 @@

        Constructor

        Options

        -
        Constructor Usage
        +
        @@ -4099,7 +4099,7 @@

        L.Control

        map.addControl(control);

        Constructor

        -
        Option Type
        +
        @@ -4120,7 +4120,7 @@

        Constructor

        Constructor Usage

        Options

        - +
        @@ -4136,7 +4136,7 @@

        Options

        Option Type

        Methods

        - +
        @@ -4182,7 +4182,7 @@

        Control Positions

        Control positions (map corner to put a control to) are set using strings. Margins between controls and the map border are set with CSS, so that you can easily override them.

        -
        Method Returns
        +
        @@ -4211,7 +4211,7 @@

        L.Control.Zoom

        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 to false. Extends Control.

        Constructor

        -
        Position Description
        +
        @@ -4232,7 +4232,7 @@

        Constructor

        Constructor Usage

        Options

        - +
        @@ -4254,7 +4254,7 @@

        L.Control.Attribution

        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 to false, and it fetches attribution texts from layers with getAttribution method automatically. Extends Control.

        Constructor

        -
        Option Type
        +
        @@ -4275,7 +4275,7 @@

        Constructor

        Constructor Usage

        Options

        - +
        @@ -4297,7 +4297,7 @@

        Options

        Option Type

        Methods

        - +
        @@ -4344,7 +4344,7 @@

        L.Control.Layers

        L.control.layers(baseLayers, overlays).addTo(map);

        Constructor

        -
        Method Returns
        +
        @@ -4365,7 +4365,7 @@

        Constructor

        Constructor Usage

        Methods

        - +
        @@ -4398,7 +4398,7 @@

        Methods

        Options

        -
        Method Returns
        +
        @@ -4444,7 +4444,7 @@

        Events

        You can subscribe to the following events on the Map object using these methods.

        -
        Option Type
        +
        @@ -4475,7 +4475,7 @@

        L.Control.Scale

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

        Constructor

        -
        Event Data
        +
        @@ -4497,7 +4497,7 @@

        Constructor

        Options

        -
        Constructor Usage
        +
        @@ -4556,7 +4556,7 @@

        Example

        map.off('click', onClick);

        Methods

        -
        Option Type
        +
        @@ -4674,7 +4674,7 @@

        Event

        The base event object. All other event objects contain these properties too.

        -
        Method Returns
        +
        @@ -4724,7 +4724,7 @@

        MouseEvent

        LocationEvent

        -
        property type
        +
        @@ -4779,7 +4779,7 @@

        LocationEvent

        ErrorEvent

        -
        property type
        +
        @@ -4799,7 +4799,7 @@

        ErrorEvent

        LayerEvent

        -
        property type
        +
        @@ -4814,7 +4814,7 @@

        LayerEvent

        LayersControlEvent

        -
        property type
        +
        @@ -4834,7 +4834,7 @@

        LayersControlEvent

        TileEvent

        -
        property type
        +
        @@ -4854,7 +4854,7 @@

        TileEvent

        ResizeEvent

        -
        property type
        +
        @@ -4874,7 +4874,7 @@

        ResizeEvent

        GeoJSON event

        -
        property type
        +
        @@ -4904,7 +4904,7 @@

        GeoJSON event

        -
        property type
        +
        @@ -5084,7 +5084,7 @@

        L.Browser

        alert('Upgrade your browser, dude!'); } -
        property type
        +
        @@ -5174,7 +5174,7 @@

        L.Util

        Methods

        -
        property type
        +
        @@ -5294,7 +5294,7 @@

        Methods

        Properties

        -
        Method Returns
        +
        @@ -5321,7 +5321,7 @@

        L.Transformation

        Constructor

        -
        Property Type
        +
        @@ -5347,7 +5347,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -5382,7 +5382,7 @@

        L.LineUtil

        Methods

        -
        Method Returns
        +
        @@ -5441,7 +5441,7 @@

        L.PolyUtil

        Methods

        -
        Method Returns
        +
        @@ -5468,7 +5468,7 @@

        L.DomEvent

        Methods

        -
        Method Returns
        +
        @@ -5560,7 +5560,7 @@

        L.DomUtil

        Methods

        -
        Method Returns
        +
        @@ -5698,7 +5698,7 @@

        Methods

        Properties

        -
        Method Returns
        +
        @@ -5729,7 +5729,7 @@

        L.PosAnimation

        Constructor

        -
        Property Type
        +
        @@ -5748,7 +5748,7 @@

        Constructor

        Methods

        -
        Constructor Usage
        +
        @@ -5771,7 +5771,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Method Returns
        +
        @@ -5806,7 +5806,7 @@

        L.Draggable

        Constructor

        -
        Event Data
        +
        @@ -5831,7 +5831,7 @@

        Events

        You can subscribe to the following events using these methods.

        -
        Constructor Usage
        +
        @@ -5861,7 +5861,7 @@

        Events

        Methods

        -
        Event Data
        +
        @@ -5909,7 +5909,7 @@

        Methods

        IHandler

        An interface implemented by interaction handlers.

        -
        Method Returns
        +
        @@ -5939,7 +5939,7 @@

        ILayer

        Methods

        -
        Method Returns
        +
        @@ -6020,7 +6020,7 @@

        Methods

        Every control in Leaflet should extend from Control class and additionally have the following methods:

        -
        Method Returns
        +
        @@ -6087,7 +6087,7 @@

        IProjection

        Methods

        -
        Method Returns
        +
        @@ -6115,7 +6115,7 @@

        Defined Projections

        Leaflet comes with a set of already defined projections out of the box:

        -
        Method Returns
        +
        @@ -6146,7 +6146,7 @@

        ICRS

        Methods

        -
        Projection Description
        +
        @@ -6190,7 +6190,7 @@

        Methods

        Properties

        -
        Method Returns
        +
        @@ -6221,7 +6221,7 @@

        Defined CRS

        Leaflet comes with a set of already defined CRS to use out of the box:

        -
        Property Type
        +
        @@ -6258,7 +6258,7 @@

        Global Switches

        <script>L_PREFER_CANVAS = true;</script>
         <script src="leaflet.js"></script>
        -
        Projection Description
        +
        @@ -6302,7 +6302,7 @@

        L.version

        tds = tables[i].getElementsByTagName('td'), tdl = tds.length; for (var j = 0; j < tdl; j++) { if (tds[j].cellIndex === 0) { - tds[j].id = id + '.' + tds[j].innerText.split('(')[0]; + tds[j].id = id + '-' + tds[j].innerText.split('(')[0].toLowerCase(); } } } From c7668676f1af9bd5cc390d48ae910d1e8f193a24 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 27 Jun 2013 18:15:50 -0400 Subject: [PATCH 442/816] add anchor highlighting to the reference --- docs/css/screen.css | 21 +++++++++++++++++++++ reference.html | 10 +++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 01668fc2dda..abe7ca63f1c 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -548,3 +548,24 @@ p.notice { #disqus_thread { margin-top: 3em; } + +tr:target { + background: yellow; + -webkit-animation: highlight 2s ease 0.5s 1 normal forwards; + -moz-animation: highlight 2s ease 0.5s 1 normal forwards; + -o-animation: highlight 2s ease 0.5s 1 normal forwards; + animation: highlight 2s ease 0.5s 1 normal forwards; +} + +@-webkit-keyframes highlight { + 0% { background: yellow; } + 100% { background: white; } +} +@-moz-keyframes highlight { + 0% { background: yellow; } + 100% { background: white; } +} +@keyframes highlight { + 0% { background: yellow; } + 100% { background: white; } +} diff --git a/reference.html b/reference.html index 14a9eb5046f..119bc32fe55 100644 --- a/reference.html +++ b/reference.html @@ -6296,13 +6296,13 @@

        L.version

        L.version // returns "0.5" (or whatever version is currently in use)
        + ### Building Leaflet from the Source From 7a1394790e52b3cfaf7f5f9cd467ffecbe72b9eb Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 28 Jun 2013 16:46:11 -0400 Subject: [PATCH 445/816] update build --- dist/leaflet-src.js | 7 +++---- dist/leaflet.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index 3cdaea8c3df..06561d19fa8 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -3607,8 +3607,7 @@ L.Marker = L.Class.extend({ // TODO refactor into something shared with Map/Path/etc. to DRY it up var icon = this._icon, - events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick', 'contextmenu']; + events = ['dblclick', 'mousedown', 'mouseover', 'mouseout', 'contextmenu']; L.DomUtil.addClass(icon, 'leaflet-clickable'); L.DomEvent.on(icon, 'click', this._onMouseClick, this); @@ -4588,8 +4587,8 @@ L.Path = L.Path.extend({ L.DomEvent.on(this._container, 'click', this._onMouseClick, this); - var events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick', 'contextmenu']; + var events = ['dblclick', 'mousedown', 'mouseover', + 'mouseout', 'mousemove', 'contextmenu']; for (var i = 0; i < events.length; i++) { L.DomEvent.on(this._container, events[i], this._fireMouseEvent, this); } diff --git a/dist/leaflet.js b/dist/leaflet.js index 8899c340670..5aa723800a8 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -4,6 +4,6 @@ (c) 2010-2011, CloudMade */ !function(t,e,i){var n=t.L,o={};o.version="0.6.2","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],i?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=i&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n=!!t.ActiveXObject,s=n&&!t.XMLHttpRequest,a=n&&!e.querySelector,r=n&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("phantom"),d=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",m=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,L="MozPerspective"in g.style,P="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||L||P)&&!c,w=!t.L_NO_TOUCH&&!c&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ie6:s,ie7:a,ielt9:r,webkit:l,android:d,android23:p,chrome:u,ie3d:v,webkit3d:y,gecko3d:L,opera3d:P,any3d:x,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&y,mobileOpera:_&&t.opera,touch:w,msTouch:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement,l=o.Browser.ie7;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var u=o.DomUtil.getStyle(a,"width"),c=o.DomUtil.getStyle(a,"max-width"),d=a.getBoundingClientRect();("none"!==u||"none"!==c)&&(s+=d.left+a.clientLeft),n+=d.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==o.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){return t.className.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){o.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){t.className=o.Util.trim((" "+t.className+" ").replace(" "+e+" "," "))},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?new o.LatLng(t[0],t[1]):t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){return t?(t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this):this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this.setView(this.getCenter(),t,{zoom:e})},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){if(t=o.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var e=this.getBoundsZoom(t,!0);return this._boundsMinZoom=e,this._loaded&&(this._zooma.x&&(r=Math.floor(a.x-n.x)),i.y>s.y&&(h=Math.floor(s.y-i.y)),i.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&this.dragging&&this.dragging.moved()||t._leaflet_stop||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!t._leaflet_stop){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new o.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update() -},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i)||t.y<0||t.y>=i)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs;var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,n=this.options.tileSize,s=t.multiplyBy(n),a=s.add([n,n]),r=this._crs.project(i.unproject(s,e)),h=this._crs.project(i.unproject(a,e)),l=[r.x,h.y,h.x,r.y].join(","),u=o.Util.template(this._url,{s:this._getSubdomain(t)});return u+o.Util.getParamString(this.wmsParams,u,!0)+"&BBOX="+l},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return o.Browser.ie6?(i||(i=e.createElement("div")),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i||(i=e.createElement("img")),i.src=t),i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0,r&&o.DomUtil.addClass(r,n)),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["mousedown","mouseup","mouseover","mouseout","mousemove","dblclick","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=t.getSize(),h=0,l=0;s.x+i>r.x&&(h=s.x+i-r.x+a.x),s.x-h<0&&(h=s.x-a.x),s.y+e>r.y&&(l=s.y+e-r.y+a.y),s.y-l<0&&(l=s.y-a.y),(h||l)&&t.fire("autopanstart").panBy([h,l])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:(t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:o.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["mousedown","mouseup","mouseover","mouseout","mousemove","dblclick","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t) +},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i)||t.y<0||t.y>=i)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs;var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,n=this.options.tileSize,s=t.multiplyBy(n),a=s.add([n,n]),r=this._crs.project(i.unproject(s,e)),h=this._crs.project(i.unproject(a,e)),l=[r.x,h.y,h.x,r.y].join(","),u=o.Util.template(this._url,{s:this._getSubdomain(t)});return u+o.Util.getParamString(this.wmsParams,u,!0)+"&BBOX="+l},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return o.Browser.ie6?(i||(i=e.createElement("div")),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i||(i=e.createElement("img")),i.src=t),i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0,r&&o.DomUtil.addClass(r,n)),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=t.getSize(),h=0,l=0;s.x+i>r.x&&(h=s.x+i-r.x+a.x),s.x-h<0&&(h=s.x-a.x),s.y+e>r.y&&(l=s.y+e-r.y+a.y),s.y-l<0&&(l=s.y-a.y),(h||l)&&t.fire("autopanstart").panBy([h,l])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:(t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:o.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(t.innerWidth,t.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t) },_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){var i,n,s;if(o.Polyline.prototype.initialize.call(this,t,e),t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),i=0,n=this._holes.length;n>i;i++)s=this._holes[i]=this._convertLatLngs(this._holes[i]),s[0].equals(s[s.length-1])&&s.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n=o.Util.isArray(t)?t:t.features;if(n){for(e=0,i=n.length;i>e;e++)(n[e].geometries||n[e].geometry||n[e].features)&&this.addData(n[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=o.GeoJSON.geometryToLayer(t,s.pointToLayer,s.coordsToLatLng);return a.feature=o.GeoJSON.asFeature(t),a.defaultOptions=a.options,this.resetStyle(a),s.onEachFeature&&s.onEachFeature(t,a),this.addLayer(a)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i){var n,s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return n=i(u),e?e(t,n):new o.Marker(n);case"MultiPoint":for(a=0,r=u.length;r>a;a++)n=i(u[a]),h=e?e(t,n):new o.Marker(n),c.push(h);return new o.FeatureGroup(c);case"LineString":return s=this.coordsToLatLngs(u,0,i),new o.Polyline(s);case"Polygon":return s=this.coordsToLatLngs(u,1,i),new o.Polygon(s);case"MultiLineString":return s=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(s);case"MultiPolygon":return s=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(s);case"GeometryCollection":for(a=0,r=l.geometries.length;r>a;a++)h=this.geometryToLayer({geometry:l.geometries[a],type:"Feature",properties:t.properties},e,i),c.push(h);return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){return[t.lng,t.lat]},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t,e){t.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){t.push(e.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:e,coordinates:t})}})}t(o.MultiPolyline,"MultiLineString"),t(o.MultiPolygon,"MultiPolygon")}(),o.LayerGroup.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){e.toGeoJSON&&t.push(o.GeoJSON.asFeature(e.toGeoJSON()))}),{type:"FeatureCollection",features:t}}}),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.addListener(t,o.Draggable.START[i],e);return o.DomEvent.addListener(t,"click",o.DomEvent._fakeStop).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=t.pageX?t.pageX:t.clientX+n.scrollLeft+s.scrollLeft,r=t.pageY?t.pageY:t.clientY+n.scrollTop+s.scrollTop,h=new o.Point(a,r);return i?h._subtract(o.DomUtil.getViewportOffset(i)):h},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_fakeStop:function(t){t._leaflet_stop=!0},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!t.shiftKey&&(1===t.which||1===t.button||t.touches)&&(o.DomEvent.stopPropagation(t),!o.Draggable._disabled)){o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection();var i=t.touches?t.touches[0]:t,n=i.target;o.Browser.touch&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.Browser.touch||o.DomUtil.addClass(e.body,"leaflet-dragging")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){o.Browser.touch||o.DomUtil.removeClass(e.body,"leaflet-dragging");for(var t in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[t],this._onMove).off(e,o.Draggable.END[t],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(t.fire("dragend"),n)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),d=u/(e.inertiaDeceleration*r),p=c.multiplyBy(-d/2).round();p.x&&p.y?o.Util.requestAnimFrame(function(){t.panBy(p,{duration:d,easeLinearity:r,noMoveStart:!0})}):t.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setZoomAround(t.containerPoint,this._zoom+1)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&t.setZoomAround(this._lastMousePos,i+e)}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:o.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.msTouch?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.msTouch){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.msTouch){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.msTouch?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;i0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i)) },this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.msTouch&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollTop||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):(o.DomEvent.disableClickPropagation(e),o.DomEvent.on(e,"mousewheel",o.DomEvent.stopPropagation));var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){this._el._leaflet_pos=this._getPos(),this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);return o.Browser.any3d?(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),e=n?parseFloat(n[1]):0,i=n?parseFloat(n[2]):0):(e=parseFloat(a.left),i=parseFloat(a.top)),new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=this._limitZoom(e),t=o.latLng(t),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file From 2585d71a5af3f94c02cb684220e0151e0ce4a032 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 28 Jun 2013 17:00:25 -0400 Subject: [PATCH 446/816] blog post with plugin authoring guide --- ...13-06-28-leaflet-plugin-authoring-guide.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 _posts/2013-06-28-leaflet-plugin-authoring-guide.md diff --git a/_posts/2013-06-28-leaflet-plugin-authoring-guide.md b/_posts/2013-06-28-leaflet-plugin-authoring-guide.md new file mode 100644 index 00000000000..8fd5f4ace0f --- /dev/null +++ b/_posts/2013-06-28-leaflet-plugin-authoring-guide.md @@ -0,0 +1,111 @@ +--- +layout: post +title: Leaflet Plugin Authoring Guide +description: A number of best practices and tips for publishing your own perfect Leaflet plugin +author: Vladimir Agafonkin +authorsite: http://agafonkin.com/en +--- + +One of the greatest things about Leaflet is its powerful plugin ecosystem. +The [Leaflet plugins page](http://leafletjs.com/plugins.html) lists dozens of awesome plugins, and more are being added every week. + +This guide lists a number of best practices for publishing a Leaflet plugin that meets the quality standards of Leaflet itself. Also available [in the repo](https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md). + +### Presentation + +#### Repository + +The best place to put your Leaflet plugin to is a separate [GitHub](http://github.com) repository. +If you create a collection of plugins for different uses, +don't put them in one repo — +it's usually easier to work with small, self-contained plugins in individual repositories. + +#### Demo + +The most essential thing to do when publishing a plugin is to include a demo that showcases what the plugin does — +it's usually the first thing people will look for. + +The easiest way to put up a demo is using [GitHub Pages](http://pages.github.com/). +A good [starting point](https://help.github.com/articles/creating-project-pages-manually) is creating a `gh-pages` branch in your repo and adding an `index.html` page to it — +after pushing, it'll be published as `http://.github.io/`. + +#### Readme + +The next thing you need to have is a descriptive `README.md` in the root of the repo (or a link to a website with a similar content). +At a minimum it should contain the following items: + +- name of the plugin +- a simple, concise description of what it does +- requirements + - Leaflet version + - other external dependencies (if any) + - browser / device compatibility +- links to demos +- instructions for including the plugin +- simple usage code example +- API reference (methods, options, events) + +#### License + +Every open source repository should include a license. +If you don't know what open source license to choose for your code, +[MIT License](http://opensource.org/licenses/MIT) and [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) are both good choices. +You can either put it in the repo as a `LICENSE` file or just link to the license from the Readme. + +### Code + +#### File Structure + +Keep the file structure clean and simple, +don't pile up lots of files in one place — +make it easy for a new person to find their way in your repo. + +A barebones repo for a simple plugin would like this: + + my-plugin.js + README.md + +An example of a file structure for a more sophisticated plugin: + + /src JS source files + /dist minified plugin JS, CSS, images + /spec test files + /examples HTML examples of plugin usage + README.md + LICENSE + package.json + +#### Code Conventions + +Everyone's tastes are different, but it's important to be consistent with whatever conventions you choose for your plugin. + +For a good starting point, check out [Airbnb JavaScript Guide](https://github.com/airbnb/javascript). +Leaflet follows pretty much the same conventions +except for using smart tabs (hard tabs for indentation, spaces for alignment) +and putting a space after the `function` keyword. + +#### Plugin API + +Never expose global variables in your plugin.
        +If you have a new class, put it directly in the `L` namespace (`L.MyPlugin`).
        +If you inherit one of the existing classes, make it a sub-property (`L.TileLayer.Banana`).
        +If you want to add new methods to existing Leaflet classes, you can do it like this: `L.Marker.include({myPlugin: …})`. + +Function, method and property names should be in `camelCase`.
        +Class names should be in `CapitalizedCamelCase`. + +If you have a lot of arguments in your function, consider accepting an options object instead (putting default values where possible so that users don't need specify all of them): + + // bad + marker.myPlugin('bla', 'foo', null, {}, 5, 0); + + // good + marker.myPlugin('bla', { + optionOne: 'foo', + optionThree: 5 + }); + +And most importantly, keep it simple. Leaflet is all about *simplicity*. + +Cheers,
        +Vladimir. From e795e484465251dff18f8131d86b6304b005e4d9 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 28 Jun 2013 17:10:45 -0400 Subject: [PATCH 447/816] fix typo --- _posts/2013-06-28-leaflet-plugin-authoring-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-06-28-leaflet-plugin-authoring-guide.md b/_posts/2013-06-28-leaflet-plugin-authoring-guide.md index 8fd5f4ace0f..38c22d854e1 100644 --- a/_posts/2013-06-28-leaflet-plugin-authoring-guide.md +++ b/_posts/2013-06-28-leaflet-plugin-authoring-guide.md @@ -60,7 +60,7 @@ Keep the file structure clean and simple, don't pile up lots of files in one place — make it easy for a new person to find their way in your repo. -A barebones repo for a simple plugin would like this: +A barebones repo for a simple plugin would look like this: my-plugin.js README.md From 02090a32811b028d86e5867f71b16aad67f18715 Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Sat, 29 Jun 2013 00:38:03 -0600 Subject: [PATCH 448/816] Note that only one base layer should be added to the map at instantiation. --- examples/layers-control.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/layers-control.md b/examples/layers-control.md index 0b85c3bf720..6ce2622f388 100644 --- a/examples/layers-control.md +++ b/examples/layers-control.md @@ -64,6 +64,8 @@ Now, all that's left to do is to create a [Layers Control](../reference.html#con Note that we added `minimal`, `motorways` and `cities` layers to the map but didn't add `midnight`. The layers control is smart enough to detect what layers we've already added and have corresponding checkboxes and radioboxes set. +Also note that when using multiple base layers, only one of them should be added to the map at instantiation, but all of them should be present in the base layers object when creating the layers control. + Now lets [view the result on a separate page →](layers-control-example.html) - + + + + + + * Put a `div` element with a certain `id` where you want your map to be: From 2e9cb136b23067d612c81afb323991cb725081be Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 10 Jul 2013 17:13:39 +0300 Subject: [PATCH 461/816] update download links according to #1354 --- download.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/download.md b/download.md index fc96bd2cd3b..1521cf5c9a9 100644 --- a/download.md +++ b/download.md @@ -5,24 +5,26 @@ title: Download ## Download Leaflet -Besides the library itself, the download package contains full source code, unit tests, files for debugging and a build system. The production files are in the `dist` folder. -
        Switch Description
        - - + + + + + + - - + + - - + +
        Version Description
        Leaflet 0.6.2Stable version, released on June 26, 2013 and last updated on June 28, 2013Leaflet 0.6.2Stable version, released on June 26, 2013 and last updated on June 28, 2013.
        Leaflet 0.5.1Previous stable version, released on January 17, 2013 and last updated on February 6, 2013.
        Leaflet 0.5.1Previous stable version, released on January 17, 2013 and last updated on February 6, 2013Leaflet 0.7-devIn-progress major version, developed on the master branch.
        Leaflet masterIn-progress version, developed on the master branchLeaflet 0.6.3-devIn-progress minor version, developed on the stable branch.
        @@ -33,7 +35,7 @@ Note that the master version can contain incompatible changes, so please read th ### Using a Hosted Version of Leaflet The latest stable release of Leaflet is hosted on a CDN — to start using -it straight away, place this code in the `head` section of your HTML: +it straight away, place this in the `head` section of your HTML code: - + ### Leaflet Source Code diff --git a/examples/quick-start.md b/examples/quick-start.md index 62792958747..b01e1e0ebe8 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -19,14 +19,14 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS files in the head section of your document: - + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From 460ffba599fb2f9d1fb7eff737fd659e3651adef Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 17 Jul 2013 19:52:27 +0300 Subject: [PATCH 468/816] remove link to stable branch dev --- download.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download.md b/download.md index 107b91b5ab5..e51b5ad1987 100644 --- a/download.md +++ b/download.md @@ -22,10 +22,10 @@ title: Download Leaflet 0.7-dev In-progress major version, developed on the master branch. - + [View Changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) From 189914f750e083ddeca6b7be46f0da1d22cc980e Mon Sep 17 00:00:00 2001 From: "David\\ Beitey" Date: Thu, 18 Jul 2013 13:56:07 +1000 Subject: [PATCH 469/816] Update documentation regarding addition of options to panInsideBounds and setMaxBounds. Refs #1879 --- reference.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference.html b/reference.html index 7081bd24c4e..bbb9331c052 100644 --- a/reference.html +++ b/reference.html @@ -671,10 +671,11 @@

        Methods for Modifying Map State

        panInsideBounds( - <LatLngBounds> bounds ) + <LatLngBounds> bounds, + <pan options> options? ) this - Pans the map to the closest view that would lie inside the given bounds (if it's not already). + Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any. panBy( @@ -698,7 +699,7 @@

        Methods for Modifying Map State

        <zoom/pan options> options? )
        this - Restricts the map view to the given bounds (see map maxBounds option), passing the given animation options through to `setView`, if required. + Restricts the map view to the given bounds (see map maxBounds option), animating the map view if bounds are changed. The given animation options are passed through to `setView` or `panInsideBounds`, depending on map zoom level, and can be used to control how the map animates during this change. locate( From 3bff3c3eddcf66f351347aefbc81286c705054a8 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 19 Jul 2013 17:47:23 +0200 Subject: [PATCH 470/816] Added leaflet-usermarker to list of plugins --- plugins.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins.md b/plugins.md index 1705aa12d72..3b79734a81d 100644 --- a/plugins.md +++ b/plugins.md @@ -226,6 +226,17 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bjørn Sandvik + + + leaflet-usermarker + + Plugin for plotting a marker representing a user - or multiple users - on a map, + with support for drawing an accuraccy circle. Can be seen in action on + Longitude.me. + + Jonatan Heyman + + From ecec4c190916af739c3a823f07100dfbfb7d5530 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 19 Jul 2013 12:37:40 -0400 Subject: [PATCH 471/816] Fix #1867 --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 7081bd24c4e..7fe1b2c5bf0 100644 --- a/reference.html +++ b/reference.html @@ -6299,8 +6299,8 @@

        L.version

        for (var j = 0, tdLen = tds.length; j < tdLen; j++) { if (tds[j].cellIndex === 0) { tds[j].parentNode.id = id + '-' + (tds[j].textContent || tds[j].innerText).split('(')[0].toLowerCase(); - tds[j].parentNode.onclick = function() { - window.location.hash = '#' + this.id; + tds[j].parentNode.onclick = function(e) { + if ((window.innerWidth / 2) - e.clientX > 394) window.location.hash = '#' + this.id; }; } } From 98c5e7ab845b7e6da400c40f0a9b91f9f3840239 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 19 Jul 2013 19:15:53 +0200 Subject: [PATCH 472/816] [reference.html] Add cursor=pointer to anchor icon (cf #1867) --- docs/css/screen.css | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/css/screen.css b/docs/css/screen.css index 0a436667035..97171eadecf 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -95,6 +95,7 @@ h2 { text-indent:-9999px; border-radius:50%; overflow:hidden; + cursor: pointer; } .api-page tr[id] td:first-child:before { From b73ed6afb8426dd70e44c065a09d36a8d90533b7 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 12:42:09 +0300 Subject: [PATCH 473/816] fix infinite loop in getBounds and setMaxBounds, close #1895, close #1866 --- src/map/Map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/Map.js b/src/map/Map.js index 0df345c560e..62f16efbe4a 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -345,8 +345,8 @@ L.Map = L.Class.extend({ }, getMinZoom: function () { - var z1 = this._layersMinZoom === undefined ? -Infinity : this._layersMinZoom, - z2 = this._boundsMinZoom === undefined ? -Infinity : this._boundsMinZoom; + var z1 = this._layersMinZoom === undefined ? 0 : this._layersMinZoom, + z2 = this._boundsMinZoom === undefined ? 0 : this._boundsMinZoom; return this.options.minZoom === undefined ? Math.max(z1, z2) : this.options.minZoom; }, From 8248c6b1d0f7f739d45c9e800c8ae16e1d7d4f6a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 12:49:16 +0300 Subject: [PATCH 474/816] fix map scrolling right on click with horizontal scroll on page, close #1901 --- src/map/handler/Map.Keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/handler/Map.Keyboard.js b/src/map/handler/Map.Keyboard.js index dabbc02cb7c..ddf67597f87 100644 --- a/src/map/handler/Map.Keyboard.js +++ b/src/map/handler/Map.Keyboard.js @@ -65,7 +65,7 @@ L.Map.Keyboard = L.Handler.extend({ var body = document.body, docEl = document.documentElement, top = body.scrollTop || docEl.scrollTop, - left = body.scrollTop || docEl.scrollLeft; + left = body.scrollLeft || docEl.scrollLeft; this._map._container.focus(); From 3a8cff69e4797d05005382c4b01e55797d329756 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 13:10:35 +0300 Subject: [PATCH 475/816] bump version --- package.json | 2 +- src/Leaflet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5e755ffe55b..688dfc63e99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet", - "version": "0.6.3", + "version": "0.6.4", "description": "JavaScript library for mobile-friendly interactive maps", "devDependencies": { "jshint": "~2.1.4", diff --git a/src/Leaflet.js b/src/Leaflet.js index d1294d04856..ea330280049 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -2,7 +2,7 @@ var oldL = window.L, L = {}; -L.version = '0.6.3'; +L.version = '0.6.4'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { From 985dd00c89a7748ae2e633f37289a3495da08b87 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 13:15:06 +0300 Subject: [PATCH 476/816] update build to 0.6.4 --- dist/leaflet-src.js | 8 ++++---- dist/leaflet.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index 794496b3513..2466f5619ed 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -7,7 +7,7 @@ var oldL = window.L, L = {}; -L.version = '0.6.3'; +L.version = '0.6.4'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { @@ -1844,8 +1844,8 @@ L.Map = L.Class.extend({ }, getMinZoom: function () { - var z1 = this._layersMinZoom === undefined ? -Infinity : this._layersMinZoom, - z2 = this._boundsMinZoom === undefined ? -Infinity : this._boundsMinZoom; + var z1 = this._layersMinZoom === undefined ? 0 : this._layersMinZoom, + z2 = this._boundsMinZoom === undefined ? 0 : this._boundsMinZoom; return this.options.minZoom === undefined ? Math.max(z1, z2) : this.options.minZoom; }, @@ -7499,7 +7499,7 @@ L.Map.Keyboard = L.Handler.extend({ var body = document.body, docEl = document.documentElement, top = body.scrollTop || docEl.scrollTop, - left = body.scrollTop || docEl.scrollLeft; + left = body.scrollLeft || docEl.scrollLeft; this._map._container.focus(); diff --git a/dist/leaflet.js b/dist/leaflet.js index becaaf91956..1d4c6e5450b 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -3,7 +3,7 @@ (c) 2010-2013, Vladimir Agafonkin (c) 2010-2011, CloudMade */ -!function(t,e,i){var n=t.L,o={};o.version="0.6.3","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],i?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=i&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n=!!t.ActiveXObject,s=n&&!t.XMLHttpRequest,a=n&&!e.querySelector,r=n&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("phantom"),d=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",m=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,L="MozPerspective"in g.style,P="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||L||P)&&!c,w=!t.L_NO_TOUCH&&!c&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ie6:s,ie7:a,ielt9:r,webkit:l,android:d,android23:p,chrome:u,ie3d:v,webkit3d:y,gecko3d:L,opera3d:P,any3d:x,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&y,mobileOpera:_&&t.opera,touch:w,msTouch:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement,l=o.Browser.ie7;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var u=o.DomUtil.getStyle(a,"width"),c=o.DomUtil.getStyle(a,"max-width"),d=a.getBoundingClientRect();("none"!==u||"none"!==c)&&(s+=d.left+a.clientLeft),n+=d.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==o.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){return t.className.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){o.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){t.className=o.Util.trim((" "+t.className+" ").replace(" "+e+" "," "))},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?new o.LatLng(t[0],t[1]):t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){return t?(t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this):this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this.setView(this.getCenter(),t,{zoom:e})},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t,e){if(t=o.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var i=this.getBoundsZoom(t,!0);return this._boundsMinZoom=i,this._loaded&&(this._zooma.x&&(r=Math.floor(a.x-n.x)),i.y>s.y&&(h=Math.floor(s.y-i.y)),i.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&this.dragging&&this.dragging.moved()||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new o.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update() +!function(t,e,i){var n=t.L,o={};o.version="0.6.4","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],i?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=i&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n=!!t.ActiveXObject,s=n&&!t.XMLHttpRequest,a=n&&!e.querySelector,r=n&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("phantom"),d=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",m=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,L="MozPerspective"in g.style,P="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||L||P)&&!c,w=!t.L_NO_TOUCH&&!c&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ie6:s,ie7:a,ielt9:r,webkit:l,android:d,android23:p,chrome:u,ie3d:v,webkit3d:y,gecko3d:L,opera3d:P,any3d:x,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&y,mobileOpera:_&&t.opera,touch:w,msTouch:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement,l=o.Browser.ie7;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var u=o.DomUtil.getStyle(a,"width"),c=o.DomUtil.getStyle(a,"max-width"),d=a.getBoundingClientRect();("none"!==u||"none"!==c)&&(s+=d.left+a.clientLeft),n+=d.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==o.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){return t.className.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){o.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){t.className=o.Util.trim((" "+t.className+" ").replace(" "+e+" "," "))},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?new o.LatLng(t[0],t[1]):t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){return t?(t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this):this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this.setView(this.getCenter(),t,{zoom:e})},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t,e){if(t=o.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var i=this.getBoundsZoom(t,!0);return this._boundsMinZoom=i,this._loaded&&(this._zooma.x&&(r=Math.floor(a.x-n.x)),i.y>s.y&&(h=Math.floor(s.y-i.y)),i.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&this.dragging&&this.dragging.moved()||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new o.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update() },addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i)||t.y<0||t.y>=i)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs;var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,n=this.options.tileSize,s=t.multiplyBy(n),a=s.add([n,n]),r=this._crs.project(i.unproject(s,e)),h=this._crs.project(i.unproject(a,e)),l=[r.x,h.y,h.x,r.y].join(","),u=o.Util.template(this._url,{s:this._getSubdomain(t)});return u+o.Util.getParamString(this.wmsParams,u,!0)+"&BBOX="+l},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return o.Browser.ie6?(i||(i=e.createElement("div")),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i||(i=e.createElement("img")),i.src=t),i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=t.getSize(),h=0,l=0;s.x+i>r.x&&(h=s.x+i-r.x+a.x),s.x-h<0&&(h=s.x-a.x),s.y+e>r.y&&(l=s.y+e-r.y+a.y),s.y-l<0&&(l=s.y-a.y),(h||l)&&t.fire("autopanstart").panBy([h,l])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:(t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape"); o.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){var i,n,s;if(o.Polyline.prototype.initialize.call(this,t,e),t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),i=0,n=this._holes.length;n>i;i++)s=this._holes[i]=this._convertLatLngs(this._holes[i]),s[0].equals(s[s.length-1])&&s.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i){var n,s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return n=i(u),e?e(t,n):new o.Marker(n);case"MultiPoint":for(a=0,r=u.length;r>a;a++)n=i(u[a]),h=e?e(t,n):new o.Marker(n),c.push(h);return new o.FeatureGroup(c);case"LineString":return s=this.coordsToLatLngs(u,0,i),new o.Polyline(s);case"Polygon":return s=this.coordsToLatLngs(u,1,i),new o.Polygon(s);case"MultiLineString":return s=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(s);case"MultiPolygon":return s=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(s);case"GeometryCollection":for(a=0,r=l.geometries.length;r>a;a++)h=this.geometryToLayer({geometry:l.geometries[a],type:"Feature",properties:t.properties},e,i),c.push(h);return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){return[t.lng,t.lat]},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t,e){t.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){t.push(e.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:e,coordinates:t})}})}t(o.MultiPolyline,"MultiLineString"),t(o.MultiPolygon,"MultiPolygon")}(),o.LayerGroup.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){e.toGeoJSON&&t.push(o.GeoJSON.asFeature(e.toGeoJSON()))}),{type:"FeatureCollection",features:t}}}),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.addListener(t,o.Draggable.START[i],e);return o.DomEvent.addListener(t,"click",o.DomEvent._fakeStop).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=o.Browser.ie7,s=e.body,a=e.documentElement,r=t.pageX?t.pageX-s.scrollLeft-a.scrollLeft:t.clientX,h=t.pageY?t.pageY-s.scrollTop-a.scrollTop:t.clientY,l=new o.Point(r,h),u=i.getBoundingClientRect(),c=u.left-i.clientLeft,d=u.top-i.clientTop;return o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!n||(c+=i.scrollWidth-i.clientWidth,n&&"hidden"!==o.DomUtil.getStyle(i,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(i,"overflow")&&(c+=17)),l._subtract(new o.Point(c,d))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!t.shiftKey&&(1===t.which||1===t.button||t.touches)&&(o.DomEvent.stopPropagation(t),!o.Draggable._disabled)){o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection();var i=t.touches?t.touches[0]:t,n=i.target;o.Browser.touch&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.Browser.touch||o.DomUtil.addClass(e.body,"leaflet-dragging")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){o.Browser.touch||o.DomUtil.removeClass(e.body,"leaflet-dragging");for(var t in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[t],this._onMove).off(e,o.Draggable.END[t],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),this._onViewReset())}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(t.fire("dragend"),n)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),d=u/(e.inertiaDeceleration*r),p=c.multiplyBy(-d/2).round();p.x&&p.y?o.Util.requestAnimFrame(function(){t.panBy(p,{duration:d,easeLinearity:r,noMoveStart:!0})}):t.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setZoomAround(t.containerPoint,this._zoom+1)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&t.setZoomAround(this._lastMousePos,i+e)}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:o.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.msTouch?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.msTouch){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.msTouch){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.msTouch?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;i0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this) -},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.msTouch&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollTop||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):(o.DomEvent.disableClickPropagation(e),o.DomEvent.on(e,"mousewheel",o.DomEvent.stopPropagation));var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=this._limitZoom(e),t=o.latLng(t),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file +},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.msTouch&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):(o.DomEvent.disableClickPropagation(e),o.DomEvent.on(e,"mousewheel",o.DomEvent.stopPropagation));var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=this._limitZoom(e),t=o.latLng(t),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file From e3cd252d2db72d70d07b4975bdfb560113c472c9 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 13:15:13 +0300 Subject: [PATCH 477/816] update links to 0.6.4 --- download.md | 12 ++++++------ examples/quick-start.md | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/download.md b/download.md index e51b5ad1987..def33da73f5 100644 --- a/download.md +++ b/download.md @@ -11,8 +11,8 @@ title: Download Description - Leaflet 0.6.3 - Stable version, released on June 26, 2013 and last updated on July 17, 2013. + Leaflet 0.6.4 + Stable version, released on June 26, 2013 and last updated on July 25, 2013. Leaflet 0.5.1 @@ -23,7 +23,7 @@ title: Download In-progress major version, developed on the master branch. @@ -37,12 +37,12 @@ Note that the master version can contain incompatible changes, so please read th The latest stable release of Leaflet is hosted on a CDN — to start using it straight away, place this in the `head` section of your HTML code: - + - + ### Leaflet Source Code diff --git a/examples/quick-start.md b/examples/quick-start.md index b01e1e0ebe8..0919c871be6 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -19,14 +19,14 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS files in the head section of your document: - + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From d4f515137efdaf1da75410044a5d75c46ce8c81e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 25 Jul 2013 13:16:40 +0300 Subject: [PATCH 478/816] add notes about 0.6 updates to blog post --- _posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index f9e53a6bdea..f2b7e6c08ca 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -22,6 +22,8 @@ Grab the CDN links or downloads for the new release on the [download page](../.. **update** (June 27): 0.6.1 hotfix released with a couple of regressions fixed (particularly the one with FF scroll-zooming too fast). **update** (June 28): 0.6.2 hotfix released with a couple more minor issues fixed. +**update** (July 17): 0.6.3 released with lots of regressions and bugs fixed. +**update** (July 25): 0.6.4 released with a fix to 0.6.3 regression. P.S. Everyone who tweets/posts about the new Leaflet release or why he loves Leaflet over the next few days will get a karma boost of over 9000 points. I heard that from a passing monk in Georgetown yesterday, true story! From e6a9414567b68ea4a1b94ff7ae32ab8e6df6d7e5 Mon Sep 17 00:00:00 2001 From: Nicholas Hallahan Date: Fri, 26 Jul 2013 12:36:24 -0700 Subject: [PATCH 479/816] Submit LeafletPlayback plug-in --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3b79734a81d..e822f836913 100644 --- a/plugins.md +++ b/plugins.md @@ -651,6 +651,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Yohan Boniface + + + LeafletPlayback + + Play back time-stamped GPS Tracks synchronized to a clock. + + Nicholas Hallahan + + From 20ba826f754e84bfab9d5455ea1bf583937746e1 Mon Sep 17 00:00:00 2001 From: Adam Ratcliffe Date: Wed, 31 Jul 2013 12:44:02 +1200 Subject: [PATCH 480/816] Add Leaflet.print plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index e822f836913..ae3545e4b3f 100644 --- a/plugins.md +++ b/plugins.md @@ -761,6 +761,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Yohan Boniface + + + Leaflet.print + + Implements the Mapfish print protocol allowing a Leaflet map to be printed using either the Mapfish or GeoServer print module. + + Adam Ratcliffe + + To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From 74e4f399e63bc1a4ddd12c3ebbf809c706529561 Mon Sep 17 00:00:00 2001 From: Ubergesundheit Date: Sat, 3 Aug 2013 17:02:31 +0200 Subject: [PATCH 481/816] Addition of Leaflet.EdgeMarker Plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index e822f836913..df41f95c41a 100644 --- a/plugins.md +++ b/plugins.md @@ -237,6 +237,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jonatan Heyman + + + Leaflet.EdgeMarker + + Plugin to indicate the existence of Features outside of the current view. + + Gerald Pape + + From 4a71f3163c341932d401efdfda1c5d5f02b82e0e Mon Sep 17 00:00:00 2001 From: Glen Robertson Date: Mon, 5 Aug 2013 08:43:30 +1200 Subject: [PATCH 482/816] Removed JQuery dependency note from TileLayer.GeoJSON plugin. --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index e822f836913..b0090d4fdd3 100644 --- a/plugins.md +++ b/plugins.md @@ -203,7 +203,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s TileLayer.GeoJSON - A TileLayer for GeoJSON tiles (requires JQuery). + A TileLayer for GeoJSON tiles. Glen Robertson From c40940874dfd7c03850a33f9eb7ea3267e038492 Mon Sep 17 00:00:00 2001 From: Eric Brelsford Date: Mon, 5 Aug 2013 11:44:33 -0400 Subject: [PATCH 483/816] Add Leaflet.loading control --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index b0090d4fdd3..e18fcdd9097 100644 --- a/plugins.md +++ b/plugins.md @@ -660,6 +660,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Nicholas Hallahan + + + Leaflet.loading + + A simple control that adds a loading indicator as tiles and other data are loaded. + + Eric Brelsford + + From 9ed6d487fe87f82d6eb53305acea34c1997317b4 Mon Sep 17 00:00:00 2001 From: Jan Marsch Date: Wed, 7 Aug 2013 00:42:35 +0200 Subject: [PATCH 484/816] Updated plugins.md for correct OSM Buildings url --- plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins.md b/plugins.md index f3e52a8c67f..ebb06d1bc1a 100644 --- a/plugins.md +++ b/plugins.md @@ -691,11 +691,11 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - OSM Buildings + OSM Buildings - Amazing JS library for visualizing 3D OSM building data on top of Leaflet. + Amazing JS library for visualizing 3D OSM building geometry on top of Leaflet. - Jan Marsch + Jan Marsch From a762331356bf3ef75344fd358f1057ec59bc4e48 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Thu, 8 Aug 2013 13:03:16 -0400 Subject: [PATCH 485/816] shapefile plugin --- plugins.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index f88b135611a..34e4d876919 100644 --- a/plugins.md +++ b/plugins.md @@ -245,7 +245,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Gerald Pape - + + + + Leaflet.Shapefile + + Put a shapefile onto your map as a layer. + + Calvin Metcalf + + From 4eaa3ac47eb7ea8425058e04bae0b0aab8bb4c6b Mon Sep 17 00:00:00 2001 From: pwldp Date: Fri, 23 Aug 2013 13:57:30 +0200 Subject: [PATCH 486/816] Update plugins.md --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 34e4d876919..322d3d3031c 100644 --- a/plugins.md +++ b/plugins.md @@ -687,6 +687,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Eric Brelsford + + + Leaflet.viewcenter + + A simple control that adds a button to change view and zoom to predefinied values in options. + + Dariusz Pawlak + + From 702ed96e75656d4fd35a0def051cba76f324f96f Mon Sep 17 00:00:00 2001 From: Adam Ratcliffe Date: Tue, 27 Aug 2013 12:33:38 +1200 Subject: [PATCH 487/816] Add context menu plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 322d3d3031c..ec014c62214 100644 --- a/plugins.md +++ b/plugins.md @@ -695,6 +695,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Dariusz Pawlak + + + + Leaflet.contextmenu + + A context menu for Leaflet. + + Adam Ratcliffe + From 230ee48dcb9bde2953ac9d7e7cb9408338dadfc8 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 28 Aug 2013 12:23:14 +0200 Subject: [PATCH 488/816] Add Leaflet.MeasureControl --- plugins.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins.md b/plugins.md index ec014c62214..3fa54e70f4c 100644 --- a/plugins.md +++ b/plugins.md @@ -688,23 +688,32 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - - Leaflet.viewcenter + + Leaflet.viewcenter A simple control that adds a button to change view and zoom to predefinied values in options. Dariusz Pawlak - - - - Leaflet.contextmenu + + + + Leaflet.contextmenu A context menu for Leaflet. Adam Ratcliffe + + + Leaflet.MeasureControl + + A simple tool to measure distances on maps (*relies on Leaflet.Draw*). + + Makina Corpus + + From 1e22eef01abef886e8251f53184303c26a9e140b Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Tue, 3 Sep 2013 12:19:25 +0200 Subject: [PATCH 489/816] Add Leaflet.OverIntent plugin --- plugins.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins.md b/plugins.md index 3fa54e70f4c..d599b2fb5fa 100644 --- a/plugins.md +++ b/plugins.md @@ -714,6 +714,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Makina Corpus + + + Leaflet.OverIntent + + Adds a new event ``mouseintent``, that differs from ``mouseover`` since it reflects user + intentions to aim a particular layer. + + Mathieu Leplatre + + From da083da135cefdf8ab44c6236793bb41f6cbc9dd Mon Sep 17 00:00:00 2001 From: Sagie Maoz Date: Tue, 3 Sep 2013 16:40:35 +0300 Subject: [PATCH 490/816] Describe new autoPanPadding{TopLeft,BottomRight} Popup options Options were added in #1972. --- reference.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 7fe1b2c5bf0..5695f3fdf82 100644 --- a/reference.html +++ b/reference.html @@ -1648,12 +1648,26 @@
        The offset of the popup position. Useful to control the anchor of the popup when opening it on some overlays. + + autoPanPaddingTopLeft + Point + null + + The margin between the popup and the top left corner of the map view after autopanning was performed. + + + autoPanPaddingBottomRight + Point + null + + The margin between the popup and the bottom right corner of the map view after autopanning was performed. + autoPanPadding Point - Point(5, 5) + (5, 5) - The margin between the popup and the edges of the map view after autopanning was performed. + Equivalent of setting both top left and bottom right autopan padding to the same value. zoomAnimation From 24b1f252a191b0e335c15981d00b903ced678a27 Mon Sep 17 00:00:00 2001 From: Sagie Maoz Date: Tue, 3 Sep 2013 16:52:13 +0300 Subject: [PATCH 491/816] Undo (accidental) removal of 'Point' --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 5695f3fdf82..7ba4a338e5f 100644 --- a/reference.html +++ b/reference.html @@ -1665,7 +1665,7 @@ autoPanPadding Point - (5, 5) + Point(5, 5) Equivalent of setting both top left and bottom right autopan padding to the same value. From 0d443e3f78539cc46bb1bf6b484d142733961f2b Mon Sep 17 00:00:00 2001 From: kr1 Date: Thu, 19 Sep 2013 04:26:46 +0200 Subject: [PATCH 492/816] adds Leaflet.dbpediaLayer to plugin list puts the plugin in the "Services, Providers and Formats" section. --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index d599b2fb5fa..2d52c317d3c 100644 --- a/plugins.md +++ b/plugins.md @@ -374,6 +374,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s K. Arthur Endsley + + + Leaflet.dbpediaLayer + + A layer with Points of interest from Wikipedia - loaded via ajax from DBpedia's SPARQL endpoint. + + Kr1 + + From 6057d3419c0af75e069e83a8e0c520d71d82fb06 Mon Sep 17 00:00:00 2001 From: Vladimir Zotov Date: Sat, 21 Sep 2013 13:53:10 +0400 Subject: [PATCH 493/816] Update reference.html changed invalid signature of `invalidateSize` L.Control.Scale extends L.Control, not IControl --- reference.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reference.html b/reference.html index c5ef982b904..fa603f4394f 100644 --- a/reference.html +++ b/reference.html @@ -686,8 +686,14 @@

        Methods for Modifying Map State

        invalidateSize( - <Boolean> options?, - <zoom/pan options> options? ) + <Boolean> animate ) + + this + Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. + + + invalidateSize( + <zoom/pan options> options ) this Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. @@ -4470,7 +4476,7 @@

        Events

        L.Control.Scale

        -

        A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Implements IControl interface.

        +

        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.

        L.control.scale().addTo(map);
        From 2518fee82af25b441102d1ce61562c1ec2815844 Mon Sep 17 00:00:00 2001 From: Eugene Mikhalev Date: Tue, 24 Sep 2013 17:00:32 +0700 Subject: [PATCH 494/816] Add Leaflet-2gis plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 2d52c317d3c..d5fb123bf71 100644 --- a/plugins.md +++ b/plugins.md @@ -383,6 +383,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Kr1 + + + Leaflet-2gis + + This plugin add 2GIS support to the leaflet + + Eugene Mikhalev + + From 5a40ba5ad35f00a5bf2d91fb934f2915bac98e3e Mon Sep 17 00:00:00 2001 From: Eugene Mikhalev Date: Tue, 24 Sep 2013 19:03:04 +0700 Subject: [PATCH 495/816] Update plugins.md description of Leaflet-2gis --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index d5fb123bf71..671121256df 100644 --- a/plugins.md +++ b/plugins.md @@ -387,7 +387,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet-2gis - This plugin add 2GIS support to the leaflet + Adds support for 2GIS tile layer Eugene Mikhalev From cdd179a427000bc67563bb2b320569fb7b6bf24b Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Tue, 24 Sep 2013 17:49:36 +0200 Subject: [PATCH 496/816] Add Leaflet.AlmostOver plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 671121256df..1ffd3c2241d 100644 --- a/plugins.md +++ b/plugins.md @@ -742,6 +742,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet.AlmostOver + + Trigger mouse events when cursor is "almost" over a layer. + + Mathieu Leplatre + + From 1589ae2fb75999419431bb44e3d98efeff23a981 Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Thu, 26 Sep 2013 13:14:02 -0700 Subject: [PATCH 497/816] Added simple docs for lineJoin and lineCap settings on a path --- reference.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference.html b/reference.html index 7fe1b2c5bf0..69489ff25cd 100644 --- a/reference.html +++ b/reference.html @@ -2292,6 +2292,18 @@

        Options

        null A string that defines the stroke dash pattern. Doesn't work on canvas-powered layers (e.g. Android 2). + + lineCap + String + null + A string that defines shape to be used at the end of the stroke. + + + lineJoin + String + null + A string that defines shape to be used at the corners of the stroke. + clickable Boolean From 6a60c0f79135d611c8c93e1d18f8930dac220070 Mon Sep 17 00:00:00 2001 From: Michael Salgado Date: Thu, 26 Sep 2013 15:38:49 -0500 Subject: [PATCH 498/816] Add Plugin Control Order Layers Add support to control layers for reorder overlays. --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 1ffd3c2241d..24b8ecf81d2 100644 --- a/plugins.md +++ b/plugins.md @@ -751,6 +751,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Mathieu Leplatre + + + Leaflet Control Order Layers + + Control for order overlay layers. + + Michael Salgado + + From 986745d46cfe79980f990530253d67a765db57d9 Mon Sep 17 00:00:00 2001 From: Michael Salgado Date: Thu, 26 Sep 2013 16:30:47 -0500 Subject: [PATCH 499/816] Add Plugin Control Order Layers Adds the ability to change overlay order in the layers control --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 24b8ecf81d2..f15e4d5a034 100644 --- a/plugins.md +++ b/plugins.md @@ -755,7 +755,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet Control Order Layers - Control for order overlay layers. + Adds the ability to change overlay order in the layers control. Michael Salgado From 2fc94037083364de8fd1271e4fa51039fc868f4c Mon Sep 17 00:00:00 2001 From: Vladimir Zotov Date: Fri, 4 Oct 2013 22:20:05 +0400 Subject: [PATCH 500/816] fixed return type --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index fa603f4394f..1f78acd2e33 100644 --- a/reference.html +++ b/reference.html @@ -3052,7 +3052,7 @@

        Methods

        <String> id )
        - Boolean + ILayer Returns the layer with the given id. From efd24f1d3acc9e7a4ae221fd15f9ed543ff3939e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Dietrich?= Date: Sat, 5 Oct 2013 19:30:53 +0200 Subject: [PATCH 501/816] Add Leaflet.Terminator plugin to overlay section. --- plugins.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins.md b/plugins.md index f15e4d5a034..5af26c988d7 100644 --- a/plugins.md +++ b/plugins.md @@ -255,6 +255,14 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Calvin Metcalf + + + Leaflet.Terminator + Overlay day and night regions on a map. + + Jörg Dietrich + + From d568667422279b7580c7ab1a988c2220bacc4edf Mon Sep 17 00:00:00 2001 From: Vladimir Zotov Date: Sun, 6 Oct 2013 01:44:17 +0400 Subject: [PATCH 502/816] Fixed setPopupContent description --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 1f78acd2e33..d44a7aadd28 100644 --- a/reference.html +++ b/reference.html @@ -1534,7 +1534,7 @@

        Methods

        this - Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method. + Sets an HTML content of the popup of this marker. toGeoJSON() From 8caf04f09c9d2dc292268a4580d5f1b5aea44f3e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 7 Oct 2013 22:50:47 +0300 Subject: [PATCH 503/816] fit incorrect closing tag, #2070 --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 5af26c988d7..59e77ac9c62 100644 --- a/plugins.md +++ b/plugins.md @@ -262,7 +262,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jörg Dietrich - + From e88e01b60912681ab8ae70f1b8f52339ea5a9270 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Fri, 11 Oct 2013 11:01:46 +0200 Subject: [PATCH 504/816] Add Leaflet.layerscontrol-minimap http://jieter.github.io/Leaflet.layerscontrol-minimap/ --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 59e77ac9c62..2411eb62a3e 100644 --- a/plugins.md +++ b/plugins.md @@ -768,6 +768,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Michael Salgado + + + Leaflet.layerscontrol-minimap + + Extends the default Leaflet layers control with synced minimaps. + + Jieter + + From e39886766f488b14ae1eb8150e9acd54508ce8a9 Mon Sep 17 00:00:00 2001 From: Daniele Piccone Date: Sat, 12 Oct 2013 10:44:29 +0200 Subject: [PATCH 505/816] Update plugins.md I added the link to my version of a leaflet heatmap layer extending featureGroup suited for small and middle datasets https://github.com/dpiccone/leaflet-heatmap. --- plugins.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins.md b/plugins.md index 2411eb62a3e..17fe90eff2f 100644 --- a/plugins.md +++ b/plugins.md @@ -91,6 +91,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Patrick Wied + + + Leaflet Heatmap + + Lightweight and versatile heatmap layer based on CSS3 and divIcons + + + Daniele Piccone + + Leaflet.MultiTileLayer From 0a0a223e50747bd0bb5a1c8449980c49c53791ac Mon Sep 17 00:00:00 2001 From: AndreyGeonya Date: Mon, 14 Oct 2013 17:26:35 +0300 Subject: [PATCH 506/816] popup getLatLng method added to the reference --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index d44a7aadd28..924dabbca60 100644 --- a/reference.html +++ b/reference.html @@ -1706,6 +1706,11 @@

        Methods

        this Sets the geographical point where the popup will open. + + getLatLng() + LatLng + Returns the geographical point of popup. + setContent( <String|HTMLElement> htmlContent ) From 9514eec7ede819bd810e36104f95fa71c3d53686 Mon Sep 17 00:00:00 2001 From: Daniele Piccone Date: Mon, 14 Oct 2013 16:51:06 +0200 Subject: [PATCH 507/816] Update plugins.md changed name to div-heatmap --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 17fe90eff2f..572061e5f9b 100644 --- a/plugins.md +++ b/plugins.md @@ -93,7 +93,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet Heatmap + Leaflet divHeatmap Lightweight and versatile heatmap layer based on CSS3 and divIcons From bc5131305bff90aa60f12a41999a7b1c21866df3 Mon Sep 17 00:00:00 2001 From: Dave Leaver Date: Thu, 24 Oct 2013 08:59:46 +1300 Subject: [PATCH 508/816] Update reference.html This is a layers control, not an attribution control. --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 7fe1b2c5bf0..1cf137a93c6 100644 --- a/reference.html +++ b/reference.html @@ -4361,7 +4361,7 @@

        Constructor

        new L.Control.Layers()
        L.control.layers() - 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. + Creates a layers 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. From f69ca7e61728ee2056e3fb3a16416415716f1444 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 30 Oct 2013 22:00:14 +0100 Subject: [PATCH 509/816] plugins: Added leaflet-sidebar project --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 572061e5f9b..fb3f0a1ca64 100644 --- a/plugins.md +++ b/plugins.md @@ -787,6 +787,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jieter + + + leaflet-sidebar + + A responsive sidebar plugin. + + Tobias Bieniek + + From 63742ad6ba784119191442904373abe652664852 Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Fri, 1 Nov 2013 11:59:43 -0400 Subject: [PATCH 510/816] add filegeodatabase plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index fb3f0a1ca64..ceac6a8f491 100644 --- a/plugins.md +++ b/plugins.md @@ -265,6 +265,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Calvin Metcalf + + + Leaflet.FileGDB + + Put an ESRI File GeoDatabase onto your map as a layer. + + Calvin Metcalf + + Leaflet.Terminator From 22f1c792a5b347fea6a480458a42451e29a6ed1c Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 1 Nov 2013 14:21:41 -0400 Subject: [PATCH 511/816] Document tileloadstart event --- reference.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.html b/reference.html index 924dabbca60..15b5c373f5f 100644 --- a/reference.html +++ b/reference.html @@ -1902,6 +1902,11 @@

        Events

        Event Fired when the tile layer loaded all visible tiles. + + tileloadstart + TileEvent + Fired when a tile is requested and starts loading. + tileload TileEvent From 00a8820b5bf69508aeb5aa7fa2ee4c28aa60966c Mon Sep 17 00:00:00 2001 From: Benny Lichtner Date: Tue, 5 Nov 2013 20:58:45 -0800 Subject: [PATCH 512/816] Updated description of L.Popup source arg https://github.com/Leaflet/Leaflet/issues/2146 --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 1cf137a93c6..0814b768665 100644 --- a/reference.html +++ b/reference.html @@ -1584,7 +1584,7 @@

        Constructor

        L.Popup( <Popup options> options?, - <object> source? ) + <ILayer> source? ) @@ -1592,7 +1592,7 @@

        Constructor

        L.popup() - Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers. + 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 ILayer to which it refers. From 3ca464f95a0d5e58350f0ddeaa3b24717c86462d Mon Sep 17 00:00:00 2001 From: Vladimir Zotov Date: Thu, 7 Nov 2013 12:44:33 +0300 Subject: [PATCH 513/816] an accidentally :) fixed typo --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 0814b768665..270ac071f92 100644 --- a/reference.html +++ b/reference.html @@ -4635,7 +4635,7 @@

        Methods

        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. - cleanAllEventListeners() + clearAllEventListeners() this Removes all listeners to all events on the object.
        From c2c9f30ae7a0936f3722870629fe1f225602614c Mon Sep 17 00:00:00 2001 From: Ilya Vassilevsky Date: Sat, 9 Nov 2013 10:30:22 +0400 Subject: [PATCH 514/816] Fix grammar related to the word "milliseconds" --- reference.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference.html b/reference.html index 270ac071f92..5dfd6eafb5c 100644 --- a/reference.html +++ b/reference.html @@ -350,7 +350,7 @@

        Panning Inertia Options

        inertiaThreshold Number depends - Amount of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement. 32 for touch devices and 14 for the rest by default. + Number of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement. 32 for touch devices and 14 for the rest by default. @@ -1015,7 +1015,7 @@

        Locate options

        timeout Number 10000 - Number of millisecond to wait for a response from geolocation before firing a locationerror event. + Number of milliseconds to wait for a response from geolocation before firing a locationerror event. maximumAge From b439f5fc93cb8245c758bfdfd21a2c16abcf4f5f Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 14 Nov 2013 19:34:49 +0100 Subject: [PATCH 515/816] proper title for GeoJSON example page --- examples/geojson-example.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/geojson-example.html b/examples/geojson-example.html index 59e90b9048f..3b3f1ed8b4b 100644 --- a/examples/geojson-example.html +++ b/examples/geojson-example.html @@ -1,7 +1,7 @@ - Leaflet Layers Control Example + Leaflet GeoJSON Example From 02313757d530dfe2642dcc369e1c95bdfab51f98 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 13:40:03 +0200 Subject: [PATCH 516/816] remove UserVoice widget (now it's ridden with spam) --- _layouts/default.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 708a736ad0f..9fe219b983c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -199,13 +199,13 @@

        An Open-Source JavaScript Library for Mobile-Friendly Interactiv })(); - --> From 355b0f5ed22bfe6dd63b99e24d3f295d559d4430 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 13:40:40 +0200 Subject: [PATCH 517/816] remove notice on the frontpage --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index ce9f5978fe2..7af1c8592e1 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- -

        June 26, 2013 — Leaflet 0.6 Released, Code Sprint in DC with MapBox — Read More in the Blog

        + Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. From 1c5c7f9a7e122333de3d5e0dd43dea79d7f7dc97 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 18:41:40 +0200 Subject: [PATCH 518/816] fix build and commit built 0.7 --- dist/leaflet-src.js | 1058 ++++++++++++++++++++----------- dist/leaflet.js | 8 +- src/layer/tile/TileLayer.WMS.js | 2 +- 3 files changed, 678 insertions(+), 390 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index 2466f5619ed..c6c6bde2daf 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -7,7 +7,7 @@ var oldL = window.L, L = {}; -L.version = '0.6.4'; +L.version = '0.7'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { @@ -135,19 +135,23 @@ L.Util = { return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); }, - template: function (str, data) { - return str.replace(/\{ *([\w_]+) *\}/g, 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; + compileTemplate: function (str, data) { + // based on https://gist.github.com/padolsey/6008842 + str = str.replace(/"/g, '\\\"'); + str = str.replace(/\{ *([\w_]+) *\}/g, function (str, key) { + return '" + o["' + key + '"]' + (typeof data[key] === 'function' ? '(o)' : '') + ' + "'; }); + // jshint evil: true + return new Function('o', 'return "' + str + '";'); + }, + + template: function (str, data) { + var cache = L.Util._templateCache = L.Util._templateCache || {}; + cache[str] = cache[str] || L.Util.compileTemplate(str, data); + return cache[str](data); }, - isArray: function (obj) { + isArray: Array.isArray || function (obj) { return (Object.prototype.toString.call(obj) === '[object Array]'); }, @@ -337,7 +341,7 @@ L.Mixin.Events = { if (L.Util.invokeEach(types, this.addEventListener, this, fn, context)) { return this; } var events = this[eventsKey] = this[eventsKey] || {}, - contextId = context && L.stamp(context), + contextId = context && context !== this && L.stamp(context), i, len, event, type, indexKey, indexLenKey, typeIndex; // types can be a string of space-separated words @@ -350,7 +354,7 @@ L.Mixin.Events = { }; type = types[i]; - if (context) { + if (contextId) { // store listeners of a particular context in a separate hash (if it has an id) // gives a major performance boost when removing thousands of map layers @@ -397,7 +401,7 @@ L.Mixin.Events = { if (L.Util.invokeEach(types, this.removeEventListener, this, fn, context)) { return this; } var events = this[eventsKey], - contextId = context && L.stamp(context), + contextId = context && context !== this && L.stamp(context), i, len, type, listeners, j, indexKey, indexLenKey, typeIndex, removed; types = L.Util.splitWords(types); @@ -413,9 +417,10 @@ L.Mixin.Events = { // clear all listeners for a type if function isn't specified delete events[type]; delete events[indexKey]; + delete events[indexLenKey]; } else { - listeners = context && typeIndex ? typeIndex[contextId] : events[type]; + listeners = contextId && typeIndex ? typeIndex[contextId] : events[type]; if (listeners) { for (j = listeners.length - 1; j >= 0; j--) { @@ -458,7 +463,7 @@ L.Mixin.Events = { listeners = events[type].slice(); for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].action.call(listeners[i].context || this, event); + listeners[i].action.call(listeners[i].context, event); } } @@ -470,7 +475,7 @@ L.Mixin.Events = { if (listeners) { for (i = 0, len = listeners.length; i < len; i++) { - listeners[i].action.call(listeners[i].context || this, event); + listeners[i].action.call(listeners[i].context, event); } } } @@ -506,9 +511,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; (function () { - var ie = !!window.ActiveXObject, - ie6 = ie && !window.XMLHttpRequest, - ie7 = ie && !document.querySelector, + var ie = 'ActiveXObject' in window, ielt9 = ie && !document.addEventListener, // terrible browser detection to work around Safari / iOS / Android browser bugs @@ -518,10 +521,13 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; phantomjs = ua.indexOf('phantom') !== -1, android = ua.indexOf('android') !== -1, android23 = ua.search('android [23]') !== -1, + gecko = ua.indexOf('gecko') !== -1, mobile = typeof orientation !== undefined + '', - msTouch = window.navigator && window.navigator.msPointerEnabled && - window.navigator.msMaxTouchPoints, + msPointer = window.navigator && window.navigator.msPointerEnabled && + window.navigator.msMaxTouchPoints && !window.PointerEvent, + pointer = (window.PointerEvent && window.navigator.pointerEnabled && window.navigator.maxTouchPoints) || + msPointer, retina = ('devicePixelRatio' in window && window.devicePixelRatio > 1) || ('matchMedia' in window && window.matchMedia('(min-resolution:144dpi)') && window.matchMedia('(min-resolution:144dpi)').matches), @@ -541,8 +547,8 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; var startName = 'ontouchstart'; - // IE10+ (We simulate these into touch* events in L.DomEvent and L.DomEvent.MsTouch) or WebKit, etc. - if (msTouch || (startName in doc)) { + // IE10+ (We simulate these into touch* events in L.DomEvent and L.DomEvent.Pointer) or WebKit, etc. + if (pointer || (startName in doc)) { return true; } @@ -568,10 +574,9 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; L.Browser = { ie: ie, - ie6: ie6, - ie7: ie7, ielt9: ielt9, webkit: webkit, + gecko: gecko && !webkit && !window.opera && !ie, android: android, android23: android23, @@ -590,7 +595,8 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; mobileOpera: mobile && window.opera, touch: touch, - msTouch: msTouch, + msPointer: msPointer, + pointer: pointer, retina: retina }; @@ -881,8 +887,7 @@ L.DomUtil = { el = element, docBody = document.body, docEl = document.documentElement, - pos, - ie7 = L.Browser.ie7; + pos; do { top += el.offsetTop || 0; @@ -929,19 +934,6 @@ L.DomUtil = { top -= el.scrollTop || 0; left -= el.scrollLeft || 0; - // webkit (and ie <= 7) handles RTL scrollLeft different to everyone else - // https://code.google.com/p/closure-library/source/browse/trunk/closure/goog/style/bidi.js - if (!L.DomUtil.documentIsLtr() && (L.Browser.webkit || ie7)) { - left += el.scrollWidth - el.clientWidth; - - // ie7 shows the scrollbar by default and provides clientWidth counting it, so we - // need to add it back in if it is visible; scrollbar is on the left as we are RTL - if (ie7 && L.DomUtil.getStyle(el, 'overflow-y') !== 'hidden' && - L.DomUtil.getStyle(el, 'overflow') !== 'hidden') { - left += 17; - } - } - el = el.parentNode; } while (el); @@ -969,18 +961,44 @@ L.DomUtil = { }, hasClass: function (el, name) { - return (el.className.length > 0) && - new RegExp('(^|\\s)' + name + '(\\s|$)').test(el.className); + if (el.classList !== undefined) { + return el.classList.contains(name); + } + var className = L.DomUtil._getClass(el); + return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className); }, addClass: function (el, name) { - if (!L.DomUtil.hasClass(el, name)) { - el.className += (el.className ? ' ' : '') + name; + if (el.classList !== undefined) { + var classes = L.Util.splitWords(name); + for (var i = 0, len = classes.length; i < len; i++) { + el.classList.add(classes[i]); + } + } else if (!L.DomUtil.hasClass(el, name)) { + var className = L.DomUtil._getClass(el); + L.DomUtil._setClass(el, (className ? className + ' ' : '') + name); } }, removeClass: function (el, name) { - el.className = L.Util.trim((' ' + el.className + ' ').replace(' ' + name + ' ', ' ')); + if (el.classList !== undefined) { + el.classList.remove(name); + } else { + L.DomUtil._setClass(el, L.Util.trim((' ' + L.DomUtil._getClass(el) + ' ').replace(' ' + name + ' ', ' '))); + } + }, + + _setClass: function (el, name) { + if (el.className.baseVal === undefined) { + el.className = name; + } else { + // in case of SVG element + el.className.baseVal = name; + } + }, + + _getClass: function (el) { + return el.className.baseVal === undefined ? el.className : el.className.baseVal; }, setOpacity: function (el, value) { @@ -1089,27 +1107,39 @@ L.DomUtil.TRANSITION_END = L.DomUtil.TRANSITION + 'End' : 'transitionend'; (function () { - var userSelectProperty = L.DomUtil.testProp( - ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']); + if ('onselectstart' in document) { + L.extend(L.DomUtil, { + disableTextSelection: function () { + L.DomEvent.on(window, 'selectstart', L.DomEvent.preventDefault); + }, + + enableTextSelection: function () { + L.DomEvent.off(window, 'selectstart', L.DomEvent.preventDefault); + } + }); + } else { + var userSelectProperty = L.DomUtil.testProp( + ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']); + + L.extend(L.DomUtil, { + disableTextSelection: function () { + if (userSelectProperty) { + var style = document.documentElement.style; + this._userSelect = style[userSelectProperty]; + style[userSelectProperty] = 'none'; + } + }, + + enableTextSelection: function () { + if (userSelectProperty) { + document.documentElement.style[userSelectProperty] = this._userSelect; + delete this._userSelect; + } + } + }); + } L.extend(L.DomUtil, { - disableTextSelection: function () { - L.DomEvent.on(window, 'selectstart', L.DomEvent.preventDefault); - if (userSelectProperty) { - var style = document.documentElement.style; - this._userSelect = style[userSelectProperty]; - style[userSelectProperty] = 'none'; - } - }, - - enableTextSelection: function () { - L.DomEvent.off(window, 'selectstart', L.DomEvent.preventDefault); - if (userSelectProperty) { - document.documentElement.style[userSelectProperty] = this._userSelect; - delete this._userSelect; - } - }, - disableImageDrag: function () { L.DomEvent.on(window, 'dragstart', L.DomEvent.preventDefault); }, @@ -1125,16 +1155,20 @@ L.DomUtil.TRANSITION_END = * L.LatLng represents a geographical point with latitude and longitude coordinates. */ -L.LatLng = function (rawLat, rawLng) { // (Number, Number) - var lat = parseFloat(rawLat), - lng = parseFloat(rawLng); +L.LatLng = function (lat, lng, alt) { // (Number, Number, Number) + lat = parseFloat(lat); + lng = parseFloat(lng); if (isNaN(lat) || isNaN(lng)) { - throw new Error('Invalid LatLng object: (' + rawLat + ', ' + rawLng + ')'); + throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')'); } this.lat = lat; this.lng = lng; + + if (alt !== undefined) { + this.alt = parseFloat(alt); + } }; L.extend(L.LatLng, { @@ -1198,7 +1232,11 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe return a; } if (L.Util.isArray(a)) { - return new L.LatLng(a[0], a[1]); + if (typeof a[0] === 'number' || typeof a[0] === 'string') { + return new L.LatLng(a[0], a[1], a[2]); + } else { + return null; + } } if (a === undefined || a === null) { return a; @@ -1206,6 +1244,9 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe if (typeof a === 'object' && 'lat' in a) { return new L.LatLng(a.lat, 'lng' in a ? a.lng : a.lon); } + if (b === undefined) { + return null; + } return new L.LatLng(a, b); }; @@ -1230,8 +1271,9 @@ L.LatLngBounds.prototype = { extend: function (obj) { // (LatLng) or (LatLngBounds) if (!obj) { return this; } - if (typeof obj[0] === 'number' || typeof obj[0] === 'string' || obj instanceof L.LatLng) { - obj = L.latLng(obj); + var latLng = L.latLng(obj); + if (latLng !== null) { + obj = latLng; } else { obj = L.latLngBounds(obj); } @@ -1444,6 +1486,11 @@ L.CRS = { scale: function (zoom) { return 256 * Math.pow(2, zoom); + }, + + getSize: function (zoom) { + var s = this.scale(zoom); + return L.point(s, s); } }; @@ -1522,8 +1569,13 @@ L.Map = L.Class.extend({ initialize: function (id, options) { // (HTMLElement or String, Object) options = L.setOptions(this, options); + this._initContainer(id); this._initLayout(); + + // hack for https://github.com/Leaflet/Leaflet/issues/1980 + this._onResize = L.bind(this._onResize, this); + this._initEvents(); if (options.maxBounds) { @@ -1550,11 +1602,16 @@ L.Map = L.Class.extend({ // replaced by animation-powered implementation in Map.PanAnimation.js setView: function (center, zoom) { + zoom = zoom === undefined ? this.getZoom() : zoom; this._resetView(L.latLng(center), this._limitZoom(zoom)); return this; }, setZoom: function (zoom, options) { + if (!this._loaded) { + this._zoom = this._limitZoom(zoom); + return this; + } return this.setView(this.getCenter(), zoom, {zoom: options}); }, @@ -1592,6 +1649,8 @@ L.Map = L.Class.extend({ nePoint = this.project(bounds.getNorthEast(), zoom), center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom); + zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom; + return this.setView(center, zoom, options); }, @@ -1604,7 +1663,7 @@ L.Map = L.Class.extend({ }, panBy: function (offset) { // (Point) - // replaced with animated panBy in Map.Animation.js + // replaced with animated panBy in Map.PanAnimation.js this.fire('movestart'); this._rawPanBy(L.point(offset)); @@ -1613,63 +1672,29 @@ L.Map = L.Class.extend({ return this.fire('moveend'); }, - setMaxBounds: function (bounds, options) { + setMaxBounds: function (bounds) { bounds = L.latLngBounds(bounds); this.options.maxBounds = bounds; if (!bounds) { - this._boundsMinZoom = null; - this.off('moveend', this._panInsideMaxBounds, this); - return this; + return this.off('moveend', this._panInsideMaxBounds, this); } - var minZoom = this.getBoundsZoom(bounds, true); - - this._boundsMinZoom = minZoom; - if (this._loaded) { - if (this._zoom < minZoom) { - this.setView(bounds.getCenter(), minZoom, options); - } else { - this.panInsideBounds(bounds); - } + this._panInsideMaxBounds(); } - this.on('moveend', this._panInsideMaxBounds, this); - - return this; + return this.on('moveend', this._panInsideMaxBounds, this); }, - panInsideBounds: function (bounds) { - bounds = L.latLngBounds(bounds); + panInsideBounds: function (bounds, options) { + var center = this.getCenter(), + newCenter = this._limitCenter(center, this._zoom, bounds); - var viewBounds = this.getPixelBounds(), - viewSw = viewBounds.getBottomLeft(), - viewNe = viewBounds.getTopRight(), - sw = this.project(bounds.getSouthWest()), - ne = this.project(bounds.getNorthEast()), - dx = 0, - dy = 0; + if (center.equals(newCenter)) { return this; } - if (viewNe.y < ne.y) { // north - dy = Math.ceil(ne.y - viewNe.y); - } - if (viewNe.x > ne.x) { // east - dx = Math.floor(ne.x - viewNe.x); - } - if (viewSw.y > sw.y) { // south - dy = Math.floor(sw.y - viewSw.y); - } - if (viewSw.x < sw.x) { // west - dx = Math.ceil(sw.x - viewSw.x); - } - - if (dx || dy) { - return this.panBy([dx, dy]); - } - - return this; + return this.panTo(newCenter, options); }, addLayer: function (layer) { @@ -1704,7 +1729,7 @@ L.Map = L.Class.extend({ removeLayer: function (layer) { var id = L.stamp(layer); - if (!this._layers[id]) { return; } + if (!this._layers[id]) { return this; } if (this._loaded) { layer.onRemove(this); @@ -1752,15 +1777,14 @@ L.Map = L.Class.extend({ var oldSize = this.getSize(); this._sizeChanged = true; - - if (this.options.maxBounds) { - this.setMaxBounds(this.options.maxBounds); - } + this._initialCenter = null; if (!this._loaded) { return this; } var newSize = this.getSize(), - offset = oldSize.subtract(newSize).divideBy(2).round(); + oldCenter = oldSize.divideBy(2).round(), + newCenter = newSize.divideBy(2).round(), + offset = oldCenter.subtract(newCenter); if (!offset.x && !offset.y) { return this; } @@ -1774,9 +1798,12 @@ L.Map = L.Class.extend({ this.fire('move'); - // make sure moveend is not fired too often on resize - clearTimeout(this._sizeTimer); - this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); + if (options.debounceMoveend) { + clearTimeout(this._sizeTimer); + this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200); + } else { + this.fire('moveend'); + } } return this.fire('resize', { @@ -1787,7 +1814,7 @@ L.Map = L.Class.extend({ // TODO handler.addTo addHandler: function (name, HandlerClass) { - if (!HandlerClass) { return; } + if (!HandlerClass) { return this; } var handler = this[name] = new HandlerClass(this); @@ -1807,7 +1834,12 @@ L.Map = L.Class.extend({ this._initEvents('off'); - delete this._container._leaflet; + try { + // throws error in IE6-8 + delete this._container._leaflet; + } catch (e) { + this._container._leaflet = undefined; + } this._clearPanes(); if (this._clearControlPos) { @@ -1825,7 +1857,7 @@ L.Map = L.Class.extend({ getCenter: function () { // (Boolean) -> LatLng this._checkIfLoaded(); - if (!this._moved()) { + if (this._initialCenter && !this._moved()) { return this._initialCenter; } return this.layerPointToLatLng(this._getCenterLayerPoint()); @@ -1844,9 +1876,9 @@ L.Map = L.Class.extend({ }, getMinZoom: function () { - var z1 = this._layersMinZoom === undefined ? 0 : this._layersMinZoom, - z2 = this._boundsMinZoom === undefined ? 0 : this._boundsMinZoom; - return this.options.minZoom === undefined ? Math.max(z1, z2) : this.options.minZoom; + return this.options.minZoom === undefined ? + (this._layersMinZoom === undefined ? 0 : this._layersMinZoom) : + this.options.minZoom; }, getMaxZoom: function () { @@ -1998,6 +2030,7 @@ L.Map = L.Class.extend({ L.DomUtil.addClass(container, 'leaflet-container' + (L.Browser.touch ? ' leaflet-touch' : '') + (L.Browser.retina ? ' leaflet-retina' : '') + + (L.Browser.ielt9 ? ' leaflet-oldie' : '') + (this.options.fadeAnimation ? ' leaflet-fade-anim' : '')); var position = L.DomUtil.getStyle(container, 'position'); @@ -2168,12 +2201,14 @@ L.Map = L.Class.extend({ _onResize: function () { L.Util.cancelAnimFrame(this._resizeRequest); this._resizeRequest = L.Util.requestAnimFrame( - this.invalidateSize, this, false, this._container); + function () { this.invalidateSize({debounceMoveend: true}); }, this, false, this._container); }, _onMouseClick: function (e) { - if (!this._loaded || (!e._simulated && this.dragging && this.dragging.moved()) || - L.DomEvent._skipped(e)) { return; } + if (!this._loaded || (!e._simulated && + ((this.dragging && this.dragging.moved()) || + (this.boxZoom && this.boxZoom.moved()))) || + L.DomEvent._skipped(e)) { return; } this.fire('preclick'); this._fireMouseEvent(e); @@ -2268,6 +2303,46 @@ L.Map = L.Class.extend({ return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint()); }, + // adjust center for view to get inside bounds + _limitCenter: function (center, zoom, bounds) { + + if (!bounds) { return center; } + + var centerPoint = this.project(center, zoom), + viewHalf = this.getSize().divideBy(2), + viewBounds = new L.Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)), + offset = this._getBoundsOffset(viewBounds, bounds, zoom); + + return this.unproject(centerPoint.add(offset), zoom); + }, + + // adjust offset for view to get inside bounds + _limitOffset: function (offset, bounds) { + if (!bounds) { return offset; } + + var viewBounds = this.getPixelBounds(), + newBounds = new L.Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset)); + + return offset.add(this._getBoundsOffset(newBounds, bounds)); + }, + + // returns offset needed for pxBounds to get inside maxBounds at a specified zoom + _getBoundsOffset: function (pxBounds, maxBounds, zoom) { + var nwOffset = this.project(maxBounds.getNorthWest(), zoom).subtract(pxBounds.min), + seOffset = this.project(maxBounds.getSouthEast(), zoom).subtract(pxBounds.max), + + dx = this._rebound(nwOffset.x, -seOffset.x), + dy = this._rebound(nwOffset.y, -seOffset.y); + + return new L.Point(dx, dy); + }, + + _rebound: function (left, right) { + return left + right > 0 ? + Math.round(left - right) / 2 : + Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right)); + }, + _limitZoom: function (zoom) { var min = this.getMinZoom(), max = this.getMaxZoom(); @@ -2348,9 +2423,9 @@ L.CRS.EPSG3395 = L.extend({}, L.CRS, { transformation: (function () { var m = L.Projection.Mercator, r = m.R_MAJOR, - r2 = m.R_MINOR; + scale = 0.5 / (Math.PI * r); - return new L.Transformation(0.5 / (Math.PI * r), 0.5, -0.5 / (Math.PI * r2), 0.5); + return new L.Transformation(scale, 0.5, -scale, 0.5); }()) }); @@ -2587,7 +2662,7 @@ L.TileLayer = L.Class.extend({ this._updateZIndex(); if (this._animated) { - var className = 'leaflet-tile-container leaflet-zoom-animated'; + var className = 'leaflet-tile-container'; this._bgBuffer = L.DomUtil.create('div', className, this._container); this._tileContainer = L.DomUtil.create('div', className, this._container); @@ -2625,6 +2700,19 @@ L.TileLayer = L.Class.extend({ this._initContainer(); }, + _getTileSize: function () { + var map = this._map, + zoom = map.getZoom() + this.options.zoomOffset, + zoomN = this.options.maxNativeZoom, + tileSize = this.options.tileSize; + + if (zoomN && zoom > zoomN) { + tileSize = Math.round(map.getZoomScale(zoom) / map.getZoomScale(zoomN) * tileSize); + } + + return tileSize; + }, + _update: function () { if (!this._map) { return; } @@ -2700,8 +2788,8 @@ L.TileLayer = L.Class.extend({ var limit = this._getWrapTileNum(); // don't load if exceeds world bounds - if ((options.noWrap && (tilePoint.x < 0 || tilePoint.x >= limit)) || - tilePoint.y < 0 || tilePoint.y >= limit) { return false; } + if ((options.noWrap && (tilePoint.x < 0 || tilePoint.x >= limit.x)) || + tilePoint.y < 0 || tilePoint.y >= limit.y) { return false; } } if (options.bounds) { @@ -2816,8 +2904,9 @@ L.TileLayer = L.Class.extend({ }, _getWrapTileNum: function () { - // TODO refactor, limit is not valid for non-standard projections - return Math.pow(2, this._getZoomForUrl()); + var crs = this._map.options.crs, + size = crs.getSize(this._map.getZoom()); + return size.divideBy(this.options.tileSize); }, _adjustTilePoint: function (tilePoint) { @@ -2826,11 +2915,11 @@ L.TileLayer = L.Class.extend({ // wrap tile coordinates if (!this.options.continuousWorld && !this.options.noWrap) { - tilePoint.x = ((tilePoint.x % limit) + limit) % limit; + tilePoint.x = ((tilePoint.x % limit.x) + limit.x) % limit.x; } if (this.options.tms) { - tilePoint.y = limit - tilePoint.y - 1; + tilePoint.y = limit.y - tilePoint.y - 1; } tilePoint.z = this._getZoomForUrl(); @@ -2866,6 +2955,11 @@ L.TileLayer = L.Class.extend({ if (L.Browser.ielt9 && this.options.opacity !== undefined) { L.DomUtil.setOpacity(tile, this.options.opacity); } + // without this hack, tiles disappear after zoom on Chrome for Android + // https://github.com/Leaflet/Leaflet/issues/2078 + if (L.Browser.mobileWebkit3d) { + tile.style.WebkitBackfaceVisibility = 'hidden'; + } return tile; }, @@ -2876,10 +2970,20 @@ L.TileLayer = L.Class.extend({ this._adjustTilePoint(tilePoint); tile.src = this.getTileUrl(tilePoint); + + this.fire('tileloadstart', { + tile: tile, + url: tile.src + }); }, _tileLoaded: function () { this._tilesToLoad--; + + if (this._animated) { + L.DomUtil.addClass(this._tileContainer, 'leaflet-zoom-animated'); + } + if (!this._tilesToLoad) { this.fire('load'); @@ -2974,13 +3078,15 @@ L.TileLayer.WMS = L.TileLayer.extend({ this._crs = this.options.crs || map.options.crs; - var projectionKey = parseFloat(this.wmsParams.version) >= 1.3 ? 'crs' : 'srs'; + this._wmsVersion = parseFloat(this.wmsParams.version); + + var projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs'; this.wmsParams[projectionKey] = this._crs.code; L.TileLayer.prototype.onAdd.call(this, map); }, - getTileUrl: function (tilePoint, zoom) { // (Point, Number) -> String + getTileUrl: function (tilePoint) { // (Point, Number) -> String var map = this._map, tileSize = this.options.tileSize, @@ -2988,10 +3094,11 @@ L.TileLayer.WMS = L.TileLayer.extend({ nwPoint = tilePoint.multiplyBy(tileSize), sePoint = nwPoint.add([tileSize, tileSize]), - nw = this._crs.project(map.unproject(nwPoint, zoom)), - se = this._crs.project(map.unproject(sePoint, zoom)), - - bbox = [nw.x, se.y, se.x, nw.y].join(','), + nw = this._crs.project(map.unproject(nwPoint, tilePoint.z)), + se = this._crs.project(map.unproject(sePoint, tilePoint.z)), + bbox = this._wmsVersion >= 1.3 && this._crs === L.CRS.EPSG4326 ? + [se.y, nw.x, nw.y, se.x].join(',') : + [nw.x, se.y, se.x, nw.y].join(','), url = L.Util.template(this._url, {s: this._getSubdomain(tilePoint)}); @@ -3034,7 +3141,7 @@ L.TileLayer.Canvas = L.TileLayer.extend({ this._reset({hard: true}); this._update(); } - + for (var i in this._tiles) { this._redrawTile(this._tiles[i]); } @@ -3155,6 +3262,15 @@ L.ImageOverlay = L.Class.extend({ return this; }, + setUrl: function (url) { + this._url = url; + this._image.src = this._url; + }, + + getAttribution: function () { + return this.options.attribution; + }, + _initImage: function () { this._image = L.DomUtil.create('img', 'leaflet-image-layer'); @@ -3298,19 +3414,8 @@ L.Icon = L.Class.extend({ }, _createImg: function (src, el) { - - if (!L.Browser.ie6) { - if (!el) { - el = document.createElement('img'); - } - el.src = src; - } else { - if (!el) { - el = document.createElement('div'); - } - el.style.filter = - 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '")'; - } + el = el || document.createElement('img'); + el.src = src; return el; }, @@ -3391,6 +3496,7 @@ L.Marker = L.Class.extend({ options: { icon: new L.Icon.Default(), title: '', + alt: '', clickable: true, draggable: false, keyboard: true, @@ -3412,6 +3518,7 @@ L.Marker = L.Class.extend({ this._initIcon(); this.update(); + this.fire('add'); if (map.options.zoomAnimation && map.options.markerZoomAnimation) { map.on('zoomanim', this._animateZoom, this); @@ -3469,6 +3576,10 @@ L.Marker = L.Class.extend({ this.update(); } + if (this._popup) { + this.bindPopup(this._popup); + } + return this; }, @@ -3500,6 +3611,10 @@ L.Marker = L.Class.extend({ if (options.title) { icon.title = options.title; } + + if (options.alt) { + icon.alt = options.alt; + } } L.DomUtil.addClass(icon, classToAdd); @@ -3584,7 +3699,7 @@ L.Marker = L.Class.extend({ }, _animateZoom: function (opt) { - var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center); + var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round(); this._setPos(pos); }, @@ -3665,7 +3780,7 @@ L.Marker = L.Class.extend({ if (this._map) { this._updateOpacity(); } - + return this; }, @@ -3751,11 +3866,13 @@ L.Popup = L.Class.extend({ options: { minWidth: 50, maxWidth: 300, - maxHeight: null, + // maxHeight: null, autoPan: true, closeButton: true, offset: [0, 7], autoPanPadding: [5, 5], + // autoPanPaddingTopLeft: null, + // autoPanPaddingBottomRight: null, keepInView: false, className: '', zoomAnimation: true @@ -3775,7 +3892,6 @@ L.Popup = L.Class.extend({ if (!this._container) { this._initLayout(); } - this._updateContent(); var animFade = map.options.fadeAnimation; @@ -3786,7 +3902,7 @@ L.Popup = L.Class.extend({ map.on(this._getEvents(), this); - this._update(); + this.update(); if (animFade) { L.DomUtil.setOpacity(this._container, 1); @@ -3833,18 +3949,43 @@ L.Popup = L.Class.extend({ } }, + getLatLng: function () { + return this._latlng; + }, + setLatLng: function (latlng) { this._latlng = L.latLng(latlng); - this._update(); + if (this._map) { + this._updatePosition(); + this._adjustPan(); + } return this; }, + getContent: function () { + return this._content; + }, + setContent: function (content) { this._content = content; - this._update(); + this.update(); return this; }, + 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 = { viewreset: this._updatePosition @@ -3891,27 +4032,14 @@ L.Popup = L.Class.extend({ L.DomEvent.disableClickPropagation(wrapper); this._contentNode = L.DomUtil.create('div', prefix + '-content', wrapper); - L.DomEvent.on(this._contentNode, 'mousewheel', L.DomEvent.stopPropagation); - L.DomEvent.on(this._contentNode, 'MozMousePixelScroll', L.DomEvent.stopPropagation); + + L.DomEvent.disableScrollPropagation(this._contentNode); L.DomEvent.on(wrapper, 'contextmenu', L.DomEvent.stopPropagation); + this._tipContainer = L.DomUtil.create('div', prefix + '-tip-container', container); this._tip = L.DomUtil.create('div', prefix + '-tip', this._tipContainer); }, - _update: function () { - if (!this._map) { return; } - - this._container.style.visibility = 'hidden'; - - this._updateContent(); - this._updateLayout(); - this._updatePosition(); - - this._container.style.visibility = ''; - - this._adjustPan(); - }, - _updateContent: function () { if (!this._content) { return; } @@ -3996,21 +4124,23 @@ L.Popup = L.Class.extend({ var containerPos = map.layerPointToContainerPoint(layerPos), padding = L.point(this.options.autoPanPadding), + paddingTL = L.point(this.options.autoPanPaddingTopLeft || padding), + paddingBR = L.point(this.options.autoPanPaddingBottomRight || padding), size = map.getSize(), dx = 0, dy = 0; - if (containerPos.x + containerWidth > size.x) { // right - dx = containerPos.x + containerWidth - size.x + padding.x; + if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right + dx = containerPos.x + containerWidth - size.x + paddingBR.x; } - if (containerPos.x - dx < 0) { // left - dx = containerPos.x - padding.x; + if (containerPos.x - dx - paddingTL.x < 0) { // left + dx = containerPos.x - paddingTL.x; } - if (containerPos.y + containerHeight > size.y) { // bottom - dy = containerPos.y + containerHeight - size.y + padding.y; + if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom + dy = containerPos.y + containerHeight - size.y + paddingBR.y; } - if (containerPos.y - dy < 0) { // top - dy = containerPos.y - padding.y; + if (containerPos.y - dy - paddingTL.y < 0) { // top + dy = containerPos.y - paddingTL.y; } if (dx || dy) { @@ -4105,11 +4235,12 @@ L.Marker.include({ options = L.extend({offset: anchor}, options); - if (!this._popup) { + if (!this._popupHandlersAdded) { this .on('click', this.togglePopup, this) .on('remove', this.closePopup, this) .on('move', this._movePopup, this); + this._popupHandlersAdded = true; } if (content instanceof L.Popup) { @@ -4134,13 +4265,18 @@ L.Marker.include({ if (this._popup) { this._popup = null; this - .off('click', this.togglePopup) - .off('remove', this.closePopup) - .off('move', this._movePopup); + .off('click', this.togglePopup, this) + .off('remove', this.closePopup, this) + .off('move', this._movePopup, this); + this._popupHandlersAdded = false; } return this; }, + getPopup: function () { + return this._popup; + }, + _movePopup: function (e) { this._popup.setLatLng(e.latlng); } @@ -4281,7 +4417,9 @@ L.FeatureGroup = L.LayerGroup.extend({ return this; } - layer.on(L.FeatureGroup.EVENTS, this._propagateEvent, this); + if ('on' in layer) { + layer.on(L.FeatureGroup.EVENTS, this._propagateEvent, this); + } L.LayerGroup.prototype.addLayer.call(this, layer); @@ -4317,6 +4455,15 @@ L.FeatureGroup = L.LayerGroup.extend({ return this.invoke('bindPopup', content, options); }, + openPopup: function (latlng) { + // open popup on the first layer + for (var id in this._layers) { + this._layers[id].openPopup(latlng); + break; + } + return this; + }, + setStyle: function (style) { return this.invoke('setStyle', style); }, @@ -4340,11 +4487,10 @@ L.FeatureGroup = L.LayerGroup.extend({ }, _propagateEvent: function (e) { - if (!e.layer) { - e.layer = e.target; - } - e.target = this; - + e = L.extend({}, e, { + layer: e.target, + target: this + }); this.fire(e.type, e); } }); @@ -4376,6 +4522,8 @@ L.Path = L.Class.extend({ stroke: true, color: '#0033ff', dashArray: null, + lineCap: null, + lineJoin: null, weight: 5, opacity: 0.5, @@ -4525,6 +4673,11 @@ L.Path = L.Path.extend({ this._container = this._createElement('g'); this._path = this._createElement('path'); + + if (this.options.className) { + L.DomUtil.addClass(this._path, this.options.className); + } + this._container.appendChild(this._path); }, @@ -4555,6 +4708,12 @@ L.Path = L.Path.extend({ } else { this._path.removeAttribute('stroke-dasharray'); } + if (this.options.lineCap) { + this._path.setAttribute('stroke-linecap', this.options.lineCap); + } + if (this.options.lineJoin) { + this._path.setAttribute('stroke-linejoin', this.options.lineJoin); + } } else { this._path.setAttribute('stroke', 'none'); } @@ -4579,7 +4738,7 @@ L.Path = L.Path.extend({ _initEvents: function () { if (this.options.clickable) { if (L.Browser.svg || !L.Browser.vml) { - this._path.setAttribute('class', 'leaflet-clickable'); + L.DomUtil.addClass(this._path, 'leaflet-clickable'); } L.DomEvent.on(this._container, 'click', this._onMouseClick, this); @@ -4629,14 +4788,14 @@ L.Map.include({ this._panes.overlayPane.appendChild(this._pathRoot); if (this.options.zoomAnimation && L.Browser.any3d) { - this._pathRoot.setAttribute('class', ' leaflet-zoom-animated'); + L.DomUtil.addClass(this._pathRoot, 'leaflet-zoom-animated'); this.on({ 'zoomanim': this._animatePathZoom, 'zoomend': this._endPathZoom }); } else { - this._pathRoot.setAttribute('class', ' leaflet-zoom-hide'); + L.DomUtil.addClass(this._pathRoot, 'leaflet-zoom-hide'); } this.on('moveend', this._updateSvgViewport); @@ -4803,10 +4962,14 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({ _initPath: function () { var container = this._container = this._createElement('shape'); - L.DomUtil.addClass(container, 'leaflet-vml-shape'); + + L.DomUtil.addClass(container, 'leaflet-vml-shape' + + (this.options.className ? ' ' + this.options.className : '')); + if (this.options.clickable) { L.DomUtil.addClass(container, 'leaflet-clickable'); } + container.coordsize = '1 1'; this._path = this._createElement('path'); @@ -4839,12 +5002,18 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({ stroke.opacity = options.opacity; if (options.dashArray) { - stroke.dashStyle = options.dashArray instanceof Array ? + stroke.dashStyle = L.Util.isArray(options.dashArray) ? options.dashArray.join(' ') : options.dashArray.replace(/( *, *)/g, ' '); } else { stroke.dashStyle = ''; } + if (options.lineCap) { + stroke.endcap = options.lineCap.replace('butt', 'flat'); + } + if (options.lineJoin) { + stroke.joinstyle = options.lineJoin; + } } else if (stroke) { container.removeChild(stroke); @@ -5524,10 +5693,12 @@ L.Polygon = L.Polyline.extend({ }, initialize: function (latlngs, options) { - var i, len, hole; - L.Polyline.prototype.initialize.call(this, latlngs, options); + this._initWithHoles(latlngs); + }, + _initWithHoles: function (latlngs) { + var i, len, hole; if (latlngs && L.Util.isArray(latlngs[0]) && (typeof latlngs[0][0] !== 'number')) { this._latlngs = this._convertLatLngs(latlngs[0]); this._holes = latlngs.slice(1); @@ -5568,6 +5739,15 @@ L.Polygon = L.Polyline.extend({ } }, + setLatLngs: function (latlngs) { + if (latlngs && L.Util.isArray(latlngs[0]) && (typeof latlngs[0][0] !== 'number')) { + this._initWithHoles(latlngs); + return this.redraw(); + } else { + return L.Polyline.prototype.setLatLngs.call(this, latlngs); + } + }, + _clipPoints: function () { var points = this._originalPoints, newParts = []; @@ -5809,9 +5989,20 @@ L.CircleMarker = L.Circle.extend({ this.setRadius(this.options.radius); }, + setLatLng: function (latlng) { + L.Circle.prototype.setLatLng.call(this, latlng); + if (this._popup && this._popup._isOpen) { + this._popup.setLatLng(latlng); + } + }, + setRadius: function (radius) { this.options.radius = this._radius = radius; return this.redraw(); + }, + + getRadius: function () { + return this._radius; } }); @@ -5957,7 +6148,7 @@ L.GeoJSON = L.FeatureGroup.extend({ if (options.filter && !options.filter(geojson)) { return; } - var layer = L.GeoJSON.geometryToLayer(geojson, options.pointToLayer, options.coordsToLatLng); + var layer = L.GeoJSON.geometryToLayer(geojson, options.pointToLayer, options.coordsToLatLng, options); layer.feature = L.GeoJSON.asFeature(geojson); layer.defaultOptions = layer.options; @@ -5997,11 +6188,11 @@ L.GeoJSON = L.FeatureGroup.extend({ }); L.extend(L.GeoJSON, { - geometryToLayer: function (geojson, pointToLayer, coordsToLatLng) { + geometryToLayer: function (geojson, pointToLayer, coordsToLatLng, vectorOptions) { var geometry = geojson.type === 'Feature' ? geojson.geometry : geojson, coords = geometry.coordinates, layers = [], - latlng, latlngs, i, len, layer; + latlng, latlngs, i, len; coordsToLatLng = coordsToLatLng || this.coordsToLatLng; @@ -6013,37 +6204,37 @@ L.extend(L.GeoJSON, { case 'MultiPoint': for (i = 0, len = coords.length; i < len; i++) { latlng = coordsToLatLng(coords[i]); - layer = pointToLayer ? pointToLayer(geojson, latlng) : new L.Marker(latlng); - layers.push(layer); + layers.push(pointToLayer ? pointToLayer(geojson, latlng) : new L.Marker(latlng)); } return new L.FeatureGroup(layers); case 'LineString': latlngs = this.coordsToLatLngs(coords, 0, coordsToLatLng); - return new L.Polyline(latlngs); + return new L.Polyline(latlngs, vectorOptions); case 'Polygon': + if (coords.length === 2 && !coords[1].length) { + throw new Error('Invalid GeoJSON object.'); + } latlngs = this.coordsToLatLngs(coords, 1, coordsToLatLng); - return new L.Polygon(latlngs); + return new L.Polygon(latlngs, vectorOptions); case 'MultiLineString': latlngs = this.coordsToLatLngs(coords, 1, coordsToLatLng); - return new L.MultiPolyline(latlngs); + return new L.MultiPolyline(latlngs, vectorOptions); case 'MultiPolygon': latlngs = this.coordsToLatLngs(coords, 2, coordsToLatLng); - return new L.MultiPolygon(latlngs); + return new L.MultiPolygon(latlngs, vectorOptions); case 'GeometryCollection': for (i = 0, len = geometry.geometries.length; i < len; i++) { - layer = this.geometryToLayer({ + layers.push(this.geometryToLayer({ geometry: geometry.geometries[i], type: 'Feature', properties: geojson.properties - }, pointToLayer, coordsToLatLng); - - layers.push(layer); + }, pointToLayer, coordsToLatLng, vectorOptions)); } return new L.FeatureGroup(layers); @@ -6053,7 +6244,7 @@ L.extend(L.GeoJSON, { }, coordsToLatLng: function (coords) { // (Array[, Boolean]) -> LatLng - return new L.LatLng(coords[1], coords[0]); + return new L.LatLng(coords[1], coords[0], coords[2]); }, coordsToLatLngs: function (coords, levelsDeep, coordsToLatLng) { // (Array[, Number, Function]) -> Array @@ -6071,8 +6262,13 @@ L.extend(L.GeoJSON, { return latlngs; }, - latLngToCoords: function (latLng) { - return [latLng.lng, latLng.lat]; + latLngToCoords: function (latlng) { + var coords = [latlng.lng, latlng.lat]; + + if (latlng.alt !== undefined) { + coords.push(latlng.alt); + } + return coords; }, latLngsToCoords: function (latLngs) { @@ -6147,43 +6343,58 @@ L.Polygon.include({ }); (function () { - function includeMulti(Klass, type) { - Klass.include({ - toGeoJSON: function () { - var coords = []; + function multiToGeoJSON(type) { + return function () { + var coords = []; - this.eachLayer(function (layer) { - coords.push(layer.toGeoJSON().geometry.coordinates); - }); + this.eachLayer(function (layer) { + coords.push(layer.toGeoJSON().geometry.coordinates); + }); - return L.GeoJSON.getFeature(this, { - type: type, - coordinates: coords - }); - } - }); + return L.GeoJSON.getFeature(this, { + type: type, + coordinates: coords + }); + }; } - includeMulti(L.MultiPolyline, 'MultiLineString'); - includeMulti(L.MultiPolygon, 'MultiPolygon'); -}()); + L.MultiPolyline.include({toGeoJSON: multiToGeoJSON('MultiLineString')}); + L.MultiPolygon.include({toGeoJSON: multiToGeoJSON('MultiPolygon')}); -L.LayerGroup.include({ - toGeoJSON: function () { - var features = []; + L.LayerGroup.include({ + toGeoJSON: function () { - this.eachLayer(function (layer) { - if (layer.toGeoJSON) { - features.push(L.GeoJSON.asFeature(layer.toGeoJSON())); + var geometry = this.feature && this.feature.geometry, + jsons = [], + json; + + if (geometry && geometry.type === 'MultiPoint') { + return multiToGeoJSON('MultiPoint').call(this); } - }); - return { - type: 'FeatureCollection', - features: features - }; - } -}); + var isGeometryCollection = geometry && geometry.type === 'GeometryCollection'; + + this.eachLayer(function (layer) { + if (layer.toGeoJSON) { + json = layer.toGeoJSON(); + jsons.push(isGeometryCollection ? json.geometry : L.GeoJSON.asFeature(json)); + } + }); + + if (isGeometryCollection) { + return L.GeoJSON.getFeature(this, { + geometries: jsons, + type: 'GeometryCollection' + }); + } + + return { + type: 'FeatureCollection', + features: jsons + }; + } + }); +}()); L.geoJson = function (geojson, options) { return new L.GeoJSON(geojson, options); @@ -6208,8 +6419,8 @@ L.DomEvent = { return fn.call(context || obj, e || L.DomEvent._getEvent()); }; - if (L.Browser.msTouch && type.indexOf('touch') === 0) { - return this.addMsTouchListener(obj, type, handler, id); + if (L.Browser.pointer && type.indexOf('touch') === 0) { + return this.addPointerListener(obj, type, handler, id); } if (L.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener) { this.addDoubleTapListener(obj, handler, id); @@ -6261,8 +6472,8 @@ L.DomEvent = { if (!handler) { return this; } - if (L.Browser.msTouch && type.indexOf('touch') === 0) { - this.removeMsTouchListener(obj, type, id); + if (L.Browser.pointer && type.indexOf('touch') === 0) { + this.removePointerListener(obj, type, id); } else if (L.Browser.touch && (type === 'dblclick') && this.removeDoubleTapListener) { this.removeDoubleTapListener(obj, id); @@ -6293,19 +6504,29 @@ L.DomEvent = { } else { e.cancelBubble = true; } + L.DomEvent._skipped(e); + return this; }, + disableScrollPropagation: function (el) { + var stop = L.DomEvent.stopPropagation; + + return L.DomEvent + .on(el, 'mousewheel', stop) + .on(el, 'MozMousePixelScroll', stop); + }, + disableClickPropagation: function (el) { var stop = L.DomEvent.stopPropagation; for (var i = L.Draggable.START.length - 1; i >= 0; i--) { - L.DomEvent.addListener(el, L.Draggable.START[i], stop); + L.DomEvent.on(el, L.Draggable.START[i], stop); } return L.DomEvent - .addListener(el, 'click', L.DomEvent._fakeStop) - .addListener(el, 'dblclick', stop); + .on(el, 'click', L.DomEvent._fakeStop) + .on(el, 'dblclick', stop); }, preventDefault: function (e) { @@ -6319,34 +6540,31 @@ L.DomEvent = { }, stop: function (e) { - return L.DomEvent.preventDefault(e).stopPropagation(e); + return L.DomEvent + .preventDefault(e) + .stopPropagation(e); }, getMousePosition: function (e, container) { - - var ie7 = L.Browser.ie7, - body = document.body, + var body = document.body, docEl = document.documentElement, - x = e.pageX ? e.pageX - body.scrollLeft - docEl.scrollLeft: e.clientX, + //gecko makes scrollLeft more negative as you scroll in rtl, other browsers don't + //ref: https://code.google.com/p/closure-library/source/browse/closure/goog/style/bidi.js + x = L.DomUtil.documentIsLtr() ? + (e.pageX ? e.pageX - body.scrollLeft - docEl.scrollLeft : e.clientX) : + (L.Browser.gecko ? e.pageX - body.scrollLeft - docEl.scrollLeft : + e.pageX ? e.pageX - body.scrollLeft + docEl.scrollLeft : e.clientX), y = e.pageY ? e.pageY - body.scrollTop - docEl.scrollTop: e.clientY, - pos = new L.Point(x, y), - rect = container.getBoundingClientRect(), - left = rect.left - container.clientLeft, - top = rect.top - container.clientTop; - - // webkit (and ie <= 7) handles RTL scrollLeft different to everyone else - // https://code.google.com/p/closure-library/source/browse/trunk/closure/goog/style/bidi.js - if (!L.DomUtil.documentIsLtr() && (L.Browser.webkit || ie7)) { - left += container.scrollWidth - container.clientWidth; + pos = new L.Point(x, y); - // ie7 shows the scrollbar by default and provides clientWidth counting it, so we - // need to add it back in if it is visible; scrollbar is on the left as we are RTL - if (ie7 && L.DomUtil.getStyle(container, 'overflow-y') !== 'hidden' && - L.DomUtil.getStyle(container, 'overflow') !== 'hidden') { - left += 17; - } + if (!container) { + return pos; } + var rect = container.getBoundingClientRect(), + left = rect.left - container.clientLeft, + top = rect.top - container.clientTop; + return pos._subtract(new L.Point(left, top)); }, @@ -6446,11 +6664,13 @@ L.Draggable = L.Class.extend({ END: { mousedown: 'mouseup', touchstart: 'touchend', + pointerdown: 'touchend', MSPointerDown: 'touchend' }, MOVE: { mousedown: 'mousemove', touchstart: 'touchmove', + pointerdown: 'touchmove', MSPointerDown: 'touchmove' } }, @@ -6482,28 +6702,21 @@ L.Draggable = L.Class.extend({ }, _onDown: function (e) { + this._moved = false; + if (e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; } - L.DomEvent - .stopPropagation(e); + L.DomEvent.stopPropagation(e); if (L.Draggable._disabled) { return; } L.DomUtil.disableImageDrag(); L.DomUtil.disableTextSelection(); - var first = e.touches ? e.touches[0] : e, - el = first.target; - - // if touching a link, highlight it - if (L.Browser.touch && el.tagName.toLowerCase() === 'a') { - L.DomUtil.addClass(el, 'leaflet-active'); - } - - this._moved = false; - if (this._moving) { return; } + var first = e.touches ? e.touches[0] : e; + this._startPoint = new L.Point(first.clientX, first.clientY); this._startPos = this._newPos = L.DomUtil.getPosition(this._element); @@ -6513,7 +6726,10 @@ L.Draggable = L.Class.extend({ }, _onMove: function (e) { - if (e.touches && e.touches.length > 1) { return; } + if (e.touches && e.touches.length > 1) { + this._moved = true; + return; + } var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e), newPoint = new L.Point(first.clientX, first.clientY), @@ -6529,9 +6745,8 @@ L.Draggable = L.Class.extend({ this._moved = true; this._startPos = L.DomUtil.getPosition(this._element).subtract(offset); - if (!L.Browser.touch) { - L.DomUtil.addClass(document.body, 'leaflet-dragging'); - } + L.DomUtil.addClass(document.body, 'leaflet-dragging'); + L.DomUtil.addClass((e.target || e.srcElement), 'leaflet-drag-target'); } this._newPos = this._startPos.add(offset); @@ -6547,10 +6762,9 @@ L.Draggable = L.Class.extend({ this.fire('drag'); }, - _onUp: function () { - if (!L.Browser.touch) { - L.DomUtil.removeClass(document.body, 'leaflet-dragging'); - } + _onUp: function (e) { + L.DomUtil.removeClass(document.body, 'leaflet-dragging'); + L.DomUtil.removeClass((e.target || e.srcElement), 'leaflet-drag-target'); for (var i in L.Draggable.MOVE) { L.DomEvent @@ -6565,7 +6779,9 @@ L.Draggable = L.Class.extend({ // ensure drag is not fired after dragend L.Util.cancelAnimFrame(this._animRequest); - this.fire('dragend'); + this.fire('dragend', { + distance: this._newPos.distanceTo(this._startPos) + }); } this._moving = false; @@ -6637,7 +6853,7 @@ L.Map.Drag = L.Handler.extend({ this._draggable.on('predrag', this._onPreDrag, this); map.on('viewreset', this._onViewReset, this); - this._onViewReset(); + map.whenReady(this._onViewReset, this); } } this._draggable.enable(); @@ -6709,14 +6925,14 @@ L.Map.Drag = L.Handler.extend({ this._draggable._newPos.x = newX; }, - _onDragEnd: function () { + _onDragEnd: function (e) { var map = this._map, options = map.options, delay = +new Date() - this._lastTime, noInertia = !options.inertia || delay > options.inertiaThreshold || !this._positions[0]; - map.fire('dragend'); + map.fire('dragend', e); if (noInertia) { map.fire('moveend'); @@ -6740,6 +6956,8 @@ L.Map.Drag = L.Handler.extend({ map.fire('moveend'); } else { + offset = map._limitOffset(offset, map.options.maxBounds); + L.Util.requestAnimFrame(function () { map.panBy(offset, { duration: decelerationDuration, @@ -6765,15 +6983,22 @@ L.Map.mergeOptions({ L.Map.DoubleClickZoom = L.Handler.extend({ addHooks: function () { - this._map.on('dblclick', this._onDoubleClick); + this._map.on('dblclick', this._onDoubleClick, this); }, removeHooks: function () { - this._map.off('dblclick', this._onDoubleClick); + this._map.off('dblclick', this._onDoubleClick, this); }, _onDoubleClick: function (e) { - this.setZoomAround(e.containerPoint, this._zoom + 1); + var map = this._map, + zoom = map.getZoom() + (e.originalEvent.shiftKey ? -1 : 1); + + if (map.options.doubleClickZoom === 'center') { + map.setZoom(zoom); + } else { + map.setZoomAround(e.containerPoint, zoom); + } } }); @@ -6833,7 +7058,11 @@ L.Map.ScrollWheelZoom = L.Handler.extend({ if (!delta) { return; } - map.setZoomAround(this._lastMousePos, zoom + delta); + if (map.options.scrollWheelZoom === 'center') { + map.setZoom(zoom + delta); + } else { + map.setZoomAround(this._lastMousePos, zoom + delta); + } } }); @@ -6846,8 +7075,8 @@ L.Map.addInitHook('addHandler', 'scrollWheelZoom', L.Map.ScrollWheelZoom); L.extend(L.DomEvent, { - _touchstart: L.Browser.msTouch ? 'MSPointerDown' : 'touchstart', - _touchend: L.Browser.msTouch ? 'MSPointerUp' : 'touchend', + _touchstart: L.Browser.msPointer ? 'MSPointerDown' : L.Browser.pointer ? 'pointerdown' : 'touchstart', + _touchend: L.Browser.msPointer ? 'MSPointerUp' : L.Browser.pointer ? 'pointerup' : 'touchend', // inspired by Zepto touch code by Thomas Fuchs addDoubleTapListener: function (obj, handler, id) { @@ -6863,7 +7092,7 @@ L.extend(L.DomEvent, { function onTouchStart(e) { var count; - if (L.Browser.msTouch) { + if (L.Browser.pointer) { trackedTouches.push(e.pointerId); count = trackedTouches.length; } else { @@ -6882,7 +7111,7 @@ L.extend(L.DomEvent, { } function onTouchEnd(e) { - if (L.Browser.msTouch) { + if (L.Browser.pointer) { var idx = trackedTouches.indexOf(e.pointerId); if (idx === -1) { return; @@ -6891,7 +7120,7 @@ L.extend(L.DomEvent, { } if (doubleTap) { - if (L.Browser.msTouch) { + if (L.Browser.pointer) { // work around .type being readonly with MSPointer* events var newTouch = { }, prop; @@ -6915,15 +7144,15 @@ L.extend(L.DomEvent, { obj[pre + touchstart + id] = onTouchStart; obj[pre + touchend + id] = onTouchEnd; - // on msTouch we need to listen on the document, otherwise a drag starting on the map and moving off screen + // on pointer we need to listen on the document, otherwise a drag starting on the map and moving off screen // will not come through to us, so we will lose track of how many touches are ongoing - var endElement = L.Browser.msTouch ? document.documentElement : obj; + var endElement = L.Browser.pointer ? document.documentElement : obj; obj.addEventListener(touchstart, onTouchStart, false); endElement.addEventListener(touchend, onTouchEnd, false); - if (L.Browser.msTouch) { - endElement.addEventListener('MSPointerCancel', onTouchEnd, false); + if (L.Browser.pointer) { + endElement.addEventListener(L.DomEvent.POINTER_CANCEL, onTouchEnd, false); } return this; @@ -6933,11 +7162,12 @@ L.extend(L.DomEvent, { var pre = '_leaflet_'; obj.removeEventListener(this._touchstart, obj[pre + this._touchstart + id], false); - (L.Browser.msTouch ? document.documentElement : obj).removeEventListener( + (L.Browser.pointer ? document.documentElement : obj).removeEventListener( this._touchend, obj[pre + this._touchend + id], false); - if (L.Browser.msTouch) { - document.documentElement.removeEventListener('MSPointerCancel', obj[pre + this._touchend + id], false); + if (L.Browser.pointer) { + document.documentElement.removeEventListener(L.DomEvent.POINTER_CANCEL, obj[pre + this._touchend + id], + false); } return this; @@ -6951,81 +7181,90 @@ L.extend(L.DomEvent, { L.extend(L.DomEvent, { - _msTouches: [], - _msDocumentListener: false, + //static + POINTER_DOWN: L.Browser.msPointer ? 'MSPointerDown' : 'pointerdown', + POINTER_MOVE: L.Browser.msPointer ? 'MSPointerMove' : 'pointermove', + POINTER_UP: L.Browser.msPointer ? 'MSPointerUp' : 'pointerup', + POINTER_CANCEL: L.Browser.msPointer ? 'MSPointerCancel' : 'pointercancel', - // Provides a touch events wrapper for msPointer events. + _pointers: [], + _pointerDocumentListener: false, + + // Provides a touch events wrapper for (ms)pointer events. // Based on changes by veproza https://github.com/CloudMade/Leaflet/pull/1019 + //ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890 - addMsTouchListener: function (obj, type, handler, id) { + addPointerListener: function (obj, type, handler, id) { switch (type) { case 'touchstart': - return this.addMsTouchListenerStart(obj, type, handler, id); + return this.addPointerListenerStart(obj, type, handler, id); case 'touchend': - return this.addMsTouchListenerEnd(obj, type, handler, id); + return this.addPointerListenerEnd(obj, type, handler, id); case 'touchmove': - return this.addMsTouchListenerMove(obj, type, handler, id); + return this.addPointerListenerMove(obj, type, handler, id); default: throw 'Unknown touch event type'; } }, - addMsTouchListenerStart: function (obj, type, handler, id) { + addPointerListenerStart: function (obj, type, handler, id) { var pre = '_leaflet_', - touches = this._msTouches; + pointers = this._pointers; var cb = function (e) { + L.DomEvent.preventDefault(e); + var alreadyInArray = false; - for (var i = 0; i < touches.length; i++) { - if (touches[i].pointerId === e.pointerId) { + for (var i = 0; i < pointers.length; i++) { + if (pointers[i].pointerId === e.pointerId) { alreadyInArray = true; break; } } if (!alreadyInArray) { - touches.push(e); + pointers.push(e); } - e.touches = touches.slice(); + e.touches = pointers.slice(); e.changedTouches = [e]; handler(e); }; obj[pre + 'touchstart' + id] = cb; - obj.addEventListener('MSPointerDown', cb, false); + obj.addEventListener(this.POINTER_DOWN, cb, false); - // need to also listen for end events to keep the _msTouches list accurate + // need to also listen for end events to keep the _pointers list accurate // this needs to be on the body and never go away - if (!this._msDocumentListener) { + if (!this._pointerDocumentListener) { var internalCb = function (e) { - for (var i = 0; i < touches.length; i++) { - if (touches[i].pointerId === e.pointerId) { - touches.splice(i, 1); + for (var i = 0; i < pointers.length; i++) { + if (pointers[i].pointerId === e.pointerId) { + pointers.splice(i, 1); break; } } }; //We listen on the documentElement as any drags that end by moving the touch off the screen get fired there - document.documentElement.addEventListener('MSPointerUp', internalCb, false); - document.documentElement.addEventListener('MSPointerCancel', internalCb, false); + document.documentElement.addEventListener(this.POINTER_UP, internalCb, false); + document.documentElement.addEventListener(this.POINTER_CANCEL, internalCb, false); - this._msDocumentListener = true; + this._pointerDocumentListener = true; } return this; }, - addMsTouchListenerMove: function (obj, type, handler, id) { + addPointerListenerMove: function (obj, type, handler, id) { var pre = '_leaflet_', - touches = this._msTouches; + touches = this._pointers; function cb(e) { // don't fire touch moves when mouse isn't down - if (e.pointerType === e.MSPOINTER_TYPE_MOUSE && e.buttons === 0) { return; } + if ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; } for (var i = 0; i < touches.length; i++) { if (touches[i].pointerId === e.pointerId) { @@ -7041,14 +7280,14 @@ L.extend(L.DomEvent, { } obj[pre + 'touchmove' + id] = cb; - obj.addEventListener('MSPointerMove', cb, false); + obj.addEventListener(this.POINTER_MOVE, cb, false); return this; }, - addMsTouchListenerEnd: function (obj, type, handler, id) { + addPointerListenerEnd: function (obj, type, handler, id) { var pre = '_leaflet_', - touches = this._msTouches; + touches = this._pointers; var cb = function (e) { for (var i = 0; i < touches.length; i++) { @@ -7065,26 +7304,26 @@ L.extend(L.DomEvent, { }; obj[pre + 'touchend' + id] = cb; - obj.addEventListener('MSPointerUp', cb, false); - obj.addEventListener('MSPointerCancel', cb, false); + obj.addEventListener(this.POINTER_UP, cb, false); + obj.addEventListener(this.POINTER_CANCEL, cb, false); return this; }, - removeMsTouchListener: function (obj, type, id) { + removePointerListener: function (obj, type, id) { var pre = '_leaflet_', cb = obj[pre + type + id]; switch (type) { case 'touchstart': - obj.removeEventListener('MSPointerDown', cb, false); + obj.removeEventListener(this.POINTER_DOWN, cb, false); break; case 'touchmove': - obj.removeEventListener('MSPointerMove', cb, false); + obj.removeEventListener(this.POINTER_MOVE, cb, false); break; case 'touchend': - obj.removeEventListener('MSPointerUp', cb, false); - obj.removeEventListener('MSPointerCancel', cb, false); + obj.removeEventListener(this.POINTER_UP, cb, false); + obj.removeEventListener(this.POINTER_CANCEL, cb, false); break; } @@ -7098,7 +7337,8 @@ L.extend(L.DomEvent, { */ L.Map.mergeOptions({ - touchZoom: L.Browser.touch && !L.Browser.android23 + touchZoom: L.Browser.touch && !L.Browser.android23, + bounceAtZoomLimits: true }); L.Map.TouchZoom = L.Handler.extend({ @@ -7151,6 +7391,11 @@ L.Map.TouchZoom = L.Handler.extend({ if (this._scale === 1) { return; } + if (!map.options.bounceAtZoomLimits) { + if ((map.getZoom() === map.getMinZoom() && this._scale < 1) || + (map.getZoom() === map.getMaxZoom() && this._scale > 1)) { return; } + } + if (!this._moved) { L.DomUtil.addClass(map._mapPane, 'leaflet-touching'); @@ -7254,7 +7499,7 @@ L.Map.Tap = L.Handler.extend({ this._startPos = this._newPos = new L.Point(first.clientX, first.clientY); // if touching a link, highlight it - if (el.tagName.toLowerCase() === 'a') { + if (el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.addClass(el, 'leaflet-active'); } @@ -7284,7 +7529,7 @@ L.Map.Tap = L.Handler.extend({ var first = e.changedTouches[0], el = first.target; - if (el.tagName.toLowerCase() === 'a') { + if (el && el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.removeClass(el, 'leaflet-active'); } @@ -7320,7 +7565,7 @@ L.Map.Tap = L.Handler.extend({ } }); -if (L.Browser.touch && !L.Browser.msTouch) { +if (L.Browser.touch && !L.Browser.pointer) { L.Map.addInitHook('addHandler', 'tap', L.Map.Tap); } @@ -7339,6 +7584,7 @@ L.Map.BoxZoom = L.Handler.extend({ this._map = map; this._container = map._container; this._pane = map._panes.overlayPane; + this._moved = false; }, addHooks: function () { @@ -7347,9 +7593,16 @@ L.Map.BoxZoom = L.Handler.extend({ removeHooks: function () { L.DomEvent.off(this._container, 'mousedown', this._onMouseDown); + this._moved = false; + }, + + moved: function () { + return this._moved; }, _onMouseDown: function (e) { + this._moved = false; + if (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; } L.DomUtil.disableTextSelection(); @@ -7357,21 +7610,22 @@ L.Map.BoxZoom = L.Handler.extend({ this._startLayerPoint = this._map.mouseEventToLayerPoint(e); - this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._pane); - L.DomUtil.setPosition(this._box, this._startLayerPoint); - - //TODO refactor: move cursor to styles - this._container.style.cursor = 'crosshair'; - L.DomEvent .on(document, 'mousemove', this._onMouseMove, this) .on(document, 'mouseup', this._onMouseUp, this) .on(document, 'keydown', this._onKeyDown, this); - - this._map.fire('boxzoomstart'); }, _onMouseMove: function (e) { + if (!this._moved) { + this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._pane); + L.DomUtil.setPosition(this._box, this._startLayerPoint); + + //TODO refactor: move cursor to styles + this._container.style.cursor = 'crosshair'; + this._map.fire('boxzoomstart'); + } + var startPoint = this._startLayerPoint, box = this._box, @@ -7384,14 +7638,18 @@ L.Map.BoxZoom = L.Handler.extend({ L.DomUtil.setPosition(box, newPos); + this._moved = true; + // TODO refactor: remove hardcoded 4 pixels box.style.width = (Math.max(0, Math.abs(offset.x) - 4)) + 'px'; box.style.height = (Math.max(0, Math.abs(offset.y) - 4)) + 'px'; }, _finish: function () { - this._pane.removeChild(this._box); - this._container.style.cursor = ''; + if (this._moved) { + this._pane.removeChild(this._box); + this._container.style.cursor = ''; + } L.DomUtil.enableTextSelection(); L.DomUtil.enableImageDrag(); @@ -7449,7 +7707,7 @@ L.Map.Keyboard = L.Handler.extend({ right: [39], down: [40], up: [38], - zoomIn: [187, 107, 61], + zoomIn: [187, 107, 61, 171], zoomOut: [189, 109, 173] }, @@ -7604,6 +7862,7 @@ L.Handler.MarkerDrag = L.Handler.extend({ .on('drag', this._onDrag, this) .on('dragend', this._onDragEnd, this); this._draggable.enable(); + L.DomUtil.addClass(this._marker._icon, 'leaflet-marker-draggable'); }, removeHooks: function () { @@ -7613,6 +7872,7 @@ L.Handler.MarkerDrag = L.Handler.extend({ .off('dragend', this._onDragEnd, this); this._draggable.disable(); + L.DomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable'); }, moved: function () { @@ -7644,10 +7904,10 @@ L.Handler.MarkerDrag = L.Handler.extend({ .fire('drag'); }, - _onDragEnd: function () { + _onDragEnd: function (e) { this._marker .fire('moveend') - .fire('dragend'); + .fire('dragend', e); } }); @@ -7720,6 +7980,12 @@ L.Control = L.Class.extend({ } return this; + }, + + _refocusOnMap: function () { + if (this._map) { + this._map.getContainer().focus(); + } } }); @@ -7771,7 +8037,11 @@ L.Map.include({ L.Control.Zoom = L.Control.extend({ options: { - position: 'topleft' + position: 'topleft', + zoomInText: '+', + zoomInTitle: 'Zoom in', + zoomOutText: '-', + zoomOutTitle: 'Zoom out' }, onAdd: function (map) { @@ -7781,10 +8051,13 @@ L.Control.Zoom = L.Control.extend({ this._map = map; this._zoomInButton = this._createButton( - '+', 'Zoom in', zoomName + '-in', container, this._zoomIn, this); + this.options.zoomInText, this.options.zoomInTitle, + zoomName + '-in', container, this._zoomIn, this); this._zoomOutButton = this._createButton( - '-', 'Zoom out', zoomName + '-out', container, this._zoomOut, this); + this.options.zoomOutText, this.options.zoomOutTitle, + zoomName + '-out', container, this._zoomOut, this); + this._updateDisabled(); map.on('zoomend zoomlevelschange', this._updateDisabled, this); return container; @@ -7815,7 +8088,8 @@ L.Control.Zoom = L.Control.extend({ .on(link, 'mousedown', stop) .on(link, 'dblclick', stop) .on(link, 'click', L.DomEvent.preventDefault) - .on(link, 'click', fn, context); + .on(link, 'click', fn, context) + .on(link, 'click', this._refocusOnMap, context); return link; }, @@ -7873,6 +8147,12 @@ L.Control.Attribution = L.Control.extend({ this._container = L.DomUtil.create('div', 'leaflet-control-attribution'); L.DomEvent.disableClickPropagation(this._container); + for (var i in map._layers) { + if (map._layers[i].getAttribution) { + this.addAttribution(map._layers[i].getAttribution()); + } + } + map .on('layeradd', this._onLayerAdd, this) .on('layerremove', this._onLayerRemove, this); @@ -8155,8 +8435,9 @@ L.Control.Layers = L.Control.extend({ container.setAttribute('aria-haspopup', true); if (!L.Browser.touch) { - L.DomEvent.disableClickPropagation(container); - L.DomEvent.on(container, 'mousewheel', L.DomEvent.stopPropagation); + L.DomEvent + .disableClickPropagation(container) + .disableScrollPropagation(container); } else { L.DomEvent.on(container, 'click', L.DomEvent.stopPropagation); } @@ -8181,6 +8462,10 @@ L.Control.Layers = L.Control.extend({ else { L.DomEvent.on(link, 'focus', this._expand, this); } + //Work around for Firefox android issue https://github.com/Leaflet/Leaflet/issues/2033 + L.DomEvent.on(form, 'click', function () { + setTimeout(L.bind(this._onInputClick, this), 0); + }, this); this._map.on('click', this._collapse, this); // TODO keyboard accessibility @@ -8315,6 +8600,8 @@ L.Control.Layers = L.Control.extend({ } this._handlingClick = false; + + this._refocusOnMap(); }, _expand: function () { @@ -8435,8 +8722,8 @@ L.Map.include({ setView: function (center, zoom, options) { - zoom = this._limitZoom(zoom); - center = L.latLng(center); + zoom = zoom === undefined ? this._zoom : this._limitZoom(zoom); + center = this._limitCenter(L.latLng(center), zoom, this.options.maxBounds); options = options || {}; if (this._panAnim) { @@ -8892,7 +9179,8 @@ L.Map.include({ var data = { latlng: latlng, - bounds: bounds + bounds: bounds, + timestamp: pos.timestamp }; for (var i in pos.coords) { diff --git a/dist/leaflet.js b/dist/leaflet.js index 1d4c6e5450b..d778359c89d 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -3,7 +3,7 @@ (c) 2010-2013, Vladimir Agafonkin (c) 2010-2011, CloudMade */ -!function(t,e,i){var n=t.L,o={};o.version="0.6.4","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],i?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=i&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context||this,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n=!!t.ActiveXObject,s=n&&!t.XMLHttpRequest,a=n&&!e.querySelector,r=n&&!e.addEventListener,h=navigator.userAgent.toLowerCase(),l=-1!==h.indexOf("webkit"),u=-1!==h.indexOf("chrome"),c=-1!==h.indexOf("phantom"),d=-1!==h.indexOf("android"),p=-1!==h.search("android [23]"),_=typeof orientation!=i+"",m=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,L="MozPerspective"in g.style,P="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||L||P)&&!c,w=!t.L_NO_TOUCH&&!c&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ie6:s,ie7:a,ielt9:r,webkit:l,android:d,android23:p,chrome:u,ie3d:v,webkit3d:y,gecko3d:L,opera3d:P,any3d:x,mobile:_,mobileWebkit:_&&l,mobileWebkit3d:_&&y,mobileOpera:_&&t.opera,touch:w,msTouch:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement,l=o.Browser.ie7;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var u=o.DomUtil.getStyle(a,"width"),c=o.DomUtil.getStyle(a,"max-width"),d=a.getBoundingClientRect();("none"!==u||"none"!==c)&&(s+=d.left+a.clientLeft),n+=d.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!l||(s+=a.scrollWidth-a.clientWidth,l&&"hidden"!==o.DomUtil.getStyle(a,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(a,"overflow")&&(s+=17)),a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){return t.className.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)},addClass:function(t,e){o.DomUtil.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(t,e){t.className=o.Util.trim((" "+t.className+" ").replace(" "+e+" "," "))},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?new o.LatLng(t[0],t[1]):t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){return t?(t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this):this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this.setView(this.getCenter(),t,{zoom:e})},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t,e){if(t=o.latLngBounds(t),this.options.maxBounds=t,!t)return this._boundsMinZoom=null,this.off("moveend",this._panInsideMaxBounds,this),this;var i=this.getBoundsZoom(t,!0);return this._boundsMinZoom=i,this._loaded&&(this._zooma.x&&(r=Math.floor(a.x-n.x)),i.y>s.y&&(h=Math.floor(s.y-i.y)),i.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&this.dragging&&this.dragging.moved()||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=t.R_MINOR;return new o.Transformation(.5/(Math.PI*e),.5,-.5/(Math.PI*i),.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update() -},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container leaflet-zoom-animated";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i)||t.y<0||t.y>=i)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs;var e=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t,e){var i=this._map,n=this.options.tileSize,s=t.multiplyBy(n),a=s.add([n,n]),r=this._crs.project(i.unproject(s,e)),h=this._crs.project(i.unproject(a,e)),l=[r.x,h.y,h.x,r.y].join(","),u=o.Util.template(this._url,{s:this._getSubdomain(t)});return u+o.Util.getParamString(this.wmsParams,u,!0)+"&BBOX="+l},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return o.Browser.ie6?(i||(i=e.createElement("div")),i.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+t+'")'):(i||(i=e.createElement("img")),i.src=t),i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=t.getSize(),h=0,l=0;s.x+i>r.x&&(h=s.x+i-r.x+a.x),s.x-h<0&&(h=s.x-a.x),s.y+e>r.y&&(l=s.y+e-r.y+a.y),s.y-l<0&&(l=s.y-a.y),(h||l)&&t.fire("autopanstart").panBy([h,l])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)),this},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:(t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t.layer||(t.layer=t.target),t.target=this,this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape"); -o.DomUtil.addClass(t,"leaflet-vml-shape"),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?i.dashArray instanceof Array?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):""):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){var i,n,s;if(o.Polyline.prototype.initialize.call(this,t,e),t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),i=0,n=this._holes.length;n>i;i++)s=this._holes[i]=this._convertLatLngs(this._holes[i]),s[0].equals(s[s.length-1])&&s.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=360*(this._mRadius/40075017),i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return 360*(this._mRadius/40075017)},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i){var n,s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return n=i(u),e?e(t,n):new o.Marker(n);case"MultiPoint":for(a=0,r=u.length;r>a;a++)n=i(u[a]),h=e?e(t,n):new o.Marker(n),c.push(h);return new o.FeatureGroup(c);case"LineString":return s=this.coordsToLatLngs(u,0,i),new o.Polyline(s);case"Polygon":return s=this.coordsToLatLngs(u,1,i),new o.Polygon(s);case"MultiLineString":return s=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(s);case"MultiPolygon":return s=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(s);case"GeometryCollection":for(a=0,r=l.geometries.length;r>a;a++)h=this.geometryToLayer({geometry:l.geometries[a],type:"Feature",properties:t.properties},e,i),c.push(h);return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){return[t.lng,t.lat]},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t,e){t.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){t.push(e.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:e,coordinates:t})}})}t(o.MultiPolyline,"MultiLineString"),t(o.MultiPolygon,"MultiPolygon")}(),o.LayerGroup.include({toGeoJSON:function(){var t=[];return this.eachLayer(function(e){e.toGeoJSON&&t.push(o.GeoJSON.asFeature(e.toGeoJSON()))}),{type:"FeatureCollection",features:t}}}),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.msTouch&&0===e.indexOf("touch")?this.addMsTouchListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.msTouch&&0===e.indexOf("touch")?this.removeMsTouchListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.addListener(t,o.Draggable.START[i],e);return o.DomEvent.addListener(t,"click",o.DomEvent._fakeStop).addListener(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=o.Browser.ie7,s=e.body,a=e.documentElement,r=t.pageX?t.pageX-s.scrollLeft-a.scrollLeft:t.clientX,h=t.pageY?t.pageY-s.scrollTop-a.scrollTop:t.clientY,l=new o.Point(r,h),u=i.getBoundingClientRect(),c=u.left-i.clientLeft,d=u.top-i.clientTop;return o.DomUtil.documentIsLtr()||!o.Browser.webkit&&!n||(c+=i.scrollWidth-i.clientWidth,n&&"hidden"!==o.DomUtil.getStyle(i,"overflow-y")&&"hidden"!==o.DomUtil.getStyle(i,"overflow")&&(c+=17)),l._subtract(new o.Point(c,d))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(!t.shiftKey&&(1===t.which||1===t.button||t.touches)&&(o.DomEvent.stopPropagation(t),!o.Draggable._disabled)){o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection();var i=t.touches?t.touches[0]:t,n=i.target;o.Browser.touch&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._moved=!1,this._moving||(this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this))}},_onMove:function(t){if(!(t.touches&&t.touches.length>1)){var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.Browser.touch||o.DomUtil.addClass(e.body,"leaflet-dragging")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){o.Browser.touch||o.DomUtil.removeClass(e.body,"leaflet-dragging");for(var t in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[t],this._onMove).off(e,o.Draggable.END[t],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),this._onViewReset())}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)e.inertiaThreshold||!this._positions[0];if(t.fire("dragend"),n)t.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),a=(this._lastTime+i-this._times[0])/1e3,r=e.easeLinearity,h=s.multiplyBy(r/a),l=h.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,l),c=h.multiplyBy(u/l),d=u/(e.inertiaDeceleration*r),p=c.multiplyBy(-d/2).round();p.x&&p.y?o.Util.requestAnimFrame(function(){t.panBy(p,{duration:d,easeLinearity:r,noMoveStart:!0})}):t.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(t){this.setZoomAround(t.containerPoint,this._zoom+1)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&t.setZoomAround(this._lastMousePos,i+e)}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:o.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.msTouch?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.msTouch){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.msTouch){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.msTouch?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.msTouch&&m.addEventListener("MSPointerCancel",a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.msTouch?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.msTouch&&e.documentElement.removeEventListener("MSPointerCancel",t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(t,e,i,n){switch(e){case"touchstart":return this.addMsTouchListenerStart(t,e,i,n);case"touchend":return this.addMsTouchListenerEnd(t,e,i,n);case"touchmove":return this.addMsTouchListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(t,i,n,o){var s="_leaflet_",a=this._msTouches,r=function(t){for(var e=!1,i=0;i0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this) -},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.msTouch&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(t){return!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),this._map.fire("boxzoomstart"),void 0)},_onMouseMove:function(t){var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box),this._container.style.cursor="",o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable()},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton("+","Zoom in",e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton("-","Zoom out",e+"-out",i,this._zoomOut,this),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){return this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container),t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):(o.DomEvent.disableClickPropagation(e),o.DomEvent.on(e,"mousewheel",o.DomEvent.stopPropagation));var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=this._limitZoom(e),t=o.latLng(t),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file +!function(t,e,i){var n=t.L,o={};o.version="0.7","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},compileTemplate:function(t,e){return t=t.replace(/"/g,'\\"'),t=t.replace(/\{ *([\w_]+) *\}/g,function(t,i){return'" + o["'+i+'"]'+("function"==typeof e[i]?"(o)":"")+' + "'}),new Function("o",'return "'+t+'";')},template:function(t,e){var i=o.Util._templateCache=o.Util._templateCache||{};return i[t]=i[t]||o.Util.compileTemplate(t,e),i[t](e)},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?o.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();if(this._sizeChanged=!0,this._initialCenter=null,!this._loaded)return this;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c; +return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this.options.tileSize)},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({},t,{layer:t.target,target:this}),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=o.DomUtil.documentIsLtr()?t.pageX?t.pageX-n.scrollLeft-s.scrollLeft:t.clientX:o.Browser.gecko?t.pageX-n.scrollLeft-s.scrollLeft:t.pageX?t.pageX-n.scrollLeft+s.scrollLeft:t.clientX,r=t.pageY?t.pageY-n.scrollTop-s.scrollTop:t.clientY,h=new o.Point(a,r);if(!i)return h;var l=i.getBoundingClientRect(),u=l.left-i.clientLeft,c=l.top-i.clientTop;return h._subtract(new o.Point(u,c))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return this._moved=!0,void 0;var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),o.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){o.DomUtil.removeClass(e.body,"leaflet-dragging"),o.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target");for(var i in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[i],this._onMove).off(e,o.Draggable.END[i],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this +}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return this._zooming=!1,void 0;var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),void 0)},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file diff --git a/src/layer/tile/TileLayer.WMS.js b/src/layer/tile/TileLayer.WMS.js index 3632436f3f8..7c895088a5b 100644 --- a/src/layer/tile/TileLayer.WMS.js +++ b/src/layer/tile/TileLayer.WMS.js @@ -51,7 +51,7 @@ L.TileLayer.WMS = L.TileLayer.extend({ L.TileLayer.prototype.onAdd.call(this, map); }, - getTileUrl: function (tilePoint, zoom) { // (Point, Number) -> String + getTileUrl: function (tilePoint) { // (Point, Number) -> String var map = this._map, tileSize = this.options.tileSize, From b1afb43e5d5a4a050ef3ef6224999d439dc3ab7e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 18:56:20 +0200 Subject: [PATCH 519/816] update features page --- features.html | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/features.html b/features.html index 08b049bcfb2..8c0ab6b7c8d 100644 --- a/features.html +++ b/features.html @@ -19,10 +19,10 @@

        Available Map Layers

      • Markers
      • Popups
      • Vector layers: polylines, polygons, circles, rectangles, circle markers
      • +
      • GeoJSON layers
      • Image overlays
      • WMS layers
      • Layer groups
      • -
      • GeoJSON layers
      @@ -80,7 +80,6 @@

      Customization Features

      • Pure CSS3 popups and controls for easy restyling
      • Image- and HTML-based markers
      • -
      • A simple interface for implementing custom map layers
      • The same for custom map controls
      • Custom map projections (with EPSG:4326, EPSG:3857 and EPSG:3395 out of the box)
      • @@ -119,27 +118,26 @@

        On Desktop

      • Chrome
      • Firefox
      • Safari 5+
      • -
      • Opera 11.11+
      • -
      • IE 7–10
      • -
      • IE 6 (not perfect but accessible)
      • +
      • Opera 12+
      • +
      • IE 7–11

      On Mobile

        -
      • Safari for iOS 3/4/5/6+
      • +
      • Safari for iOS 3–7+
      • Android browser 2.2+, 3.1+, 4+
      • Chrome for Android 4+ and iOS
      • Firefox for Android
      • -
      • Other webkit-based browsers (webOS, Blackberry 7+, etc.)
      • -
      • IE10 for Win8-based devices
      • +
      • Other WebKit browsers (webOS, Blackberry 7+, etc.)
      • +
      • IE10/11 for Win8 devices

      Misc

        -
      • Extremely lightweight — around 31 KB of gzipped JS code
      • +
      • Extremely lightweight — around 34 KB of gzipped JS code
      • No external dependencies
      • Keeps your JS environment clean — no global or native prototypes pollution
      From fadfb53c92945a1d7cbd3978c220fc577df0a3f6 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 18:58:23 +0200 Subject: [PATCH 520/816] update index regarding lib size --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 7af1c8592e1..7d355b76674 100644 --- a/index.md +++ b/index.md @@ -6,7 +6,7 @@ layout: default Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 31 KB of JS, +Weighing just about 34 KB of JS, it has all the [features][] most developers ever need for online maps. Leaflet is designed with _simplicity_, _performance_ and _usability_ in mind. From 37b6f3e62679fb3df8c136322d445dcfcb41e445 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 19:10:26 +0200 Subject: [PATCH 521/816] minor fixes before 0.7 --- index.md | 5 +++-- reference.html | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/index.md b/index.md index 7d355b76674..c893c8baca6 100644 --- a/index.md +++ b/index.md @@ -6,13 +6,14 @@ layout: default Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 34 KB of JS, +Weighing just about 34 KB of JS, it has all the [features][] most developers ever need for online maps. 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 still being accessible on older ones. -It can be extended with many [plugins][], has a beautiful, easy to use and [well-documented API][] +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. {: .usedby} diff --git a/reference.html b/reference.html index 104b7fd7c59..3dcd570d44e 100644 --- a/reference.html +++ b/reference.html @@ -123,8 +123,8 @@

      Misc


      -

      This reference reflects Leaflet 0.6.
      -Docs for the previous stable version (0.5) are available in the source form (see instructions for running docs).

      +

      This reference reflects Leaflet 0.7. +Docs for 0.6 are available in the source form (see instructions for running docs).

      L.Map

      @@ -140,7 +140,7 @@

      Usage example

      Constructor

      - +
      @@ -4711,7 +4711,7 @@

      Event

      MouseEvent

      -
      Constructor Usage
      +
      From 9cd8f5dc8a79b5be86c9b728060e5e774836bb60 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 19:18:22 +0200 Subject: [PATCH 522/816] download page updates --- download.md | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/download.md b/download.md index def33da73f5..9ac6f7c5022 100644 --- a/download.md +++ b/download.md @@ -11,46 +11,44 @@ title: Download - - + + - - + + - - + + -
      property typeDescription
      Leaflet 0.6.4Stable version, released on June 26, 2013 and last updated on July 25, 2013.Leaflet 0.7Stable version, released on November 18, 2013.
      Leaflet 0.5.1Previous stable version, released on January 17, 2013 and last updated on February 6, 2013.Leaflet 0.6.4Previous stable version, released on June 26, 2013 and last updated on July 25, 2013.
      Leaflet 0.7-devIn-progress major version, developed on the master branch.Leaflet 0.8-devIn-progress version, developed on the master branch.
      [View Changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) -Note that the master version can contain incompatible changes, so please read the changelog carefully when upgrading to it. +Note that the master version can contain incompatible changes, +so please read the changelog carefully when upgrading to it. ### Using a Hosted Version of Leaflet -The latest stable release of Leaflet is hosted on a CDN — to start using -it straight away, place this in the `head` section of your HTML code: - - - +The latest stable Leaflet release is hosted on a CDN — to start using +it straight away, place this in the `head` of your HTML code: - + + ### Leaflet Source Code -These download packages above only contain the library itself. If you want to download the full source code, including unit tests, files for debugging, build scripts, etc., you can download it from the GitHub repository. +These download packages above only contain the library itself. +If you want to download the full source code, including unit tests, files for debugging, build scripts, etc., +you can download it +from the GitHub repository. ### Building Leaflet from the Source -Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and Jake, JSHint and UglifyJS libraries, which install easily and work well across all major platforms. Here are the steps to install it: +Leaflet build system is powered by the [Node.js](http://nodejs.org) platform, +which installs easily and works well across all major platforms. +Here are the steps to set it up: 1. [Download and install Node](http://nodejs.org) 2. Run the following commands in the command line: @@ -58,8 +56,11 @@ Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and
      npm install -g jake
       npm install
      -Now that you have everything installed, run `jake` inside the Leaflet directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and compress it to the `dist` folder. +Now that you have everything installed, run `jake build` inside the Leaflet directory. +This will combine and compress the Leaflet source files, saving the build to the `dist` folder. ### Building a Custom Version of Leaflet -To make a custom build of the library with only the things you need, open `build/build.html` page of the Leaflet source code contents, choose the components (it figures out dependencies for you) and then run the command generated with it. +To make a custom build of the library with only the things you need, +open `build/build.html` page of the Leaflet source code contents, choose the components +(it figures out dependencies for you) and then run the command generated with it. From 7a1b3719046063750e28ce3553ac19f2d334cb42 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 15 Nov 2013 19:43:36 +0200 Subject: [PATCH 523/816] update setMaxBounds description --- reference.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference.html b/reference.html index e917558b66f..ffb509a9c93 100644 --- a/reference.html +++ b/reference.html @@ -701,11 +701,11 @@

      Methods for Modifying Map State

      setMaxBounds( - <LatLngBounds> bounds, - <zoom/pan options> options? ) + <LatLngBounds> bounds this - Restricts the map view to the given bounds (see map maxBounds option), animating the map view if bounds are changed. The given animation options are passed through to `setView` or `panInsideBounds`, depending on map zoom level, and can be used to control how the map animates during this change. + Restricts the map view to the given bounds (see map maxBounds option). locate( From 37af19e6b0f2ff9982d666201e025b8ae4c5e818 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 13:07:10 +0200 Subject: [PATCH 524/816] add Point floor and contains reference, close #2123 --- reference.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference.html b/reference.html index ffb509a9c93..803eb55e7e7 100644 --- a/reference.html +++ b/reference.html @@ -3821,6 +3821,11 @@

      Methods

      Point Returns a copy of the current point with rounded coordinates. + + floor() + Point + Returns a copy of the current point with floored coordinates (rounded down). + equals( <Point> otherPoint ) @@ -3829,6 +3834,14 @@

      Methods

      Boolean Returns true if the given point has the same coordinates. + + contains( + <Point> otherPoint ) + + + Boolean + Returns true if the both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). + toString() String From e8f4411d7df61f0aedd5d8469c1bb30a19690da8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 13:08:08 +0200 Subject: [PATCH 525/816] fix geojson addData return type, close #2105 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 803eb55e7e7..36af40f5474 100644 --- a/reference.html +++ b/reference.html @@ -3350,7 +3350,7 @@

      Methods

      <GeoJSON> data )
      - Boolean + this Adds a GeoJSON object to the layer. From 4e9ad828f4e24e77734786dcdbb2a7d0fb942b5d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 13:10:18 +0200 Subject: [PATCH 526/816] add a note about Draggable & setPosition, close #1743 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 36af40f5474..5a7567c2a2d 100644 --- a/reference.html +++ b/reference.html @@ -5850,7 +5850,7 @@

      Events

      L.Draggable

      -

      A class for making DOM elements draggable (including touch support). Used internally for map and marker dragging.

      +

      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 DomUtil#setPosition

      var draggable = new L.Draggable(elementToDrag);
       draggable.enable();
      
      From 948c43ea60d8d0814329f06f89654e9bb001c0f4 Mon Sep 17 00:00:00 2001
      From: Vladimir Agafonkin 
      Date: Mon, 18 Nov 2013 14:11:15 +0200
      Subject: [PATCH 527/816] first batch of docs updates for 0.7
      
      ---
       reference.html | 94 +++++++++++++++++++++++++++++++++++++++++++++-----
       1 file changed, 86 insertions(+), 8 deletions(-)
      
      diff --git a/reference.html b/reference.html
      index 5a7567c2a2d..f4ef0f73010 100644
      --- a/reference.html
      +++ b/reference.html
      @@ -244,13 +244,13 @@ 

      Interaction Options

      scrollWheelZoom Boolean true - Whether the map can be zoomed by using the mouse wheel. + Whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was. doubleClickZoom Boolean true - Whether the map can be zoomed in by double clicking on it. + Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was. boxZoom @@ -288,6 +288,12 @@

      Interaction Options

      true Set it to false if you don't want popups to close when user clicks the map. + + bounceZoomAtLimits + Boolean + true + Set it to false if you don't want the map to zoom beyound min/max zoom and then bounce back when pinch-zooming. +

      Keyboard Navigation Options

      @@ -520,7 +526,7 @@

      Events

      dragend - Event + DragEndEvent Fired when the user stops dragging the map. @@ -607,7 +613,7 @@

      Methods for Modifying Map State

      setView( <LatLng> center, - <Number> zoom, + <Number> zoom?, <zoom/pan options> options? ) this @@ -697,7 +703,7 @@

      Methods for Modifying Map State

      <zoom/pan options> options )
      this - Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. + Checks if the map container size changed and updates the map if so — call it after you've changed the map size dynamically, also animating pan by default. If options.pan is false, panning will not occur. If options.debounceMoveend is true, it will delay moveend event so that it doesn't happen often even if the method is called many times in a row. setMaxBounds( @@ -1155,6 +1161,12 @@

      fitBounds options

      [0, 0] Equivalent of setting both top left and bottom right padding to the same value. + + maxZoom + Number + null + The maximum possible zoom to use. + @@ -1338,6 +1350,12 @@

      Options

      '' Text for the browser tooltip that appear on marker hover (no tooltip by default). + + alt + String + '' + Text for the alt attribute of the icon image (useful for accessibility). + zIndexOffset Number @@ -1416,7 +1434,7 @@

      Events

      dragend - Event + DragEndEvent Fired when the user stops dragging the marker. @@ -1424,6 +1442,11 @@

      Events

      Event Fired when the marker is moved via setLatLng. New coordinate include in event arguments. + + add + Event + Fired when the marker is added to the map. + remove Event @@ -1519,6 +1542,11 @@

      Methods

      this Opens the popup previously bound by the bindPopup method. + + getPopup() + Popup> popup + Returns the popup previously bound by the bindPopup method. + closePopup() this @@ -1806,6 +1834,12 @@

      Options

      18 Maximum zoom number. + + maxNativeZoom + Number + null + Maximum zoom number the tiles source has available. If it is specified, the tiles on all zoom levels higher than maxNativeZoom will be loaded from maxZoom level and auto-scaled. + tileSize Number @@ -2347,6 +2381,12 @@

      Options

      null Sets the pointer-events attribute on the path if SVG backend is used. + + className + String + '' + Custom class name set on an element. +

      Events

      @@ -2697,6 +2737,12 @@

      Methods

      <LatLng[][]> latlngs Returns an array of arrays of geographical points in each line. + + + openPopup() + + this + Opens the popup previously bound by bindPopup. toGeoJSON() @@ -2808,6 +2854,12 @@

      Methods

      <LatLng[][]> latlngs Returns an array of arrays of geographical points in each polygon. + + + openPopup() + + this + Opens the popup previously bound by bindPopup. toGeoJSON() @@ -3336,6 +3388,7 @@

      Options

      +

      Additionally accepts all Path options for polylines and polygons.

      Methods

      @@ -3435,7 +3488,8 @@

      Constructor

      L.LatLng( <Number> latitude, - <Number> longitude ) + <Number> longitude, + <Number> altitude? ) @@ -3444,7 +3498,7 @@

      Constructor

      L.latLng([]) - Creates an object representing a geographical point with the given latitude and longitude. + Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude). @@ -4969,6 +5023,22 @@ +

      DragEndEvent

      + + + + + + + + + + + + +
      propertytypedescription
      distanceNumberThe distance in pixels the draggable element was moved by.
      + + @@ -6238,6 +6308,14 @@

      Methods

      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. + + getSize( + <Number> zoom ) + + + Point + Returns the size of the world in pixels for a particular zoom. +

      Properties

      From 5666865cc6d5bbfaf585d6db46817b44dad071d6 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 14:20:57 +0200 Subject: [PATCH 528/816] second batch of 0.7 docs updates --- reference.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/reference.html b/reference.html index f4ef0f73010..b6b913f08a5 100644 --- a/reference.html +++ b/reference.html @@ -1763,6 +1763,17 @@

      Methods

      this Sets the HTML content of the popup. + + getContent() + <String|HTMLElement> + Returns the content of the popup. + + + update() + + this + Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded. + @@ -2260,6 +2271,12 @@

      Options

      1.0 The opacity of the image overlay. + + attribution + String + '' + The attribution text of the image overlay. +

      Methods

      @@ -2285,6 +2302,14 @@

      Methods

      this Sets the opacity of the overlay. + + setUrl( + <String> imageUrl ) + + + this + Changes the URL of the image. + bringToFront() this @@ -4356,6 +4381,30 @@

      Options

      'topleft' The position of the control (one of the map corners). See control positions. + + zoomInText + String + '+' + The text set on the zoom in button. + + + zoomOutText + String + '-' + The text set on the zoom out button. + + + zoomInTitle + String + 'Zoom in' + The title set on the zoom in button. + + + zoomInTitle + String + 'Zoom out' + The title set on the zoom out button. + From 3c0e6ab14ba7fa55e01e6ae607638b0f781e4e25 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 14:33:54 +0200 Subject: [PATCH 529/816] css cleanup and minor layout fix --- docs/css/screen.css | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/docs/css/screen.css b/docs/css/screen.css index 97171eadecf..cac0b998967 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -72,8 +72,6 @@ h2 { filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#b0de5c', EndColorStr='#82cb00'); /* IE6�IE9 */ border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; text-shadow: 0 -1px 1px rgba(0,0,0,0.35); @@ -82,20 +80,20 @@ h2 { .api-page h2[id]:before, .api-page tr[id] td:first-child:before { - content:'Permalink'; - display:inline-block; - margin:0px 5px 0px -35px; - width:30px; - height:20px; - line-height:20px; - vertical-align:baseline; - background:url(../images/sprite.png) -0px -0px no-repeat; - opacity:0.2; - border-radius:50%; - text-indent:-9999px; - border-radius:50%; - overflow:hidden; + content: 'Permalink'; + display: inline-block; + margin: 0px 5px 0px -35px; + width: 30px; + height: 20px; + line-height: 20px; + vertical-align: baseline; + background: url(../images/sprite.png) -0px -0px no-repeat; + opacity: 0.2; + border-radius: 50%; + text-indent: -9999px; + overflow: hidden; cursor: pointer; + position: absolute; } .api-page tr[id] td:first-child:before { @@ -143,8 +141,6 @@ h3.alt { color: #444; box-shadow: 0 0 15px #ddd; - -moz-box-shadow: 0 0 15px #ddd; - -webkit-box-shadow: 0 0 15px #ddd; border-radius: 5px; } @@ -210,15 +206,10 @@ td { background-image: -webkit-linear-gradient(top, #ffffff, #eaebec); /* Chrome 10+, Saf5.1+, iOS 5+ */ background-image: -moz-linear-gradient(top, #ffffff, #eaebec); /* FF3.6+ */ background-image: -o-linear-gradient(top, #ffffff, #eaebec); /* Opera 11.10+ */ - filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#eff0f1'); /* IE6�IE9 */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#eff0f1'); /* IE6-IE9 */ border-radius: 10px; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - box-shadow: 0 0 8px #eee; - -moz-box-shadow: 0 0 8px #eee; - -webkit-box-shadow: 0 0 8px #eee; } .nav li a, .nav li span { From 1d21d76a5d740cf14e6f53246de2c204735ca80a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 14:53:26 +0200 Subject: [PATCH 530/816] update screenshots on tutorials page --- docs/images/custom-icons.png | Bin 26323 -> 13104 bytes docs/images/layers-control.png | Bin 20262 -> 6851 bytes docs/images/quick-start.png | Bin 7927 -> 11051 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/images/custom-icons.png b/docs/images/custom-icons.png index f160b8ecc2b14c9d43633caaa36afd291fb76dee..68424029dd6175665c998ef831a9ef3680d34fa5 100644 GIT binary patch delta 12575 zcmZu&RaBm_vc;jeyHniVU5gZoYfEu0?(*U84uv0gcP;Mj?)KyE*4uOMeLR_!m(1)v z`zb3kN#-UXYs}&Z5TGF-AgbAW>EbEqAgSWzW2m{AjoH|_$a(o$*tyxc_}H1qIoQ}a zS=l&Q**TfnIRx1F1=zW3-zgwbB+2QNei~c;a<+4_piiWOBG%{Omf_)G<7VUH7H5~?laQ9=kd~q(cek}yQWB7|Gj_2x{pI{cN|^HB3X6%QiNOD3|E2uz z*u)$tHgYMhe{>QuGXH`&|678@D=6as3zB5}kBa{u!~`t?9Jpa%KtMo4s3@vS*Y0Wm z`SWN0;9zBCWpHqCV{;=tJ-x23?&9KNSwi<9qi}k9+TPyo;o+g8q9QLZ?{!e(>FH@= za&l*FMp02QppS23XXCk-Z)9X-VP@=bcPTU^WF*h9@z8K~toH2e?C;;d-QC?c&2)qW z1V?I)3+?caz=YZ2;^LW}Ti(3v$;rvW%KX2vySux+y*1W_eKr@CmZdRoV0UzMG=E$h zJ0dxDlCgX^&+dn%wQnoI?bvkx= zb?(tAu)MxJKGJ`6anLO;G(NL3y|_`+I@sPfb-4$$6i&JB%-2;a7`(l`?e6b(MW@Uy zZw(8G9)b^6mu3zc3D&mu&yIKN^Kmx@zAnvA9bT>+og9@n^sM)p?)>S!Iv6de?z%o* znOT^wsP|1TXdE5t{-IBKb91+~yH&lV+CMmad9br{aB_ZjGBiATa&{ub&v$llw!N{^ zQB($;ogUrXKAfIh%+AhEe$%hd&O6xO-P#3r9eS;Jv}|%-d^nQZjOzQ-Q7LD zyu3U;yxiU0)YR16-rdeFEH2DVFD=eJK0UAZFh4##Jv`j?_xE33T&=IK&n?XrmX!7O z_73%RU0vPYT;GgOj!usLlQCG9lXrP_c?ukZA0Hnd?jN#;zWez4USFJTZtb+Tww|6{ zfIy)2watZvh4b_Cx3`bs(aFop%h8FM*VosfhQ`9e!i9y!hr9cKwC88%3yVwRW0S|n z$6zpcXJ@B!7ZQUtQln+~3{a-P{7Vw>SU1 zH+OgU|Lp4O`tJ6oq@?8L=Jx6z>>udv{_X8`X=&;8_3i!RKjZqJ>eJJIj^mT#sHmv9 zxw*Bqwfm>X#>U3+>e_^agxueu<<*75>qWyuL)WVreSLlZ5}sfDvr|JuLtQN`cSlz6 z5jcsH`~CeL_+LR+vA@d}=a+W(4o;3wH10_AAt0DizetIzyRSxh0p4qOS`9sKj1ySHQ7v3U@Ly9G5lPqbp3llC~0&+zrW zvGyU&1|B7D4BF&ZcdF8N!L<`Nhu=5!dv>gICIT+U2cC~MQ@76o$7nKt-8&tP25JwQ zMMO8VAHn6-Mm$Krr!I@Uwvta^6RVb*&Ru=_?zd$Vdat^mYF|?N>Xx~M&UPXahK3(~ z#w0o}Jrfw0doD>mf?f`J$vm!yM12cWQ@mqMb$D}}Na&YBdRB*dkvC0`5xhXB?IN)X z{s5QsL+##k$0d@83_{PA5LqBv4QlLG(o3)I#=K63Z{VXo=&>f!w&GZHI0~0(%1Ecb zeb}@<^W-+{p6w7ewwbZhKaf$RoeeJK0e2qQ&UPgU)xfuFV3xg-tFXR;i*>3yyt3C{ zx?N8A@~tV_W67mv?+NZQF|mL7(a4X?25^}6ZN{`WqLGZG{@mT{(RALTnrzHl{XwWi zurK7(=UQVhO^l~gwc{o03(Dt@_)GtOnk6{3@nx`B^yfId_e1L(S zuWAurpk#=*`u%3`Rbio{Ul+845I`n{35P|+SA`XxvA>O1&ByC{aSfTHx$%%p`<<(B z>CIhlKQP{w?21pdU@xT}xh6P0=OM6C7y$`>9VSiRU9QnnK*rTWE3Xy79KN%|^*nWt zMk8{(EpOPl;Qi^4^?l%^7oigS1mI9p2X6Zx^R`|7qCnQlxeIe}54oNnMPz{ozfwXe zX6w2PLKC%h^S)h z5_w!-en@mTGAz_^ZDQ?YLYa}5NCU5g!OO zi}v->F_U>=j6;9-|Go_>8m7W6Wf>*2cV2M-l{c|$UBz=z<=83M=dfzT;F~9iPLe2@N6~{d<7fX zN-E>}74LUuO7Q1MSVa}ql4YK;{CtvYiPC%wIxgn1hOYql*9h-2Tcqulkw*#(c3OMN z#W#>ThBxe#S%$iBo{|*K!vzfX+K-J+1X^4wQ9-Tu%kWJ27N7l|P#}^?Dn==R5ZRb7 z*m(io&Hp`a!pf+vO4pDsJJufyf3ZB`dUOZW7wYB7L-L(i6d=F0HR~c5qv<8^@UBu( zKi%1Tbb*8AjAdpOB%B)O@c*TyXr_VGle}hJ9FvtTH^a@~>_hbGkzPlFW<(^h_cf9s4Ty(teyPnt=L?wNE)ymrP!AWB;8-|7nZhX34?~m|Oj=-=n8^TZ z(wAA`rANF3u9i9JAyjqTs0*!CzureiNLZ_X9i3@Ac#2Wt8w$O?{-OV>xYZ72EN(jV%MbJ=eOM`owzNm zxenq&`V316+Ld$otEL`{m6mRk*-#<;%25U36(ra|i&K>)E!s{&3dJ0>c}J<5q+|UK z@B2sn**UV&pOu{SJO?BRr;)?Jg<=W~O(~skSsPzvc|$c=rj0cGz{u(c4mP;azJJo= zDP(v2^D6@qIPm)^Cn8SIf&4p?(JC!}4mQFQ;)(#&Z@3w@a7tWRwtiL{yW3MwxmVM< z&Ch}sWL+OZjW-?;#g?G2D6LPk-tjWVK&u66IbT1oU35KwHOxDY+*`>de*)8}RA z>L=IukB`-8UfNOpNp72Jo(&!>QHXvnY{vPhcb~Qd{$FH2Sv-i*BJk=_=RL)_7d%NL zNGa0*^??AP?f40=`)Ww9$aKp2ktq-xA_V2Ku4t`>3c9*Za0UUc>59p)EW42;aiLwO z*&eqMCG%+fU{f@>F-(EF%qXf!2yM!V_R4)Mm4p|E0gpN~3?h61k!imJ<m%shMYWQ#XG%u01|zKf99Xo_R1w`=(LE$b&Qz9;b_7J62a4dgh%= zLr&D$<8r`PnaZIacT4K~R1g0Ce6rhe6QIm;_T%}40b53VKwO)yiI%#RNwQNOkreR?wlGn7JlXR#GY-;urE6g$?=ugY6QZU04 z@}g+y#nJVB6I*O3ak68km`=k!bs7V;t$qouf#LYf z#XfW`c}TQfRFkNTFM`KSE%bvhQ@x}by5rS9I{t3n)IKUdAzkg`w?W`EMd$-@swu3N zEJ~7-h*AxP^4PK$V8>3BlcRH6h?3xgSlpp=!1o2*iIV8R*M!G$Ep;~)|t=0k&5T5q|3X`;ZwL_%s`w0pcEyhD#@26dzrxN!WS;H?Y zHYqbXjyK{X96=PN>dol$=#;ZUPv@)b-|Y?Btw3SsK+QQHX%p4=-3UVhO%4BFFjDIW z9*XEjtPM421XFudcFOm{5R+Uv2d+ z^WZpPV3(YHdClZF3n7r$!tQ)tJ;mjaBZ4Rq3f!UNtyo1pq6Dt^*&rUMP7kf^QcAks z&s?%!*TIt_uQ#`%P)D_#muiBDIW5~AFtpi?^3I?+gFqY{BrHCbBptw451Fg-R9&IC zFL2Zu_ontzw)%b}E3_N3FF*~sQVdTihQf+ilIr-nQ~a;*dFoQ<)vhfJYLqfM4C7+f z-=A1nD~pe)?!W*$4DSyI={biSW~Trebyar)s9u*??I6Hg^MIpx0Qyh#CA-4(X1iDF z*&2%c=yK=>tTSUJo&_ELXV6INrcY2 z&d4;X8eQEKT6uXA^xua1BVl6fg4s!R1tGgIe1sgFe!IxE2!+M25)H-_uslX! zOHps(9Cb_z5_S(XEmCKVk%%L#X!cij?sK#dhE%GYWTu7e{G1(?^7;Jcb;qsQNnu2s zfTA-7mhXqXS$@>AA><_P)po_i^6+mk@d7eP$5I#s-8b5KR8kqJvj$h*$n)se zOUJwE=XAxV(}c6mwfNEkSU5}F%c@&-Ni$S%HYsYkd=gryNgpp2N*#eYe{%8-81_b?>6 zI(-&iN&7E3Cn{sk(ckE3;WO4HQ|<}3#aSk^c)HF;6ierAXk^Uvj0^4)kGLM0-jxJ6 z6Zk~Te$z0Agl5`^uRZ$6pSSNuFnS6CtQ3dZOD`^iZ7!AXE~kqIA4`3Gr8_44Skp!l z$oNMAwq!FI(w@-eU9kiZfd8(*pRR%?^|$>cmKf*aI`iZDW3}&OS&EZ1{YM_rMJILZg@GRX{W-P?AP9N}`e07pN^kD|M$y3^xZl=5{TAJ>f^4 zR(E|&>hajP9~ZuUDM?)795cfVpJcXfitB<~aJsb`=ZQ<#w~1^J;?bb!pPx|bUYt1$D=J@> z2F!G4oLM$(Qkuqd~#HQF;y@a}s($g)M8IazD_%pxYQ8wn`QVFxxiuzmz z)=%=EK52g;7sl4K*-75el;OsRbZ@3p}rkX z$md~98%G@iJ&gh{w6OZ3BxC{(YLtdKgz7KU!~4Z7&_duhioC6lq$$Pft$JfEa!^>q zBy+X5^)H(Tt<)brdjypZdt`sF4ZYS(BocK)t&6CM^59MC14($te=?1xjb{z{gFChbe$>7WiDBd0YO`&26?%b_jPzUujz3 z=YHX{-zY#lpxdgCjaR;)ZxK(rF4NLWPU%I#p>%9M+jeW@@7M;d;vqac2L$-THo7o{rRkpx)l4`0b4g(RkiAwk6{sJe+ZWbDfx>C`?0S5_!?krh4u!~anMtXD z^af6sJG+S%m3f?*$=dg7iA05}NYCUaXk<7{ORh)wqQ=kUG7=kwq#1|%rZFgShn}j* zP6;G*-}14-df(G4n@g}w!4|E90fwV!d}v#Zju=xO;H(-{p~HLU^f3 zX%ap`dax(EDrRmQ&gj9)1-LwCVBcsnu)eweq%)N4!w;gR0rp7MsBqEsxDe0ap0t(0 zC~-wi$_2Rz{?2FW{Ujuk^?Uc-LL_U~PWyS_+(f?x|0j1jZoMs1{~%X;wp9@Sj7r#hNvHBM^apsu`FNz( z@%Xph&m$&-BQ#=9o0@CVQ%i9$iQBpZ4MEq-Vu%;#+}KbCx`^TL`OnBt-0Kih*9}#? zjdHiODA!mpjTz?(Dm^j@`vy~rs6cU#5W3ZBOeHKoTY3bTN)9@F;Pvf!oeD3j+kR6C zoV6@`Ith^1M{aYb%qloJafiBqJf*hQ*8cWw>@@jvXX5V@1)ir%6~zZVrDtZQk;ir0 zj<|<^N+SpTWV_R^E%_Q>#BS~=UbIe_Cy!&w{kxG=S4|5$Wc9FBqw#|yAE4|}Jx&#I zos@;_nH%~JGoZ{wN-y4Ooqj;Rwq3c!sIM|+E&s{evB3S#;_buH*u4(cJTKUSV<9Zk z-b8P2Hf67dT`AX_d~iDH{*aDtf2JX2hzB-$UoSzwda2RZKw_2ZclGnlWxeF{`cl=3 zJI3?Nz>pGe57x?L>&GKuK7ePblalORW}P;U=E0L(9-soUjc^eL`tw%dWmBWLRI%ux zLi%BPl1AwUZ1HdYc*ZSOhJrq?Q86%txP$HN`@C0HWC<%?#>BevG^Ohe@KU z32b%Jl5DqnT}`~mZ+|WjFlCnzqjz83DupiRvOn%TYI>lVoL}#&yN>Y#409;ec4**+ z()77jk>w9$JYYD+9LgchQ^2YsV~hSUY9@-V4HFH8t7fC0TIZQe#>0yzTz;2N#lnw>zbds{fXsVyR)ppCsvpc*pwnyzG(irsMSe<+_-r zk=mxFpRE{ninMCA&{l@xrF`CoNAw~Y2R6&+$1D500EJ^Mx-aV0paeBP6M|%AmT|B8 z-``v9ADLKwA2#-iE=6=zEhh3yB=jo_8mfha&$@JKmKmd3;;Su%tudatgWRKj3H=-` zNN0(J7Zya>mIW=U`8q6(6a73I3WMH4&dQNEdmpM7MJ z>z~~;qI!!)*kN{t&!`|Qc(JlAw1whs)f+-03ZJUN)nNEzg>Bx+2I0zC_6IL2F_wN8 zQ0%2O6>|^&0S|yH$!Pa_gRjj2{$8=>d4K9kV&IKGUEblu6P~BKLAQG>|iga4{29RvF*RL@wVU0OVh**1VKe`K@ zzm=7G*;{v2@Log@>$etDuSoVR9ak^_NIi>j^VQJ@S1P;B#$JB`G2Hz`Fu~R`-pCy3 zdVF~%N_Dz*zkeU5^sEnEw~u7+I#V`sA|7q0)?&ThII`XsZJS^L?ePk&61dTpuG%*C zGskk~H%w->`+K|8BjT;>)(q!<(dL7J(oz9?#9Dm6eK)?!&?wQCyu@k4a1wI>lZ~O@+0{D7Y)3*NGp7RgVFFjTc0ar<0^m z2M?CA>0^-(#C$_^65ICjjQa5))K%*(yQ=bq87z;#`=$t?rtCAp=#@%QSEOnL4c_ZXBW$#lh(J*qq%hJzpNCkRU} zN$lEFQ?&B1(us7^Ob$Rj34OY$PMrFtL|k}yS|Q#{QQzfdC|+k>gVXV22oH%M zPZBp0qAiN8fMFa#ypphR7leSiWryV)O;3-c@pQ#xBC(JN5mu7cGNG0z>W#ScnRy9=NOH zIi}i)blq1mTb6O=^PlWZbs9P|49W6G*VDf73_H)D)MV~Dd}$;bl|p6V`zzB_1J`#P z1<|g{9XD74I)2&o^v?*>`&`TLWmxff;W-gHmTTjNR->-IA@bpfnn?PVT&RX~j2vUQOdzf@Z;o9LcsmYOOjLYZVMJ zW*M2Pq0?oa_!+KRN>Ma*evo-1F$WQjs2<-NhGXLrIre}(N|XT3v9Rug0a@lH+X<6a z#W;AOI#|Q*_{+B>&%zTi!5Df^Py60-T=Gg)=2}#kImmG>TmowbZ>>{8tj54wv?BsS z9Sw~yPDWC}6ch9~bPY{lH7Y7>Gj?Yvx*|?Lc-?@3R^E6;`_fi17m6d>s+Na?-;8BD z0^b$N@QwinBPf_fcKsk`nML*JpJ`&&L`+B?EU4Nci3O?tLV*G+i{lrUo8K~Wu z>m`~Ct2^;TbZ&P2`}~$}sieClm&QBJDNG@i!-*h&?b7kz<<0;++U*aA z6RaobQk@jU6&J=7vcz04Qef9Yy!h!7oAGY3ad)YSwf6)=YJQn<)Ep>es{;Td0M(;tP!0=3@2M% zj{TRAoF>E4bX%rpRv$r$x%S4|%g>AqI-C!0)0=0Rn8NDA?} z`A&J0S2-o@KrbTs9I-vgBFYO)cl}@f&lfiT88xQ^s?Ah)am{-YG1!=3b$7p5bYLriZKP2 zhh;z<;4Nt*Ku=-N#<19Bqd+MuDGf@SZPtyLQg3rnHXHaWaG8FM-Ub3J(wg>3<7hD?UM{#x(tAUgq47Snsqq zkLFN`TKQe!C7%7;XdO&kJ-smBa*sWCH9rWG`*#f^By?p!Ak(Mzq*(l4?kmgA-tJLf zQ;bBaN7XMkrG>s#(VV^`H{k#4oYIg~U$SG|Er62dP7#fDJkbA^eVQ=Vm27MSh+%My ztt#Hv-hW0%D#x%!HKnItJF+7wqA4wS9rUz{@syekxl2e3kyGG7*h(!{>jXIn70jA_ zn~|BLag0v8EEflU`1pfXoc-_%I!<22e`QBBy)K1S~h5kT`jfB8o<|<0ZSiPg~{84xzAdo1s zc*QknSgx_qoSie4J%#s$YlLm%<={@UOqq?o{xsu=zsh8i?FKB}DG-saO`33bFSlqsS=O`qdXw?8_5k}Pns1vr^W}C3;IoXKJpd6s|6|kWO+Kmo7;PdWS~N=BB{NNhC>|nP62d? zI51r*#{3wkz+zCdPZ`oDh^s(|0uf{^A`?|-J?3<5=CluwZ2PH0y%GnSKY(V57U`Nq zAwT}|4{sw(0CBy7O&H|VF5;5Ocig=`17rSFS}nfe7wo_#8H$nJj35tX<}{D}!`YFC z)}M5`=xZ^FXh2S$^$L~jVKGx38z$5zn}cgqOHN`AfCQR-bpBso-1XPW>L1Bs##Y@K zWaqK~Z@QCd0|@GJGlbotzGVLh=mMDe9wZE(+ttSEq*Rni>^pDLdG^fAOL@nlZ!A-b z`e^KhMwU{@v+1go>5JN!t786g$^4!S%J&MmI=u+Fl0d>ZI9$a!Oe)I14(jl|hxABA z(CsWfvS=Ive-m;<(u6(}=E@;uoqxykl}YME#Jj%xPshvZ!tXg_gFdAa4z2;u<&>KN zE-wBI2L7g$%^F!78Z+66nv80Baz}DAZTJ8k@ZHDrhcBa7oPiw2R$tW^71Anc7#aFW zR4epZJzzEg5{^(^s#^~29Y{o{F8}32G)dnt(u(1iiD>`%!5c)R^FCnRmD@nJa4XHC z6oi#}UynocLP~f>t@1|D{mo?Fb)A z)-2t#K9e%hfB!|vIx0%SiFa1N>#%aslv#09GSaodtN=UBJH@bG{N_3cciI{?-2px} zz(;>#9`SP*Xg-OM$D7pCwO9X&EIFTinJa_ZHg_jMLj#GiD#|>)S1ypzO&A*Cd>Zxs z8$gFmm06`~Rhd$)IH5v}UTx|OdM~RjY`MnOU z4)VdsP*G_{*Qp#*vgl$v+MCh6CMi3catY45LF%H8;`ArFrLR~g-#mnd9j+OidFXoa z`LmEg#E`5>7-iqqWgArM6tpRsL46~CJ8-|X8Av5zB33GaF4nC^M`X`oF^fxTfvp|O zpz#7C7ltD0TV6WJSkYAx=Zsq}fQBTydRtRxz0H9KN~Kj&pxC2N;|$@jRu$mrYWW40 zG_HJr2&36+cluee5@L$Tn=h)pU)nF11u^RpP2!cR6rh&Gjwu_!HIR60J`|L007kqX z+dlGKxjc*&@;s-S#SVrw%>k=@CEB;0Ki7t!pGDnMxH8 zLI?9Tt%XK z#aMhwvxHLllg?tKM~BiJvWblvD=vn!!RH=1%$1ZRU{R26g3SLyj@!wE1Q1dF1&Eon z;%P9L{@@eP*0hwboQm;Vzs{BPo2Lfvk`f=CkLiJAaVprdcC;nBy8F}`1HS`^DcvYP%Mi?4N$Lqezf$NJDzZSB zFq-rZB-ACrF%)&ybi!UI<L%Ci(km={i5PoLdYFk0U?nKiM zI;Pn}B}qTUjK_~P4{NY=C=?f1q2igIn8R1TZ>}OVw*3q#kDv}01aNyej>sFAb znP!4A(DpK~bS8X9b%K(2GhW~C#X8RG5?wB=6uqL)vr%lSfU%P3F>`UkAK?jt0j4)p zn*#+FCpjFVP}Y4e23YanGz!azrG)$Wf$}=+JFG29?q>DeY3t7w#^uhNDKg3$U!#Q6 zY8H^V&DZ*nuP?k3KTmO(^BLXOaVOBkQaB7VR!RgP=IbBOPK9QtR}dVNmOXPFF&-uf zK4IpRWj8eGjx-O=F_M<6pAXm7qq?X{v%9dqoLP zGon%zjDmc|D1rA*R^(^s+pF)9MY?Zux^++m#5}S+FhK=7Ac0@^KCg%*${M21=%%u+Pr#F5@?)`ujzPRMu`-4U~trd}0tiz<@%e%e_vsSQSk zIvNNFh6;N*t80R2=FFB9*tVHYVZ}N_TIN_uYZ2s_!hlo}=DoDDb5rA4D1IngA{J+3 zibn>QWPOnCNLIxD*l@IOL28n=)Dp3yon8r-c-r&#xXIVFj)OlRW)&F8XgP9?qQfLjWTjyY=0=h^K@WAeE$VG|k{4&L|YAnHT)T9WY*vYBYo!4)PU<3=RBKn(q z7)7T{Q@9Zm=2i%#e3y4B3xtC!%hZMp;1;vp^#%&S+x8~(3;=p!?8_T#>E^T_rAz|s za>lq-d@0-59A-Y(T|gWilsj@iiH?K>BEvFV*G0pkXy8XUt{J9zAy(_dxiblo+K`rUuv$tzfHjCFYUdzq(rzx<6AY zC4jH-&Q;v9r|xoo7UYaCBT&|{VPBOK&N}}%#`~XC?k-=4!$hNo&ypw4TPq31t*L); zXso|iZL12vmBmqF?Vp>5>nnflc(1!!(%5X&*luj=d}pn5F8{flHG9qF%-*x7 z!E#|5JP{ub1`G@=^NO7yiJT6cEJ-e&8pLb{;s%j%v$3#oaPsi*Fp;r?*g&ixc2+ia zW;Pyv4t9PJsPTgw96^nXOv~EA+|koDg%N^CUy_%dQ=F5JkC%;;lZ{OhB*p{c_$JN) z0!d1-aY^z>QjmGsJ1HviOE{Xj+gmue$w~-O{Fh-dw>Ibhe^{~qg-t1j0R8_4JpZeR zg3Q%T)xwhB{C_v#{a@G=R!DI`A#1n_49rYcRzghOYptdmw!z%moyLp(u58Ay=QQot z=Hg<{+FUv}nIHt`iisEo*@YAnU1l6SeT&SwLug5o=Gx*Ag}n@&r7<=kXa$E1t?2l9@i_+ZSU1Zp;%KR&k^4=@4Kz-oUfd#=b^nl)B0`TidF)^hzc!P zuzsh%@X)*WA2(;8zj~mSfn^sEVEixGxw$Rtb!%zv?(XL8xGlWAw8O*0sj?K-o}5VE zFFk%g8kR34*>N*YGETDp1~I~aIJyj$m~-gxxgN!0#YnEUI~V5&c>c)~5f)|gNvmMovGax9$08YEop|IQ@+j9V`J z7I84OO5braLiiBi?)`dVCFw)ladMPx;o-bgH*IyNI)-hBeC@b_>pFn=w4;B6|9OPy zI*f;lgLAOudzBVJ8le5TOZwSA5{TO~NE#2{`{Gz9bQSkz+yi8D+b63tP~*P#zm+TH zHXUECHjgd^J@r|&qdpFZ;ELce=3R}3k_r>{vRQsaTxzuEJ;!fVlZHOY4jB#fHI8dT zG2sOGyc%`uWF#e_S1zA5wX~S$YgKE!@i;^x*PPMNDdLG;8+xI^!7saBZ-mA>oT^yL zOdK|$Q*)C_qyT?PO4m=MBqFDkh7m)rf>o{uW=>D5ga`?z-fq1+pWNDJyoZEX;=Yn`qzW1sz$+KiPJ8LjtXMgM6 zP9eh{E2=}s`DmJC;Se9z-TfUR(#~@k;cJZY-0w()-~jM`j@+?I@NSrY8YA-p800+> z+wBQP5!c4<7Xn^1b;m*?z&`x|DoUb-_K2J883`*_Ww3Fng zs5$NAkO9Jjp`tln34|feDWXmY<3i44AkwaOdNOrCl%m|cpXuT~=F4Tt_~WIn$&*&p z`Skc!Ra`brT`e}Dxd^EOZtJQHse23EU0rsBg7wQ&EPuuiwA)eiemSI#kIQ=RMbRES zt~(|~?X?Ctv64XOOFM*x2#giBe{L9ec~!g+y8sFSf36Y=snuUI5;?HZu{t+{Kfec%C}P& zmw?p2DQXnM_}1lC7KQ#Y1eNr%=GCeMvg1RR)OB{^1YFqt@E-!T8}xhOQdr}ns##rj zn@y4!)`#joiPv3c^}U9Mem9boF3P+k{>2Ye%e(zM$J&&6eh&ORDcNynHv`>ZY)+Bc zxn)8LtimC0{ZCFJHN=-zu(WF;F5(ys82|wuX30!7?@U2t|2Ot%V(xhRzbU`$2oZ~R zkJ0!_+%S-E1BWmiR4B><_E7C^ZAw|DJ+xR>f2*aZSF6@8J{-^*4o8p2cl;Q#I-u}^ z=^#_a#qH3oUVAGw9lu_@zi*jFByxMY-0a+$7)i@kpben7II6kFV4kBMp0CtxZwoJ%{UIsL-vQn2N-K~U z=uu%aLyj(vGYVdG{U+oS$c#7NR7n6HMyMR?x9nRYBbf63R$8T;21#v0LpD3`b4V3L zbkQoBeq(Si2#N-aCs;7$N-th-4>1CSSoyFnJCYfBc}Xao*zG5x5jZq6$i!vj0Y@g1 zOJWCcv`H<-UwcMsKpri}hcG$Aj9SUt}`!x^l_?(o5F-#kA0#RN9D`yPyCK>&cve zGN{ePX>0@DarrtPnvSFPSg5yDwaS4+!j!bdaHd*y^U)<|>^X9hwJz^weZQOG+hWoW znXRwSr)-xXu0EQbm$pLwOMUL*{b_=>fmh@1sGD{el4dl7>%M*donPs77Tmd93gfnd zkK~O`SMcawq{@lU;N>@F(BuGQ7c3b9m^6gB@RWAJ7L*s%@(!Z5+t_zIFfgmuxg^)S z$tKr3DeEOIBv=!OOirHECpL$`ltd&+d~WQRmd++B%0cQwQLaNIJ{|o`t-h?5VD|NS5Cb3(!27p+`Q3M1>-PPp;l>3Qmf~?%Y{J`Xfu^E zB7O{8%ZO!EnK&cq2L0tWqnAm`$h}qHf9F)2alIte{r)eXwT3_wa0jEa^y2Aikj;uh z8#OQ!hZfin7(oO}cn5GwmVHm?KtyF+p6yl0j&G56AtiC5qg;V~A2}xT+4(L*IN0(x zvyV$As+}GVCO-%bEcr&Vfe8(z&t9`NsZ+Q*b8><)B0;X+AS3K0OM8(9d!Gjm1=IH1 z-Q1uaOB(W1AQ}nq?%W}xe5g6B!I)M>B+N(2Q{5RGWvY*rI|K-MIT|X9(a6Y=Z>9xf zpt`}8%I0$7bd!d-qcX9X#DX^wm_hOMxvPhevo{r8xyMYby5-1mUT7M;2AP(tk0m|8 z$rP18$>U+4071LdXc{7gG2i)VN3%WUeLI*2DVra=l6`2UKXHdSW0H+Y8$8iAQ)dU`DUEz#rioKQKZ(ep zsFC4d&H}qfgugKa{)n_~j96hcRixy74~n@4uOvQ)zuM(!pjFr_j38l8kBrOF=;Pz> z`EHqE<70!3X|cf0MifmL%FjyiyV0*sK)Om&s=RNdq=SbTe?L zD>Tg49c-?fUGg(`xm6`ScT83dp3eM4=bGfu(`RPOhnmu4rl`M^GRqm8cs$}j!SwrM z**4=k&lQlkK&zDX0i7Mv+K8+kUC* zIr4Bklh1<^sz{qrQ~|+etO(!KEd>7tqX0M1&rv{c+6`X;FHKhnp~BLR)EXdjw^~z75_}`H*N4U|0ZzEC>}+TWfLeX0%1Gq78kZxAwtj-F8_60 z-2`dX;40!^@ePS)5*kA;K`!4k>?WED1=aTnA>B!G3&=sbp!mTyR}d~EQzJ*Bz#`Hh ziQ)%4?XX4RiOuXtS4>gepb4+Un#pnQa0ABmUe9XELKZOzPhy-SC=W*qYHG=f9_B3t zYIUrP!+G%*tlT70!*Z>rQasve8Cn_0V;Wjjk9=FSo&&v=K}l(<>AsA#I5eep<)t~L zgh=w%Zq2D_+0Y*0tjt`<)zIfeb36u zY7LQL6BOZK&bZ7;ob<3yEbVaRAJL%1uwz-uaowrpIVv;re;ubiY>Xh~zVv_I5$kxe z5@~MLoA36y?}sfduzlzTUTOJ!PXYDVEKmmU`N#7hYLuk;%+TwS@6AqU*+P=9(N z!pLkR_ro-rX2MQm4kmcx5DVKip5l(g}m5P-{(|JbU9 z5ZrSYe<#_C6lPdXzC+$wAzY5XNBrOX*s(gHpvT|Hgu8xO>h+P4z|8BWlofdiO+#$h zO7z7%k4d*XHjUzD^bA?L zrvmj^|4mN%h z5*sEKsiyWC!d1JPW}#~+7q!M8>ZB*sBdDJ=XyMBrH>0E}bEafhU1vTWCw;;ey9t>a zePzY~2^f%xh=bw^Ew<-KFv{yGu-RR9U>*_+^Co_7>e6Oaui{t5UAl~nE%(};9_-Hh z?RQyEh}x=qcVfYgis2japEvyrcde>p+9KrJz+cZ+;{7a#9OI<`ReQQYVuh4i7%Up z4MhSgr%;#*?1>PcAPPSGiK2p|Jo^)QpucP(wr_fbi?@-A=7%Dp>q0WJxY@GsFv=|O z&Z`-$Y=<=x4!lhdptjfGlTq3`yFOX+srjn>>bCA%)>dh80$Y$hRIymZ%TTA+uBw?p z8^OCRRJn?l(1yx7N6n0=+PqUeQ4d;mN@bVr=?V#Za9J`Kx zez+XWlCM^;Ew=x`)rML|mYhS~5%mVzx$k|PQ0;_KFpfHcY9qA$d=__uy$;i~On>*K zA^f?vXmTcKsQZ1%zcBH6p!_NE`JC{z(xZG#BP`-_5E)E{ zb=bJe;KwV%*gd1t#>6E_>7FL24h>K=)3#$`!{e->3Zs;)qzc6-~54Unjwn zl^qIQ)|QEG1bk?BMotkl&*zx5uqh;@^A7CM(;Ieqn0Wv5I@664Z-2;bF#EWkQ+@9GhrM9(!p9?c#ntIx5O{+)X=jug3fCV~HaL zJn3yGi}ILh1bI?+Xv}9vcj9w3>q**Zj0GXhgzjNWG^^H+2mkSu!R-Yz-ae~kBTmk7 zDGq32W+nF1kFSsmcmUkBR#(8?`pNqwQRr~N0*85f>!3a|ZN6(&BquN3gfI%<4PkO` zK`tBG+FJiC|Ko1hcnU5wq<+DMOC%ACiU9f8QMLgG6+IX<^UOgy%w$q~bnh4`s7944 zn*0aszzLtCeL}f$j3?NLKq0P3j`GQexCIjN|TYOp;M{( z;$bBjNRar$bqc{)% zdsvv@YlNrwH?gx)%Kd9=lw7^lD$l-dnB-AxTL(u8XG~DFmtW;SO;%``nr8^L^$)!A7Ng3cOKn z5!`n)rQBos6NW(vHa9ybsj>e1qQfMFjf!`-_sO@{Y8miLT zsgL4=kAd%pGEQRm;>Q`_XNI(igs5GL9^LykFCw2$Uu3XGKI3_?(?`x+=!YnH zSETQ|q;iLM`8;*tX@0s!y_IX|?FU9*hekhNk&+8_pj1%m*S|M{!ZVIgDQh6`BM@%M(bql38)WA*Fb>OIc$jrH34 zxb&PP{g@+NjT$BEI3b~XYk(ll4aaRK>yfTIh)OrXeinvXh`^;%3$p)L$-&X7Z9tFX z(q!B0vOtDqWTBM}vz2Ts z+yKb0_2ZXjN{oq{I{!t~aHdXn)8Oh-*PXA5s-5E2;Hv+3G85$xcdshfQdu&UH#Qz6 zDmk`ySGWqX{|6D*&@8?do8I5Sr)ZKj4WqzAF4dT$W^?y@kAoCM#` zb*^fR(a@E0Hwzuw>u*jzy4!sf5@b7~?*b%sWMM%^BTm1#^F2?X>*(h27%MmrDweaM zLk91n@k9thTMi5fm6K^7g1ux9*_;};5@51K;@{?qsR&oZ#waj_vWbSXGBe9nYOB<# zrHHc>?=&(D-!!fWo0iK)!Tp3+dg&JVEgerP;P6<`jcZ^hp|NDO<@0uN3rSsL^bWiq z--->p2|U?l40lj>Se%U>zLb73am1BVRUQ}<;AQGnvA!&ddTjHMuTl?dxF1Hp)HxS< z6w|hn6W>L;h%Q2vaxxHR3mi6vppGFP=4?FVc}}ieN7@(^>IxOY;=6XKv+XM~bOwB; zugvKJQx2X7JO|FbV>%nCiFI6GWBS32KI_q1A`U4JUe^)6oEvH|&_4hoSG zS~r0^!zD!`r2m^)h)I<5kd}eFh8;w?mzj!y4&8^{f#%UmJkBa6l`!Nl2;j5xwF*+M zZ?LILH;JQMxeBkF4+X6_vZxyZantVa^o8+dDobR$iSu|DkDsWBrl3m%#F?IBx4}_* z`9a#L)}j7~$wD4R5+4Mj&%>`@<0G_k^W%~uDoD-0VCuxoqk5uO@-P-?s83@& zQZfhqn=G#gQsQ3;i^ok(PZ59zZYpoEFh+^g>2+8emd5`T=%_^bh&s~j_B8j%CVz2qCF`gDZ9i! zc{~gE?_@}3Urde7rDvQv)g6(dNCSO`dFaZI)yIAH)Y?89;PX3g;Uw`l{5eCMJc7w8 z@XJK8vzi?m)*pBg~nse!7X~ zb@lHig}rwz(O%$@PTP**)F@iSY^7>c1L^mWE1ccO(HpPzgb6TGL8cEGbM|50xZWS8 z=aT{TiCl*e9|{)W>UjE<4r!79bP!dZmsF@aHy}aFh4WDcTX#)NLBvb2uKiDFRYBjv-@rpd7}1g5xNh;5-yn`N zjx5}Ma9ZMl^MsTWWP9l9eCFlqm29t;GVH)FivF1>8*g}& zl`N)nEO0bg4~7ocxpjVIt{by?F^IOCM?tMNsAO~RvjcpQX?WbS*HV9E2k@YdoXLO# z+*?hDs)8JmeM6^<#VQKrX{M^zUZ!tmgw)xm1hBfNxyjOhK1Ivas}b(I#ibgRI_cL( z8JgTJB!bMP_@~o3AMQBqsIU75%QDXEhardi&FFn~h-UA*?*DADMwJ_-U*_`2y#6^u z=d&X8p9Z*=Ge2Tr`0KNL*y4qXL@-=oV1w}}cTEi2Q56`T?WiF3LVni&I?J+LihECg zCB2=uL;b;1u)JX^ZQoZ2DRwtI{;1-hvc1<|uLF`h0D&h(=@HxW;}) zb(=d9A$}*&4(W^mE0Ys?OojpnZsug)M+>8{cL>zYh*OjAzBtinKK#xUQQldqUEjNo zLbL{mAV<-qo=c}3TN_%60$XT*|FTaXKGdN9=dZaodQh0gO211qf2QGA_1IdX?_IZ= zGPobp^sv&v=dYHu_zN9fg&&sy1$J*NXRebqDMj{mmZ103>?Bv1cGYu(=J=12ENfO| z6ArM3Lm$6{E!@Mr&qrpk4V)Iz}2I@MZk-gv_Xc#8R9v{+Q$6}%Tk^t_JZAAFr zyi`JcnoY;Ap|?kJ+QY(mAzx_n)l!$)#U!)h>HcR#ep#BxiuS z8ii1Ag;xVFmNbr+9u6NXJi;Ah25i!7g4AU1aLCNe=!uHki9Q_ct|<98oKUq&je&0h z{Eg$m%jokuEU1z%yX3<-F{OCMJ_3l!waWoyWtsM3;=yuo>iMm5L<@mPVWwFh|lPCWx;wGdE7Q&rDCX3$~qg8~)z(rP_j zde^wgEX*R5<=pZ{BW2T9kv)Q;`&LwypwJhx4%#6vJhuF1s0;O?u@8BfY^98iBB!}W z4b6J_Btp?|DOAwavD>+OrpOv&a)fFJvD&RI;UvJGKQVUy z9&9pGsJbO#&E2u}dRB}nBe;S(!nMnTg7t)}Px4hZa+bRwxFLLoyDd%UoEQsnYlW*x z^^XS$?NR>2U5bo}Hwe4?3XNw-P}mn!^HA(N%wF*GPw_DZ(9ojRy6+aboaxSZ`Gb#) zGERM?*S~*!#MrbS>I3@FJLbT&l)MeYo|8{@Z5w7m0; z81Z+Z5?Jd14?_ewsAPx9W=4@jT-<<4v=ZY`$Yt6RLz+#V0a+?_d0Dr^zik$)&X!~1 zoUe_HOyn=7VyCU0>PaK&Dwl*MgR^mP-=rJOY-xpkSSxdU&yu6(M^SBY^i8raoTUb{Yl1#V80py3qV;*B=52?RU zCK}U5Qz;o7P8j+vlG9ICGq_OZAz|en4qGs0P@=qIg?r-OPp>Yo$td3icz)%&jNend}IXNZ##y>}$8v7m)yz(Jpk9rA9$^mdPq! zWrxj5U4=n7_>EqyD53mb=pu-umk^FjmP^3Y*ZBUUAW?DRe9F6-91YeO{RX6eZsxs1 zO75{US?#hV@aIX)>6zr4QvWO2pFSnnxH#OZ_dcfB%*lR_zq0LU@N5duzlQp8^O6W1 z+cnoVYl!&$6f}W!Tx8G!!zn6^hN=sN3#mS=<{!MGyXFP{aJCNbXHWCCw=VQ~xvLz` z-x~WwmQbmwQRT7oZyQq7OXJub|HiyHyZ&W;faXCdAr}nPt&7-*w$tXWCIxskiaVO= z&FJ9^5fschw&KH1FNX`NE5dcgf*@x>BkNFY)niccjwf*Tc)`#ntwFwOESnmK@Ysk) z%aQooEI_bp3a->PBsrv19fqxt2N`NplWWTfCMe0cVpGK&opZrsPcrpb{D3UAcj}Mv zDcmLW9u)a21JWm#b_Y2Ux?;4FZ1U#X8r47__KD*vlO7F^Omo#azfPh&O9wBF8yXZ_ zR>nn3+719sL92HJUZgkTv|=MR@xa`~+^%sXAbsff#+U1-#b94T&MMcerD0z~6=$cX zWT2WxJR0Gi6Q$x7#l!nFoe2N4qLxMHqQI|^DGA`tL6np_2t*c7 zsx+!=TPfUSOHZ;iB9QLcgBgatOqX>|!E$sZhchT_)O23@Zas)-Gr}-B1Q%_)hBx-u z;m_!_=!*y0Ni81h9IngEBvl}c>o?Yq=@6S{Y7zCsajxtSTmZY%a$sfo?x z5nj-{r5UJ5NZm$Q_v$sJn~*pEIb)M5Az1Y*B#~}W#c5DMR#<8xyZ#E~s|3w@ zMt1j^^dCpG zd}qs^!$eJ9?j*)5*PK3A&iMvOtOQ7`eZu& z?;cgoAinoWULku>;Sqen{WxLiI|jVIQu5!;k=(j7#i(|_UVHtv{sNX6x1M@vNk9Hc+Y1$}v7D^MqF`J2wHKIO{;W^P0e>2W zh>s1&W|i|Xs6%rQ$N0INCP3|eh;kz6j>M1!`D|;=4}b7Wui&%Y#x$m>%MDPH8~zSI zANH>)z)#%=sp`y)`Jc$@WsPfcu-A@L-Dx2-?0}W$rh5kTc#s!ddXgVJhXk8ZEVv6l z0^e{~P=a=7F!eiktV84`cf%7W#a#qCDvM{pYGC?ECqRe+s-G$Qq2)Ee>D_mnXjtu zU6|xtOm53%6a%l5e~JDd{B|m&ATMr|%8UGX#MTJB8HshmXgB=E>SusFuhq*sSHQ3U zy5eKyiT5uL#_tfrr@%+N1n+CdiX|MzVn}nFNFJm8?flojLc*xkaEid6h2qmWQNOPTP{SgGraDKP~{Ugff6*Z%{n|7DJq=g z#vP0p2-S(=GO(9Rrw)^+Ev8FUNEot@Nz!i`Z`c@Zcj*FAN=<{^oex^L z7Z7)BxnAUm%pt%xF|M;kAt`zqD}1QY(r>PZBw^Qad!L8haRA*xA?c$K39KnHhyP)xqL5w2W$O9pHq~am z5ZTA7zoLcJK&rYsQRK`9IVIQ#^5PwdZonq-;IUq+6+lE&AdPHX%K1YnCk8Wwl7=WAc|r9KUIGsxvw}59D{s3cz|4Vzh!iU8lvhk)$fzMV6!> zV`@Z&+sNjY$;cmixhPEV<=Qn-)edF0gecA{BFWNzZ}Hl4sCF=J-8QNZ-^&{72X4n{ zneU-s2E>(uTzJq&WX>KQGaGIZFHh35fRujC#Iof zV#H^C#qIuZC9pA3@GS+h;})+}-_Moj*byu6A6rpmM_hii*-+&f8pVH0-TYx|w8U%MHTle{CfJ6q z+2?4WFCQ(IxgCdJ&84A-%s|M=Q5!i8)vFDhnvMZ>bkK_g4Sk3Kg>)gIYk9L={iQ;J zPAT%iWX>s{UhvthZh=|v7vV2&;Io6){J1X0d_8`XEd$;j(i)Ktcn&fe%XJK>{*N;W zHuec82~ro%4IwXWRxD3xakEB^t;!q*2DVgZrz(^(b5|zvk~cYtcQPi(6#2CRZX;V&q3!FH ze@u7jvQp!FSsHBP^gQ|1N=hPC3$+}t@w!bn+e=0jY{n?yX z(Vi6oB&upLldr1iQ00;}SW=WMY7@nkhjHMn=v(Qg?G)?O6W?n{G>K>;`LT+`{|50? zdqvO?Pr5+|Wr9iWOodkfA+~U#;MPIy3_q-6`AhT=prCw=#Z*X{PyG$WWEcO;-5@_g z(DJ%GTV!o?ElNP~LH4+PzPC`1E7K>}pIJ-8>~EZVH!JOv;9)t$@>*%D;2s?_rNfxy zgo%#_pNY}oHT>E$tk~m)-1Efp&{n}S^{Juw?Y)9+Mi(H9{V3}Kyuj}V236HxXevg1 z({bU)EgKkW?X19uRMEy)c%xc1NSxXe!l)6Z&NVp%5pFY|3~&=adF#ziK3y$%w_ySQ zp0QJpA|}~akx?NAiD34BR1}(|d^hl{$V|_Fe?E3Oy~lrBn*XyId_9Hz~Q~*+m<^uWJA7b^h!HsLgoW0Pr*@&asE|FPAjZdXMF6Y!#-K`1Nnr#k3A`Bt( zl@Z|w=7pr}%x4Nz?SAsw&AO`237+RS87XL4u&fevbH=Ln=vmAhh1Y01dx~jj*wR!~ z1+1WjTmer*;PUhG>7b0K=R1wOg>}H&Zw$dZ2oD}^2yub)5_R(f-}!J{VH@8>Jy{v0 zD0fFnYHFd#m?~uDf>+6A`-cYS5I2un48nHKR`VqUV>ZS)=y%j8%zZf^Xo$H9mMiNzlNaAt8oAej@)uALUaq_h(O8DfY>xbZtz zxCS5KFfjz-660Z)r@{vDm=m3yg)~B*J#AvWHT4PC9*)0zFh9=g2KID``^Z3&m6~c} z@DVWo4?;|9T1sR1u*p1?k_MeSDbmjb-tnfKCkHt7!zD>kcht!9ZK5(O=IQfe`p_Kp zvrJY8YAMkj7;;C^z=wXs9)+;6E!IkEAJ=j*AlpZc$cFOxaZP1=XkY+ZeP2pBx1 zko^{_C-F$%Ma|<9V)d@EZnv_?gQE1f)Qu??J5@IsOL!ilZOCLXUFks^Po= zZKF?n=AptX2DDHLrDQ&9R?_5b8h2OE%}OUilsW9&>Z*5Qzuu3k3W(sP+4y93zczNQ z4B#E;WuV;8J}i_bNfCJ-{L*<;m>Hkye$w$%)-n>p4*O^!X=#hjL2>C=+Vf_LR8SaL z6R@T}kGb!7Qc_%fXHRkwV-(>vWMlvo!2G`1uM+zC^FohI6rny7Mg-=#&dyzM$<{M9 zfP9@^57@G_&P|QA`1(HO>p2GvySJii>y3RqH(qG)3Gvfi7pzLRq)^nPw{DkyO) zkFZcyb>BuaPO<4~et2w`X6THk>`RYYI0s0vpNLu-TUysm{2PPO(bsLn40;1NI0AQ& zYqB(0L1NYS4Nc}fSvPaej7@);4eIxw4b_tcMxm zGuyDw~QD9c%=({MUX>|xq-v%&zZ1$R!1v!*=ut?i9^h$Z1qSMxFa7Q`tNmiRb z=Xv(19o^wuZ+gc-%`gDyBqEg7#>MG|u&3ZX@{%_zAFT{k>GV}zuvJ_0J@O^3w%O)A zH^}li5(p@9ZX^kbz8v?dX@>qkkVh3gvCOhgQU>|=e|zPh@*nePlT!xM;b(g-6EwN+ z+esLL;YSmShk`oMbm0uO1q(dUQ0Mr~>0yyIdo`Q58EapwqEZ1}T5HMn<_;4bed{&L zeSS2Q%M&%Z3T8a3*k~YI3opL=Z-d*YL(=Ep$)w`%OGS^Vc=OS?7$;pCI}kh)GS*YU z=$EUA-FW^>HqjszW%}w_KixI|p*5sYXW5WTY#4R6Z{YiWJ3+7tcYga9o?~0xZ#AL| z=N1`qK2I!J>Qlf;6G7jEpOr{b78@;$7F3a3`6@^uI}Yaqq5UL(9o`u^{LPW5IlrwsW;$TCKC|AZv}{j>i#pI~h#&-v zjn|3L$bPYUaJFw21x`Xe%$`;)_55IZKKCQ2L>FNK(}V+)GO|MM_i&Ajtj&eSB19U9 zqqIR#t{gYQW$bm9kutAg_ACdMP52Sj!A2AT$jtH*zgF3@uh;yeO=1c09V5&a|yY>v2nW5X*a!G z6>0Nuo|E(NqB84)F?N1V#%#fo+KtZGDhHr6Jt{CIt}@)KQ>eN6K{0W~a)f_CF9*Nj zsTlnocDT%F{ER&CS*(!Ogo*?gqC|mW(~!ZgHFPc2NHQ(Zg^hMAUUFgYVo5TVFn#`5 z>@aIe&fzATl6>5Yxr5r(cK=R|;}oIi&_T^0x|p73qjw3MLt|$JZ8+a8ve&rcEdUu@ zLEq7Gy-Z@$~RHodTjeOUYsDzV5OogLmm2X>r{~5#xdh8h+cqmN3dA_gj@&Y&&7`KsQ7Feb^7rQ;V7e+I|-^=*qz3K=daD^PGYGM zDRx-!%)yDF%q^K7EW`I{*3652N-^A2s%25FxVK4+{X^$mMuX94DP*{Iorr-gvQ9kri+YViPW}#IB!49Vun`Q1}%?i@7=8v zpQTkea2w{HE(=4$78un?$#jPhhZ++d*LTb+{8gjxy879Ud*V7HM7i82I5UC#9WyN} z?2cWa9IDN|7_h@vTk1J(PR{uP)FFNKca>Qlt%iHwgiFAn)KfLSH~iGsC}NZWhnY7Q zGoO^E(%Z6t%5=%1%7ZjfvU3Or@_7RWTyDTKPk1Fex!@o}gI^lGuzM!yL~7u(N5wcB z7({%hNqr6z6>_tZX9A9zm+%SXVjWAQF~^NhxtVucfM`s9{a#Bk1=8Xk0<2^uah3*0++mGn1`Yyz_}RymP>9){U>Tw z&}JPT05fetNvb^K+o`!;1YFtwFN9N{$KAeZ;O1;6mhRd4m`Kp~$9$hls8-?xb;bh2U3- zsmszKE4;IrJpj8(4$&yaL^#S*x2T7*bPYd@fkSm^1VRg+$ip>WZAZCb?Xe?34yV#Z z+f8HmI&0OaK0xtZ463fz9GFch-k@qfM=kNRs~%gul51K>%)_Qi=5;|O!;gSCnGAda z2vxmb)&|`>u2v%76TU8`vJ_yYcrTO$9@Xz!np)tILKO7&s5}xacuY|Yv7x@#EP%nkL8B+I>;NLu z&ks(S8)oDa&DJKM;gUZ#F3xq8^H+fc?B2I?}iksjMkWbG=Cg!j5bl zw&2<5;F4RVX$nU1HEtTU!u0v-!3sKM{S6m~Zjq?bA?^XBH zT5o;tqYtHB4PzgtnYFeFR5;J$3l#0Z`;YD0QoDANii(69l$IaHR~$s3DdJ^Qd;FC1 zGguXJa$HkwnB|8DxMOkr)(v^V7?T=sN6Qf*;``0*=kT;e*mkpZv0#feNGG4~mMG35 zG^mtZ`7q)xbT~c(Pda7Pb?jUK$jb&oTLujk2X?6M=A|e$Hr_15wD-sC+AP>|tRFo# zb`#m;aGN{iRHbg-1w*6fKuNbDMtxlkjF668%y~CIV=-#jgU1RwnyU#Ei5=0f{#*b@ zK~9hsnzWWNbuZ;|4q&q-_LbD6R-C4n(2xrGiXfE7;C|0yryhF!S|3!;CVq z2Ca~r*0IW`2dSA#opZgGu1sdEz%F$9wWdyIL{5psvH+0L5o-+B21$i3p*sZe5?6nM z8P^O!{0V(BK^0q^sej)WnMkkIJG{8^$#7;$Z5S=^{C5)k0o|eKAzmEsA&hn+j=5vr zNVmhplqVZMdSw;_E@urSmUOPh{PZR(C-Nv8d8r?}jbf!UvXt+t@U~Pk&D4OP+Yc zZd}(fDp0a0jrVvDIeH`9`KC9$s`%n-{a`_H(g8Gy z5r}_$%n8{t)zgp@WX%4tJb(3VSvc``x=Sj8lG(7bs8UTQp@fo73CIl|bOWg!)%=oe z86E1$?oEqw=+JX=^|fzQpm@rjH9J3R0bXOH$KVxiVyM(+W_`{p;lX?a&4|M?9i#{Nfc_Q#-yC)C@M46Q^i84EV zrX|B6z-f>Oz>o-hADyJ3c_MHAGoSg4+;GDU#@Sdb9ru8SMt`-Q0NCRga%a}!!B{a) ztRpZNqX4Lq(^^kF`l}LC0I}1GOxy{UtBp1Ty{PaxHL-WS_q}rXl~?5PM;?)vUw9!N zXe!K#v+tr?9KM5%#|hn~|6Yaq?KsGwOM@raR~19*ELc2&A;Ug--C#&U7^9q$`r@;) zaO5vlJS|8km48)klL(XS;D%8SlaFfINLaZo43tkKqTW@Cdv+w{N56bopIZxKd-a|O zfG;VIT3%g=;&)dqT-OYEPLTi+0KYKv0GkaAR4j)keYT^b7-1A3?t!@?UgvNA=5Op? z5OHroivV3i*nq%=vC)iv!1e4{$Ogh(Pa0$~7KWRGSbxC%=-g!GTPPbKVwPE9<^_TF z>k(2w4q!knI`yfjHjRNJ^OhGZbmG}3pOh&bFm4Qvg9$wRzyp>^affm!G}yoZz{${P zBO3v_^HH-5UvYde8qSjNeUo_o4-3NdXI5@lOYK>o!77PBnw2T3p7}dTbY4+zlh@x} z$pA-ndw+2Vb1&gy_M&`o1cBin5O21l=wlDd+u!;YsdxH{H)a+4Dcetkwk{kt z5SuFTv8cfKK{UiWo=YP91NjlAd9EzW!s3EibPL5o90uz!~rKZyt84lkeK`>HZ?;1ZbR|M2Ng z8$S8HfB*08M!)sRPsVYvpZTBuoi)iA-!LJ2mXdvf_zSH1+h~qWj9I=pjR$PRg4Ru?{2Jq08m6{V&ShcYjk}IdsSf=ZecO*JljL z;Uhz;Untxc}P+W!)jvxqd zMV8|AP33&iPj764djvIdXlR5h0wM+?1g*nsQTQpcMOb)=WpG$e0HTS_fSF3;yDC!T zFoe_x&Qk#)=%-f4aAaRz*SCy}tDzu9#1>t_B~w)WX-2)BZ*y^kzp9?I_v88uv0P!1{~nv!GrP}zwsOKLi-YW43Oid!S}>?Bp?4x4U6+2C}y)> z7#{H+N}GTX-v0KtN8SF0LoSkxVz>2LU;d8GsLFtI_V&xQDhemFlq-^|TN*TItB?zJs6 zG@VWvVfm96M1LKB&8ew`3HA+_!(c6HUro%5-+Un-bE2L*MAT~73!XkEtFD$^>)n9^ z1wunzAj65uH8EG*kM0ecE__iYUz5;>yUTw8Odp;Iao8E3*2wo78?VMn)pA9RN86T|jIZ0Kg0aBEf;E ze6tw5Ab$>7;K1W8T#siN&SbBUsJTl37R?11tjhIz^@}MJeaq~@xL&H^G}U`9VS({^hPUwh1Cy0+BAGAc{&@gcmb7sE^6#oLC z#+c^OR8IdJ9}B^Lz=y&><~!v1wv4Z3W%MQZ2YasLgwV@QjltUqU~xwMqo-avYVD)n zaDUZ4^B>K)9#Cum=LxyGQVk0-ME_uwY-Xl*H!~6owVF&sD;x(xKsTnLc|W z41fZl*mWeg*{j=}&)pE!ZuSwSU43 zGqW@6Y6|&60wxCZKR7QrPUhKDOwbpG_d!6!GLJm+h^-kK$})GHA_HS#|4@cjfMc+G zjW2ENJ0J4jTrZkPSTKTZ$Z>y+gAoiY^6fhVEhw?I6ke2~YWU}7=M{IJ4~fS+D}A0% zx7U4L_r33kOKY^94kZSZf`gfVxqrHB1)~8Dk+#8~y-}R+(gK3Pr)5H~XZ1~%EFm${ zw!_#SEDX2>!6#K$8qyepL=gvkgU#{Wk_QDZ5DpDta7f;A^DVZK^gGQj&a0MIkL@T7 zFC}sL5KmlhzN4ssC!X(HHW3HnecTV);}3rD1DgjpogJ!3(ZGE$cBc1IOn-rR2nT#V zS?m{dZJ^dws*SicZ9r_H&G28Wo$s|p;z3ooY^f^`KlQS`fAh7M%CL?l7);WeAj9+((T2#ZbO znOI0{0*zVtHw~V+AI1mv4}Zb{;earGbR+}v8R3Y{``JA|vlN%#{H@;%T?xIg(mhhG z&Dq&##=a}Bg%V%I-4J^rP~|2Q3JiweV)Gt<{BiT7Uvb41hPNy~f_3K7XqkSTf8{iBURT z2mnRap0U+^&3F%nNtz)s3S`PhL0^rw4yMvrr#bmv7StU0JQh`?eTNm*@tc-dY&4t6 zvp}Qo6i9+JPN9T`anRQU&}Ri2qNqD&crsZJi#VqX^u>SpqFi^wby6r7%y|jyVw%m; za%i7gUNnNj`<_#?tbd7BI7vA3v95&Vnr(BYy)unKOU2F(m5M6`!Vz524H;D4R&wmS?gcyi`7pH`p4<=2m zg@I)BK7-r9PJw&iZ!R3O0DJ}afBxP-+jHLfwzrza9Cj8Q2ztun#x43EFp$?WeF=Wt z7g?7G#UQ@&zC5p`(P4_;EM1K2F=l9A?4SsaM0^uxuvlNy=Bw;m-mvPcwvz*r*u3?g z*TLhD<}0{%$A6X`@wm5a*%||Qwjhrxq^;%R#B8-M@#%W4^kU)$%1LX7y&6_nK=W3l zu5y9Q`kBtWDwv(8h;^75n?k>sZ?(;_u_YoVg3V_W6@HGnfSa)KJUD=7-TYw;44w@e z%h$g4HTmsN{I*BR(xz%wo6bGKVDQ6UY5#ibEKX(d)VYq)?p)|AzZ zjDw6P>wmQ%^Gw>lS8Z0!oIuAS2#BDWnWj9I5Nq^DSr@y%zxmPsD6Qr5hEE_?~wR54uDrN7I;%N z%d(PqUavz9!72uUiLcaFVuKk7DaHf(Z&Wfhl|7QRd?u?{vGZ;`iQ$mtL;j*sm`~V4 z%WM!Uu7TyZ64gcq-tme2__q%vW4M7=m%sh(ZyR96eE;mv{>&B#8%>|jx|+igfzYu# zh<_F77i4!J_HSV2P-cg6jEvf2;vh~l2%X%F>Nhnlie_IdonnZAbZhM!f_0TLDDrtP z?^N~}39qe_TW!5l$ye7$V%ihawF0s>E(Gm0DAO93J4?J;Y%wF!fNj4U+ZDow_U*XU zPAOk90_yeG8l13}4OL!d41n{1Fi$NTuCL#poH?!&6_<}hU(D{sJ10q+SP z!i*Wm_4e#9bk)5=;(SL;C#kG$*r1of~=6v4>ZzN37QHq8h{k7gzh^R|PwhDqq zq?cq8VGIw5hQ2MzN7@T`0%^_lAeVg(h&ha97E)Gi1Kb5_BuVZ^%eMJ)lh+ zHpLu+F)i3&5XkZ4$L-p5wt(zn z^*yA~_-iS?K)7tyVoh1}9$^0<2H2o@h-d`#)hlRxq}_;a1#n3gHM35FMMgY?FMgr9eEDTTnxb3sg9ZxVK>YRAak$HUr;Q&&uz6|A%>~E1l>Ix{yhT zD%Da{l1&U_5N%ngwsc_bL{^}Gz93$;8jIY6G z;4}o~I5^mRa$`KV*IH3gqRN0OAH#)|<%flYhN!+VJH5Csq6Y_Cix0XVe0@Q3A`mw) z6*xa?N21bM9Frw$nGuX;^j2qb5?@k>oYiw1MmO+%FMoOi#2$w=4nkIqw3<%4A>~|P zxk{Eu*;UF{o?maHZk`&ff}&;C*Ph|HeL9aX+6WWE&fUADtYbcL znvFOmi%*M23lLdI8`e*EA)`eSHU6I9wMO$?Em%wQ-*Vw#}3Of*b z6`m)0ZLED0`LNb@&A(mnH<61)7oYD5DDYH0=#3qWPquJ@ z$heh{QipxP0nZ+NG+SITT{i|{4e$nI!>ASTq`6vm@d+kz`qSdaItaSgQh$cJao!ZT zim#;u`ws99bHrn8g?5YzW*6o{Z#sY|hz5m~Ab${QvQiE0Rq&i!_rX+hojbvo=fiVx zk8-J~<AetY-h}&&ZkCiZrHXWlyfWF4v3q@SzkWPH$i1p0V5uRek!>SSbT*jcR5b z<6!cFx0G8Pw;r;T!W0nR)PMOY*)qAs4gj@Fs`3$|NUoE89)(}1nmc8%&+ufunDugB zVv8>AAr|OWDx1cHc$xWyc{{}pB zI#@?hx&)^b22L|%)~c~F5!V}Mn%rcf3S+iVTE&7j)z(l}&L0YnD}TmeiO}=`3<2&H z5_oh-GRnP5qn3S&6mRBA`8tIZO|J!L`8*by@&wDcW-0&>Jv0r_3ePxd`X+f_94Kgj z_zubmx<(z`lL5yw6{vk%|BI$!@V(9#~^^JS^Z?t=Or6 zeFE*6SOAkh3>$@b8-LWeJo@*V6~{&MI~D-%!+OiOo%`;)&rT%Nbjopak95}zfUsdO z1C(BK1W2Kz8#ZRg#E#f1?=86`YU|Aa+n1hRfY2kzup17gpoLLl}r=&f`L9UBm#a`hOI6JSf3na27X#-Bi5a z3mX6fnfI&s93kK1iPXu>p~c{=xI^8=~NExB&1y24?%N!oE_5Z_+{Y zI(=``Q=$5d6eHXZ5qe1JWu^q@jhgGj@C}TpnY3wVzyoY#!e{sc z!T>fDzl7F;d4DmZlVKs4JJuN5AWGGOco@{?vml6X=)&<=>??+>B#&O7-i=6r}Le_tpF%dEsvx^XrY z65+z~f@D%_0bkbe4YduUe0R?oeK(!K330LTK2&Y0m6_`FI zJQthg7Xpq;>!ms}Z0Wrap=KaVXJP}Mk3FWH$%|MElU1z|(Ezkmb1jj74}X(Y(}?Ef z?N~TW(3)6-5td`$h{TJnL2T+H0)1<1Dgg8s4u96o_U;c{3%3fb)?OhQG@X#}Vui{V z`eCR97KZ?H(38#+9|tv|X92*Vs>Eni;m3p|O$ZGKa{ArIi#a{vn& ziGP4U**^?-R%Im8V7+31?=aQ~#Dn!>4w=_r8QUGlN=4)G1mv?Gh)o7#mA$XZyN!HT z#X+&@Ij@gJ3Orh8)ZO4o_i-%*SgZq_L|emtLh_mXIz;Zd841SMTV^GVI2kRQlWH=| z2F2hQBg50raUo0tLG~b2fNX+Xc9HSH?SBlYVqZ;s#*Bv0?=>5{B0x0YP=iGbe1|;G z^PLixF>X;OC6}0rz389G1`V(t#y9t&U7hPnpJo7sL-23>*erWKg?cI4TJT&xBaS$>*sav=np0xG_`; z@HvVRkkE+7m?BML_d!;JZW@2mu{IE~xCU+qYBt`}&9XJ*5zZ)!oM@`A7%` z?1N!o&zUH|?{NLS`^s}JTMOE4*nftaRmr``BFp4pNqJT>MMVy@6B2`u(e*wV_=s>{ zVkC+;Xd2jf4?IaQT-?FrwsbN~S3W;;-mZrg7!FRHR*aD;$Ac;=IUd9n#$zR0lz0H3 z@jaecW@vcl>tM?ROJ!bJGJBP`rsHpn4I4x8#zRAb;3o5La(@>3#vvrwCx77#mcH?Y zx(A)8)P{X+BwtR(J9vF$C=beDFVYLevKwJBtdbT1UZ+8YZgPecDr+w33aONmaU zf0z$3U}-V}T)x1zDI$H#XS1gC5!D!d77 z!MtzJ5ou2Fo8?;{n0PriWq&{)W_)zt^VV@z9`PGaLZY#BP@HqT5FHREi3xm=!D2F)2H1b&~zq9De-xbk5WCuK{sZz_3k%QkL)VB8T<@5{@q>d7&so zUoq2XN3t3!#Sv3rd}hF)X25_lhytEy5D37q*MQ)!V!dG+(R^zrihm;Jiji;_dVx&? z3ulMr!G$MCw8d+;jA#&)2GIqhAPXYUlMN!rp+ImL50S4q?Fo`=!Odfh91uBvgB$r+ z>cP52gK;|RDtI|@<6SW<7Ug}0gPm|Z!TG)BJ_kI7aTU~ofOt-lVUJ|b{LLEwg-86JRrN@0~k#n(=OKF>EafRhYryklV4xHyR&B4&OsLeuzro z3oIVEEo~_bY$KO6@YxKb8YyxZnt{+)SdYPhP?QoxV;j@y#ew3)P1I6pgCfxkmZkBA zJcv?^3;2iHp!uqz6l>mtdoZ}^zUZc3Q{vjeLp<2l;X-ljet(~h=vnWDY=4k&D6^Sb z!VM;2(3nK)sP}S{L-{ZbZY1S3PmFhqP=sJSJbi3##*kK|`>fVh%{GMVm<%}B&wVgI z`{tW(UT4^(J%rtU*?!38mymTe5^2V;-dp)_&0rTgbM8#Yz0;YPQ~L65e%<0iRnCUu zGb?;;9S|Ts2Y<(fB^u(82My!FGp+7*6cgpu@z)A0^CE~LzkD_{*?>Q6I=dw`vrU6e|#p`RnBDD)dq+)zX?(T-XT!YR7# zZj9ZSk55A9qR>_}ShtuFd&qc*Eya2d>&)z$nSncU%mn=up+4A)PFwtqdy=aVUlEux z>jb!t`Dd*9fi?16#$!((Re7P>(9FBXVL}KC!YxNEPO00mb;9#mCWo25SYr^YzSsZ% a1Q-CkXpLok2=dAR6v1Y2#2ADm;nUo7NkQ$T0%r>=pMRDB%~XL zp=;p7_nh~f@5lFkdtZCi_1yP!KWjZ}U3*_UR7*qY?rqxJI5;?WRg~p*ZtAF;$NCoj zO-WX`pm9^txF{I8=sH-rxSKnJabztWEWiL2sJS&*2W)PMaOwsFad7ZiZ1s#>jMQIB zfE=K_=6`H>;ZVmLG!70>8t!Ngf`DBB7GP^zdr4+=T@y3F)>4w$P(+NQ) zq^<>!b8rR&M0iDbK>Py2fM?>o0wMy!VglR%L4E-tK7JuS0U;g%K?#0w2>}tnzc1z+ zZ_buh5<2pV|Mqp$lVrAWadDL3<8ya+=XDq2b#S)k6A%{{=i?XT6BOjRvEYFr>|M;^ zJoYe_zZvAgFp#sYql>MBJ>UoeGw5dFtXTfIa+HvB2AjJ$IO{n$ z*!?|=S~d;5ivEu)T{gVq& z#~aV`U}sx5u%)820~GLA%o4W$tVQ%6`TmWy{AVrC{t?S}BZlwK%KopF{(I;qef~86 zleagW|71Sc{wCd>Z}M6zCo}$LyWnWO)Klo$!VV7)`+FjUl@H{QbJSyC*z*6ciM~Bf^Iq+G?8n^pde5P;+0F;^3~?%=E22bOKVGa&q(Rp?0)x_)6-MT_|DYS z)F;!h3j3n9(s_r-LUT*=wc+KdzMsa%#;;-FbEy+SjhM#9#-E;j2P^y86Ib3Pv%0#v z86C@}7N&<=hv(<#wY9aO`Rzq^*<;9|_4RdqBmMB`h{eUl-9t2+pnSSXJg1yl?eD96 zv-B+6lnF$4h{lIlP~-!N{lwTiI&3d& zl~3=y)KbSBV+PW?O8Pd^Gcv};rq9r)Ev{AGKHd!lwP)D#z|bH^1G~!Vs^z8Sla-@i z9|k)5Pzi|%F}h*>qXXj!{jh}UjqKm%>TjFd`i`zn>gwy3H<$M@`@g1UQ}jQb?w%|z zu4w9OVfGGMI$Cn`b1%=&!xD1$4);2vnwD0U`Ul1XZ%m*(f^8|oVF?(XjG z?HwN*s zo}B#|9T)v8bl~XdXnbsJ=SIi&_Uh{D)a3N#`Q^gW!ok78(eX(-B6%x#wi=17s;tz~ z(n?NFLicW7-3Yq6DXuQBuR2kv(b3WKy|dAg(Vo8E!LI%izk-pO(VHNq=VqpV-9$EX zb3g`!MTCTew6(Rhx3^~v92JgkMMp=QS=n@Tb=lb3bar-nn7aZET~{}@Ha9m;j*lH( z9ZxP!$DXaH|t4hal3`K^V+sLIo8dM zjad>0t0Q+V54H(Qm2=V4_lhEko&{9>bn<*aN%HZ!Rt1l&xpH27?@@CyLw)>i+0vdq zJd%K(M;DH|+}vDT++1u*$jhXrjA2!#Q*aDkR+=1n+OpL#9=`#iSklef=1}fq`-UGA z&@|e5Si#IHily{&de!>e>&wVJ#&1G;D1w&_$$+CLy>ez1K5y$qfxvp16It78=huo2 z^Z{G`B#Q$q?p+P>!)^E$DBa%s=|bkQvMhxtrWiqYOp!d=K?F~I!CmZWkUCM zl2O3FQ-$}4qJ5vn3gcyBoL(A_FF+apcvmD9>*3*1tMU9kXA1LrPOUmE&Qn7@R1zv) z2(CwF=Ne$`M$f4dl)-6e*~@Ebm6sczz&;~IZ;-uRR!CdqLTFaedUr0_Q!L#$J6jbz zV$He=#}z7>`)1 zs%Y+W{mLOk|JdCkE;^?`yoX{{Ik#rS^U>ZM{Qw@k`B9(}txly`*H7)yK;Wrah@x)s zIM)XoN?J3SlwOXUw_ne@c{%xE7L9ecU<73M-WdR5cyWmd;J5S~>zI`D!A`;{(a`aQ zh5cnCZ{K>E&b6(Wv*xxJjA#Bb(dz^8_X$H!RXfOkeh3ey-E6dq%Y9ctlzFH5U~nO2 zF+q-4B&=2F!uTTtWC5~F7*(&1jASNjqU;Sr3{e`$ejwh8u*qe2K*vzAZMjH@FMon~ zk?mJ{WwiS60bOja1^nyh4f%znE>e0V$=RrP@~z-xuG%J7xYD$$T~}RQlU0hr&2lwWf~&V=d3#_>%e(l% zIbVFpT%dK^r;*ehM1P3^_#oub9JG#&mX5qQdif(E>qJHE+S%_R?XPlTJeGs;UCe=a z?MyYIb(c+CFIQ4^YPtwCAQTn?=_g)IlHV_a`4~@+IVHvDXudVKjqR`))xM59E(?A6 zm?UCbeLeCWnHDi`t5D|WI}I#ymDO~MR5NS&q6I#lb5n0#@AfP1;vw|?hE$PjHCM^# zYRJKa&&m4h-#)lKIwvXiU$;6ytqUe_n8W4D@&>p*DFX1~@K__V0$4((R+ z^4wzGom;!~x2wYOMy2X#tCGB9>hn}p#w6f5gU_epx60{WmR|dba_Eemc=j|_5m>Xu< zEIF8yQ8Xr(yxW&#=kMEZ5q8(R#=-Z7_5`H=ea z2u<@J$C-mI4>Mk5ywFPW!ZZiN5UfVb;}wF8?LdR-P_)iR_Qo&Vc*&0}a5O9G&y9M$ zrLMKYd5^WiaVc$w4-mEWLC(5FKO+J!`~kX8Bd9GkYjgSA?u$u{1udoRTs^D?_8Efj zVrVC#NejRG!5{oriiY{6p#s|9MS>SmJ099vP%$TF@8a2H@Mcc)&SM~?{~8(<=} z3JZDci6S18xAr3Q6@H$`(c9}cz2io|6>Pm(K`|5OJpR-=i(8TtAj#Cn_dXG))87;G zV>c{MlH@@@yBZ-f2O_HZHd;df-1UBw@|nm$c~qw_*ZTGp@_`eLQ|Hp+fYs+NxZ^vM ze0VKU>Y)~^2JPqM*BmG%qK+ky1rRA-h^N^Fg#@=13?yfciK8S9BU>o)NY?f~V^l?u z^+0_qyDgd7@$E!LG1twp4Ax4`@2=Vhnm#_8alLiBd&{@)iDHH{?o3F38R!#~#pcvf zky8?Sg$Ao&Q@>Ee6PmP*+U?w zPI^+C4SLhqMI-av_tsYfg3pB2bH!6h#$PB2s};|c*rxn*q3n|02YC{jLzHf1#U}=F zEIKBsYtMp%!@HWJOHF&SO2XaPZsiDlDWDw)wKR+-+)q^CWR)ceTvco?FS7bvbDV0x zNkJ{B0QSum*u_-z?eWwbz4NbI)g_n9>%0?$yw6oC2{=VjAei@apCibxD`B%&19R zh@x8VlJl;A+|yxq?Z3_Kmf!T-v|Y|$^hg9m$NA-`0<>#GF(c#=0C+;G;0Sa+Imh)G z=U(rAt?jjnFXv_j-hg@(ja#KXq`TM9rm|TwPX!P?ed;8`80m?H1AMS;-(+4`lrdGL zrv=myB;mFKl9FFg2Mv$jk=vq>gks}H2jA@jFIIyoq4=w+yh9aPKZzwb9ko10f&_Ul zw2PSsuLY=~#ud+1ep36%a0?GDaFAeLYfV43ys$bb2za_Xx$+Wo`DsEo+?@j&;xBV3 zN=IEgEnDnEm3vpP{IIQ$e%q6x2oy#t2JuXEyO6MiswqMmyhf6{D=tghA24e|m_? z>We$of1U1=(&Q^?DmKnbpP`_LV(qRQA`iMf;+LraSr!x#NnDG(D^qppj5V+Fwnrjh zHY`u7x5cDH+ok&Ye!v(p;pU*{9Trq*-URboV?^u+M|aDHaw;*AZ`SG4dHD7}0BbNu z(k1kc)ww3$qO&hh6i#L+T}FR7*>Ab*I3l6#GXmfzW-UHaW9sFyPu^>}9v zk7F-STlc;C!L5SHHa(Dc76i#}MET+AxQMn0ZW;^jBlhtI^H*0bEfl&~>nd5F6QG_2 zXB}gXGLIp1IXq=z`*ZK z%J+EmHhaFv)$ic z_uu`!7aT@1cQkVd=M68u8kn#efwA)X8=2nwqo2#+1d!dPYwu|Obie#OiqEPUl!qZB z0dLYyW%z=Wwp$E>gKKr-?;L`<2DdZ1VW75fVmR>k(QjGT&l(T#GVJfWM;(bnh}?;y zlJOp(f(+x8K0);a%J&l;=8A~Z`wjwEq8$B#NFAtR{hoMn=f2!=;8wfG#?v#3&;&O3 z7GM0tjO6Tw$;iG+6BABrN}oBMJvVg!e)jY|WfP5C<$LFQdtL_Y2IKCYiJcm=b#BsuNIpx$Ijm00`$D+PgDUtmJ&rkmh9B zN52iwL4`%nwq8DAKSGzGke=2<|jUy&-LWbLm10xCsQ=yBH)^M~Zdp(kR_ukld@_9pD z$KRL|={KAo+c&mfS$SEVN6OCpC)`e<}X;J;KW+~|>2>CfB>K*7k8RI^uovq45K)a+9 z|8*a^_r3NjnW@KvQk1^ac}ZObIcaLjCj~mL);?o8o3H?Dg8{-<9)s0cIVzH0;zg!Ez@|M@#F; z7y}bS?&eMWWO3M#KY-kJj{qACL!fC1eErul2e=NMruOPxT-Ed61CkH=ZSDNxQM$l4L$RMsSadpvcS z(6Kra^K|ST%YuZFQm2ydr!uDD&+U16c^;iPp&Fh9AgA?S6 zBYsa&Nil_4mwHmq9cyErvTopFk;gN9c2c9~$sp-s?d%>8Od|mZp;C-TX&rW|$gxC{ z-Z2`eCJoyOR)Zd1#Enh8u2sQj_Ve}mf`_Hsn@Jyua$zJlF8U&RU29bJ_F7K1| zQm{67wVYSflLqDr&xyonNr!o5K2CLA5OAG2wz_cFzmR&3xO`=irhj`<(+vGp`@__F zAfGe+agc;w7qGcaMz&?}<}(kAM5%?XLrLGdq$~}4Sk&7U8y!{!vi08C=J>oKV7)PG z0zS(079$aI3?-Iib2uk-izZpC?4lZJSs?{ z*L8lCO9AfL_YLi%RQ$9Z% z-%GWVVcK_BUpotwn4r2zfwy;f`stu}D*OD*2bTzkj`i{Lb&8;kKfje!6g1?&y)g6p E9~*&r)c^nh literal 20262 zcmXt8V{jzg7M$3&jol<0+qSKZZQHhOY;4=+CfV4w?Kj_#SE)&=CaIY_C+GI*)7=pY za^eWExUc{K06|hhL<#sa4*0Nvh6H|3zh=S(0APhJgoPC(g@uXj9qmjltW5v__q7~l zH;trcOup@B6C^dEm7DrB>i_^LSrzmcvSuN2BETRR8C767Bpg-^9Rnp>LUkx`5mq86 zd@rB6%}g*dTq{adhvSN9qqNz_^ZN4gefhoXIQ#fx#$y)A9|e^%;i%9Oz^N3%!?i*b zCoeHH-t7;HA+ZBajC?dXUpm_CBWD(l`(X{7&f3zxzQLFkPHA=dw2_x0xA#y7Y~wr5P+5Pqzx>v|yr ztRKjxFbAaBX<1}w631XNGw=Wa?(1Ct7YBd*@zKHVk?FDZ^}}%Cm(`6ODIdx0_E%Rl zC^!IFZuWXj@9=O5%zhN4&ZXC?TpO^a1~A`#)n#6X$=8DY>-iex!SNwLm|LJQ#zTM) z3kP>eVOY@3upha9!tFrEk@+6MnszesqCmnyHbJ($#}{h>Zu>oEm7(xOp+S{pej_pPp$>3 zdD6Pi_X-3w3Q=R;6(HbyPZx~~mjFOEV`1`m1^|+JU*iO5KmgNe#rpt2*9o>xSu&Q) z2s8j7k{|H1P7n&dAHAv%F}t6js}Bp*08&H%p1h9-SqSpLA0M^=J5>-zrH^X`ytxhx zHy(iQD3M7_?l-GC@~@?2gV6oij#9;4OZAjF>6%BeF}JF*%??5$qqRi$HrB z5pLv2zSEpD3zDvXYN6E}ZWAG|e@kKMob-u{Gr%V@*2sU35z#by)j%gYOjJKY1DA3X z)96rxRV|Lyh(Lqg6$7s?*WenO95l)w?E?CDF!F$PV0^r|hKz=A8N~%z6KV&vI!sV7 z;{X+DQki@cg(vFkkh>vQeY}QP73CEPAxSR9Zz@DIy(9^8#PP%fIam^kcqU0WNh^tU z3A$qCV!nA~i)JsFrna;4&AR4G;y z{zLFTc}zkX`4x)O<+=Z$E5f<*v?OivT@~n+!^+WETrw%9voM7xi|L9M|7Kd4Sv;H5 zpE`HIYz7gEru|Kuw>p73Jw6S3aDzt(MF<*|Fr>z@!tuf>#csu+&yXpBSV+qlQ(;(U z!pksAM@qL-)%f}J(;FjU0yTvzMJ>fQ<+wsc)k&3q(W3%RrBW5C^0%5#iI{4m!hSi- zKg`O-ast)Pa<-ZoB{!uwg;_oEQ?!5hjyc4WT7R zHL!D9t8`gI?S|J28CQsRJXd-z8D(Lo3ezgn1k;=&hiMSRk@}q*&ed$G8Il=<88138 zI)1wPCCh5lYTs)1HP5x4HN#8COU%pjwQCpq9Dy9#oJTGju4fmR4z>=(j*yOZm)SGE z1*3D1Q<%qzN5s?3Iq^rEhoVQUv+JenIU;rj7HGD39BW1nqnoLCqZ6xii?+F&;N3Em zN%M|`A@ia+$s(#Y%BwK5eO7lYKGP~Ye8Vc1Et3r^9s@%QruE{X;^BjyAJfTJnWi0c zO$*LbQ)9FnRV!8F7qOg+*;cs*J*!>oA2A_+M6-vbqS&HFQ`b_xCm~X0Q=hBS)%esr z)E?EAt0b3n&S}qWmej2k@YJ*5v$(P*Tgs}ls)t;&Y_`$&(Bpp0|9DikU1PlXxPZOL zynwvqd@^{Vc(Qq#C78lTC0OEi=Js}UcA0Xuw(mMG-enmqA1WU_RX4*kD{#uWXT>U! zj-NzLb4|liwkeG)waxRKOgY58>X>g{cr425%-X14wfVO>#XIa%`7Zk_3vXO^koQ{f z;pSOm&tYmmr!=c{;6DDC{5U+B@BoUiw^oye4lmr(k>| ze4u%rd0{;zJ*3;bJ!HO1z8StyAGz<`Z8j!=xSDFX{}^!bdlBO-&WBU;2!oOdYgvoj7AP~8F4VQGQ=CP?*w{moynYi zkg1aDY*cf&QP_@kbUHJc>&BzWsu}Oi5t5FY*1&%lL@cC0k1c;#YAZ{Cb{Cu#A}`ug z7*nWN-`Xa{lX#S)mh!~0$?YTjW*#ap<}$(zBdBHt~Ew_Ud%Mj$s`lGgs84RHJ~1DMMdI z*OqCE z+G>73u~PJ^?5oOZUh2f!j`q~$^cKAzJ#5z2wxn7oF3%;-i_dMVo;7=GrMfKz7ypLd zAXMYs#vJ15*+^|U7kFAe#!fd)PfUZc8n9k!PqkF7-xaVGJ$dH%=}xMBR#&$6tWvHm z^=`U(-6IAOU~q3;Ctq|m)3~c!b&L8u+Rk4EZpPsn;&t>M`EIs}yU7pd#(Dkmf_f6Y zKDTtXv)-uf?QMXuQDTcBl;E;I%<{Ke%eu^TYqr<=i8vs5*iW@x;_bDsa8fWcxG^}r zo#EH|2z@T$K{LrzEmWRuTZ(0zRpU6e!cn?Ss$_1pKFao@;glr>I0H$R7(_xAN5 zFloQkxHLCMj-U5m#)ikU%twZmuA*+Ynec2bKbG^AOsn4W`2E&#obFAR{R8Q<;W|aD zbTw}cueh)M=dMJpw%xhO^W>#EPmS|~>^b+`^@87yZn*R$IzV z{5Fb?#~0V9ODs3oE13;l&p7wmkDj&9GpIMDGry*&o(4u2Hg4qOKVa-rJIo>X~()>$dBT?a^+c4C)VoFNOQLH>1(gzw*y~ z$KGEb^v}Wf@BW+=C_q*TX(%l&0{H&#E5Exm3HS_*y@aL{004*f-vb1YnT-v663SUp zRupO-76B6lvgT-e82}&#NQwxmxUXI4y1A>UzWMfQm&_K2ktZvF!N{J<*13s-sGHFF z*L3tYS8ck`S#37!*Al~?8LEQ^m|%#42zp)@3xL8{B#l3`Kl}Fbn_k&7XP_&%ZR#F- z97&oU^*rZ#&9onTZ@;q|nu@*uhWEF(uGM4w9>yklB01$|tKGYo{{EmjQilg%-khH= zFFW*vXEZPQvePP$^uGMjPtOQH!CGzkW{cihe$y+judnxMjE45@C0bluL)*8(P(*+E{CaT<{evL_4yn(UkuO3TZ;X>jzI#hWBwleg@bckQ z(13f*Z`wz)USHu!*TdI_-@55c!^F&7P+|G8@ohzK8alY^Pt3AeRxCjd8ua&HAz*ka z-UP?C6)%uD-)JLB&st z%uosP0ky0c(p?4~1O$zCZ_Zzt94NDV&-j?rdcjbkTM)I|F?A)+Ai|Ux&u?xEXy+yS zYgRR)zP@}PzWh~cG(3dzd*E;5SI245b1ZbHpd=J{Zl-c?;OESkzGA{uR?g8Bm*E#fJPS$Aea2Bf)QCrjE@Lb&lWOhP*(y%-1WRFPCa%SA|3TB zRPQ!OU~W1R2XQ>M7LjhSp#h`qE7EGmnaiQL0v53p?T3X0$9=X_A3&%;p|SJ@s}f<@ z6|Q$Xj!ZmO0DYK}JEUjgeBE*H*(N3`*;)++1^BKqlxXQ0hTDo9_@UI1#*M3)7eSIO zbW-W{|6*;<(-{Ey)Ubzcmyy+3?8=f3jE;_uWnEqPCKMFdOx_$y3-fiBua5W?Wqp-) z(*mPSJRkM5kKmvzvQc`Yw3&)$-2Tr`-hqwsoM1tr@W9vSaJbRGSnbAJZ?&bUT!f9u zAWe|yl3)A5-}LV5`%A_eA0^3de-t`U0HC0(EbQUoaXU^4Ez|%bQePjb7j|}b#xe+Q z@ad-5Pw)?&Py8_+6%X{^Q)0)J_0I`Vl=SQ_}%eftkh-oeO- z3|M~=QWOz%h^seGwybIN2oVicRVHioYM4KC<%8dj@F)q(=ONqI?6&eEBKQ#^(17Q& zML5c&2y)3la>=*rIl3I2^73-pNJF#~-Fc|5lR`9zlXn9xEnK=!&mXQAYXPC5kj`UQ z0zOf1LW?R4PTo(HS$`rbrS@D_AY9m#}QUmS0xn7g5T z%Ea;hD?<@^gXHNa%>;GJrQ^EbJ3h+c{L{s7tljoxc}SN4mevh1EO0N*Pb!#EZi42df*Mw^X}7 z(8mcOgR3m63970(U;M3)V902rBS31k=V3~kk(|oq#j~6806TW$hf8zG^Uuc&Ec|h6 zq$(RSc`#71*8I}rh+x`v!<8*Zg^Py=geBnVE?l`gT+WxOWa-91=`3QZ$C18mqgSoP z^7wp!CySYwkZRNU6<)X!y&(DXzNxr^J4cT8cNeyv-#zOUt~axs#5EGAL0&8PthGB% z?W`xk^M(h~1kGd?ymMisA1&x@Tt5S|h+^>IZl6&ce`tu_uYv1#`QfsQ-J8k)%27D- zJ`+bn;b~Kz#wQb*93BXt_otBc%g_=F=&->#s6wMrHPw|=N(V31O+8St>)xs=+O|zw zVBsVZ(Xq5qhk_}O;}aDZxU#y;$4R-$_a*p9y7^f}c=S!38;|cbb>)Uzv()x)b_Y+= z7f_@`0!l32LZTg|nVRWW!8vS!9aCaar$Kw;+3o$UN7z^5f_Hmd&}t;0g@TJ=*M$a6 zj9gDU)|BrJv$c5(LMh*oZP#@x_HTK4^!eGI10INRN#n^9$E}q%-;(Jo>5PEl($b>B zLQu6zR)+!d?pXboIqGU_?&g0l7aAz`U6$E*L(YW zuWk1u+z#(Htwk*@YFJaii&a)3#i$vpwawQqx&GipZWx{SXcYa;eBX;vR7>7Kn^Z`R zzEG@6okTx3&6}Az=qm3A7Sy$fiGZR@Q$lZFsaphn$^f=cY6OB?%z{kfYsaj1PGjZH5 z6Z0}GWjihZ#UBqqg0FTv?KTYk5?FsP634hU5R0g>P)(okw5)#J((+)uF46GR5^8aZ z>zTFY)Rj+^{(=b(Vn6|!M2r_53NIP2u*)0$5Y6H|b_!5cP1-{{OnB;w!$?X^4Mo6X z+lhU@9=fUOZ`%*XGr*LArUnU8Og2cNErV;n?aS=#x4JV}nzYL=tAj>BKyY}=1%!i& z60r^fa7`ctiKjl_EwjD8)mOYZ!ehk!UBbxReJo&pQ<8_SgsY*fh}~+Aqmx zIT3z!o_wBB=%NtcD=2)$nCbQ_(a<#mKOO>yD>t0je@E4uL7UFHUW0>eKW0YQJc#KS z*aI+VNii#y&4$Y}x^3?PUiOY#*gER=tmta_j#a$iOBzAKP4{fizk2K*i#E#hnN54x z&~P$vpus`o$zgzeD2vTzVB%W+_D=QOV{jyfnx6hR9slnT=&qZW!$P)A+e2uhLQUrF zR-nnp<}rU7k?c!@;QN;j#8jmt`FbZTw%Dn*;F5v9<6@e1Qk3F2*CZi zr~6~PH1BqXU>yJu4GFRTQ(OofK3Qyb{U5W(B-pUG7o1KnI{{44fqk7%7l$~ty))t! zh(-Mi;nUh|l-jz9Pc98%O{W_XTOC`o<0Di(Hk!1U8r5o%-9VN!zH9$C@sD&Fbv2R_ zITnk#EIA_xxKOg_JR{7p`RV2X*Jx0^25oX~uH5fhtY^MEvj^GJ7z-cYsF83i+|e{2 zRN{DP*S$*N?fE1ty?o{wo}gUs4;W;{jhLZJ*P@07)CyEVY|4t~O5;YYxs?-=)^%AJ zeC(fRLgr%=qD2P-1F!eDYhcTB*{9EnlFgC7K0D^!FcQk5^Z7Htv%RifUrq+w0seRM zK5ZX&+w%cnhY#bWM4*6A(|HkC2r%dC&u0>JScBa?QD{go_rqo!cek0Wm(et7hs!1l z@_32o4JWEIJf4SnxLL)x-0qW9?eB1VYCz>;sx^k>Pnwp3f@W#T7%S}pg>cje;;7-k zjyEn2V?5(T>LGC(QCzFyI@~;;iV8}K0@Qz9dC?cB;2^*{xNSH=;e*h8eg#`7u>M(f zsZNBr#`F`pf2JL%X5S2rz>@zmL2%IkC#sdU?9cYgjF3#6G z>l(xXq?v`x`?Rp6;HWoyE$nqAp1fagX}x;~%5tH==^|GPMhrT3sf;q8J}8AP0`4Xd zFiI3UTPhHZ08Nk*_(K(5A)p%ZS5!pQ3k?2F?m>b!KTH@$s0pb#^ zc{rRLt$;w#eE8s(RJQMg1v)(B4-k16Asjr2=3t|>m^r))$BvU-aiWsTtd=No=<}jyrcA^ehgs{v?Wk-8zZ7OmK#vsYC&_B!D9E zUWui<^No%i->N1gqej@kR^N#Or}JKf>DgaFG1o`fvt`z9n33~GQq+grI+UV1t7TVs zB2LI=R#tSxupein{lIg<03d<{ffTJ@9~r*RHp~#PYab4X=f@WC)Z$7>PM#Of^OiYZ zt`Zft;YFvIx1J}r6@*Em*jgU#u)$$eQCD9U8Ew?6*68)+CG`4W+|YXQnrJ+(gN#Yf zkPVDz@p8SD<~H41c;*W!v6wcuCfmirQ~Y$w3f9}x+h+uFJ9p2wg%|5Dvo^mW-4lb^ zQh!|IfZ!M9-S~@-qugF2%|j`k@7CkLwSN5WJh>d&mgaCkQn}URgZCo=I!lJ~f)ih$ zLRO$ec_1Ov)A@W2V=xR!nw-Jo_^F!ZdH>b=Yy}ET9yhWgC}pK{4=?&;nE>lI3rHe4 z=oC1qYv(4AtphP$QC1eg%+z#X|F+MX4cMw=6s#Bsw(Rrs^EagLvHB+R~`k8f&C1 zaW)X(a#I=^X)kZNT8`BC7*3I zQ|D^+{Qmu0QhMzNJBcSP7(okNm_mlG)0moG0|kWmyzh@h%V>2TK_&aWasoMIO|J7V z&*vY(VzhbHy9P zM1QcXx6?j5-)G2eiAZq1?;`OH;~_+n3B*yG3ltm1^NB`ohNR>+-n2IqI~#C6a4Pg*1T|5FSEvIfyix1$RkyF4DJ@f_?8gWq9>YK5HUFe{fP$!#oYjuCgI; zbbS4QqqlVBhY=eUX+>j8x6_a3jz-dFjy7mE54Gr54MFQdUfWzA<>E^$U`K%lCx!;C z)#`)=Yj_tjp}Vqyiq$GS4}3iNSC0lRxMS=XxfKj44@OHVouoR_R?Id?ZqSw^N9Fsn z3*~#1V&>p+9f6&}8jOcQ501JAo~qkmAbTk`waSIny6sFO$9>82Z*j5SfZOJltD<7S zw6Q=wj}OoXTuzap^IKX{lNehhX_vj>+5UWUMd!=U=`%<`ArS(X<0hwBxwAY~5nPr+ z>Qb--k$=Hw#96X+TGbs?zc*Y9dqLs_K+#nNb2@(|5X7waMyDH}6$9~ftJ}-rTljgw z!o$eI`->BrTCiwG9CI#uGuOx6Wj(9S@h+w9AyInw);${3Flw1mPDxY|IYNXQH3A6# zBVJ@hAdDFw@yXH=KBX2LLkGyrnhH||va4>=I4 zP`MZh=>}%|zHoVx_d9s9Q{G?xmc8I)x)7$hz>}x(79-nxopNHWV6$4^xfuaqkW~>O5NLJuPsXA-yh{X^p20kM0y96Bc7k^r)ctKaL%o0MRd~W z!!K@h?M)xp-*-<{JPPO#I5;>8su-rL!D|Y1BB=Xfikk6t+sc7WQ!EF^$5i`nnb5Nq zH7v$|Oa#$~j4b1+Bh9U?hrT!Opbiu;ZLhot(A5ftb0tUvX~%BFyxqMAnW;~-{rNXP zsfN^|^XO>B_^;1vdl4IlqibGuQD8#^L^vG&5_df=X@`$%I=rtWEtKw;_wr(90YGiL zFEPue+#hbkP$ER~Ei97)J`FY@yB_A5WvzA3*=;QEkafHU5j36$BimBFE+5%`H!_W=%ooEwyOP4vGcH}Zr4vQeDpRO*7!u6vGAEl0xLP7H8zk8-o>L8012C|; z@5q_TcEx%%mu%$WDPx*}%s#azm2rxEl1am8!*`Y-K9F>i?dF?$0G2uSEQJ&X-al{c z4mFA`;;Qqw=Vi%gCs?aX4lYxylL4sMnVXyUohTNKU%DoZ?i;kOPs?@Ygd!33Po@Fc z>M4&D!OCSiqZM0=wH6crJvR6UD(wB=eqqg2le-sC9+NW_-^0T+_rnQ{?9^1TPS>kp zBD-!3>92a^U5VhDjx)=S{T6Kv)d6^aU$@O`kE?eg2EdoWpsAeGs`<^|-8#)`fWNj~ zZxCVI^=~eX-~H05w5E#a7Dri)>G=+-E_AcsAIeL*Ve9KqbkKjv0s68FV}|uZ1cme& zED^Bs)P>xs`~ue(@9}z@x0F}fuh5}!gt0VKdi?aDV#V3-*WO&g(+3ltq^BM)`5u#``T^ubaQZNc$$K}5#0Aq=MW6T+c+-c(QlL5tNrseq+LA%~D(1J9LhXN)mO-lo_azty;4+XwcTJR@JRq7k^{6+JF@Q{0R%^ zRj?f~cr!A!OwCM|gzdku+jr$d;e6IMcd}TDjKpuxPmCNW$S>Pv4639fhmQFaM2&1> zY%;e)66E5969HNvKL@DNYKA?;fST)+C&`eZ{I|4RP%syDI@>KEjp-}+n!`oLOoo?7 zuOU#H=gXB^trHV8>}5ZJb4-elNTf{EG;vQ3s~lMAmqDTgUz51IPG`NEOD@! znWKY8ZKVw6!bj}le3zxwX^OwXxf6G8a1jxJ!Cv%Chd|?_eTBEOWZS#Aukl|^hzw%& z^@l)(uuSvxptX?>ont|8adBbDnzja#fJjn9##?F{nkXpIvpeAa0TdklJ_fIE*DFgL zgdahW{q4yEyEgD?-)$+by5KZEW^0LIKvh&lb#>`Z6%j;+3iJVdwOARe4xbSFBeBDJ z-%soh*Xq!M=s>&yb~`Z{E5t(H3(X`Z9$(h;57>8vfdfgbz3SHOks^7XAcIfOp#!Pi z^tb#Fn12m;6@}C)s;Z)yCH+9YgAGp!tHrN{VQeZTFJJl!ceH?KH#_hMR$55i%nmA* zAK`hOOz_}x2usU%gAs%8L}GH}S{P|b-~JitQ00rsx>&Xa?k#_+DAbxO{ymT|t>-rr|m)Yj0&%>7vlO`>B zmW(}@u0zbi`MtqZdcFHje;D~OCt)?w>n^ASZ!@NIVm;UbdtY0`S zPESG}Zhb)dSkR%Ao zXgSxXPC};ldyo$Qu}Dn={g3Ih)4u~`J#YzSRZRFTQ1eVT;*3)LBroQBUi#Gn-{1` zNV^(VdO>wJy&~v1_LCDbo3gNa`XEDqY~{md!PI3W+Rk0tYNM`eRa%%bF)`V1x-1)f ze|>Uzzc3sg9vbWoMF6qfHCe_Oa=3-W=%l8Qx+95`Tyn3nROSzn+P6R28`dsxeTzx* zDWn!uOm6#BP*qJNhY_2mf9nJYqVF%y^~Q~xfg_`f8b~HeJeMzdl(Mz_as6YGfEr`o zVes$xo`jtptAY01(mo4Zt3gmIwMLZxC?%s-U*SpMgVK-3a?k}C{_6#EF3=|zRc8AI zb_AX%#;Qa&NH`3sprr(I6%nNZRZPO@;U{%C)o=5!V5KY@Zp=gmLK91-g1S27kdP3` zxH&IA#v^UJQobJ@&S$~DlDJq=cpt3D-`J^IfTM@?w|J__paZ;Q;$Ej@AxbAikwqsc z(q0mkgZ=sWIq*sYji)Sz@yiHb^GZe$a3Hx!`|W|_<#si^J;D<%HVlVi$YT^j9$p4d z*w3u}Td>#HhtcEC*m}JO0Wl0L2ofn^*gCMV0uYNRA)Ub$>(o`RSpd6 zO_;QBTVErFS&x~^8Tr;`uzAeVzj2~aL{|i21b~{1ENIPrA{ud#j!T2;t(&b4@1%c} za40<+g{5TB{*ESq5>RR0U)6nGC{{U`OjFv2EkhkiT3#WAfq~Ivx6KD0BuEZ>jo1wq$N(M0i0jwTZU z&6b6L#CK0Tg@Q);oDSWKYrgjzxE{U~?&WE?+CzM~f702v>o`2EV9S?K(XMs6(F2#R z_?(>0n(E?i?O5NhvolLFkXOCW`6RdIlpSKlBLm*T{QCL?;R0kAAfJo~Ld`7U-wh6j z7Q07Yr>y^*SyDfFI1u;>camk-)2}DCF^D-QL&AzrBok$Rxo5FlLY7=&Vcfc&kdpF8J~wa3<18&2 zMHJ=n@li!rchlF5VLxA8Rkh!+zVFa+n6=7Ca(!-|kunM9&!0c;PtC_SS%p!GJ7*w8 z%4tB#ug2(f%zd)d%ng)LLxIkR4<(Doo69sQJw4K|G&syC3c}`0a=%$diZScchz~sv z0xKdIV3&ym1OJvfGB5xPYGlwv_m{fPqBJHk{ixD1;iKlRX=WVXil5gT%tM3A=qtf& zw4J&b=W+LEUcTau!CH!Pd~R;+)n+FdH#1ryd4YHw;fbTPpmQ^JZB6R|Xzsva(fW@Y2NFYT zG`KTD`!AdZFPuhGexeM!vy{?KroYc{11-!D+DRZuu;;+PJqTCJLIBDH>8w_mPZwK3 zR`0(f!b=49i~1iBS7V!5@#?D#DQfaO31B^+Lx-(LMv1)tQ_i-0-t-qEG14E`tTY-u zSv{YxVt~GlJJWyWp*@#@8%O@JlrvXO-TEc)-G)1zj)3Lww`LPwU|AtR1Om4PZK^w} zy-}bgU8?5d@ng$s!GC^LdAiZ>lsw-j3t&ILeEKplPfSi4)NAOoWz{=;dUELg`f$26 zq9=|jb7}0pC@EM#}8PCfwjfT+qp2J zz5QAKk!vU!;aFC@pF}SHs1gFQb%@NZy+KLhaiX?ih}5gSMD)DhJa?V0qH3;eKu>yN zV&bOs{dzQWaUd<)@c&tWN<}?&sJQhQpxIbdQ-cUJ&fgCw>u>I7>&>2Rjg5`O@z{vT$iT9eYDY_ne1geTRqMF%HQo->G&ubDfc9ec*u6W? zN{@|p7Pxt#?lkpEYl|x79o^;bZ>Ww$U zAFtGB>uGE@YvAfquivrHve1tfA`&9<~pMFw=5eA*R!@11C(|A$t>n1WhxcN<;!Ai3e zRSZ5WY=HuFWZ_Py$)x?wj$m;~$=(C=Y_uG%VzFHsUC`uV;U7KUh+8Z@8K-R@^;z!d zT{7{)qcIeGYMMb&G^)MJ)y9O>OsUGAZ^A+G==}EUo+x{25g^=RGg_hp)e@k!3+{lX*SS4D zB_(7UkKJ&fSTZ>+O*|$h=D#AD7#k~;%H^2vhavzkFOcUBmN6RHAFY}RM~Kv!?+R(q zVm4@1H+d{jCKK^Uu(GnsW^cm?oCbJqJiI7fRDijvRjzpV3BPaT-}bhH8qMa3(RX(z zL>tdP9On)~9On?EeY#%I^-C6sD;1UU@mVrzlYZ9u^2VwV*h-2qzWo3igSTY|YD(oN zqpVRgylS(7n61@{tHP(rzl?4+XlD2IS3%C^$j-9RE`A6A6bR z2#bnBRBN>-x?ZgWB>z+SIPG~qNx{++k&=SNM}%^8bYgTqVbJRJAbYyl46^9_XURW?EU|%_ME~k>c2MVaM^bor%k@Txx}Fb)x{eEl&*vjQ zkOL8V9-tum=XgEM9q0K4(qn$3?T^NdM$Pg|JMq8xyI!wB3IfqEkluVS)W!W|Zj`}d zPozrolQ&VOaNiLUt(J)Wk{)c~Z8z+$S)4APEzup+gDf36uQV2l zAS!uqGj#683up(H^WcKKym-)P5FxKuArOs$Ug@iDr;>>Yg~q~Pps2KR>6)yrqJMBQ zht1MZWYY$sztd_sEDr1+sPV%k(SG%@OQ+4hO|RE^3?kKW&)@EDaHexwArg8Vkm#@& zpxXAFnnvUBLHm85FlTc;kz22~K*;ldvhY6N(Tq(@_3>l+1USv`5-sF;z|JJYUu^c^ z*iC!joi9}j=kbM%w@faz&<(XzQ(_A)s!)<{cU*QhP^F5-M=x{@XA*mKtHNmT< zsPedEtp}5 zM6t{A`m(|XiYWMUR0BXWfDRLwW75sq1Ckv+gTKViW8(qD(D;a9`&G`syoM(Rx;^lY z0VUt~^?I^Uc!G(3{rJK9Y+l#SoX0!q(1<}rs}AViLK3$f3!ay3n%6(?zEEazZs<9D z8Ix9c2CdrBN-Q*ykp*O8eOS^Q^2YZ#vKYph`C>Z1 z{vq|(1=7^CfwHQqdhhx7&}v;!bK3)O%75j0pHkSH81L^z(Fc}@=|2$4mOU(Ini()h zgZn>x45>eNM2{TB4tz8Ww;hdGkxViv>6ZU%6qk2CUqYZ%6ch7=e7xG^ep@vTq@66b zzy$)@7vJ->`&;|z%V)%bxyTywzxPc~4F*PRpj?a*re-9$y6il-xGan=0v-s$E0Phc zfsutBCoJ}jPD(177`v3p&=z_&bIK*A-k4N3dGr1$p4X(0OrraO1`bSUi7J*sK>dU+ z46kXo7;}PVd3|;pQ0^f}+j2*0V45lpoj0(w&J<)pM=X*a#V@1Xc|FeiL!U-F@}B1n zq?#QDGo5w|n#ZxD4R$@lZM#%E`Z0KaC@7pKR>S68usoNx^6O2-OHS!xlyIhk`*+{{^3DCxOZkP-iwKB?Sij{{2&tNE~u(s>2<= z106Lw(~g3YXOSmQ#W(-avc6-xR#lU>CGHBFU#b%`P?&3-Ame^}-)@}h9}lY*h#HX_ z1n4*)&uMcil|#RIXK<@;)Dw00_^|5h3yPtKPs$8)E3D{_Llkd>~aDO=20>jF7Llld_nS9;! zQgoFw1NJRMj+3KC6gBlv+G3E;D1nBMFa$yo_6>X9t#npAzphhLV_-22m6+T;TP)@o z49(YrtXNc)e-wNPU&w$bh@?uACT&h}9y=FExWv2gru6?+i5c7lb|7LWm>_F#KJGy} z6CV3DGd5|&L1IqXnc^%(r?f<}2r!TcR8@d8;ZGGctjqOQ4seORdRntqK*OI%?C5N9 zx+Cu>P?|zW*|cR}y>#6~V7)THd3b+`IHgzkYi(4i3W=OIrQ=iWY(rB zV~+&%wOe)AafpMgEE~B{#c;?lz5l`&S>VD1{vASitZJMsJg@BpMrL&8tx3%@M@EWO zA=y>d8qNM21uNEUNpif{R`M(k!U*LgjuUd-!N|j8;?Vj_`2jx;kP3G)uU5V`AnQiJ zNis8+3>*X$$qo=+^Xnm_tOEo2E<9{KOf&QeS zL4k*y>-KtX3s^wzTee=6VffMH36FZFNze|$LQIea#i&cqs4f>JX@v?GY?kjHJ~Hx+a^02~S}4lm z+YpT@x8m0=wo!WO!%4?!TiK`wb_y>#t`)Qu3PbE#12rYLh13-Mb-Y2M%!+a|*1ei{ zK<+B9gXvtkMB^XB)!geHxVHkq!BDU)#+GI3WV9xz%MRBj5WbrZZSa2#+F+zuk`gYa-s!GoXjtjx^MV`meZ zvG9n&U|qL;n7=By{b|H?W>#mcRlKZr>p0>qp|hGK1@+5{H26B|fu`qtLMv z-nFq-f7}2v3S3}cB6)owwJgJ>MHb1Yb?5riy*~AAo2xDr&{3tG#Fx%nFzuCe+wg?S zaT?)tzrSR^UCBH>IhqQSWGDz?g%i!_o}0@RmuorKQf@Mt0*Y!sTF~37etq~%hpp(g zV{J0sEAH|||C~ih1V`blL4+0ytjn@FfMH{+F9s&;tl98{Ly}A(tpe(1)ZUR~)n`cG+SHI8lxvDqLKRVmcIWUW?3H!i$!a3pagz|Q=SMyA-qEYAr8j_ z=+{qQL~zjLIg%vhR_!uJU5H9kgaQd@uZkyOR8i;I3&_q@$OMsKqaOx%LWGW***ZGP zLWRT*t8K38`q>fDNSE<9pFs8qp0v_&=-{t-Ynz&sXmr_jFsUAyrVx^tMQRb}^*N zrONH0M6vo33v_AsFCuj#78u@sMwe^|!Tj_@fFk<1LR4_{FEU9gdElNLg+uF{cyi@+ zEjB)5_%(UsMZKB5RE3|Q?5cm1+gg8jW2xhDh*0(nS?_jkX}#4GB7fM7lYT95cWGZMIcYEV#?yiR&~0CRx*lS$`W+12&v!_5T{eu*w+Dgl(NP?W@`HO1kCE&Q6_>We z+LL>{>{Ra9k4Pd=m|H<$63~Dynu@)v51}FLclH;k+t{f9@cJ2f*>i zt-}(`E4%Lpo&XKX-+f5&6M^smE6+E;^YLsLxRzJ9D}Nn;I>C|SiY|P=$p+}l0P?pQn7KUJ|dxs!B&+ebs zyb(N}FC%>kAZJz(v$Ll;IXdoHXeucyzji-wkD|@;3cA5}q8K%Z)p75UB*dCp$3sMz z2$o>A%I&y(K`uhVUh!QX>@4?Q7e)NJ<2R1(GEc6+_NKWCU3S>incR&Me<) zbml)VMwB!GQx_uf<%@Eyjark#F>!k>gmFSLbVe)@#_Zz?E6T!-i2U9l6&MBg!0UG3 zIfbfo22x{#xJJhE_Yeim1t%hQ9EMKgBD>0-(Tkkx-J|bL7_8s+B<)2#l+%zbzp$f7 z7nhg!-|%X}n1@5ebG?HJJ0AF=&v_yH?HRUAd56a~gKUML=X0B0Iw?-HRuCXI;qvPe zX+hW_&OeaJ8Gj6JfUd9or1_*N`NY<$cZA^o+*p8a7k(M^x0+jD1p6wn*fd;^oJu5~ z^Lpp+=a1|i_*YrFH$hV)LX2!K+i0+lmS17nMBX>Tda^eeLSY;zrs$ztYxlrx> zQzlTiq2G@B3YYcT>LUI^<&1mG?(&11K&j%TM*C_Ar!)sdzNj?Ae=$`-$`oV<7p{e; z8L|!;xmsHaMRqqFmn6#A)L#M}91|SntB$CmWPnl|1eCM_G|E^^Bqn}Owe9>*_n4>B z&oDfpZ%nl}KahpQKH5$9foprEC+NE$zAq^PNkf1J;z8Ps8`a@fcduh8Yz}<@Vf!Pa z^Tj`uD@eC&1*r{X?LRmGcOO1e9CA&HbaJ$bGepC$BhfMG@%~jG`LM~ozBjO}o6j#I zhNgA>HD`S|nZzm6ahY6yD6AZJ5T=V$eO5K4m?XTf*grPChOq=>F%!6ud3(o2U))2U zoEB~?!nIfKXn1EW`fJJMZD$je$gm+m2~E37e<4&g4J|qyS;C+HfXr_tj#eBJ-;~>U zJQ(9$tssa7kLnSB__4<`d67UwFf3Q++Nr3i1b%gf)>1N!Be&%OwG7QIbe5WwSj0<%03LT*Wh&5DhmBz;=4-j`KsOA1;of z+I_RC4I-Dkapy_ac;Qt9NDG}PHpE1c!P8X@SN5kkguD`nh%f&{7fKZ#_c{{@8&dh!C0VN2(#`Xl7_G$1cE7ZD{4(IRn|>kB9l2{JTL zd!qo3hw%Gf#>BL(<^r=MNDv@kVfmMsv;94sGWHbQbLZV~I-O`}XfT@Q={S-kQL;QZ z0bc;QS9gObNbz&?2%k5WJC6V{S`_w}IF4VU zwfjE>W906nyH`C(IbCuw^U0YgC@7%D#>QwGkeElI(XXSGG^{PMk%<`nvmgmg_f`Sq zOmV`Mkpi|8WI-mCqZz;?(S)4r9IB)m2%-Q%67=>_5+mkux9wL<+Zcn}3JDinbRoa- z${Q#sC_rOlBkM_y45{QeL4eY89LGN!oraDFqkmyGnE?XAT3GiriTgd+WGnj&G35WM zw*87}?!&BW+0spaxCxO+1U{b+;cz%8Tl)RSV9e&|pWx~v*~{9zW&@tU5-<+Cld zG|@ZoSIqHY66IC^kYe6?Y_r*tvB2$OBioBX3n3xQOp+wQZnuL3LP!l8SDt8k6H$hu zDr~V>;EiU%pjMummg=|via8EU%M5cMKy462)RN%T4ko!hlQ2Gk>~=d?Ks0wDnvyoM zAR!WoBwFzko!i?C`ZKCzzhc^tNhV}V$6F@(r`+CjK`mNS3Q>+HmRmz-rHKTDm2i`s z%E!{K_R2`VVp^R*O+*GES%hW6JHC7wj%hO@F-bXrRxz;xZh!!UqAO24`cu&qbh75M zUA5t(Pd-9wYHG9d7^@q%)wW+TKMh9sDf9CFn3tj`$VksX1PbayZipntS0sfMbhdXy zPiHqQU%4E9zyE(Kt^Y6erI$>KS0jo2W#e}V96@}g_^B|)Sv~%&3$d`|OL!IE(eyXW z>{I->q}O;}yI~#g-MyD(Sx&}Z{N!!>71MNlj2OMHIvH~PQsQ?Bdm{bR82$HfIE)L= zzW`w=j5S9#kX5wAkI`78EK3HB=rn|8&z(&+n~hXe{n^|0D~6inV>V(0w4KxDSaaYU zH%8MmWM*gKytB{87yFm6s%b2ca5Q%giF|V27~Z~P2XEWHjm>8BzpQQlE{tI{;AEeV z_d1DLKaA&1a{i>(5zxGTcCvS(di=9t{C+>qI^!(3(Lh_>JIErM2^=l|7*a#jFQt$& zgf#lcKmS1%i>0Mx)W4YfIbMt*JciQK)5+)clDod1%w{tQqDY#i#ou~3G!XSSZs$8* zq{VDDlg(x$lgUJ}1fu$RFMdn$jE@zW{ZB#$k2~RdU`sirKQEoP1)^sOuOnT6c-mm z6h*xE?z?cgT=8;P4yO|t85x}5VG$(>6U_37StTg3T3$OcQ5-V{hKNT=k`M?4aLv`% z@HIDHi}LP=Dch0>1~Y*usD>~sYY;x#JC7DFTF6tTOd+4om&lO*Tkq$`V)Q{uNlD?a zmo7yp9HwipyDpCT^y81QdDAAGcE%YL3I=)4o;{S6osHjIdMRFb_F0ZZA`m5src9fL z8Lzy;ilR_jS{g=;8G~hCe@&XI@`Ot+q15zr96WFUxw*MqR#F0DCWq6BC5spHz!OiT z>LW+s^ZBrE?_L@^ZX9>X&u?-+LZSrSk}q{D8`iGHJ9Fk>?6`5b{jR%EUt5a>^X6f~#EH1$?z?g5&>6c%kQ>RWi^PF>V&UxqIx~WsiB+D?FOxV74 zEBf{CPp*^{TKd&j=-j0Xswyi90Cw)!0h`SRlgWgXl$6BOG9=!8_uUV+737bmvEA)T z3~;O%Q50Da1d5dlpkOe_eGB_y?q}~&s+@v?l%5>XBGClatRc;uii5sGy!FryI{lQ> zU`+S+bKZ|J@wc7~Ns6_d40W`A%ysmMqbLdwJn=+)`tirKYsU@{5sw}_mLlOW3VQcO zMrJ0y{pK6qw`UJ!W@VwUu#i?RU(Rb*ug0JuLulZ@fmr_Ccf5YxIvO!*6n3cGgg z!b#)CahEP#C=!XF^3Wmb)w?(6=H+3_rcLyl%Pzx??b~_Ru3coc+0d_le?-Dz^eQOe zg!p!*y1F{;U!4Od8Ag_6mL!P+fq38{+iW&`_St7NW5(-vdF)dhVTJUfwjv2=P`rH0 zvU}*o=`V2KzI`c{{`P0j=_3dND~f`$vNAeSRRtDI%&d^zYDMqf1+ZGJ&@|1MRphv` zacG*xHk%EiC{iF0fZc9qMTy4j`+UBr7XlH7LLstRt-N!`4yvrIf#+64uS87TseYxx_SjmdssXZy06f=r( zNe&zd*U*~%>o9Tr1kx>Ab(M|)00c})L_t*UKiB=}zXbvTG&D5eNL3X_OjlMvOS>TVS-vGojlNu{V8@780f&f)j;cz<9 zr?3!#KmcB^7wH)p=+(P7JdKTr)xBtv<&;{f6qqavelpt@8BWqJA?{y^X=rG`B@-?| zabqc!`VT-Br1*^o)F2H^?+d$T#kTF+^z5xaYuktjzMw)!yi6t40r)~1G}frJI*8IE zelUsp!T-{J)3cC-qALmMC7{Bg5TWHdqd%%`LTjdYW1+J4n(vPX)53R*Sf!Zm-MVAs z&=LGa$r2ERcx{Ym35^Ur-h`cff_0?Xpjgx0b|5CuAJw}+psZ7pCD zCc{rMK0=ZU8to`8c^Ceqm{!gHg20-l@rCDJh#l3tIS|d{!H95OZfm!NWCDT^iP1VKwJ~z*xvPUupMop z+D=KGl(|1EJG+^got>G7#bN=Yu&t5x6z=G`-$Jj&I15~U*0LB33%-IZdV~-Nf*yv$A%x@L;;aWL9Q6BrOsCV@a?hur>wPfm?uojOJ@kR^Uog9f zV>_^H3$f07x{T(Ew&P(n4^h{5z3+Mow7loF%S2;=cM=P}FW;vMv%NI0Oh9G)Qm@?he7-f^M9RyL%v5fIx6}hmE_t`^MdU4@kwQ5BuD@voI5TU@pz@W>@NT|N`v2V=)8UF2ECf^_W))Bf$ zYP+b}o4dFhI{{!s&FoD8@$&Mru(GqTvopPEFgbeyU5q`LfX-C^ zW{?0ln>txJxLDZ($^T(AHnDeg5u|+c^uI!|bNC-xp!0t()7yfvco;jdurag#6VksG z6%_ves&;n&qwVaX3iw}t|DVLp>Yfe&7FB?=y{nVyTjI>A{xRjiC+-9=cCmL-x3{J`;FAS9yBGsa0kRT;ly4NwR#s+wU%8~d zva@n=a`JFQY}cI5wxna}D!`@;So`TiSg_Md&>_>WkYH)mM>$?X4?>3>hXmCrxJ z|Eb$I;eRS00DLQVr?4lBQVV}kJ&i3&>xS{mVxwdj7Xs)4krN1Gyq@-xHzx8;oj5&OQnwok@!xjR$>20e` z2zS`;cN>`B1P>LjgJ+i;0b47R8jfe`>gp9OhfA|9wUIipMKxT``R6;J^`-H7Z=%%7 z{X;`bOTUxGg79k*v9r^Y-L19z8RxXrl#;yEPd?+zN=m24yNffU!ZIoFv78 z7iK1Z#T|m`#_PO)f9Dz;Odniqm>lj{?+ssdvjeY}clUHngEx=%x5uWF7mNcQAP48k z{C(tP?Y&+RmcgA)n&*9n(C721_T;Il@`t;d==#X~=Hy>7kxeaOiyMjB-@99cWTB9y zsT%8=_QB$YvekUE>g@2$0FBL+?y>3NyOW{(;^C5^(kGW9eG;LYZeqp~o|LdAq$6dcS!->hKJG%^2B(K0jVg`YwS-N;9g?LwsijYwz#xFE0hj{|eDPPDTSZL5cyaD#Npa^ox7B6koZ0S-en}?y zFa9_$(4Z9-ELhZf{zzk~cl&bXo%!^hTHJ`es!jM_AfVpcBjyrqGpgL~qkKHRfhJU% zz#M<%na?Ah-K9dCt~^O#AaBDb_|lvS#WFKlj(zYLgs3C}1n`Kca>8L$qv2@NTN=s6 z5?*9pebd)pJ#T7~@H{*JJ;07r&(1zEzFfwPYv=%vJ2dvAb}QXxy20sNiB#fRr6Nf^ z4GP~o?-rQ4(f$_C_7o)C!Lzn$y;N1YLQ?kM%B$0%bg=bPEyb+u+M`7>M@4YDWf&Id zV4FoWMl$3jp3V#^*x^4aOc(nEf&1h0RlloNNkcuMyHV{?*xFo0X8Z#H<#%hVDPyqc7YlY}Bu~IzR}$iF zVP`f+pcTl|+b-|hJh$*MHANDmfTM*)t+GDT8P4nEYT!gk^)ggI+$i{3rb{p?hXDVZq<7%m{Gx~1EoNk}dRZ>lAxiy4VX z;MkPqIr6GKF^YMi{aohEFN;(;xYwjx=XwJA?cA8?3XE8(pz#upO2AoXa)e7<#6(Zg z*(@XpQB_{wQ*A|YPKHevNl^!0-;gLxQij-yt#jUP=a(y7_{D)?MW%InXU@{9MUzffxx!R3g87Y(x+5fHSa=-Ca?7iP^tjCY4n63Ok` zBiOMmkzI(zkQ+cwGKs^7sXb43lYMdIrz|l8t!ie(vxB@oVK;(X)h;iNFqTN1h)rm! ztSFms?HwnAwmBo9zlVfQMU1$g0vI)~L4z6t`_V|bue(IrGxU5f`Ma0ZBm@~3({ z1dvO?^ydaFhKarYeYoCJKD;iF7k~Zxkz#PeqqigL%%PATo>9t~Qvsec`!iPOnnFI0 z-Z=7L8Sw-^Dnoyz9||;4ghX9j90rDAbcgf(!{W|%_V+xpf#LUZ$FoJ8AF+xR`J(={o zP{cHEyXGNX_l8`q8f~ObAd>x)x_mEdO^asd^LZ=ZgC?7eouV)b^^uc6w&rT+hbNHc zL~_U05e5s6x!Xdma&LMlnt;L2Tnv0shFKfpTIz#VJArOx#%AYOUb>B%yqq%P4oBPq zI$X&dc1MQiP(8PgBpG+Zy(WIRT!*eaqOh^{rz2BKu-YmrN^HsK>1+9yqDGscvr_XI~Mm+nQp);fh-=tS=Y1ROFGdZ$@7yPx0eIb z{MF~%-%EFd2z17u4vcUz0Vu-h{M0sB(Ifqe$2d~Z{T<>by&2b z;ahU8-E$OT07MdDP33~&&vtfm$S+4B$4L2hWcyVuTdZ1IzlNO2E2x^*yhfimo|eYG zGLbsGcLD-=8WhvIfL9(O-{@FdZCC)ZV3c}!lI2S1I1R>->f=REfr>n{M$eJ-Dzg-2 z_;pC3H{DVfLqBra2n7EwCH~Q%qZjBb9xE`fo`Tklg2E-o-@yUM$4(^~Tu2Z+wMF9Z zpd-5&KEjASCN3d?Kbd@&?P|hgwawvGIwGFPWL~GBO zKA`#(4?hs^>Qras+p{d%2Y%F55}458pr_qckX})wMC10QjU!MOkd(eTZcBbS>wwtS z69}7gF9#vmEMDFw$DUvozZFX4lJ))aI}|d@NR;*6Jp5>5Gtq_GnzM1Dy}121rMMND zL6yT-P!37a&5H#0QM*`o$uslU* zgmnpv*0=`6c~$ZigvF4lR83se@uQ5dC}8JsU)W95RSYa+2jtLk})n- zuQCKB_xmk`Y8H;{G>mngZ*I^yPI}MOnu~ShqHP(>iedjY|^l(x{;R?v;+;-WuW{azW-<(vQMG%Iio6WvtCgYs2tvy5_&uleQtL+ANeh0Nn_ zf)WZJzd~PzKuIr^V3P3z3`?4BD&Gveji$A%tdf1HY~q`=G;8{8-mLe4tK|Ne3bV^G z0s&c8X1<{P3V#Ij&y z=BcfRpq{ntF+d^qD=y*iId(zE{LXw~q?a7U_sNL$Pm*_2f&x7Kz3<;Uztdm%ySiwR zxK(PTjHiyBSYC=Uw2EvwHQjXN(7#68k!((K+XH1*0hZRU?y)R+vZH6Wk(d19A^G+%F|6WA3!&RMn{R;-r6PfIpCGs@BPS zN9Dw4W*YYoi5OU$=F@V`FF7j}klXU;=r;i5X;N2)AEr$(t#e>5u|7pf$h^zpRVEJHW+ zlZZ0qJe%WZ=*N}yRbauH!k(b^j3dwxj~~sUp?}09+Pn&-w-&wiSe79T+>buWqg(0s zhRER$!uR>^vXP!Ep62sRDE7LDy%#(wWCa$joFC*f(uWFMLwZJH5awTFt|S~)O$A(u zJX2`1r3>Db-mMCM5<)+pvxAue22fDT=}XAgj&y!-cBVrq!;}sl5sRp!v=i{F{NAqX zZo>+#7-(q!$%ctY&~`VmrBeW<|6r3UpWO4n{D3iq7-oD4FJNRzRLRd7`@lQ41v4C) zhB|lc{dAl_V%|qAlg5BA{OXUpOuoZ`FvcVxVoqh5> z-i=iGITD2lwpMam%Tw~E=4bcGX2T(B5CKreNzagFn9T6?Av27^eG=21{UoCi#d7PH;aw~D~s z(eaa(NA(NQ#HT5VN{suksO3^@NlTafIUdHyVyU*}foW`oyG;c6kho%XtZBxzTt z#B(ky#?*MJ+3YZ^NGZoq3Y=+As?vDFJSkdXfzm$Bi4vXrJ19*54#7I!}E+^G&+3pN3_bx|Ms5BHe3i9*g;6$%Gva>E*cA0jd zKHv5&IdxKa1Ry`D3xRD;=g}G%Y|o5_iX^ZKXs}3{JRHfb!GVGBNLUH7OqD}Ue0A^Y zBVH|hJG{!oR-aS|ngug3HoR=K5SJ=-nn>@qQW+D?e zg{x1iAW)cB5eKw4%m1&Z!unhZ(ghW!uzS^nqT07P1Kw7wRI>an7fh@W6B5wMg?j+Q zyTBFgM$!p$>i*nHGe?tfiS5;e$D0G|Ld6VWs~J=l0q<82U8jTnJ4!VDE>@9B=sDws z+SQVuF!gC4eac2GEC&g_OecKp@C%745M2u*JHtPBS|`heW&Zc2MDoqLQtx^*gCn8T z48b7m=~f*wTi62th=!i7(q>+u{8=PaQ$h;9acnExcbu5zS4bm$XyzpCqR5~8{I-L8 z{4>&4Lms6434_OP^`Zl;xc%9EF?D>nLps@x!w%pY0TAP0Ha`C-Hvb&YjhVZ%B(wo@CBh@^cc zjhGa5&86nZ;he&l5O|nk>3AsNBr}Z&vNLgQUeZBljokEuW*xK~+7q;RJWm*YP8YJl zM^S3y0-z9ZP>~=k_Mpf%=^{y=vdeBH5&hBT$l729P71&J;2!5>y&fs~KlQWx?P~x* z);ltI9CIO=zn9ocRdvvkRC3jSc>kFBAgz@(lrGA?hZpW##%}=q!Q8I9?t6PfB52=* zE8YHO6%M+y$0VDm(5@zDU|=|Vwi)-l4Wyea{}YXh-RjR}Zu1qW-{uE>qCK$VWB2AO zcAst_Jff%TmuW2GoclRxCcy1JlaKDM{f+!Vu-8-_APyPKP0jtdujH#a z|Geg2ke4S`wb*(bWdrM?`&?lhte*|kcRehdURSM}_*tja^Dq`3S)SD>3%c+BhEQ#zF%}tk9R#1nmCdKOd$g`uSVDZbROG zQ1p3>2Fz~vKR!Oz;ZJ&7+CQgolgX_-$G-B^TA{T4jsL8+*&D2qL@*goKN~xi)@U^= zFhpgINvO>?$5T#^UGWSJ$%3ARz6C18^XOd`NGD6Ysg-Eqw>}BGA9lCL+X^qrp0I*Z zkqVCv2Otsl^O?w@LjfI%CrFzA=@5$KJP8b6_j%lto@C^`0p}Ex&zjas1ZIzC3VIK> zEh}ZFa$}kVbyp3Bg?1K=?2r2qIR5PgnfOsc_u;%mwZRZ?}OFIvBxqBl-gddkHuMfTmMuQ z4%!aKd$I*8kdV6jHMw z+(Zx1zh9b^RihqXJg=v&F3zkx(vo0xQh|C>Y6IhGY6~o(0`fNp6?YvZOhGj;Vc75* zU{3qHQ-!qLbv<@yy@q_Dh_6_(#5x0CFS)*f7&iLum3XEs#~>9F&K{oK4_9^``i0#$ zQ_0O_dB!_A*xZ+T32D<2Sa9IJh&Uv$1o90$raFz44%g#rdcDhdg4%cQX2%f- zQqdre&2YTJ&DZX5dQ7o!F47}qvePX+%%sA2_tUn)vnnc|Q>aXspqOgv%F=Bzfo zYIhQtugvtHX!RbZ`0E;>5j?|t7H&(sSuoKK8 zuFgcr1^}k80V^xrho3Af_YNk1K3NUZ92P3<)O?Wl(he*vpUnD=`S!sAqQ)Or-~4jY z(c~dnRc7b&+;xy(j374>9J!0v%@Y%*^64eg{P`d-NN%_zMv?1uilBq3+21wF;=6b=Nl^ zm0;my5m?|48vJK-tWu{a?QL^abni*@8TS`O93xGz-(_&|+QUOM#}AHS!gBU&&mVjz zIv)0SAK3i_{50F4ccoW(caacH($V2lEZK#(`?9G1dCrwBF^SI!{`9uOG!f)5FV12f z`>;}Dn)ZfF9ahwkOex_9L)|vk*qr#oGsZv^4UMF9_ONn#KDuXhvQSncMBrOX30LPc zTDCgqZu9s!hOvnw>~qnl2wldtJfshMC|}xh@sl4-MU>iqIhq5~H{EKv)?Cv6AO&9M zNvM7Du{udvG(z}uy;*2k2R%^9eP3LMqLLy=>zL-@ddlR$To7*Im#mJv<`#LKD~o7B zaVWx*d$#5TE3N`lWjgqx-_=0Zp4&F>B7g`Pn%&X2qNhnSGEC}{RDXm5m#Z{Ep9d-g zZp5Fs+pB7YP`H9%9_xzQIhh9P==b}q%Cxv)4Wx}zeEkW@vIw4UqAEiSM)k*%(YdB= zgW`83kdqe@BZS23)NR^E%q}^(*AyW zq3itwsab7eB6P>i|G>Yz{By9q!Bt}?Wszu6yy0b#Y=da8o4<$tt`xUWm1CmLS+Ykr zu}AgYWX~6Zy#UlNbLPh{DJ+WV0f=+&a9Ee%fF2@4t_M>vdmbhecBz9o0K?&xh)3y&dQ@%p^GdAEj<1^$AuaLg){-0VZ^H% z85wvx0!&3()S$=eFqGs=%*lD&@mRz=pTowsgTK%BQGbXDuA2uiaG%vf!pQ~Jj2Ucn z?(Zaq*nzQQo(H?bZh7=<3Lh-boC`l@BSD%S(|(qj-Jx=)os+AswG~W1^;bKvtcUp2 zgO@NoL(+QpI=-w#SxZVWu1^RyBv8X2EhgRYjb7XdX{o{2o!lH`Lf5)hEFT~JGWYh( zIeuOXj3D7Kr2Aml|IYM$!JncURQlZET+7#QsphRy*QSb7slKv*p7aFBH`u2GHs{55 zoyJB}VOfoD(&wQw*&K2JSSSisN%;qic|oZC&cK^7HtVRfaHV~)ZJ-44&aVOa z_{P5W?{aD}UuL%4H(+t`O02%yis%Y_rlR?d=#LE1l>MR}{VQ&P;AJ#q!;mwQG7s$M zUSjE?ov&ljUzPYnVxX$t$MK@N*!NUUF(%5%kwAJ@ThysZsGPc3l>D#T1kYr;+CcF< z$``%)uMD9n({_uQ5hwdRVTE~Q2kQv9pZ~C8E}Z5y2A560YdfioK$4fjHSI0%Pr1yb zVb3ONbJ$4>%(l`lc*UK1I&DO}HLRO)jn1u!kCzXSQ0D3}4nTF`;YUSD8@F(8DMj61 zjW22^J?H(JP)NZb$Pqy6mUOm^|FMXME(IQed848Cw3fbYZvvv(j0*BgByOxyj)Y5vqjsk3HJKP{Neb>e(bBh2+r>r~PJq_#O1yaWB5ZiDSFCHjNf!L=98Qulq_0%SF+P zv(v0@GK-1nz1~{ViPHk6<8v6NH^=)`hM4Yp7=D{G6_6r0MNq==I|L#c)sSjwv=GW& zhkRD;wE^8V2+XD=5>?KOx9{XyE`K1#u<~j_%1dnMLTbfJ35`F8*(#K#g|Od!L6Q~A zU_bvH^!~ns48CV$LZ*49@_l`5@kBjdtQ1%>RemLXf>@ahSMsp2j_R|N9g4pQ_WL8r zg3^5a@OXNH_{uB;B$5%gcS&mg+mZsefdr1~?f7@`Dsbn@CuMh*O*&%tBXte?^6l=rk#Ru>#0Clb`oagU|Qvh8?gD9a4DT zvaXB&4yF#?{6*X`vcQVn!mcNB78Fdu8<$A}%$BVM_{bgs2(0AlsTmZ|%K;Jr)W>7E zsKpBo0yfegsYlmveF!tx^q0t23?=o-`qAb1Gc(KKW5lJ@20J=}U|`jzY`^MFF53Gy zRS2Am*F_x4#a=Ln%b@dtjoqgZf6L)Re}un7mRBVpS+iVn|Dbsa$u7pD)|BZ(L~<)r z)j=K!Hk128w+nY5$3d@wcu0mK`cZa7Ff+!Bc$gLKq&i)R>^E#~=dDz;hEy%WmL%Pb zB%hJ^d;112x+GCTHx-JOhO^ryKM@|62w09UlZ?coM6&pZ-s!d8+T|Fz~`}^)O#mdRj{MP=U3F27v?eetm zL*&(p@`T8J@c|mBcV!A@T>1W*gvH#1EDYZ!@%2a?a#)N$4{{W<5pLC-5a3G$VOe1xrg;m>_To> zZSrpsIP7l!d#O-woQCc^G@R$#iK_o zwMSOJXtsS;nTf|eueMo0ts)8hC4qk&H#dIKKB3i#otT6#>yt&22CvgtN<4<=;smK- zE%Fg}vc_U~!eqFCg9Cogmc&RdY_4{OrRJa8wn{DrM%hXwC3mUY0J`l&+>XvXOR8{@*aLI4S9YW26rc=Ci zaNO*_v#oQylnvd2rJT(6$0v?w!rdJ}SDwVQR})nMJc~+X{7KbGCMrp0I;z8)+vN^Ek)UtGU7nA<4hTSc)cf(N zWti3z7Yt#K?%xin6j*h&Eb_z4vKX)=-wFDOOy4BIKbNTh^+1c1ybl=a_lar5&%hcuL-qgv%y5?JJ=EsG*#o@`w z#G;yzW^S*rn0WFzSbKAD)6KRE zi%#0qy0WgP%BQ>4*rWI1xbErQs<`8bi?HakizR^1?zg<<`~IWN=IfYB&B3awx4-D& z#=4fI%hiGDevH-N*o>UsoQ7TUr)B>6+Pulp?kGreitFE}sF|Q@_`}0KZ?5*|$m;** z;Fe;)<@VE?ouRD2R#8uInrhA2yhB1n{_)M2z}wTTyV23l_{-HZFfpREn&02Fzn)>7 zbWoe2p}DEI?U|w9vb*%&;Nk4^;o;!azLwzo-|X(jS3*_s@bA#ksK^vIgHc%c+nE3V z{~InY_y7PM4M{{nRCwB~n~h(a$hyZtGQ0>>9E@Pfs6~N-Ll9k4YuFZRTbo#0wYK)< zwAHg&m*Z;PJzH{i<5}~s-)Exjw!3>jpZmG(C<%!Pe0k>gya95tNim`VQ3Qe!&INeU z;=AxpQa$%gOeys!77z-mu2~|grDfSfsLIok&0B~hgdjoc_j^iTmsi%3)@|Z>c;k%p zkdUJ@y(Np?wT;^|rjQF1OMOa8ieN{caddDHc8p4;6K0*FlUC}{fsz>=j^+q81x!sX z$vxOTEJ@W30HMXJzyo9$fKrtg38JKD>gcSAeV~tk#ppnMx89`^gH1}WObsW`Vj|ap(9kF z5p32I&d%V&y3E&(HEhQGISCL#^bDI-zCm(X_$D~L8YP_6(=+*b*Epk>S5tn2Tp|x zJdDrI1dMSn6@)WHkExRJYMSG`ka<@ua(XtBRQXq4YBp(-DzN)7EUJxCx56+@5QZa8 zEYs3c3>!RE9N4N=aVkc~slYG}>Kzl7O1)Dzj+~Cs&nbL?VtV`h6`~%}l~TY;sVHTS zzCv7#1Vq7#)a-*Lm5q_jCZ=6pEHyz$Yv<=ef+$$07WNe4n`Wl_S!fkSSIsg%HB-y7 zf-qPLLchq0A~ZUN1IK9`6!n8n>KxSJ*E(o-vI8(gzdX|Gm7eL#vdZ&Sb%uz9CZu_5 zvq>=li}-xZ@wFTa8VHv3yi_>e+}sd652TYGV}TSswOTX5I&snrEL~469rPkey*6uN1c0>z6Qkx}x_=oh=|P_A;{^r+#1?nH+B}g`v{_e-FvDd;_*% zndf|06q-KxhOR7aUJS4g%5mUVRj$Uz#G`^~M0RM~Sr$Dvo{64V1d|-1e>>-BOiE#oTyb!j(HJNAu}>N$_)GYKmYkp#yH(?>K^}riv&gca zKOf-OQGJ=ur3B@grq%dkGqS!Mr{5Q3(L&f0a(e3+0$b8gfn-FM#V|~$lIqeco8Qa8-%C`;CQ)U*@hjRpZmz8o`hw-8{10%YmA~u3Bp(q5(w;xDWSw{iNX5R`Yt#W zC8-c_SV&@CwrwNpmEa?af`w8svoLJ%Cj<_{Bh_jsqc58%r7x8O1D9r)m`Q31J?5Sg zgc?N;57!T^JWGYlZ}Oam1xQU!G&%RaWF8AtN>7h$n?Tl}EEK!4nQC8xBNbLzT7|?` z34y(6Qcp;H?3H;YdcHk%cgP|p5-7wyj+O|E{JZ+(C~!#5(JACch1ijwC%l_Lpp^Mm zioQ_D#IlMD0hR!iL^z?IXu`oJSj)5B(cOqbn#45bxeY}T%-XW?a`=5&_AB2Q63kfv zzD8+-4=5$E>!)9;9^JAoqXmk5jFOybNJu284K#t631n)JxjhimKQTFQJ zun|c;WJeLggs&zzf$6fOFU2XyC6E#(Np6}LL19DsG|zJY!?`D5P4ig%(L6uq-FMsD zg#y-L!WC=l4ljpudLA~_5oUvd}^8&ZQ z^?a9CpKm)S8>OP-gKwO&WO@esz+Aaix$4Sl;|r$?@>*ZHJf_xCi~b7xR}>w15W@7k z@4m}555fTMx-CxgRlX)a-+l)|QY6q1=($$_4+t#j@{otSvf2N7qcAPxc{v=dPNYS2Z~;7kT&jbLZW04xX+T@SyZilw~B4WxxSv53R4rqg$jXOQ>%^pArCou-n$%yVJx5U)fncH zms_T(f40SUll^xu`^{+j$-(}?q2#yWJua5Ajm?Ht)SybdX&)bpx%To zMb|~Q7Ie830jOw1DO4NpmW?PfwwF(~x9c_>!pPKer1cj{$f;K-v`U7yZC|8O~#-pY4is^FF+J^q-@Ney!q6{@Qu-eFx_2x4+j< z0bK)#C(k|4gYq*W(c#_eyYbG>>-iu|Fb7Sa1Ti{{{4)0xsO7y}fbeW*a0J4yImuKz z``kWsx{s&(Xde~@-S4Nv?9E@sB?9I!+kMHpFBSK{_mk<3xxbq)%Yu%V)pFxs7JpB7&+{tyr^$Qg_SOR5Vy z3kwVHma_~x3Jv3&GpnvBd07-ed%{wiz<3bL7p*{4kXt)5p;$k6qhng11eLS`KZ&KeT! z=FaPeXqGGtYe@oAh&@h9RA?nK+aP(4EGxBkN0t0+dAs&17Ky1x?Qp;TxqW(HlxOSf`NNF-x%s<_otPd=>0LanCvW27XR^7xm$wukJ(XW|6<} zY&exespdGD!(v{y;y}WpPUU9*d&hYL%jErs+><;1n01^tf61rVOO{_ZYIfpD3ehn6 za7HJgxsr3;Y6CiZ+p$5%xiHA4x>7(08X0LG-%6A+CF$opb>K;+UrqeOc_U9efgMWe z{Vrfte|uklQ(K>z`1QBxT6^~JiSwV|54(Sk(MFgR@(vJqp5iEwGGVU}WFUVbc%$U1 zGERc(iBU(F`CZ3?l0Z)gU88p^F?*Jo{?$HO?O@^`#{I^ApBdnn?E~0t<4#{aoPG18 z{wSoZ%))kP=$OpLwKrhqo*Lso%f0FTH!yfAagAHAtO}O0Pa$I|Tbwrfa*k8}NzW zxxdsLj&a~PkOAvQMs!p;igb2r=&0TaJI;~ODL9^2p~_+T{6q002xZE6Mw;lXnWu{R zc|MgMLfCCMPW}DE`!mDRLssfkoYVXL#({IGpWmE2_itC~cmDBvW#WEg_;a4D5*kPK zO2_G!N2OD@ol2)(>31sdULAONKqJrMWphMG^uqtY#plKcsoZuh z=je%Z|1Y0%+RlM-P&ZCH_0taUI0wLUROu8Ir=9_i*^L8UH6lpwQ5I#X?b|2I^~ffg zC$MtcB&AROZ*9cKQx1P!`6T|d60u1jU8kpor4+^ccBnfCVbNEzP$?A7KV~%!&7k9g zEDBVay?wH6WKf+z#X*HM)cvnnKWDX*>JE&B2kdd@_0HPsYM9Ne#iF0kQs9DSi?1Rr ziENhC?K(Uf%geS&1nAKOPs369Re3@vm|H=urmj4A{b1$6g9keg9;~fBSXg)2sVsdV$X&=3NU{M9qu@1o*O#Omds0sPxLcLIug3E#PD25jKk8|$=kgGe2<<^W zEm4r9a=^KO1L-!=Z?@lLiKP9?PWeE~DvALyeKB@9Hq1m|{Ps@`Y zD~4EgmO#l!xtVGTtvx2(`uZ-USa=^k9rL`)21Ei?4oyq{S~!w5zv6=^DfXaahy7C0 zLjCL4jz!6QIV3a6diAM>=g&Kx~rtDG) zJwrmGV5oFx6VVhg9?>$Z{?KR+598(WmVR&|)Z zUhyT5)nu@YAa-F15WrL+!L68Lm!Q*yvnQlQ-{{Q0nG)` zy{~|igrP6bFFa_$f#aMN>r0Ojm5`U`f*H2kr<8CBceuVQ64sn~OyCrmARD(97S^K+ zoJWrq=VxbUuYKv1N!|H)g#|uWMc^}F5F&&DHX|X2@SCk4uD40Tktq-khAPctSK}xY zLn_aAlU#WG^MGdY+U&!<+U(-P*>8XOGAU=Zm6esa<_GEw$&pR4k$RaZq$wpn2pBlb zgaXg?Dd@xotq#=FY0T2Ss7d+Tt5=_1eFXVs2Yz3#t;LIrd%ygDZ6qnh{(jqNS{H9lM}Vu2uNYcYB)MRKK$e9kNY=n+}OG?IXQ7<^2)O-6BExkp~bt< ztD_vrJkN4RPHK&Fe(dSftKa^4Jbd`m7`T3Wclg84FawJIIDOx1sa;6cffzuRu}nyU zT|dm~S!V3p@0^LPt!G=XOx(EwV`AdvOL(|4!9XV13jA^qj@>F)C+qUO%sT5J=|bWH zF+ch<&b1%D{q{A)qMvp@9qqO+ez1^~in1!IRo<svFo{UJW3z zp2?!B+T(MJSD%jk3Fn8!Z-4mV?atVLpFWy{!F@zBtDq$YB<+U7jVdakxJ!~ij03{# z!3KKxTiyzyJLMJnY?j@#5aS#hoz-N}A?v978KIJzeT^T%)=>+%~wrG&Om1s#@iC zLvDI{babxJb7gfv^z7M<(fxO`cMLI>Wl@YyR~g9V7$1c(4o~|=dv%!OzwezIkpq+*S&k!UJS8>3JdTnwnPkNFM#=FlJG zaIPHvFqz!kv`5<)L=zLRJCMlgDl-Nc25{I!tqulbfxor6M&GLU`%%5`qkcUbtO3vL zfQQWx!?|}2fcEy@E-t=iJdZpm3^WfKGZj5;}^oY7&ktStvf#s4|6Sv@t95@(|!dS8_OB+K=@%iFZN!rXoA5cmZ9rYVfIn&90x+0dyLx82Hy2-Yha1-;n7PaGoID)Rd~UT zxA)udMEaJ|@1Fvb)Hm#beLz3P)vN!#;Mu!&@5SEy;@-~A;{4*``~%2pi%`EnxEG*) z!dk$0+XIZDb#Cecswf^`l6<6kY|lCu&c@t&^wK`?2mu;`Dx1Fn-7rV{RwXhjW#3Ht zWhII#r8LR`&)C!d{_7ryX7AdIy~WpyYxA>jK~9TI&O55eIwVg>F=ki8Zw}1!9(;3Z zuvX-r&QL}le-zSqZDF3x+Lghijb2XI`0y%|)GAvWAKpJ59^T>vsTb~ty}kk!WM7HE z)1X(CrdjcGZ*A`$==kmHokhs&YwEpwYx7{9F^J@@9AHf{bB)S;GT@nFv0|F7T{i?x z5R{V9Tv}+Zy|NHZ7vndc4I=c`jZbyMEX2$+yg&Zz8K-G|@5vLbmt#%b(0YC8{b(j? z$}h~1cGj-#EzZAw4ORkOuYt$2wDz`O*Xi6?BuRo(*EOd;@{A66PHTjEIh4Q3NBh(k zmWKgrZa~ClZR-++>1p*M42_QiD)4BKFrefY^4e{&JvRusI12Bvs(ELA_Vo^g9?;N> zYirkJR)jnXAnBS7$Wdx6re>oS>nXZZq58NKj+n6^Kh zY<0N3KfZf|1x^mWC7kdv6lBesY+w3>X8Ji8=;_$b&iq>lJ9}^6vgk9$W(%b$t6ofK z(q@`*W2Vu_u3x{)FxH0#D=+uWuG-DWMT{B{*$WG&7gIMnjSJAx2cq$tH(7@ryq`lpH`_oSkA2I1%z4}ud=TLzQIL)EACcZc$*IK*4aXGGE zpEQh`0VSP#B2tK&!tv&axUgV<8j_~JTiU7I?x4 z3~=^hdhQdVx#F?D`fOmNXIpH(25{G>hIhH9ph=0VCQ=^9wc$Ay#vX5OjzB9<&btG} zJiQpK6Pvm_RG8R9rDtMx9lGEDo(GrAZ+^7T-AQNp#IGB5F$}7%E4M~+iL5NNKo#XD zK(L##T)ni>>MG;9vajz#U~it~9&y!{gyUB+OU%>y#^&akAO&hGvL5bzFwNDmpA&0$ zE(|28XZEC?f_03DFY~5}dcC2KJa=pWiu{aS2W&w>E|Z?Pumj;U*SyD{0)ddq@yq&% zNoQAw+Aib}R18U#ZwV-vsa^1B-mj3ElCEfyAj)cQUynW7+xr1ak`;<>&`JojlZ4$- zgp$a0$uTio9}V=}&xsz-t!`a-|JLXLHXG2;2N%mmCu1#0KdTk($=NA=AeG=OTz86-WTZY@csMu z)@i?wbxnA6yJpkK$OO}GxQ(7f(*&xEF5f~(zyuHOONn_^j#yC^2jmjM_~&k>}EJWr%GAlW0P4Ns*6^xu#;Js=mkV|IOy)# z`uciJ{E_iYK%vftCLo(PQ8-*d4ExcBS9R z45xG2sXOfEXv_5t8?2L}MA4&|j|n0a%dV^|9>%umftF-usbqI(>acdAPJ(&ZbVYvH zVmAz%=Q1QkWQseo-{5&MrC=8wL4E>pmrD6pC2^yQ#wk7F)rRijjg9Z=E1GP4zp?S8 z*~~Xy@m(fhMA;cxnnFZiFF?-}dRRmW1c_=2Sse5}HPlvl{`uXz700n7_|_5xux8Q_ z6P%+U&a1KA;(0X<=Ku$E$2P=zlj%$GF!{_udsO1w<0NR{YvOsM8=nNtW^?9N)l~;4 zdif?!V2bk8>cd2}_^Jt^D&|2?h@BiwRbHm-rgX7piZwMzf|oCy?RSxtdpT*Ijcg{W z%q~R63qjOXeE{Zb8L%)K=$F7uu%;IUMFk8*&o)QcU921p%_KE8TU;>)6oA(-g(@cw< zg&-jtP`_0nRs~S!f@3I3DWE}f!aM`BQ**~>kfb0qb7>IAko!bPFqe{IrcA1?n5G-Z zrv!ngf^yg$>p~v$89P9NU;<6}Ad-367IIVNeX5%zkzKx)Vs>WKLoGh`m#{pKa*~R& zZ;22ZV5?`k4Kbg2i%qtn#rtIF;i1 zRTYxOdB|$BCZ-^#;MOh7?$T{B6G0UN;!muV1rtiU96Ug@O@Y|#@(jBM0Op}Z(hkGa z3<9VG2OEXKHJe}#v#Jv5@gQ)|u_}{vLAT79qeIsZlUC4Z$knQPajCUht;%steuYe1 zb*V&2jyEVZS%ez7m9z7ZV6194Wx*lv7fy7@*a8?E{1W*ohDP9A1}6mtq>m2|cV+it hv%m>Hc>X^E3;=7|&WwP^{Z{}0002ovPDHLkV1iaFrfL8H From 88abdd06e0db363f2cac9d916bb07525524840fa Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 14:56:48 +0200 Subject: [PATCH 531/816] add link to FAQ --- index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.md b/index.md index c893c8baca6..d4fc64f2994 100644 --- a/index.md +++ b/index.md @@ -50,7 +50,8 @@ In this basic example, we create a map with Point

      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:

      map.panBy([200, 300]);
      -map.panBy( L.point(200, 300));
      +map.panBy(L.point(200, 300));

      Creation

      - @@ -3727,7 +3726,6 @@

      Creation

      <Boolean> round? ) -
      FactoryUsage Description
      Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.
      @@ -4994,6 +4992,21 @@

      Class

      a.greet("World");
      + +

      Class Factories

      + +

      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:

      + +
      new L.Map('map'); // becomes:
      +L.map('map');
      + +

      The factories are implemented very easily, and you can do this for your own classes:

      + +
      L.map = function (id, options) {
      +	return new L.Map(id, options);
      +};
      + +

      Inheritance

      You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

      @@ -5098,20 +5111,6 @@

      Statics

      MyClass.FOO; // 'bar'
      -

      Class Factories

      - -

      You may have noticed that you can create Leaflet class instances in two ways — using the new keyword, or using lowercase factory method:

      - -
      new L.Map('map');
      -L.map('map');
      - -

      The second way is implemented very easily, and you can do this for your own classes:

      - -
      L.map = function (id, options) {
      -	return new L.Map(id, options);
      -};
      - -

      Constructor Hooks

      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:

      @@ -5373,24 +5372,17 @@

      Creation

      - - + - - -
      FactoryUsageCreation Description
      L.Transformation( + new L.Transformation( <Number> a, <Number> b, <Number> c, <Number> d ) - new L.Transformation()
      - -
      Creates a transformation object with the given coefficients.
      @@ -5781,16 +5773,11 @@

      Creation

      - - + - - - + @@ -5858,21 +5845,15 @@

      Creation

      FactoryUsageCreation Description
      L.PosAnimation() - new L.PosAnimation() - new L.PosAnimation() Creates a PosAnimation object.
      - - + - - -
      FactoryUsageCreation Description
      L.Draggable( + new L.Draggable( <HTMLElement> element, <HTMLElement> dragHandle? ) - new L.Draggable() - Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).
      From d037c23b2dc7cea128a3a556c7338b774653fa1d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 16:40:13 +0200 Subject: [PATCH 533/816] fix prefix default value --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 62a2af37af2..e4afb1c5e1f 100644 --- a/reference.html +++ b/reference.html @@ -4335,7 +4335,7 @@

      Options

      prefix String - 'Powered by Leaflet' + 'Leaflet' The HTML text shown before the attributions. Pass false to disable. From 81cbb20c8657cbe4217779d18c162a1bb3d67965 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 16:47:38 +0200 Subject: [PATCH 534/816] add some breaks to 0.6 post --- ...2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md index f2b7e6c08ca..b241d1120c2 100644 --- a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +++ b/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md @@ -20,9 +20,9 @@ Special thanks go to [Universal Mind](http://universalmind.com/), my awesome emp Grab the CDN links or downloads for the new release on the [download page](../../../download.html) as always. Enjoy! And be sure try it out and report any regressions in your apps so that we can patch them up immediately. -**update** (June 27): 0.6.1 hotfix released with a couple of regressions fixed (particularly the one with FF scroll-zooming too fast). -**update** (June 28): 0.6.2 hotfix released with a couple more minor issues fixed. -**update** (July 17): 0.6.3 released with lots of regressions and bugs fixed. +**update** (June 27): 0.6.1 hotfix released with a couple of regressions fixed (particularly the one with FF scroll-zooming too fast).
      +**update** (June 28): 0.6.2 hotfix released with a couple more minor issues fixed.
      +**update** (July 17): 0.6.3 released with lots of regressions and bugs fixed.
      **update** (July 25): 0.6.4 released with a fix to 0.6.3 regression. P.S. Everyone who tweets/posts about the new Leaflet release or why he loves Leaflet over the next few days will get a karma boost of over 9000 points. I heard that from a passing monk in Georgetown yesterday, true story! From f52bc2323aea540a29c0e0692d8e319c4b0e7fec Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 17:20:23 +0200 Subject: [PATCH 535/816] add post about 0.7 release and plans for future --- ...8-leaflet-0-7-released-plans-for-future.md | 56 +++++++++++++++++++ index.md | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 _posts/2013-11-18-leaflet-0-7-released-plans-for-future.md diff --git a/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md b/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md new file mode 100644 index 00000000000..290f754c105 --- /dev/null +++ b/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md @@ -0,0 +1,56 @@ +--- +layout: post +title: Leaflet 0.7 Release, MapBox and Plans for Future +description: Leaflet 0.7 Released — with IE11 touch support, upscaling tiles and tons of other improvements and bugfixes! Meanwhile, I've joined the MapBox team full-time. +author: Vladimir Agafonkin +authorsite: http://agafonkin.com/en +--- + +_Leaflet 0.7 Released — with IE11 touch support, upscaling tiles and tons of other improvements and bugfixes! Meanwhile, I've joined the MapBox team full-time..._ + +After another 5 months of active development with [lots of contributors involved](https://github.com/Leaflet/Leaflet/graphs/contributors?from=2013-06-27&to=2013-11-18&type=c), I'm happy to announce the **release of Leaflet 0.7** stable. + +This is a bugfix-heavy release — as Leaflet becomes more and more stable feature-wise, the focus shifts towards stability, usability and API improvements over new features. I've also been holding back some of the planned deep refactorings (which I'll talk about later in the post) until 0.7 is released, so that the heavy risky stuff is done at the beginning of the release cycle, leaving plenty of room to catch bugs and incompatible changes that can unintentionally break existing apps. + +### Joining MapBox + +In other news, I [joined the MapBox team full-time](https://www.mapbox.com/blog/vladimir-agafonkin-joins-mapbox/). This is extremely exciting for me, as this was my dream job for quite a while — [MapBox](https://www.mapbox.com) have changed the world of interactive mapping forever with all their amazing work, having some of the greatest geomapping engineers and designers of the world working together, pushing the boundaries of what's possible and inspiring others every day. + +For Leaflet, this can only mean very good things — much more time on Leaflet development, more enthusiasm, more play, more crazy experiments with maps (like [this one](https://www.mapbox.com/blog/dynamic-hill-shading/)), and lots of learning. I'm now one of the happiest map geeks ever. Stay tuned for tons of awesome! + +### 0.7 changes + +You can check out the [detailed changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#07-dev-master) of what's already done over the recent months for 0.7 (about 90 improvements and bugfixes), but I'd like to mention some highlights: + +* Added the ability to **upscale tiles** to higher zoom levels (e.g. have zoom 19-20 when the source has 18 max). +* Added support for **IE11 touch devices**. MS unexpectedly broke their pointer API compatibility between Developer Preview and final IE11 release, and we eventually rewrote quite a bit of code to make everything work smoothly across all IE versions (both dekstop & mobile), fixing a bunch of IE10 bugs along the way as well. +* Officially **dropped IE6 support** (nobody cares anyway) and cleaned up/fixed IE7-8 styles. +* Dropped the need for **IE conditional comment** when including Leaflet, making the snippet much simpler — all IE7/8-specific styles got simplified and moved to the main `leaflet.css` file. +* Fixed an **obscure iOS7 memory leak** that crashed Safari when you tried to create several thousands of layers (e.g. markers for clustering). I still don't understand why it happens, but we managed to fix it with a bit of trickery. +* Fixed a critical **Chrome for Android** bug that made the tiles disappear after zooming on some devices. +* Removed some **Earth-related hardcode** in TileLayer implementation to make it easier for plugins like Proj4Leaflet to handle complex projections without horrible hacks. Some other work in this direction to follow in 0.8. +* Improved **panning performance** on complex pages with significant number of elements — we found out that simple things like setting a different cursor to `document` (for a "grabbing" hand) caused noticeable performance hit on some browsers (Chrome in particular). +* **Changed the way maxBounds works**, not enforcing a derived `minZoom` from it but restricting panning across lower zoom levels, along with some tricks to make it play better with panning inertia or offset zooming, etc. + +### Plans for 0.8 + +There are several big undertakings in refactoring Leaflet that I'd want to switch to immediately after releasing 0.7 — I've been holding them off for too long, and they'll be extremely beneficial for plugin and Leaflet-based API authors. Some of them are already in progress. + +* Refactoring the **layers** architecture. Currently there's a lot of duplication of logic across implementation of different layers (map, markers, vector layers, etc.), specifically event handling, zoom animation logic, zIndex and pane handling (what appears on top of what etc.). Making the code consistent, more universal and shared across different layers will make it much easier to customize layers and make your own (e.g. integrate d3, etc.) +* Splitting the huge TileLayer implementation into **GridLayer and TileLayer**, separating image tiles-related logic and grid-logic that will make other grid-like layer implementations (e.g. UTFGrid interaction or tiled GeoJSON) much simpler. +* Refactoring **zoom animation logic** to make the long-awaited Easey-style animations (mapbox.js 0.6-style) possible. +* Refactoring **projections** code to make it easier to set up flat maps and weird projections and customize how Leaflet handles them. +* Refactoring the **vector layers** code to make it possible to use different rendering backends (Canvas, SVG, etc.) for different layers on the same map and switch between them easily. This will also open it up for interesting extensions, like indexing layers with [RBush](https://github.com/mourner/rbush) for fast interaction features. + +While it's an ambitious plan and it may take more than one stable release, finishing all those refactorings will mean that Leaflet is getting ready for a 1.0 release. + +Another direction I'd like to focus on after releasing 0.7 is **website and documentation improvements**. First, Leaflet is begging for **more step-by-step tutorials** (with more advanced features like custom layers, custom controls, etc.), and I'd love to do a docs/tutorials sprint some time in future. Second, the presentation could be significantly improved — adding a prominent visual **showcase** or app gallery, making Leaflet users more prominent with some logos and quotes/testimonials, and updating the layout/design for a more stylish, clean look, etc. + +Hope that gives a good glimpse of the stuff to expect from Leafet in near future, and don't hesitate to ask any questions in comments — I'll be happy to answer! + +Grab the CDN links or downloads for the new release on the [download page](../../../download.html) as always. Be sure to try it out on your apps and report any regressions so that we can patch them up immediately. And lets make some nice Twitter buzz about the release as usual! + +To all the people wo've been involved in Leaflet contributions, bug reports, mailing list, Twitter buzz, making awesome apps and spreading the word about Leaflet — thank you! You are the most awesome community ever. + +Cheers,
      +Vladimir. diff --git a/index.md b/index.md index d4fc64f2994..1112c02fe0e 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- - +

      November 18, 2013 — Leaflet 0.7 Release, MapBox & Plans for Future (Blog Post)

      Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. From a26834f3e1d78092131d02cb57f342df2b0b5b19 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 17:36:53 +0200 Subject: [PATCH 536/816] minor post fix --- _posts/2013-11-18-leaflet-0-7-released-plans-for-future.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md b/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md index 290f754c105..96b5d2a4d93 100644 --- a/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md +++ b/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md @@ -38,7 +38,7 @@ There are several big undertakings in refactoring Leaflet that I'd want to switc * Refactoring the **layers** architecture. Currently there's a lot of duplication of logic across implementation of different layers (map, markers, vector layers, etc.), specifically event handling, zoom animation logic, zIndex and pane handling (what appears on top of what etc.). Making the code consistent, more universal and shared across different layers will make it much easier to customize layers and make your own (e.g. integrate d3, etc.) * Splitting the huge TileLayer implementation into **GridLayer and TileLayer**, separating image tiles-related logic and grid-logic that will make other grid-like layer implementations (e.g. UTFGrid interaction or tiled GeoJSON) much simpler. -* Refactoring **zoom animation logic** to make the long-awaited Easey-style animations (mapbox.js 0.6-style) possible. +* Refactoring **zoom animation logic** to make the long-awaited Easey-style animations (zoom-panning between points) possible. * Refactoring **projections** code to make it easier to set up flat maps and weird projections and customize how Leaflet handles them. * Refactoring the **vector layers** code to make it possible to use different rendering backends (Canvas, SVG, etc.) for different layers on the same map and switch between them easily. This will also open it up for interesting extensions, like indexing layers with [RBush](https://github.com/mourner/rbush) for fast interaction features. From 7fe1f804d327fc3e1c7699162956428dd4eb72c2 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 17:56:33 +0200 Subject: [PATCH 537/816] fix download link --- download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.md b/download.md index 9ac6f7c5022..efad0395c0f 100644 --- a/download.md +++ b/download.md @@ -11,7 +11,7 @@ title: Download Description - Leaflet 0.7 + Leaflet 0.7 Stable version, released on November 18, 2013. From fb5c2484f0c0a1746213f39f64d872875c2cf80d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 18:15:44 +0200 Subject: [PATCH 538/816] fix cursor on headings --- docs/css/screen.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/css/screen.css b/docs/css/screen.css index cac0b998967..08c9245c900 100644 --- a/docs/css/screen.css +++ b/docs/css/screen.css @@ -74,7 +74,9 @@ h2 { border-radius: 5px; text-shadow: 0 -1px 1px rgba(0,0,0,0.35); + } +.api-page h2 { cursor: pointer; } From 8a2a0ae6e433dc7d8faf634a85908ba664f9f304 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 18:25:37 +0200 Subject: [PATCH 539/816] remove metadata on non-title pages --- _layouts/default.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index 9fe219b983c..eb23ae5e1e9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -7,6 +7,7 @@ + {% if page.title %} @@ -14,6 +15,7 @@ + {% endif %} From 838549253cb29a118a6860b4df284868e07edd8e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 18:26:47 +0200 Subject: [PATCH 540/816] one more attempt at metadata --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index eb23ae5e1e9..6ea9bfc2bca 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -7,7 +7,7 @@ - {% if page.title %} + {% unless page.title %} From ebc62771cfcc28faf075ca148a60a5049c45bcb3 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 18 Nov 2013 18:29:29 +0200 Subject: [PATCH 541/816] and one more metadata fix --- _layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 6ea9bfc2bca..06cd11b92b9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -7,7 +7,7 @@ - {% unless page.title %} + {% if title == '' %} From 087a14916c0363754ef0f323a303de85d739b00b Mon Sep 17 00:00:00 2001 From: Benjamin J DeLong Date: Tue, 19 Nov 2013 10:13:13 -0700 Subject: [PATCH 542/816] Added WebGL heatmap plugin I added it next to and after the other heatmap plugins. --- plugins.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins.md b/plugins.md index ceac6a8f491..699725e9012 100644 --- a/plugins.md +++ b/plugins.md @@ -101,6 +101,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Daniele Piccone + + + WebGL Heatmap + + High performance javascript heatmap plugin using WebGL + + + Benjamin J DeLong + + Leaflet.MultiTileLayer From 86f3995ce79691f84f0d70f5bb6064f06cf5557b Mon Sep 17 00:00:00 2001 From: Trevor Powell Date: Tue, 19 Nov 2013 15:37:08 -0600 Subject: [PATCH 543/816] Fixing bounceAtZoomLimits option name --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index e4afb1c5e1f..3faaf386894 100644 --- a/reference.html +++ b/reference.html @@ -284,7 +284,7 @@

      Interaction Options

      Set it to false if you don't want popups to close when user clicks the map. - bounceZoomAtLimits + bounceAtZoomLimits Boolean true Set it to false if you don't want the map to zoom beyound min/max zoom and then bounce back when pinch-zooming. From 7dd54d0d2bdea8670db1cd58e64718ec5dd236c8 Mon Sep 17 00:00:00 2001 From: Trevor Powell Date: Tue, 19 Nov 2013 15:45:42 -0600 Subject: [PATCH 544/816] Spelling fix --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 3faaf386894..7caf53689be 100644 --- a/reference.html +++ b/reference.html @@ -287,7 +287,7 @@

      Interaction Options

      bounceAtZoomLimits Boolean true - Set it to false if you don't want the map to zoom beyound min/max zoom and then bounce back when pinch-zooming. + Set it to false if you don't want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming. From 280fb14a2a0aa9273fe2ffd5208c68acf3a8f02f Mon Sep 17 00:00:00 2001 From: Benjamin J DeLong Date: Tue, 19 Nov 2013 15:37:28 -0700 Subject: [PATCH 545/816] Spelling/punctuation adjustments --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 699725e9012..1577a6d81b2 100644 --- a/plugins.md +++ b/plugins.md @@ -105,7 +105,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s WebGL Heatmap - High performance javascript heatmap plugin using WebGL + High performance Javascript heatmap plugin using WebGL. Benjamin J DeLong From 6ccdd4934ba4f7a75a3adfb927a57a28827a69a4 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 20 Nov 2013 16:52:34 +0000 Subject: [PATCH 546/816] add leaflet.plotter plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index ceac6a8f491..3f4e3055b94 100644 --- a/plugins.md +++ b/plugins.md @@ -17,6 +17,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Description Maintainer + + + Leaflet.plotter + + leaflet-plotter allows you to create routes using a leaflet powered map. You can click on the mid-points to create a new, draggable point. + + Dave Leaver + + Leaflet.markercluster From cfa0d04a16fd00d7be116a84dd6d60bddf822fc0 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 21 Nov 2013 10:16:59 +0000 Subject: [PATCH 547/816] missed the namechange from last commit --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 3f4e3055b94..3b0270c11f1 100644 --- a/plugins.md +++ b/plugins.md @@ -23,7 +23,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s leaflet-plotter allows you to create routes using a leaflet powered map. You can click on the mid-points to create a new, draggable point. - Dave Leaver + Nathan Mahdavi From 71e8dfa38265d12d61ec9a7f6dc092a028b44f9d Mon Sep 17 00:00:00 2001 From: Seong Choi Date: Mon, 25 Nov 2013 19:47:37 +0900 Subject: [PATCH 548/816] Update plugins.md I added Leaflet.KoreanTmsProviders at the Services, Providers and Formats table. --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3b0270c11f1..5e9d0d48767 100644 --- a/plugins.md +++ b/plugins.md @@ -428,6 +428,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Eugene Mikhalev + + + Leaflet.KoreanTmsProviders + + Contains configurations for various (South) Korean tile providers — Daum, Naver, VWorld, etc. + + Seong Choi + + From 26d5952b825abc88828c934d21826695be188752 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Thu, 28 Nov 2013 21:50:39 -0500 Subject: [PATCH 549/816] Add Leaflet.FeatureSelect --- plugins.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/plugins.md b/plugins.md index 5e9d0d48767..478b0ca6310 100644 --- a/plugins.md +++ b/plugins.md @@ -235,7 +235,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bjørn Sandvik - + Leaflet.Graticule @@ -244,13 +244,13 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bjørn Sandvik - + leaflet-usermarker - Plugin for plotting a marker representing a user - or multiple users - on a map, - with support for drawing an accuraccy circle. Can be seen in action on + Plugin for plotting a marker representing a user - or multiple users - on a map, + with support for drawing an accuraccy circle. Can be seen in action on Longitude.me. Jonatan Heyman @@ -291,6 +291,14 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jörg Dietrich + + + Leaflet.FeatureSelect + Use a configurable centerpoint marker to select any geometry type from a GeoJSON layer. + + Aaron Ogle + + @@ -766,7 +774,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s A context menu for Leaflet. Adam Ratcliffe - + @@ -775,7 +783,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s A simple tool to measure distances on maps (*relies on Leaflet.Draw*). Makina Corpus - + @@ -785,7 +793,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s intentions to aim a particular layer. Mathieu Leplatre - + @@ -794,7 +802,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Trigger mouse events when cursor is "almost" over a layer. Mathieu Leplatre - + @@ -803,7 +811,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Adds the ability to change overlay order in the layers control. Michael Salgado - + From 504f1f23c22d7533a5e1d777d8fdc1af63ad74fa Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 3 Dec 2013 14:45:48 +0200 Subject: [PATCH 550/816] update changelog [skip ci] --- CHANGELOG.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99efcf86d30..3031419072c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,53 @@ Leaflet Changelog ## 0.8-dev (master) -An in-progress version being developed on the `master` branch. No changes since 0.7 release yet. +An in-progress version being developed on the `master` branch. Includes `stable` branch fixes. + +### TileLayer & Projections refactoring + +TileLayer code and everything projections-related has undergone a major refactoring, documented in [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): + +#### TileLayer-related changes + +These changes make implementing custom grid-like layers for Leaflet much easier. + +* Moved most of the `TileLayer` logic into the new `GridLayer` class (which `TileLayer` now inherits, extending it with logic specific to tile servers). +* Removed `TileLayer.Canvas` in favor of the much more flexible and powerful `GridLayer`. +* Improved tile wrapping and bounding logic in `TileLayer` to work transparently and completely depent on the CRS used; removed the need for `TileLayer` hacks when using custom projections. +* Removed `url` property in `tileload` and `tileloadstart` events (get it through `tile.src`). + +#### Projections-related changes + +These changes were targeted at removing any hardcoded projection-specific logic accross Leaflet classes, making it transparent and driven by the chosen CRS. They make using Leaflet with custom projections (including flat maps) much easier, and remove the need for ugly hacks in the [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. + +* Added `Projection` `bounds` property that defines bounds for different projections (`Mercator`, etc.) in projected coordinates (by [@perliedman](https://github.com/perliedman)). +* Added `CRS` `wrapLat` and `wrapLng` properties which define whether the world wraps on a given axis and in what range. Set as `[-180, 180]` for `EPSG:3857`, `EPSG:4326`, `EPSG:3395` by default. +* Removed `LatLng` `wrap` method; added `CRS` and `Map` `wrapLatLng` instead (so that wrapping depends on the chosen CRS). +* Added `CRS` `infinite` property that disables boundaries (the world can go on infinitely in any direction), default for `CRS.Simple`. +* Added `CRS` `getProjectedBounds` and `Map` `getPixelWorldBounds` methods that returns world bounds in projected coordinates depending on zoom (derived from `Projection` `bounds`) (by [@perliedman](https://github.com/perliedman)). +* Added `CRS` `unproject` method that converts coordinates in CRS-dependent units into `LatLng` coordinates (by [@sowelie](https://github.com/sowelie)). +* Fixed `EPSG:4326` to have correct tile pyramid (2x1 tiles at root). +* Fixed `Projection.SphericalMercator` to project to meter units (by [@calvinmetcalf](https://github.com/calvinmetcalf)). +* Fixed `Map` `worldCopyJump` option to work for other projections. + +#### Misc. changes + +* Added `Point` `ceil` method (by [@perliedman](https://github.com/perliedman)). +* Added `Util.wrapNum` method for wrapping a number to lie in a certain range. +* Improved `L.bind` to use native `Function` `bind` on modern browsers and prepend real arguments to bound ones. +* Improved the build system (`jake build`) to report gzipped library size. + + +## 0.7.1-dev (stable) + +An in-progress version being developed on the `stable` branch. + +* Fixed tile flickering issues on some old Android 2/3 devices by disabling buggy hardware accelerated CSS there (by [@danzel](https://github.com/danzel)). [#2216](https://github.com/Leaflet/Leaflet/pull/2216) [#2198](https://github.com/Leaflet/Leaflet/issues/2198) +* Fixed a regression that sometimes led to an error when you started pinch-zoom as the first action on the map (by [@danzel](https://github.com/danzel)). [#2259](https://github.com/Leaflet/Leaflet/pull/2259) [#2256](https://github.com/Leaflet/Leaflet/issues/2256) +* Reverted `L.Util.template` optimizations to allow Leaflet to be used in eval-banning environments like browser extensions (performance gain was insignificant anyway) (by [@calvinmetcalf](https://github.com/calvinmetcalf)). [#2217](https://github.com/Leaflet/Leaflet/issues/2217) [#2209](https://github.com/Leaflet/Leaflet/issues/2209) [#1968](https://github.com/Leaflet/Leaflet/issues/1968) +* Fixed a regression where `Map` `invalidateSize` could lead to unexpected results when called before map initialization (by [@Zverik](https://github.com/Zverik)). [#2250](https://github.com/Leaflet/Leaflet/issues/2250) [#2249](https://github.com/Leaflet/Leaflet/issues/2249) +* Fixed a regression where `FeatureGroup` containing other group overwrote original `e.layer` value in mouse events (by [@gumballhead](https://github.com/gumballhead)). [#2253](https://github.com/Leaflet/Leaflet/pull/2253) [#2252](https://github.com/Leaflet/Leaflet/issues/2252) +* Fixed a regression where `CircleMarker` `setLatLngs` didn't return `this` (by [@radicalbiscuit](https://github.com/radicalbiscuit)). [#2206](https://github.com/Leaflet/Leaflet/pull/2206) ## 0.7 (November 18, 2013) From 440f2f89c1dd7a8e5d07159d51aeae020047d837 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 3 Dec 2013 15:08:57 +0200 Subject: [PATCH 551/816] bump version to 0.7.1 --- package.json | 2 +- src/Leaflet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index efb0cb2b033..59756ad780c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet", - "version": "0.7.0", + "version": "0.7.1", "description": "JavaScript library for mobile-friendly interactive maps", "devDependencies": { "jake": "~0.7.4", diff --git a/src/Leaflet.js b/src/Leaflet.js index 6303605b87f..cd7fc6962cc 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -2,7 +2,7 @@ var oldL = window.L, L = {}; -L.version = '0.7'; +L.version = '0.7.1'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { From 401297d3cd70314c07b2a1cc43f0333603b118c8 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 4 Dec 2013 17:19:08 +0000 Subject: [PATCH 552/816] Add link to leaflet-zoom-min plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 12a903a2b1f..ab53d0017d7 100644 --- a/plugins.md +++ b/plugins.md @@ -841,6 +841,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Tobias Bieniek + + + leaflet-zoom-min + + Adds a button to the zoom control that allows you to zoom to the map minimum zoom level in a single click. + + Alan Shaw + + From bda5ce1a94ae458f50411cf5af0e7c1474cae86b Mon Sep 17 00:00:00 2001 From: danzel Date: Fri, 6 Dec 2013 14:54:48 +1300 Subject: [PATCH 553/816] A transitionEnd event only finished a zoom animation if it is for a transform. Fixes #2255 --- src/map/anim/Map.ZoomAnimation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/anim/Map.ZoomAnimation.js b/src/map/anim/Map.ZoomAnimation.js index e40a840f1e0..ead4fbd1a12 100644 --- a/src/map/anim/Map.ZoomAnimation.js +++ b/src/map/anim/Map.ZoomAnimation.js @@ -24,8 +24,8 @@ if (L.DomUtil.TRANSITION) { L.Map.include(!L.DomUtil.TRANSITION ? {} : { - _catchTransitionEnd: function () { - if (this._animatingZoom) { + _catchTransitionEnd: function (e) { + if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) { this._onZoomTransitionEnd(); } }, From bd5fbd278978f490814d6fbc412daa778dfb6483 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 6 Dec 2013 16:16:41 +0200 Subject: [PATCH 554/816] update changelog [skip ci] --- CHANGELOG.md | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3031419072c..eee00274205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,28 @@ Leaflet Changelog ## 0.8-dev (master) -An in-progress version being developed on the `master` branch. Includes `stable` branch fixes. +An in-progress version being developed on the `master` branch. + +This version contains a lot of beneficial but potentially breaking changes (especially if you're a plugin author), so please read through the changes carefully before upgrading. + +### Layers refactoring + +All Leaflet layers (including markers, popups, tile and vector layers) have been refactored to have a common parent, `Layer` class, that shares the basic logic of adding and removing. The leads to the following changes (documented in PR [#2266](https://github.com/Leaflet/Leaflet/pull/2266)): + +* Added `Layer` class which all layers added to a map should inherit from. +* Added `add` and `remove` events to all layers. +* Added `pane` option to all layers that can be changed (e.g. you can set `pane: 'overlayPane'` to a tile layer). +* Added `shadowPane` option to markers as well. +* Added `getEvents` method to all layers that returns an `{event: listener, ...}` hash; layers now manage its listeners automatically without having to do this in `onAdd`/`onRemove`. +* Improved performance of adding/removing layers with layers control present (instead of listening to any layer add/remove, the control only listens to layers added in configuration). +* Fixed `FeatureGroup` `getBounds` to work correctly when containing circle markers. +* Removed `Map` `tilelayersload` event. +* Removed `Popup` `open` and `close` events in favor of `add` and `remove` for consistency. +* Moved all layer-related logic in `Map.js` to `Layer.js`. ### TileLayer & Projections refactoring -TileLayer code and everything projections-related has undergone a major refactoring, documented in [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): +TileLayer code and everything projections-related has undergone a major refactoring, documented in PR [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): #### TileLayer-related changes @@ -34,18 +51,24 @@ These changes were targeted at removing any hardcoded projection-specific logic * Fixed `Projection.SphericalMercator` to project to meter units (by [@calvinmetcalf](https://github.com/calvinmetcalf)). * Fixed `Map` `worldCopyJump` option to work for other projections. -#### Misc. changes +### Other improvements * Added `Point` `ceil` method (by [@perliedman](https://github.com/perliedman)). * Added `Util.wrapNum` method for wrapping a number to lie in a certain range. * Improved `L.bind` to use native `Function` `bind` on modern browsers and prepend real arguments to bound ones. +* Added `DomUtil` `setClass` and `getClass` methods. +* Removed `LatLng` `RAD_TO_DEG`, `DEG_TO_RAD` and `MAX_MARGIN` constants. +* Added `LatLng` `equals` second argument `maxMargin`. +* Improved performance of layer objects construction. +* Added popup fade out animation. * Improved the build system (`jake build`) to report gzipped library size. -## 0.7.1-dev (stable) +## 0.7.1 (December 6, 2013) -An in-progress version being developed on the `stable` branch. +A follow-up bugfix release for the recent stable version. +* Fixed a bug where pinch-zooming quickly could occasionally leave the map at a fractional zoom thus breaking tile loading (by [@danzel](https://github.com/danzel)). [#2269](https://github.com/Leaflet/Leaflet/pull/2269) [#2255](https://github.com/Leaflet/Leaflet/issues/2255) [#1934](https://github.com/Leaflet/Leaflet/issues/1934) * Fixed tile flickering issues on some old Android 2/3 devices by disabling buggy hardware accelerated CSS there (by [@danzel](https://github.com/danzel)). [#2216](https://github.com/Leaflet/Leaflet/pull/2216) [#2198](https://github.com/Leaflet/Leaflet/issues/2198) * Fixed a regression that sometimes led to an error when you started pinch-zoom as the first action on the map (by [@danzel](https://github.com/danzel)). [#2259](https://github.com/Leaflet/Leaflet/pull/2259) [#2256](https://github.com/Leaflet/Leaflet/issues/2256) * Reverted `L.Util.template` optimizations to allow Leaflet to be used in eval-banning environments like browser extensions (performance gain was insignificant anyway) (by [@calvinmetcalf](https://github.com/calvinmetcalf)). [#2217](https://github.com/Leaflet/Leaflet/issues/2217) [#2209](https://github.com/Leaflet/Leaflet/issues/2209) [#1968](https://github.com/Leaflet/Leaflet/issues/1968) From 512063d06fc2741e2e4558736b829a02b48c83d5 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 6 Dec 2013 17:50:21 +0200 Subject: [PATCH 555/816] update build to 0.7.1 --- dist/leaflet-src.js | 53 ++++++++++++++++++--------------------------- dist/leaflet.js | 8 +++---- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/dist/leaflet-src.js b/dist/leaflet-src.js index c6c6bde2daf..6928837f6f1 100644 --- a/dist/leaflet-src.js +++ b/dist/leaflet-src.js @@ -7,7 +7,7 @@ var oldL = window.L, L = {}; -L.version = '0.7'; +L.version = '0.7.1'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { @@ -134,21 +134,16 @@ L.Util = { } return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); }, - - compileTemplate: function (str, data) { - // based on https://gist.github.com/padolsey/6008842 - str = str.replace(/"/g, '\\\"'); - str = str.replace(/\{ *([\w_]+) *\}/g, function (str, key) { - return '" + o["' + key + '"]' + (typeof data[key] === 'function' ? '(o)' : '') + ' + "'; - }); - // jshint evil: true - return new Function('o', 'return "' + str + '";'); - }, - template: function (str, data) { - var cache = L.Util._templateCache = L.Util._templateCache || {}; - cache[str] = cache[str] || L.Util.compileTemplate(str, data); - return cache[str](data); + return str.replace(/\{ *([\w_]+) *\}/g, 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; + }); }, isArray: Array.isArray || function (obj) { @@ -534,7 +529,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent; doc = document.documentElement, ie3d = ie && ('transition' in doc.style), - webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()), + webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23, gecko3d = 'MozPerspective' in doc.style, opera3d = 'OTransition' in doc.style, any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d) && !phantomjs; @@ -1070,11 +1065,6 @@ L.DomUtil = { if (!disable3D && L.Browser.any3d) { el.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString(point); - - // workaround for Android 2/3 stability (https://github.com/CloudMade/Leaflet/issues/69) - if (L.Browser.mobileWebkit3d) { - el.style.WebkitBackfaceVisibility = 'hidden'; - } } else { el.style.left = point.x + 'px'; el.style.top = point.y + 'px'; @@ -1770,6 +1760,8 @@ L.Map = L.Class.extend({ }, invalidateSize: function (options) { + if (!this._loaded) { return this; } + options = L.extend({ animate: false, pan: true @@ -1779,8 +1771,6 @@ L.Map = L.Class.extend({ this._sizeChanged = true; this._initialCenter = null; - if (!this._loaded) { return this; } - var newSize = this.getSize(), oldCenter = oldSize.divideBy(2).round(), newCenter = newSize.divideBy(2).round(), @@ -2858,11 +2848,9 @@ L.TileLayer = L.Class.extend({ /* Chrome 20 layouts much faster with top/left (verify with timeline, frames) Android 4 browser has display issues with top/left and requires transform instead - Android 2 browser requires top/left or tiles disappear on load or first drag - (reappear after zoom) https://github.com/CloudMade/Leaflet/issues/866 (other browsers don't currently care) - see debug/hacks/jitter.html for an example */ - L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome || L.Browser.android23); + L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome); this._tiles[tilePoint.x + ':' + tilePoint.y] = tile; @@ -4487,10 +4475,10 @@ L.FeatureGroup = L.LayerGroup.extend({ }, _propagateEvent: function (e) { - e = L.extend({}, e, { + e = L.extend({ layer: e.target, target: this - }); + }, e); this.fire(e.type, e); } }); @@ -5261,7 +5249,7 @@ L.Map.include((L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? {} * and polylines (clipping, simplification, distances, etc.) */ -/*jshint bitwise:false */ // allow bitwise oprations for this file +/*jshint bitwise:false */ // allow bitwise operations for this file L.LineUtil = { @@ -5994,6 +5982,7 @@ L.CircleMarker = L.Circle.extend({ if (this._popup && this._popup._isOpen) { this._popup.setLatLng(latlng); } + return this; }, setRadius: function (radius) { @@ -6775,7 +6764,7 @@ L.Draggable = L.Class.extend({ L.DomUtil.enableImageDrag(); L.DomUtil.enableTextSelection(); - if (this._moved) { + if (this._moved && this._moving) { // ensure drag is not fired after dragend L.Util.cancelAnimFrame(this._animRequest); @@ -8909,8 +8898,8 @@ if (L.DomUtil.TRANSITION) { L.Map.include(!L.DomUtil.TRANSITION ? {} : { - _catchTransitionEnd: function () { - if (this._animatingZoom) { + _catchTransitionEnd: function (e) { + if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) { this._onZoomTransitionEnd(); } }, diff --git a/dist/leaflet.js b/dist/leaflet.js index d778359c89d..59c843174be 100644 --- a/dist/leaflet.js +++ b/dist/leaflet.js @@ -3,7 +3,7 @@ (c) 2010-2013, Vladimir Agafonkin (c) 2010-2011, CloudMade */ -!function(t,e,i){var n=t.L,o={};o.version="0.7","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},compileTemplate:function(t,e){return t=t.replace(/"/g,'\\"'),t=t.replace(/\{ *([\w_]+) *\}/g,function(t,i){return'" + o["'+i+'"]'+("function"==typeof e[i]?"(o)":"")+' + "'}),new Function("o",'return "'+t+'";')},template:function(t,e){var i=o.Util._templateCache=o.Util._templateCache||{};return i[t]=i[t]||o.Util.compileTemplate(t,e),i[t](e)},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?o.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();if(this._sizeChanged=!0,this._initialCenter=null,!this._loaded)return this;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c; -return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome||o.Browser.android23),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this.options.tileSize)},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({},t,{layer:t.target,target:this}),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=o.DomUtil.documentIsLtr()?t.pageX?t.pageX-n.scrollLeft-s.scrollLeft:t.clientX:o.Browser.gecko?t.pageX-n.scrollLeft-s.scrollLeft:t.pageX?t.pageX-n.scrollLeft+s.scrollLeft:t.clientX,r=t.pageY?t.pageY-n.scrollTop-s.scrollTop:t.clientY,h=new o.Point(a,r);if(!i)return h;var l=i.getBoundingClientRect(),u=l.left-i.clientLeft,c=l.top-i.clientTop;return h._subtract(new o.Point(u,c))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return this._moved=!0,void 0;var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),o.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){o.DomUtil.removeClass(e.body,"leaflet-dragging"),o.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target");for(var i in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[i],this._onMove).off(e,o.Draggable.END[i],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this -}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return this._zooming=!1,void 0;var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),void 0)},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(){this._animatingZoom&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file +!function(t,e,i){var n=t.L,o={};o.version="0.7.1","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?(o=!0,void 0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),t.apply(i,a),void 0)}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix&&!c,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?o.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_; +return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),this._createTileProto(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map.getPixelBounds(),e=this._map.getZoom(),i=this.options.tileSize;if(!(e>this.options.maxZoom||en;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+t.zoomOffset},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this.options.tileSize;return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this.options.tileSize)},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createTileProto:function(){var t=this._tileImg=o.DomUtil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tileSize+"px",t.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=this._tileImg.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTileProto:function(){var t=this._canvasProto=o.DomUtil.create("canvas","leaflet-tile");t.width=t.height=this.options.tileSize},_createTile:function(){var t=this._canvasProto.cloneNode(!1);return t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return this._parts=[n],void 0;this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=o.DomUtil.documentIsLtr()?t.pageX?t.pageX-n.scrollLeft-s.scrollLeft:t.clientX:o.Browser.gecko?t.pageX-n.scrollLeft-s.scrollLeft:t.pageX?t.pageX-n.scrollLeft+s.scrollLeft:t.clientX,r=t.pageY?t.pageY-n.scrollTop-s.scrollTop:t.clientY,h=new o.Point(a,r);if(!i)return h;var l=i.getBoundingClientRect(),u=l.left-i.clientLeft,c=l.top-i.clientTop;return h._subtract(new o.Point(u,c))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?(o.DomEvent.stop(t),void 0):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return this._moved=!0,void 0;var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),o.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){o.DomUtil.removeClass(e.body,"leaflet-dragging"),o.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target");for(var i in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[i],this._onMove).off(e,o.Draggable.END[i],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&this._moving&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){o.DomEvent.preventDefault(t); +for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return this._zooming=!1,void 0;var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,clearTimeout(this._holdTimeout),void 0;var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this),void 0)},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,this.fire("step"),void 0):(this._onTransitionEnd(),void 0)},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",this._stopLoadingImages(t),void 0):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),clearTimeout(this._clearBgBufferTimer),void 0)},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document); \ No newline at end of file From cb37d25dbe4325cecf4537cb5a965c28f66b3b04 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 6 Dec 2013 17:53:40 +0200 Subject: [PATCH 556/816] update index and download pages for 0.7.1 --- download.md | 8 ++++---- index.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/download.md b/download.md index efad0395c0f..778ce2fda41 100644 --- a/download.md +++ b/download.md @@ -11,8 +11,8 @@ title: Download Description - Leaflet 0.7 - Stable version, released on November 18, 2013. + Leaflet 0.7.1 + Stable version, released on November 18, 2013 and last updated on December 6, 2013. Leaflet 0.6.4 @@ -34,8 +34,8 @@ so please read the changelog carefully when upgrading to it. The latest stable Leaflet release is hosted on a CDN — to start using it straight away, place this in the `head` of your HTML code: - - + + ### Leaflet Source Code diff --git a/index.md b/index.md index 1112c02fe0e..d66d63b9baf 100644 --- a/index.md +++ b/index.md @@ -6,7 +6,7 @@ layout: default Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. -Weighing just about 34 KB of JS, +Weighing just about 33 KB of JS, it has all the [features][] most developers ever need for online maps. Leaflet is designed with _simplicity_, _performance_ and _usability_ in mind. From 5cc602ec0a89885fe8693b5c5b93bff8026711aa Mon Sep 17 00:00:00 2001 From: Lyzi Diamond Date: Fri, 6 Dec 2013 14:30:02 -0800 Subject: [PATCH 557/816] Change example to use Leaflet 0.7 --- examples/quick-start.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/quick-start.md b/examples/quick-start.md index 0919c871be6..6b77f6b101c 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -19,14 +19,14 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS files in the head section of your document: - + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From e0e3721f13f73e697a86a66c7ec114009c3254a3 Mon Sep 17 00:00:00 2001 From: Lyzi Diamond Date: Fri, 6 Dec 2013 14:40:07 -0800 Subject: [PATCH 558/816] Update to 0.7.1 --- examples/quick-start.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/quick-start.md b/examples/quick-start.md index 6b77f6b101c..46114f954dd 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -19,14 +19,14 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS files in the head section of your document: - + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From 83f10b60395d688f56f70cc21981a19cfb8282c5 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 11 Dec 2013 17:33:56 -0500 Subject: [PATCH 559/816] bump CDN link (the original was a bit broken) --- download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download.md b/download.md index 778ce2fda41..f192581de4f 100644 --- a/download.md +++ b/download.md @@ -35,7 +35,7 @@ The latest stable Leaflet release is hosted on a CDN — to start using it straight away, place this in the `head` of your HTML code: - + ### Leaflet Source Code From 972386c965978ce49ff7278e059907e4dcd9d647 Mon Sep 17 00:00:00 2001 From: davidcalhoun Date: Wed, 11 Dec 2013 14:51:56 -0800 Subject: [PATCH 560/816] fix typo (attching -> attaching) --- examples/quick-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quick-start.md b/examples/quick-start.md index 46114f954dd..fe9988facfc 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -101,7 +101,7 @@ Popups are usually used when you want to attach some information to a particular Try clicking on our objects. The `bindPopup` method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the `openPopup` method (for markers only) immediately opens the attached popup. -You can also use popups as layers (when you need something more than attching a popup to an object): +You can also use popups as layers (when you need something more than attaching a popup to an object): var popup = L.popup() .setLatLng([51.5, -0.09]) From 4d4aa733aecb91ee920b0d858a116eff76bb2423 Mon Sep 17 00:00:00 2001 From: alfarisi Date: Sat, 14 Dec 2013 22:49:13 +0700 Subject: [PATCH 561/816] Update plugins.md --- plugins.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins.md b/plugins.md index ab53d0017d7..3f998d9829a 100644 --- a/plugins.md +++ b/plugins.md @@ -246,6 +246,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Bjørn Sandvik + + + TileLayer.DeepZoom + + A TileLayer for DeepZoom images. + + Al Farisi, + Indokreatif Teknologi + + Leaflet.Graticule From f5054d3b7a9054fe275936eb90b96a0fb927006b Mon Sep 17 00:00:00 2001 From: Benjamin Becquet Date: Sun, 15 Dec 2013 17:43:20 +0100 Subject: [PATCH 562/816] Add Leaflet.MagnifyingGlass plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index ab53d0017d7..868a0c62d74 100644 --- a/plugins.md +++ b/plugins.md @@ -850,6 +850,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Alan Shaw + + + leaflet-zoom-min + + Allows you to display a small portion of the map at another zoom level, either at a fixed position or linked to the mouse movement, for a magnifying glass effect. + + Benjamin Becquet + + From 90a5c69b3617d6a011687197a72b9a11086070e6 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 16 Dec 2013 10:59:51 -0500 Subject: [PATCH 563/816] remove Leaflet IE stylesheet that's not needed anymore --- _layouts/default.html | 1 - examples/choropleth-example.html | 1 - examples/custom-icons-example.html | 1 - examples/geojson-example.html | 1 - examples/layers-control-example.html | 1 - examples/mobile-example.html | 1 - examples/quick-start-example.html | 1 - examples/quick-start.md | 5 +---- 8 files changed, 1 insertion(+), 11 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 06cd11b92b9..1da4d70996d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -28,7 +28,6 @@ - diff --git a/examples/choropleth-example.html b/examples/choropleth-example.html index 6c1295b6efc..98632dbad71 100644 --- a/examples/choropleth-example.html +++ b/examples/choropleth-example.html @@ -7,7 +7,6 @@ - {% endif %} + + ### Leaflet Source Code diff --git a/examples/quick-start.md b/examples/quick-start.md index 5b62aa9b3e1..b0c76606187 100644 --- a/examples/quick-start.md +++ b/examples/quick-start.md @@ -19,11 +19,11 @@ Before writing any code for the map, you need to do the following preparation st * Include Leaflet CSS file in the head section of your document: - + * Include Leaflet JavaScript file: - + * Put a `div` element with a certain `id` where you want your map to be: From 50012a66d051db043da2fb57cb683889a11a0c9f Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 12:20:32 +0300 Subject: [PATCH 657/816] update Leaflet to 0.7.3 & Mapbox URL to http --- _layouts/default.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 74e813ccf7b..dd1a6fa02fb 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -35,9 +35,8 @@ - - - + + {% if page.css %}{% endif %} @@ -46,7 +45,7 @@ 'CC-BY-SA, ' + 'Imagery © Mapbox'; - MB_URL = 'https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png'; + MB_URL = 'http://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png'; OSM_URL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; OSM_ATTRIB = '© OpenStreetMap contributors'; From 005fef5b6c82f4efe81b54cbb55cd3a95e93a96e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 12:21:24 +0300 Subject: [PATCH 658/816] remove release notice --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 3cd8f95d23f..59b80d4be4e 100644 --- a/index.md +++ b/index.md @@ -2,7 +2,7 @@ layout: default --- -

      November 18, 2013 — Leaflet 0.7 Release, MapBox & Plans for Future (Blog Post)

      + Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][]. From 2812151bac3e7b80b294d23d88589c12128d792a Mon Sep 17 00:00:00 2001 From: Brian Stoner Date: Wed, 26 Feb 2014 17:21:49 -0500 Subject: [PATCH 659/816] enforce maxZoom before applying paddingOffset, fixes #2489 --- src/map/Map.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/map/Map.js b/src/map/Map.js index 059a928dcb3..2aa2418fa9e 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -96,15 +96,16 @@ L.Map = L.Class.extend({ var paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]), paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]), - zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)), - paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), + zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)); + + zoom = (options.maxZoom) ? Math.min(options.maxZoom, zoom) : zoom; + + var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), swPoint = this.project(bounds.getSouthWest(), zoom), nePoint = this.project(bounds.getNorthEast(), zoom), center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom); - zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom; - return this.setView(center, zoom, options); }, From ada4e22bcbea19c9e589dd1fce25ba2e0f46bcf7 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Wed, 4 Jun 2014 08:06:49 +0200 Subject: [PATCH 660/816] Remove extra "the". Close #2723 --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index 914b411c7fa..b32b0f977e6 100644 --- a/reference.html +++ b/reference.html @@ -3374,7 +3374,7 @@

      Methods

      this - Resets the the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events. + Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events. From 9288f7fbd839a4ef585b8f7c8292f4ca63765da2 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Wed, 16 Apr 2014 09:20:58 +0200 Subject: [PATCH 661/816] Document requestAnimFrame and cancelAnimFrame --- reference.html | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/reference.html b/reference.html index 1a545e28eb1..b5fb01fe502 100644 --- a/reference.html +++ b/reference.html @@ -5258,19 +5258,23 @@

      Methods

      String Applies a unique key to the object and returns that key. Has an L.stamp shortcut. - limitExecByInterval( <Function> fn, From 0ec0e40609275f725c95551c7fc99c7697893b10 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Thu, 5 Jun 2014 02:02:00 +0400 Subject: [PATCH 662/816] Convert Map#getPixelBounds result to link --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index b918dad5bf7..d5a0878c246 100644 --- a/reference.html +++ b/reference.html @@ -777,7 +777,7 @@

      Methods for Getting Map State

      getPixelBounds() - Bounds + Bounds Returns the bounds of the current map view in projected pixel coordinates (sometimes useful in layer and overlay implementations). From 05c3f93757a124965a5e04bc9968d2ec343a56a8 Mon Sep 17 00:00:00 2001 From: davidchouse Date: Mon, 16 Jun 2014 23:50:05 -0400 Subject: [PATCH 663/816] Adding Leaflet.NavBar plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 85f68bfd143..63e4c9855f8 100644 --- a/plugins.md +++ b/plugins.md @@ -1106,6 +1106,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Robbie Trencheny + + + Leaflet Navigation Toolbar + + Leaflet control for simple back, forward and home navigation. + + David C + + From 3b1512b6a0485c171372f32236063cbf89fde51f Mon Sep 17 00:00:00 2001 From: Patrick Arlt Date: Tue, 17 Jun 2014 14:31:00 -0700 Subject: [PATCH 664/816] Esri Leaflet and Esri Leaflet Geocoder plugins --- plugins.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins.md b/plugins.md index 63e4c9855f8..8c28345aa4d 100644 --- a/plugins.md +++ b/plugins.md @@ -553,6 +553,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Tao Huang + + + Esri Leaflet + + A set of tools for using ArcGIS services with Leaflet. Support for map services, feature layers, ArcGIS Online tiles and more. + + Patrick Arlt + + @@ -610,6 +619,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Jakub Dostal + + + Esri Leaflet Geocoder + + A geocoding control with suggestions powered by the ArcGIS Online geocoder. + + Patrick Arlt + + From cb26ff59f35d7657da1c4f8152dbb91076b42094 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Thu, 26 Jun 2014 15:39:24 +0400 Subject: [PATCH 665/816] added some plugins --- plugins.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins.md b/plugins.md index 8c28345aa4d..11f39759f42 100644 --- a/plugins.md +++ b/plugins.md @@ -1133,6 +1133,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s David C + + + Leaflet LimitZoom + + Limits available zoom levels to a given list. + + Ilya Zverev + + @@ -1263,6 +1272,16 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Benjamin J DeLong + + + MapBBCode-related leaflet plugins + + Seven plugins for various features, independent of the MapBBCode library. + From circular and popup icons to buttons, layer switcher, better search and attribution. + + Ilya Zverev + + To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From 64e149f0a78e8f2ba20ab0ef34f7c45acd4edaab Mon Sep 17 00:00:00 2001 From: vicchi Date: Thu, 26 Jun 2014 13:01:56 +0100 Subject: [PATCH 666/816] Add OpenCage Data's geocoding search control plugin --- plugins.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins.md b/plugins.md index 8c28345aa4d..6bc53462f9d 100644 --- a/plugins.md +++ b/plugins.md @@ -21,7 +21,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.ellipse - Leaflet.ellipse place ellipses on map by specifying center point, semi-major axis, + Leaflet.ellipse place ellipses on map by specifying center point, semi-major axis, semi-minor axis, and tilt degrees from west. JD Fergason @@ -375,7 +375,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.ImageTransform Add support of image overlays with arbitrary perspective transformation. - Alexander Parshin, + Alexander Parshin, Sergey Alekseev @@ -628,6 +628,17 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Patrick Arlt + + + Leaflet.OpenCage.Search + + + A search plugin plugin that uses OpenCage Data's geocoding API. + + + The OpenCage team + + @@ -1257,7 +1268,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s WordPress Leaflet Map - Interactive and flexible shortcode to create multiple maps in posts and pages, + Interactive and flexible shortcode to create multiple maps in posts and pages, and to add multiple markers on those maps. Benjamin J DeLong From f754fb2f99bccbfe3df5b073c36a14532f015de1 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Fri, 27 Jun 2014 15:12:28 +0400 Subject: [PATCH 667/816] update LimitZoom repository --- plugins.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins.md b/plugins.md index 11f39759f42..6fe41369b0e 100644 --- a/plugins.md +++ b/plugins.md @@ -1135,9 +1135,10 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet LimitZoom + Leaflet LimitZoom - Limits available zoom levels to a given list. + Plugins to limit available zoom levels to a given list, either by + restricting zooming or by interpolating tiles. Ilya Zverev From 07d5b6448887cd36ae1ab8c660f8e43f80712802 Mon Sep 17 00:00:00 2001 From: zimmicz Date: Fri, 27 Jun 2014 21:12:35 +0200 Subject: [PATCH 668/816] Leaflet Coordinates Control pull request --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index e650a933e78..ec31ad12377 100644 --- a/plugins.md +++ b/plugins.md @@ -1153,6 +1153,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ilya Zverev + + + Leaflet Coordinates Control + + Captures mouseclick and displays its coordinates with easy way to copy them. + + Michal Zimmermann + + From 685998821648814e4fc1f2e61e6747353e63a484 Mon Sep 17 00:00:00 2001 From: rowanwins Date: Fri, 4 Jul 2014 20:48:07 +1000 Subject: [PATCH 669/816] Added easyPrint plugin --- plugins.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins.md b/plugins.md index 5146de91571..ccdf45f6a0f 100644 --- a/plugins.md +++ b/plugins.md @@ -1274,6 +1274,14 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s + + Leaflet-easyPrint + + A simple leaflet plugin which adds an icon to print the map. The resulting print page will strip ot the other content on the page and only print the leaflet map div. + Rowan Winsemius + + + Leaflet-active-area From d1cf1b70beb340982bd2e452bd780e43e6b1afec Mon Sep 17 00:00:00 2001 From: gerbsen Date: Tue, 8 Jul 2014 18:17:07 +0200 Subject: [PATCH 670/816] =?UTF-8?q?Added=20Route360=C2=B0=20Library=20to?= =?UTF-8?q?=20routing=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hey, This is my first plugin, so I don't exactly know how this works. Our library is based on leaflet and we have used the project structure of leaflet, we implemented a custom polygon layer and added some custom controls. A demo about the capabilities can be found at the demo site: http://route360.net/project/tutorial/ Any feedback is kindly appreciated. Cheers, Daniel --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5146de91571..b536a45511d 100644 --- a/plugins.md +++ b/plugins.md @@ -669,6 +669,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Norwegian Trekking Association + + + Route360° + + Route360° visualizes the area which is reachable from a set of starting points in a given time and gives detailed routing information (walk, bike, car and public transportation) to targets. + + Motion Intelligence GmbH + + From 5fffe157506b6f8d6e3fbd290103d939a9f15e91 Mon Sep 17 00:00:00 2001 From: Antoine Pultier Date: Thu, 10 Jul 2014 10:58:04 +0200 Subject: [PATCH 671/816] Add Leaflet.GameController in the plugins list --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index b536a45511d..5a6937f457a 100644 --- a/plugins.md +++ b/plugins.md @@ -1172,6 +1172,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Michal Zimmermann + + + Leaflet GameController + + Interaction handler providing support for gamepads. + + Antoine Pultier + + From 597c4b51e5e81c332383e00d0301f07c7a69410e Mon Sep 17 00:00:00 2001 From: rowanwins Date: Fri, 11 Jul 2014 09:24:06 +1000 Subject: [PATCH 672/816] Update plugins.md --- plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index ccdf45f6a0f..1253dbcffd8 100644 --- a/plugins.md +++ b/plugins.md @@ -1277,7 +1277,8 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet-easyPrint - A simple leaflet plugin which adds an icon to print the map. The resulting print page will strip ot the other content on the page and only print the leaflet map div. + A simple leaflet plugin which adds an icon to print the map. The resulting print page will strip ot the other content on the page and only print the leaflet map div. + Rowan Winsemius From c9118b118e90c06366d2dc6b77d092557ee4f761 Mon Sep 17 00:00:00 2001 From: rowanwins Date: Fri, 11 Jul 2014 09:25:27 +1000 Subject: [PATCH 673/816] Update plugins.md --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 1253dbcffd8..f00e762f7c4 100644 --- a/plugins.md +++ b/plugins.md @@ -1282,7 +1282,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Rowan Winsemius - + Leaflet-active-area From 390e925fe4096214e7a7b1c367b6acf8cd44f028 Mon Sep 17 00:00:00 2001 From: stefano cudini Date: Sun, 13 Jul 2014 18:29:24 +0200 Subject: [PATCH 674/816] add new plugin Leaflet Control Compass --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5a6f9a4a98e..91e06de2a6b 100644 --- a/plugins.md +++ b/plugins.md @@ -1181,6 +1181,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Antoine Pultier + + + Leaflet Control Compass + + A leaflet control plugin to build a simple rotating compass + + Stefano Cudini + + From f9d9489e7edad267a52c9feb540f0d28abad3a7d Mon Sep 17 00:00:00 2001 From: henrythasler Date: Tue, 15 Jul 2014 20:49:07 +0200 Subject: [PATCH 675/816] Update plugins.md Added Leaflet.Geodesic --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5a6f9a4a98e..ee06d3dfaad 100644 --- a/plugins.md +++ b/plugins.md @@ -397,6 +397,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Christopher Baines + + + Leaflet.Geodesic + + Draw geodesic (poly)lines. A geodesic line is the shortest path between two given positions on the earth surface. and You can also calculate the exact distance between two given points on the map. + + Henry Thasler + + From ba7dc5a5542623305b638e12debc78deb74546f5 Mon Sep 17 00:00:00 2001 From: Ondrej Zvara Date: Tue, 15 Jul 2014 21:44:24 +0200 Subject: [PATCH 676/816] Leaflet.MeasureAreaControl plugin pull request --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 5a6f9a4a98e..87e3b72f12b 100644 --- a/plugins.md +++ b/plugins.md @@ -1181,6 +1181,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Antoine Pultier + + + Leaflet.MeasureAreaControl + + Control for measuring element's area. + + Ondrej Zvara + + From 173a37e976ebbd6fd9dc403760520a8c103fa643 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Fri, 18 Jul 2014 15:40:44 +0200 Subject: [PATCH 677/816] Implement #2702 Add map.eachLayer() to reference page --- reference.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference.html b/reference.html index d5a0878c246..a5ced329ada 100644 --- a/reference.html +++ b/reference.html @@ -820,6 +820,18 @@

      Methods for Layers and Controls

      Boolean Returns true if the given layer is currently added to the map. + + eachLayer( + <Function> fn, + <Object> context? ) + + this + Iterates over the layers of the map, optionally specifying context of the iterator function. +
      map.eachLayer(function (layer) {
      +	layer.bindPopup('Hello');
      +});
      + + openPopup( From 311e988aa00e9424824055a21b527df47e0bcb14 Mon Sep 17 00:00:00 2001 From: Justin Manley Date: Wed, 23 Jul 2014 15:54:09 -0500 Subject: [PATCH 678/816] Add comment to removeEventListener doc noting that arguments to removeEventListener must be the same as those passed to addEventListener. --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index d5a0878c246..6f67d10b43c 100644 --- a/reference.html +++ b/reference.html @@ -4645,7 +4645,7 @@

      Methods

      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. + 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 addEventListener, you must pass the same context to removeEventListener in order to remove the listener. removeEventListener( From dde5e26a604ef2fde80452b0a42a044b92a61860 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 30 Jul 2014 10:02:31 +0200 Subject: [PATCH 679/816] Mention Leaflet.LineExtremities --- plugins.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index bfabfb3cbdb..6164dc44ac8 100644 --- a/plugins.md +++ b/plugins.md @@ -406,7 +406,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Henry Thasler - + + + Leaflet.LineExtremities + + Show symbols at the extremities of polylines, using SVG markers. + + Frédéric Bonifas + + From 9b8457b0125a46e8294c5c9007cc7bb5395bb007 Mon Sep 17 00:00:00 2001 From: Adam Ratcliffe Date: Thu, 31 Jul 2014 15:26:44 +1200 Subject: [PATCH 680/816] Added Leaflet.twoFingerZoom plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 6164dc44ac8..2013621e5ec 100644 --- a/plugins.md +++ b/plugins.md @@ -1207,6 +1207,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ondrej Zvara + + + Leaflet.twofingerZoom + + Interaction handler for touch devices enabling zooming out with a two finger tap. + + Adam Ratcliffe + + From 64039917bd2cc6fe4610fcbd506628591ba25133 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 3 Aug 2014 22:53:00 +0200 Subject: [PATCH 681/816] Suggestion to add Leaflet.Editable in plugins list --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index b75b7f2c4df..23a3e02ca58 100644 --- a/plugins.md +++ b/plugins.md @@ -1225,6 +1225,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Stefano Cudini + + + Leaflet.Editable + + Lightweight fully customisable and controlable drawing/editing plugin. + + Yohan Boniface + + From b5091248e11514efa4d93673275cf8270df1e998 Mon Sep 17 00:00:00 2001 From: M165437 Date: Mon, 4 Aug 2014 16:23:06 -0400 Subject: [PATCH 682/816] Add Leaflet.AccuratePosition plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 23a3e02ca58..1abe3ec36ed 100644 --- a/plugins.md +++ b/plugins.md @@ -1234,6 +1234,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Yohan Boniface + + + Leaflet.AccuratePosition + + Leaflet.AccuratePosition aims to provide a desired device location accuracy. + + Michael Schmidt-Voigt + + From 62ca8a825a4715be1ee2ace43c5df1c540aa6b1e Mon Sep 17 00:00:00 2001 From: Alexander Burtsev Date: Tue, 5 Aug 2014 17:50:00 +0400 Subject: [PATCH 683/816] Add Leaflet.geojsonCSS plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 1abe3ec36ed..30859668609 100644 --- a/plugins.md +++ b/plugins.md @@ -579,6 +579,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Patrick Arlt + + + Leaflet.geojsonCSS + + Geojson CSS implementation for Leaflet. + + Alexander Burtsev + + From d1f8aad7124376bb978eba43419677036beb698e Mon Sep 17 00:00:00 2001 From: "i.vasilevskiy" Date: Sat, 9 Aug 2014 21:54:42 +0400 Subject: [PATCH 684/816] Fix map click event name --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index b1ddc0c413a..784c69afb6f 100644 --- a/reference.html +++ b/reference.html @@ -4598,7 +4598,7 @@

      Options

      Events methods

      -

      A set of methods shared between event-powered classes (like Map). 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 'fire' event).

      +

      A set of methods shared between event-powered classes (like Map). 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 'click' event).

      Example

      From 773317c8f9e53f7f747105b02b4c547e92a4f69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20L=C3=B3pez?= Date: Wed, 13 Aug 2014 18:13:35 -0300 Subject: [PATCH 685/816] L.Class usage example Said L.Class where it should've said MyClass Usage example for L.Class options mechanism should refer to MyChildClass inheriting from MyClass instead of MyChildClass inheriting from L.Class directly. --- reference.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.html b/reference.html index b1ddc0c413a..5d72293d9bf 100644 --- a/reference.html +++ b/reference.html @@ -5069,7 +5069,7 @@

      Options

      } }); -var MyChildClass = L.Class.extend({ +var MyChildClass = MyClass.extend({ options: { myOption1: 'baz', myOption3: 5 From b2825f5ef576ba133ea6ea457be153c941ac1076 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 22 Aug 2014 16:11:25 +0400 Subject: [PATCH 686/816] Add leaflet.locationlist plugin --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 30859668609..035c4c06aef 100644 --- a/plugins.md +++ b/plugins.md @@ -1252,6 +1252,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Michael Schmidt-Voigt + + + Leaflet Locationlist + + A control to jump between predefined locations and zooms. + + Ivan Ignatyev + + From 0c110985691e3562616a8d29f33d3329c5d1d003 Mon Sep 17 00:00:00 2001 From: Wildhoney Date: Tue, 26 Aug 2014 21:57:33 +0100 Subject: [PATCH 687/816] Added L.FreeDraw --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 035c4c06aef..22e9fe0f310 100644 --- a/plugins.md +++ b/plugins.md @@ -17,6 +17,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Description Maintainer + + + Leaflet.ellipse + + Zoopla inspired freehand polygon creation using Leaflet.js and D3. + + Wildhoney + + Leaflet.ellipse From 31ac409b94f83c4936ff13f91b9935600cf2f94d Mon Sep 17 00:00:00 2001 From: Alex Nguyen Date: Tue, 26 Aug 2014 16:27:37 -0500 Subject: [PATCH 688/816] add Leaflet.defaultextent --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 035c4c06aef..3e50e65b1fe 100644 --- a/plugins.md +++ b/plugins.md @@ -1261,6 +1261,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ivan Ignatyev + + + Leaflet.defaultextent + + A control pan/zoom to the original (home) location when the map loaded. + + Alex Nguyen + + From 48effb1daf2f1737401e3213ef6a409c08f10471 Mon Sep 17 00:00:00 2001 From: Alex Nguyen Date: Tue, 26 Aug 2014 17:20:37 -0500 Subject: [PATCH 689/816] update description of Leaflet.defaultextent --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 3e50e65b1fe..4c9699af7a1 100644 --- a/plugins.md +++ b/plugins.md @@ -1265,7 +1265,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.defaultextent - A control pan/zoom to the original (home) location when the map loaded. + A control that returns to the original start extent of the map. Similar to the [HomeButton](https://developers.arcgis.com/javascript/jssamples/widget_home.html) widget. Alex Nguyen From 2a5ed5df1a0ab9bf4f16ba64be2b57670cf3e7cd Mon Sep 17 00:00:00 2001 From: Alex Nguyen Date: Tue, 26 Aug 2014 17:27:52 -0500 Subject: [PATCH 690/816] update description. Third time is a charm. --- plugins.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins.md b/plugins.md index 4c9699af7a1..e18a0cf653c 100644 --- a/plugins.md +++ b/plugins.md @@ -1264,9 +1264,11 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Leaflet.defaultextent - - A control that returns to the original start extent of the map. Similar to the [HomeButton](https://developers.arcgis.com/javascript/jssamples/widget_home.html) widget. - + + + A control that returns to the original start extent of the map. Similar to the HomeButton widget. + + Alex Nguyen From 88b9d6e90e9864a05307d91e60d96b79ad2c2340 Mon Sep 17 00:00:00 2001 From: Wildhoney Date: Wed, 27 Aug 2014 07:55:47 +0100 Subject: [PATCH 691/816] Changed Leaflet.FreeDraw label --- plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.md b/plugins.md index 22e9fe0f310..ebdbbf176d7 100644 --- a/plugins.md +++ b/plugins.md @@ -19,7 +19,7 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s - Leaflet.ellipse + Leaflet.FreeDraw Zoopla inspired freehand polygon creation using Leaflet.js and D3. From 972bc466eb196c3a11412b45dfbb391c6bcbbd11 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 3 Sep 2014 00:58:16 +0200 Subject: [PATCH 692/816] Update plugins.md Add Leaflet Yeoman generator. --- plugins.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins.md b/plugins.md index 836734b6af3..d97b5f189cf 100644 --- a/plugins.md +++ b/plugins.md @@ -1430,6 +1430,17 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Ilya Zverev + + + Leaflet Yeoman Generator + + + Yeoman generator that scaffolds out a basic Leaflet map application. + + + Moritz Klack + + To submit your own Leaflet plugin to this list, just send a pull request with the addition to Leaflet repo's [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages) (`plugins.md` file). From 997d9ac76b9cbe1c378dc172a444273bc63b5a10 Mon Sep 17 00:00:00 2001 From: Mathias Schneider Date: Wed, 10 Sep 2014 23:02:46 +0200 Subject: [PATCH 693/816] New plugin for SVG markers Vector SVG markers for Leaflet, with an option for Font Awesome/Twitter Bootstrap icons. Inspired by Leaflet.AwesomeMarkers. --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index d97b5f189cf..3b047ec4ec1 100644 --- a/plugins.md +++ b/plugins.md @@ -424,6 +424,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Frédéric Bonifas + + + Leaflet.VectorMarkers + + Vector SVG markers for Leaflet, with an option for Font Awesome/Twitter Bootstrap icons. + + Mathias Schneider + + From 9fe5f41fe09c43e3b4ccf634b5d90ce877f97b0d Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 11 Sep 2014 18:23:19 +0200 Subject: [PATCH 694/816] plugins: Added sidebar-v2 project see https://github.com/Turbo87/sidebar-v2 --- plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins.md b/plugins.md index 3b047ec4ec1..0794e2d76ba 100644 --- a/plugins.md +++ b/plugins.md @@ -1116,6 +1116,15 @@ While Leaflet is meant to be as lightweight as possible, and focuses on a core s Tobias Bieniek + + + sidebar-v2 + + Another responsive sidebar plugin. This time with tabs! + + Tobias Bieniek + + leaflet-zoom-min From 8fbcb7fa920776e40282ca675773e40b3d8ee703 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Wed, 17 Sep 2014 18:05:29 -0700 Subject: [PATCH 695/816] Change map --- _posts/2012-07-30-leaflet-0-4-released.md | 2 +- .../2012-08-20-guest-post-markerclusterer-0-1-released.md | 2 +- examples/layers-control-example.html | 2 +- examples/layers-control.md | 6 +++--- examples/mobile-example.html | 2 +- examples/quick-start-example.html | 2 +- examples/quick-start.md | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/_posts/2012-07-30-leaflet-0-4-released.md index ef3861891ec..18ab66e1d7d 100644 --- a/_posts/2012-07-30-leaflet-0-4-released.md +++ b/_posts/2012-07-30-leaflet-0-4-released.md @@ -215,7 +215,7 @@ Vladimir Agafonkin, Leaflet maintainer. - + + diff --git a/_layouts/post.html b/docs/_layouts/post.html similarity index 100% rename from _layouts/post.html rename to docs/_layouts/post.html diff --git a/_layouts/tutorial.html b/docs/_layouts/tutorial.html similarity index 100% rename from _layouts/tutorial.html rename to docs/_layouts/tutorial.html diff --git a/_posts/2012-07-30-leaflet-0-4-released.md b/docs/_posts/2012-07-30-leaflet-0-4-released.md similarity index 100% rename from _posts/2012-07-30-leaflet-0-4-released.md rename to docs/_posts/2012-07-30-leaflet-0-4-released.md diff --git a/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md b/docs/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md similarity index 100% rename from _posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md rename to docs/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md diff --git a/_posts/2012-08-20-guest-post-markerclusterer-0-1-released.md b/docs/_posts/2012-08-20-guest-post-markerclusterer-0-1-released.md similarity index 100% rename from _posts/2012-08-20-guest-post-markerclusterer-0-1-released.md rename to docs/_posts/2012-08-20-guest-post-markerclusterer-0-1-released.md diff --git a/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md b/docs/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md similarity index 100% rename from _posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md rename to docs/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md diff --git a/_posts/2013-01-17-leaflet-0-5-released.md b/docs/_posts/2013-01-17-leaflet-0-5-released.md similarity index 100% rename from _posts/2013-01-17-leaflet-0-5-released.md rename to docs/_posts/2013-01-17-leaflet-0-5-released.md diff --git a/_posts/2013-02-20-guest-post-draw.md b/docs/_posts/2013-02-20-guest-post-draw.md similarity index 100% rename from _posts/2013-02-20-guest-post-draw.md rename to docs/_posts/2013-02-20-guest-post-draw.md diff --git a/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md b/docs/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md similarity index 100% rename from _posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md rename to docs/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md diff --git a/_posts/2013-06-28-leaflet-plugin-authoring-guide.md b/docs/_posts/2013-06-28-leaflet-plugin-authoring-guide.md similarity index 100% rename from _posts/2013-06-28-leaflet-plugin-authoring-guide.md rename to docs/_posts/2013-06-28-leaflet-plugin-authoring-guide.md diff --git a/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md b/docs/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md similarity index 100% rename from _posts/2013-11-18-leaflet-0-7-released-plans-for-future.md rename to docs/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md diff --git a/atom.xml b/docs/atom.xml similarity index 100% rename from atom.xml rename to docs/atom.xml diff --git a/blog.md b/docs/blog.md similarity index 100% rename from blog.md rename to docs/blog.md diff --git a/download.md b/docs/download.md similarity index 100% rename from download.md rename to docs/download.md diff --git a/examples.md b/docs/examples.md similarity index 81% rename from examples.md rename to docs/examples.md index 3740f1cb41a..20d230d07e7 100644 --- a/examples.md +++ b/docs/examples.md @@ -8,42 +8,42 @@ title: Tutorials Every tutorial here comes with step-by-step code explanation and is easy enough even for beginner JavaScript developers. *** -[][1] +[][1] ### [Leaflet Quick Start Guide][1] A simple step-by-step guide that will quickly get you started with Leaflet basics, including setting up a Leaflet map (with Mapbox tiles) on your page, working with markers, polylines and popups, and dealing with events. *** -[][2] +[][2] ### [Leaflet on Mobile][2] In this tutorial, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location. *** -[][3] +[][3] ### [Markers with Custom Icons][3] In this pretty tutorial, you'll learn how to easily define your own icons for use by the markers you put on the map. *** -[][4] +[][4] ### [Using GeoJSON with Leaflet][4] In this tutorial, you'll learn how to create and interact with map vectors created from [GeoJSON][5] objects. *** -[][7] +[][7] ### [Interactive Choropleth Map][7] A case study of creating a colorful interactive [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map) of US States Population Density with GeoJSON and some custom controls. News websites will love this. *** -[][6] +[][6] ### [Layer Groups and Layers Control][6] diff --git a/examples/baseball-marker.png b/docs/examples/baseball-marker.png similarity index 100% rename from examples/baseball-marker.png rename to docs/examples/baseball-marker.png diff --git a/examples/choropleth-example.html b/docs/examples/choropleth-example.html similarity index 100% rename from examples/choropleth-example.html rename to docs/examples/choropleth-example.html diff --git a/examples/choropleth.md b/docs/examples/choropleth.md similarity index 100% rename from examples/choropleth.md rename to docs/examples/choropleth.md diff --git a/examples/custom-icons-example.html b/docs/examples/custom-icons-example.html similarity index 100% rename from examples/custom-icons-example.html rename to docs/examples/custom-icons-example.html diff --git a/examples/custom-icons.md b/docs/examples/custom-icons.md similarity index 100% rename from examples/custom-icons.md rename to docs/examples/custom-icons.md diff --git a/examples/geojson-example.html b/docs/examples/geojson-example.html similarity index 100% rename from examples/geojson-example.html rename to docs/examples/geojson-example.html diff --git a/examples/geojson.html b/docs/examples/geojson.html similarity index 100% rename from examples/geojson.html rename to docs/examples/geojson.html diff --git a/examples/layers-control-example.html b/docs/examples/layers-control-example.html similarity index 100% rename from examples/layers-control-example.html rename to docs/examples/layers-control-example.html diff --git a/examples/layers-control.md b/docs/examples/layers-control.md similarity index 100% rename from examples/layers-control.md rename to docs/examples/layers-control.md diff --git a/examples/mobile-example.html b/docs/examples/mobile-example.html similarity index 100% rename from examples/mobile-example.html rename to docs/examples/mobile-example.html diff --git a/examples/mobile.md b/docs/examples/mobile.md similarity index 100% rename from examples/mobile.md rename to docs/examples/mobile.md diff --git a/examples/quick-start-example.html b/docs/examples/quick-start-example.html similarity index 100% rename from examples/quick-start-example.html rename to docs/examples/quick-start-example.html diff --git a/examples/quick-start.md b/docs/examples/quick-start.md similarity index 100% rename from examples/quick-start.md rename to docs/examples/quick-start.md diff --git a/examples/sample-geojson.js b/docs/examples/sample-geojson.js similarity index 100% rename from examples/sample-geojson.js rename to docs/examples/sample-geojson.js diff --git a/examples/us-states.js b/docs/examples/us-states.js similarity index 100% rename from examples/us-states.js rename to docs/examples/us-states.js diff --git a/features.html b/docs/features.html similarity index 100% rename from features.html rename to docs/features.html diff --git a/index.md b/docs/index.md similarity index 100% rename from index.md rename to docs/index.md diff --git a/plugins.md b/docs/plugins.md similarity index 100% rename from plugins.md rename to docs/plugins.md diff --git a/reference-tpl.html b/docs/reference-tpl.html similarity index 100% rename from reference-tpl.html rename to docs/reference-tpl.html diff --git a/reference.html b/docs/reference.html similarity index 100% rename from reference.html rename to docs/reference.html From 94b63b4b560e2b4a2dd96d364444c1a8fb2e8573 Mon Sep 17 00:00:00 2001 From: John Laxson Date: Wed, 29 Apr 2015 22:34:52 -0700 Subject: [PATCH 773/816] TileLayer - Use correct tileSize when checking tile bounds When using options.bounds in combination with options.maxNativezoom, the tileSize used in _tileShouldBeLoaded can be incorrect, causing tiles to not get loaded or not get displayed. --- src/layer/tile/TileLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 6f8222e35bf..1892df1c7de 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -360,7 +360,7 @@ L.TileLayer = L.Class.extend({ } if (options.bounds) { - var tileSize = options.tileSize, + var tileSize = this._getTileSize(), nwPoint = tilePoint.multiplyBy(tileSize), sePoint = nwPoint.add([tileSize, tileSize]), nw = this._map.unproject(nwPoint), From 7986d001146a1070faf1aea63e3d27d1533bda51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20S=C3=A1nchez=20Ortega?= Date: Fri, 8 May 2015 16:11:35 +0200 Subject: [PATCH 774/816] Backport #2726 to stable --- build/bower.json | 1 - 1 file changed, 1 deletion(-) diff --git a/build/bower.json b/build/bower.json index 615371cbb35..ca85bde2744 100644 --- a/build/bower.json +++ b/build/bower.json @@ -2,7 +2,6 @@ "name": "leaflet", "description": "JavaScript library for mobile-friendly interactive maps", "main": [ - "dist/leaflet.js", "dist/leaflet.css", "dist/leaflet-src.js", "dist/images/layers-2x.png", From ec0b5ee49611a73b64ce7008a947a4712e7ba96a Mon Sep 17 00:00:00 2001 From: w8r Date: Mon, 18 May 2015 14:02:11 +0200 Subject: [PATCH 775/816] Canvas path holes fillRule fix --- src/layer/vector/canvas/Path.Canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/vector/canvas/Path.Canvas.js b/src/layer/vector/canvas/Path.Canvas.js index 0eaaf9713f0..818abc26db9 100644 --- a/src/layer/vector/canvas/Path.Canvas.js +++ b/src/layer/vector/canvas/Path.Canvas.js @@ -117,7 +117,7 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path : if (options.fill) { ctx.globalAlpha = options.fillOpacity; - ctx.fill(); + ctx.fill(options.fillRule || 'evenodd'); } if (options.stroke) { From 3cec7fc1d43f978e1152d939b1f091272472880b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20S=C3=A1nchez=20Ortega?= Date: Wed, 20 May 2015 09:58:34 +0200 Subject: [PATCH 776/816] Implement contextclick and dblclick for canvas paths, fixes #3481 --- src/layer/vector/canvas/Path.Canvas.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/layer/vector/canvas/Path.Canvas.js b/src/layer/vector/canvas/Path.Canvas.js index 818abc26db9..778d8afbcb4 100644 --- a/src/layer/vector/canvas/Path.Canvas.js +++ b/src/layer/vector/canvas/Path.Canvas.js @@ -132,15 +132,14 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path : _initEvents: function () { if (this.options.clickable) { - // TODO dblclick this._map.on('mousemove', this._onMouseMove, this); - this._map.on('click', this._onClick, this); + this._map.on('click dblclick contextmenu', this._fireMouseEvent, this); } }, - _onClick: function (e) { + _fireMouseEvent: function (e) { if (this._containsPoint(e.layerPoint)) { - this.fire('click', e); + this.fire(e.type, e); } }, From f3dca3b544776099d32020dd8d6578e2d19081ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20S=C3=A1nchez=20Ortega?= Date: Wed, 20 May 2015 13:20:35 +0200 Subject: [PATCH 777/816] Update outdated cloudmade tiles with OSM. --- debug/map/map-mobile.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debug/map/map-mobile.html b/debug/map/map-mobile.html index e9829c1c33d..bb228336931 100644 --- a/debug/map/map-mobile.html +++ b/debug/map/map-mobile.html @@ -18,12 +18,12 @@