/* Copyright (c) 2010, CloudMade Leaflet is a BSD-licensed JavaScript library for map display and interaction. Check out the source on GitHub: http://github.com/CloudMade/Leaflet/ */ var L={VERSION:"0.1a1",ROOT_URL:function(){for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b0},removeEventListener:function(a,b,c){if(!this.hasEventListeners(a))return this;for(var d=0,e=this._leaflet_events,f=e[a].length;d= this.min.x&&a.max.x<=this.max.x&&a.min.y>=this.min.y&&a.max.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={}; L.Util.extend(L.LineUtil,{simplify:function(a,b){if(!b)return a.slice();var c=b*b;a=this._reducePoints(a,c);return a=this._dpSimplify(a,c)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqPointToSegmentDist(a,b,c))},_dpSimplify:function(a,b){for(var c=0,d=0,e=1,f=a.length,g;ec){d=e;c=g}}if(c>=b){c=a.slice(0,d);d=a.slice(d);f=this._dpSimplify(c,b).slice(0,f-2);d=this._dpSimplify(d,b);return f.concat(d)}else return[a[0],a[f- 1]]},_reducePoints:function(a,b){for(var c=[a[0]],d=1,e=0,f=a.length;d1)return this._sqDist(a,c);b=new L.Point(b.x+d*f,b.y+e*f);return this._sqDist(a,b)}}); L.Util.extend(L.LineUtil,{clipSegment:function(a,b,c,d){var e=c.min,f=c.max;d=d?this._lastCode:this._getBitCode(a,c);var g=this._getBitCode(b,c);for(this._lastCode=g;;)if(d|g)if(d&g)return false;else{var h=d||g,i=b.x-a.x,k=b.y-a.y,j;if(h&8)j=new L.Point(a.x+i*(f.y-a.y)/k,f.y);else if(h&4)j=new L.Point(a.x+i*(e.y-a.y)/k,e.y);else if(h&2)j=new L.Point(f.x,a.y+k*(f.x-a.x)/i);else if(h&1)j=new L.Point(e.x,a.y+k*(e.x-a.x)/i);i=this._getBitCode(j,c);if(h==d){a=j;d=i}else{b=j;g=i}}else return[a,b]},_getBitCode:function(a, b){var c=0;if(a.xb.max.x)c|=2;if(a.yb.max.y)c|=8;return c}});L.DomEvent={addListener:function(a,b,c,d){function e(g){return c.call(d||a,g||L.DomEvent._getEvent())}var f=L.Util.stamp(c);a["_leaflet_"+b+f]=e;if("addEventListener"in a){b=="mousewheel"&&a.addEventListener("DOMMouseScroll",e,false);a.addEventListener(b,e,false)}else"attachEvent"in a&&a.attachEvent("on"+b,e)},removeListener:function(a,b,c){c=L.Util.stamp(c);c="_leaflet_"+b+c;handler=a[c];if("removeEventListener"in a){b=="mousewheel"&&a.removeEventListener("DOMMouseScroll",handler,false);a.removeEventListener(b, handler,false)}else"detachEvent"in a&&a.detachEvent("on"+b,handler);a[c]=null},_getEvent:function(){var a=window.event;if(!a)for(var b=arguments.callee.caller;b;){if((a=b.arguments[0])&&Event==a.constructor)break;b=b.caller}return a},stopPropagation:function(a){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true},disableClickPropagation:function(a){L.DomEvent.addListener(a,"mousedown",L.DomEvent.stopPropagation);L.DomEvent.addListener(a,"click",L.DomEvent.stopPropagation);L.DomEvent.addListener(a, "dblclick",L.DomEvent.stopPropagation)},preventDefault:function(a){if(a.preventDefault)a.preventDefault();else a.returnValue=false},getMousePosition:function(a,b){var c=new L.Point(a.pageX?a.pageX:a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.pageY?a.pageY:a.clientY+document.body.scrollTop+document.documentElement.scrollTop);return b?c.subtract(L.DomUtil.getCumulativeOffset(b)):c},getWheelDelta:function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta/120;if(a.detail)b=-a.detail/ 3;return b}};L.DomUtil={get:function(a){return typeof a=="string"?document.getElementById(a):a},getStyle:function(a,b){var c=a.style[b];if(typeof c=="undefined"&&a.currentStyle)c=a.currentStyle[b];if(typeof c=="undefined")c=(c=document.defaultView.getComputedStyle(a,null))?c[b]:null;return c=="auto"?null:c},getCumulativeOffset:function(a){var b=0,c=0;do{b+=a.offsetTop-a.scrollTop||0;c+=a.offsetLeft||0;a=a.offsetParent}while(a);return new L.Point(c,b)},create:function(a,b,c){a=document.createElement(a);a.className= b;c&&c.appendChild(a);return a},testProp:function(a){for(var b=document.documentElement.style,c=0;c1)){if(a.touches&&a.touches.length==1)a=a.touches[0];this._dragStartPos=L.DomUtil.getPosition(this._element);this._startX=a.clientX;this._startY=a.clientY;this._moved=false;this._disableTextSelection();this._setMovingCursor();L.DomEvent.addListener(document,L.Draggable.MOVE,this._onMove,this);L.DomEvent.addListener(document, L.Draggable.END,this._onUp,this)}}},_onMove:function(a){L.DomEvent.preventDefault(a);if(!(a.touches&&a.touches.length>1)){if(a.touches&&a.touches.length==1)a=a.touches[0];this._newPos=this._dragStartPos.add(new L.Point(a.clientX-this._startX,a.clientY-this._startY));this._updatePosition();if(!this._moved){this.fire("dragstart");this._moved=true}this.fire("drag")}},_updatePosition:function(){L.DomUtil.setPosition(this._element,this._newPos)},_onUp:function(){this._enableTextSelection();this._restoreCursor(); L.DomEvent.removeListener(document,L.Draggable.MOVE,this._onMove);L.DomEvent.removeListener(document,L.Draggable.END,this._onUp);this._moved&&this.fire("dragend")},_setMovingCursor:function(){this._bodyCursor=document.body.style.cursor;document.body.style.cursor="move"},_restoreCursor:function(){document.body.style.cursor=this._bodyCursor},_disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty();if(!this._onselectstart){this._onselectstart=document.onselectstart; document.onselectstart=L.Util.falseFn}},_enableTextSelection:function(){document.onselectstart=this._onselectstart;this._onselectstart=null}});L.Transition=L.Class.extend({includes:L.Mixin.Events,statics:{CUSTOM_PROPS_SETTERS:{position:L.DomUtil.setPosition},implemented:function(){return L.Transition.NATIVE||L.Transition.TIMER}},options:{easing:"ease",duration:0.5},_setProperty:function(a,b){var c=L.Transition.CUSTOM_PROPS_SETTERS;if(a in c)c[a](this._el,b);else this._el.style[a]=b}});L.Transition=L.Transition.extend({statics:function(){var a=L.DomUtil.TRANSITION_PROPERTY;return{NATIVE:!!a,TRANSITION:a,PROPERTY:a+"Property",DURATION:a+"Duration",EASING:a+"TimingFunction",END:a=="webkitTransition"||a=="OTransition"?a+"End":"transitionend",CUSTOM_PROPS_PROPERTIES:{position:L.Browser.webkit?L.DomUtil.TRANSFORM_PROPERTY:"top, left"}}}(),options:{fakeStepInterval:100},initialize:function(a,b){this._el=a;L.Util.extend(this.options,b);L.DomEvent.addListener(a,L.Transition.END,this._onTransitionEnd, this);this._onFakeStep=L.Util.bind(this._onFakeStep,this)},run:function(a){var b,c=[],d=L.Transition.CUSTOM_PROPS_PROPERTIES;for(b in a)if(a.hasOwnProperty(b)){b=d[b]?d[b]:b;b=b.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()});c.push(b)}this._el.style[L.Transition.DURATION]=this.options.duration+"s";this._el.style[L.Transition.EASING]=this.options.easing;this._el.style[L.Transition.PROPERTY]=c.join(", ");for(b in a)a.hasOwnProperty(b)&&this._setProperty(b,a[b]);this._inProgress=true;this.fire("start"); if(L.Transition.NATIVE)this._timer=setInterval(this._onFakeStep,this.options.fakeStepInterval);else this._onTransitionEnd()},_onFakeStep:function(){this.fire("step")},_onTransitionEnd:function(){if(this._inProgress){this._inProgress=false;clearInterval(this._timer);this._el.style[L.Transition.PROPERTY]="none";this.fire("step");this.fire("end")}}});L.Transition=L.Transition.NATIVE?L.Transition:L.Transition.extend({statics:{getTime:Date.now||function(){return+new Date},TIMER:true,EASINGS:{ease:[0.25,0.1,0.25,1],linear:[0,0,1,1],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},CUSTOM_PROPS_GETTERS:{position:L.DomUtil.getPosition},UNIT_RE:/^[\d\.]+(\D*)$/},options:{fps:50},initialize:function(a,b){this._el=a;L.Util.extend(this.options,b);var c=L.Transition.EASINGS[this.options.easing]||L.Transition.EASINGS.ease;this._p1= new L.Point(0,0);this._p2=new L.Point(c[0],c[1]);this._p3=new L.Point(c[2],c[3]);this._p4=new L.Point(1,1);this._step=L.Util.bind(this._step,this);this._interval=Math.round(1E3/this.options.fps)},run:function(a){this._props={};var b=L.Transition.CUSTOM_PROPS_GETTERS,c=L.Transition.UNIT_RE;this.fire("start");for(var d in a)if(a.hasOwnProperty(d)){var e={};if(d in b)e.from=b[d](this._el);else{var f=this._el.style[d].match(c);e.from=parseFloat(f[0]);e.unit=f[1]}e.to=a[d];this._props[d]=e}clearInterval(this._timer); this._timer=setInterval(this._step,this._interval);this._startTime=L.Transition.getTime()},_step:function(){var a=L.Transition.getTime()-this._startTime,b=this.options.duration*1E3;if(a= b.lat&&a.lat<=c.lat&&d.lng>=b.lng&&a.lng<=c.lng}});L.Projection={};L.Projection.Mercator={MAX_LATITUDE:function(){var a=Math.exp(2*Math.PI);return Math.asin((a-1)/(a+1))*L.LatLng.RAD_TO_DEG}(),project:function(a){var b=L.LatLng.DEG_TO_RAD,c=L.Projection.Mercator.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.DEG_TO_RAD;return new L.LatLng((2*Math.atan(Math.exp(a.y))-Math.PI/2)/c,a.x/c,b)}};L.TileLayer=L.Class.extend({includes:L.Mixin.Events,options:{tileSize:256,minZoom:0,maxZoom:18,subdomains:"abc",copyright:"",unloadInvisibleTiles:L.Browser.mobileWebkit,updateWhenIdle:L.Browser.mobileWebkit,errorTileUrl:""},initialize:function(a,b){L.Util.extend(this.options,b);this._url=a;if(typeof this.options.subdomains=="string")this.options.subdomains=this.options.subdomains.split("")},onAdd:function(a){this._map=a;this._initContainer();this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg= "no";var b=this.options.tileSize;this._tileImg.style.width=b+"px";this._tileImg.style.height=b+"px";a.on("viewreset",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._map.off("viewreset",this._reset);this.options.updateWhenIdle?this._map.off("moveend", this._update):this._map.off("move",this._limitedUpdate)},_initContainer:function(){var a=this._map.getPanes().tilePane;if(!this._container||a.empty)this._container=L.DomUtil.create("div","leaflet-layer",a)},_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._loadTilesFromCenterOut(c);this.options.unloadInvisibleTiles&&this._unloadOtherTiles(c)},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)},_loadTilesFromCenterOut: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(f,g){return f.distanceTo(c)-g.distanceTo(c)}); a=0;for(d=b.length;aa.max.x||ba.max.y){this._container.removeChild(this._tiles[d]);delete this._tiles[d]}}},_loadTile:function(a){var b=this._map.getPixelOrigin();b=a.multiplyBy(this.options.tileSize).subtract(b);var c=this._map.getZoom(),d=1<=d)){d=this._tileImg.cloneNode(false); this._tiles[a.x+":"+a.y]=d;L.DomUtil.setPosition(d,b);d._leaflet_layer=this;d.onload=this._tileOnLoad;d.onerror=this._tileOnError;d.onselectstart=d.onmousemove=L.Util.falseFn;d.src=this.getTileUrl(a,c);this._container.appendChild(d)}},_tileOnLoad:function(){this.className+=" leaflet-tile-loaded";this._leaflet_layer.fire("tileload",{tile:this})},_tileOnError:function(){this._leaflet_layer.fire("tileerror",{tile:this,url:this.src});var a=this._leaflet_layer.options.errorTileUrl;if(a)this.src=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=L.DomUtil.create("img","leaflet-image-layer");this._image.style.visibility="hidden";this._image.style.position="absolute";L.Util.extend(this._image,{galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:this._onImageLoad,src:this._url});this._map.getPanes().overlayPane.appendChild(this._image);this._map.on("viewreset",this._reset, this);this._reset()},_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:true,closeButton:true,closeOnMapClick:true,offset:new L.Point(0,0),autoPanPadding:new L.Point(5,5)},initialize:function(a,b,c){this._latlng=a;this._content=b;L.Util.extend(this.options,c)},onAdd:function(a){this._map=a;if(!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); this._map.on("click",this._close,this);this._update();this._container.style.opacity="1"},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"},_close:function(){this._map.removeLayer(this)},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-popup");L.DomEvent.disableClickPropagation(this._container);this._closeButton=L.DomUtil.create("a","leaflet-popup-close-button", this._container);this._closeButton.href="#close";this._closeButton.onclick=L.Util.bind(this._onCloseButtonClick,this);this._wrapper=L.DomUtil.create("div","leaflet-popup-content-wrapper",this._container);this._contentNode=L.DomUtil.create("div","leaflet-popup-content",this._wrapper);this._tipContainer=L.DomUtil.create("div","leaflet-popup-tip-container",this._container);this._tip=L.DomUtil.create("div","leaflet-popup-tip",this._tipContainer)},_update:function(){this._container.style.visibility="hidden"; this._updateLayout();this._updatePosition();this._container.style.visibility="";this._adjustPan()},_updateContent:function(){this._contentNode.innerHTML=this._content},_updateLayout:function(){this._container.style.width="";this._container.style.whiteSpace="nowrap";var a=this._container.offsetWidth;this._container.style.width=(a>this.options.maxWidth?this.options.maxWidth:a)+"px";this._container.style.whiteSpace="";this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var a= this._map.latLngToLayerPoint(this._latlng);this._containerBottom=-a.y-this.options.offset.y;this._containerLeft=a.x-this._containerWidth/2+this.options.offset.x;this._container.style.bottom=this._containerBottom+"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;if(c.x||c.y)this._map.panBy(c)}},_onCloseButtonClick:function(){this._close();return false}});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._createImg("icon")},createShadow:function(){return this._createImg("shadow")},_createImg:function(a){var b=L.DomUtil.create("img","leaflet-marker-"+a),c=this[a+"Size"];b.src=this[a+"Url"];if(this.iconAnchor){b.style.marginLeft= -this.iconAnchor.x+"px";b.style.marginTop=-this.iconAnchor.y+"px"}else L.DomEvent.addListener(b,"load",this._setAnchorToCenter);if(c){b.width=c.x;b.height=c.y}return b},_setAnchorToCenter:function(){this.style.marginLeft=-this.width/2+"px";this.style.marginTop=-this.height/2+"px"}});L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon,clickable:true},initialize:function(a,b){this._latlng=a;L.Util.extend(this.options,b)},onAdd:function(a){this._map=a;if(!this._icon){this._icon=this.options.icon.createIcon();a._panes.markerPane.appendChild(this._icon);this._initInteraction()}if(!this._shadow){this._shadow=this.options.icon.createShadow();a._panes.shadowPane.appendChild(this._shadow)}a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){this._icon&& a._panes.markerPane.removeChild(this._icon);this._shadow||a._panes.shadowPane.removeChild(this._shadow);a.off("viewreset",this._reset,this)},getLatLng:function(){return this._latlng},_reset:function(){var a=this._map.latLngToLayerPoint(this._latlng).round();L.DomUtil.setPosition(this._icon,a);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,"mousedown", this._fireMouseEvent,this);L.DomEvent.addListener(this._icon,"click",this._fireMouseEvent,this);L.DomEvent.addListener(this._icon,"dblclick",this._fireMouseEvent,this)}},_fireMouseEvent:function(a){this.fire(a.type);L.DomEvent.stopPropagation(a)}});L.Marker.include({openPopup:function(){this._map.closePopup();this._popup&&this._map.openPopup(this._popup);return this},bindPopup:function(a,b){b=L.Util.extend({offset:this.options.icon.popupAnchor},b);this._popup=new L.Popup(this._latlng,a,b);this.on("click",this.openPopup,this);return this}});L.Path=L.Class.extend({statics:function(){return{SVG_NS:"http://www.w3.org/2000/svg",SVG:!!(document.createElementNS&&document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),CLIP_PADDING:0.5}}(),options:{stroke:true,color:"#0033ff",weight:5,opacity:0.5,fill:false,fillColor:null,fillOpacity:0.2},initialize:function(a){L.Util.extend(this.options,a)},onAdd:function(a){this._map=a;this._initElements();this._updatePath()},onRemove:function(a){a._pathRoot.removeChild(this._container)}, setPathString:function(a){this._pathStr=a;this._path&&this._updatePath()},_initElements:function(){this._initRoot();this._initPath();this._initStyle()},_initRoot:function(){if(!this._map._pathRoot){this._map._pathRoot=this._createElement("svg");this._map._panes.overlayPane.appendChild(this._map._pathRoot);this._map.on("moveend",this._updateSvgViewport,this);this._updateSvgViewport()}},_updateSvgViewport:function(){this._updateViewport();var a=this._map._pathViewport,b=a.min,c=a.max;a=c.x-b.x;c=c.y- b.y;var d=this._map._pathRoot;d.setAttribute("width",a);d.setAttribute("height",c);d.setAttribute("viewBox",[b.x,b.y,a,c].join(" "));L.DomUtil.setPosition(d,b)},_updateViewport:function(){var a=L.Path.CLIP_PADDING,b=this._map.getSize(),c=L.DomUtil.getPosition(this._map._mapPane).multiplyBy(-1).subtract(b.multiplyBy(a));a=c.add(b.multiplyBy(1+a*2));this._map._pathViewport=new L.Bounds(c,a)},_initPath:function(){this._container=this._createElement("g");this._path=this._createElement("path");this._container.appendChild(this._path); this._map._pathRoot.appendChild(this._container)},_initStyle:function(){if(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._path.setAttribute("fill","none");this._updateStyle()},_updateStyle:function(){if(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)}if(this.options.fill){this._path.setAttribute("fill",this.options.fillColor||this.options.color);this._path.setAttribute("fill-opacity",this.options.fillOpacity)}},_updatePath:function(){this._path.setAttribute("d",this._pathStr)},_createElement:function(a){return document.createElementNS(L.Path.SVG_NS,a)}});L.Path.VML=function(){var a=document.createElement("div");a.innerHTML='';a=a.firstChild;a.style.behavior="url(#default#VML)";return a&&typeof a.adj=="object"}(); L.Path=!L.Path.VML?L.Path:L.Path.extend({_createElement:function(){document.createStyleSheet().addRule(".lvml","behavior:url(#default#VML);display: inline-block; position: absolute;");try{document.namespaces.add("lvml","urn:schemas-microsoft-com:vml");return function(b){return document.createElement("')}}catch(a){return function(b){return document.createElement("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initRoot:function(){if(!this._map._pathRoot){this._map._pathRoot= document.createElement("div");this._map._pathRoot.className="leaflet-vml-container";this._map._panes.overlayPane.appendChild(this._map._pathRoot);this._map.on("moveend",this._updateViewport,this);this._updateViewport()}},_initPath:function(){this._container=this._createElement("shape");this._container.className+=" leaflet-vml-shape";this._container.coordsize="1 1";this._path=this._createElement("path");this._container.appendChild(this._path);this._map._pathRoot.appendChild(this._container)},_initStyle:function(){if(this.options.stroke){this._stroke= this._createElement("stroke");this._stroke.endcap="round";this._container.appendChild(this._stroke)}if(this.options.fill){this._container.filled=true;this._fill=this._createElement("fill");this._container.appendChild(this._fill)}else this._container.filled=false;this._updateStyle()},_updateStyle:function(){if(this.options.stroke){this._stroke.weight=this.options.weight+"px";this._stroke.color=this.options.color;this._stroke.opacity=this.options.opacity}if(this.options.fill){this._fill.color=this.options.fillColor|| this.options.color;this._fill.opacity=this.options.fillOpacity}},_updatePath:function(){this._container.style.display="none";this._path.v=this._pathStr;this._container.style.display=""}});L.Polyline=L.Path.extend({initialize:function(a,b){L.Path.prototype.initialize.call(this,b);this._latlngs=a},options:{smoothFactor:1,noClip:false},onAdd:function(a){this._map=a;this._initElements();this._projectLatlngs();this._updatePath();a.on("viewreset",this._projectLatlngs,this);a.on("moveend",this._updatePath,this)},_projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;a=7E5&&L.Browser.gecko)this._draggable._updatePosition=L.Util.deferExecByInterval(this._draggable._updatePosition,0,this._draggable);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=true}},disable:function(){if(this._enabled){this._draggable.disable();this._enabled=false}},moved:function(){return this._draggable._moved},_onDragStart:function(){this._map.fire("movestart");this._map.fire("dragstart")},_onDrag:function(){this._map.fire("move");this._map.fire("drag")},_onDragEnd:function(){this._map.fire("moveend");this._map.fire("dragend")}});L.Handler.TouchZoom=L.Handler.extend({enable:function(){if(!(!L.Browser.mobileWebkit||this._enabled)){L.DomEvent.addListener(this._map._container,"touchstart",this._onTouchStart,this);this._enabled=true}},disable:function(){if(this._enabled){L.DomEvent.removeListener(this._map._container,"touchstart",this._onTouchStart,this);this._enabled=false}},_onTouchStart:function(a){if(!(!a.touches||a.touches.length!=2)){var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]), d=this._map.containerPointToLayerPoint(this._map.getSize().divideBy(2));this._startCenter=b.add(c).divideBy(2,true);this._startDist=b.distanceTo(c);this._startTransform=this._map._mapPane.style.webkitTransform;this._moved=false;this._centerOffset=d.subtract(this._startCenter);L.DomEvent.addListener(document,"touchmove",this._onTouchMove,this);L.DomEvent.addListener(document,"touchend",this._onTouchEnd,this);L.DomEvent.preventDefault(a)}},_onTouchMove:function(a){if(!(!a.touches||a.touches.length!= 2)){if(!this._moved){this._map._panes.popupPane.style.display="none";this._moved=true}var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]);this._scale=b.distanceTo(c)/this._startDist;this._delta=b.add(c).divideBy(2,true).subtract(this._startCenter);this._map._mapPane.style.webkitTransform=[this._startTransform,L.DomUtil.getTranslateString(this._delta),L.DomUtil.getScaleString(this._scale,this._startCenter)].join(" ");L.DomEvent.preventDefault(a)}}, _onTouchEnd:function(a){if(!(!a.touches||a.touches.length>=2||!this._scale)){a=this._map.getZoom()+Math.round(Math.log(this._scale)/Math.LN2);var b=this._centerOffset.subtract(this._delta).divideBy(this._scale);this._map.setView(this._map.unproject(this._map.getPixelOrigin().add(this._startCenter).add(b)),a,true);this._map._panes.popupPane.style.display="";this._scale=null;L.DomEvent.removeListener(document,"touchmove",this._onTouchMove);L.DomEvent.removeListener(document,"touchend",this._onTouchEnd)}}});L.Handler.ScrollWheelZoom=L.Handler.extend({enable:function(){if(!this._enabled){L.DomEvent.addListener(this._map._container,"mousewheel",this._onWheelScroll,this);this._delta=0;this._enabled=true}},disable:function(){if(this._enabled){L.DomEvent.removeListener(this._map._container,"mousewheel",this._onWheelScroll);this._enabled=false}},_onWheelScroll:function(a){this._delta+=L.DomEvent.getWheelDelta(a);this._lastMousePos=this._map.mouseEventToContainerPoint(a);clearTimeout(this._timer);this._timer= setTimeout(L.Util.bind(this._performZoom,this),50);L.DomEvent.preventDefault(a)},_performZoom:function(){var a=Math.round(this._delta);this._delta=0;if(a){var b=this._getCenterForScrollWheelZoom(this._lastMousePos,a);a=this._map.getZoom()+a;this._map._limitZoom(a)!=this._map._zoom&&this._map.setView(b,a)}},_getCenterForScrollWheelZoom:function(a,b){var c=this._map.getPixelBounds().getCenter(),d=this._map.getSize().divideBy(2);d=a.subtract(d).multiplyBy(1-Math.pow(2,-b));return this._map.unproject(c.add(d))}});L.Handler.DoubleClickZoom=L.Handler.extend({enable:function(){if(!this._enabled){this._map.on("dblclick",this._onDoubleClick,this._map);this._enabled=true}},disable:function(){if(this._enabled){this._map.off("dblclick",this._onDoubleClick,this._map);this._enabled=false}},_onDoubleClick:function(a){this.setView(a.position,this._zoom+1)}});L.Map=L.Class.extend({includes:L.Mixin.Events,options:{projection:L.Projection.Mercator,transformation:new L.Transformation(0.5/Math.PI,0.5,-0.5/Math.PI,0.5),scaling:function(a){return 256*(1<