🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-leaflet-magnifying-glass

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-leaflet-magnifying-glass - npm Package Compare versions

Comparing version

to
0.1.1

lib/cloneLayer.js

2

dist/react-leaflet-magnifying-glass.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("leaflet"),require("react-leaflet")):"function"==typeof define&&define.amd?define(["leaflet","react-leaflet"],e):"object"==typeof exports?exports.ReactLeafletMagnifyingGlass=e(require("leaflet"),require("react-leaflet")):t.ReactLeafletMagnifyingGlass=e(t.L,t.ReactLeaflet)}(this,function(t,e){return function(t){function e(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),a=i(n);e.default=a.default},function(t,e){"use strict";L.Control.MagnifyingGlass=L.Control.extend({_magnifyingGlass:!1,options:{position:"topleft",title:"Toggle Magnifying Glass",forceSeparateButton:!1},initialize:function(t,e){this._magnifyingGlass=t;for(var o in e)e.hasOwnProperty(o)&&this.options.hasOwnProperty(o)&&(this.options[o]=e[o])},onAdd:function(t){var e,o="leaflet-control-magnifying-glass";return e=t.zoomControl&&!this.options.forceSeparateButton?t.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this._createButton(this.options.title,o,e,this._clicked,t,this._magnifyingGlass),e},_createButton:function(t,e,o,i,n,a){var s=L.DomUtil.create("a",e,o);return s.href="#",s.title=t,L.DomEvent.addListener(s,"click",L.DomEvent.stopPropagation).addListener(s,"click",L.DomEvent.preventDefault).addListener(s,"click",function(){i(n,a)},n),s},_clicked:function(t,e){e&&(t.hasLayer(e)?t.removeLayer(e):e.addTo(t))}}),L.control.magnifyingglass=function(t,e){return new L.Control.MagnifyingGlass(t,e)}},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}(),l=o(5),p=o(4),f=i(p);o(3),o(1);var u=function(t){function e(){return n(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return s(e,t),r(e,[{key:"createLeafletElement",value:function(t){var e=t.position,o=void 0===e?"topleft":e,i=t.forceSeparateButton,n=void 0!==i&&i,a=t.radius,s=void 0===a?100:a,r=t.zoomOffset,l=void 0===r?3:r,p=t.fixedZoom,u=void 0===p?-1:p,c={position:o,forceSeparateButton:n},h="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",d={attribution:'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'},m=f.default.magnifyingGlass({radius:s,zoomOffset:l,fixedZoom:u,layers:[f.default.tileLayer(h,d)]});return f.default.control.magnifyingglass(m,c)}},{key:"componentDidMount",value:function(){var t=this.context.map;console.log(this.context),this.leafletElement.addTo(t)}}]),e}(l.MapControl);e.default=u},function(t,e){"use strict";L.MagnifyingGlass=L.Layer.extend({options:{radius:100,zoomOffset:3,layers:[],fixedPosition:!1,latLng:[0,0],fixedZoom:-1},initialize:function(t){L.Util.setOptions(this,t),this._fixedZoom=this.options.fixedZoom!=-1,this._mainMap=null,this._glassMap=null},getMap:function(){return this._glassMap},_createMiniMap:function(t){return new L.Map(t,{layers:this.options.layers,zoom:this._getZoom(),maxZoom:this._mainMap.getMaxZoom(),minZoom:this._mainMap.getMinZoom(),crs:this._mainMap.options.crs,fadeAnimation:!1,attributionControl:!1,zoomControl:!1,boxZoom:!1,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,dragging:!1,keyboard:!1})},_getZoom:function(){return this._fixedZoom?this.options.fixedZoom:this._mainMap.getZoom()+this.options.zoomOffset},_updateZoom:function(){this._glassMap.setZoom(this._getZoom())},setRadius:function(t){this.options.radius=t,this._wrapperElt&&(this._wrapperElt.style.width=2*this.options.radius+"px",this._wrapperElt.style.height=2*this.options.radius+"px")},setLatLng:function(t){this.options.latLng=t,this._update(t)},_updateFromMouse:function(t){this._update(t.latlng,t.layerPoint)},_updateFixed:function(){this._update(this.options.latLng)},_update:function(t,e){this._glassMap.setView(t,this._getZoom(),{pan:{animate:!1}}),e=e||this._mainMap.latLngToLayerPoint(t),this._wrapperElt.style.left=e.x-this.options.radius+"px",this._wrapperElt.style.top=e.y-this.options.radius+"px"},onAdd:function(t){this._mainMap=t,this._wrapperElt=L.DomUtil.create("div","leaflet-magnifying-glass");var e=L.DomUtil.create("div","",this._wrapperElt);L.Browser.webkit&&L.DomUtil.addClass(e,"leaflet-magnifying-glass-webkit"),this._glassMap=this._createMiniMap(e),L.DomEvent.addListener(this._wrapperElt,"click",this._fireClick,this);var o=this.options;return this.setRadius(o.radius),this.setLatLng(o.latLng),this._glassMap.whenReady(function(){o.fixedPosition?(this._mainMap.on("zoomend",this._updateFixed,this),L.DomUtil.addClass(this._wrapperElt,"leaflet-zoom-hide")):(this._mainMap.on("mousemove",this._updateFromMouse,this),this._fixedZoom||this._mainMap.on("zoomend",this._updateZoom,this))},this),t.getPanes().popupPane.appendChild(this._wrapperElt),this._glassMap.invalidateSize(),this},_fireClick:function(t){this.fire("click",t),L.DomEvent.stopPropagation(t)},onRemove:function(t){t.off("viewreset",this._updateFixed,this),t.off("mousemove",this._updateFromMouse,this),t.off("zoomend",this._updateZoom,this);for(var e=0,o=this.options.layers.length;e<o;e++)this._glassMap.removeLayer(this.options.layers[e]);return this._glassMap.remove(),L.DomEvent.removeListener(this._wrapperElt,"click",this._fireClick),t.getPanes().popupPane.removeChild(this._wrapperElt),this._mainMap=null,this}}),L.magnifyingGlass=function(t){return new L.MagnifyingGlass(t)}},function(e,o){e.exports=t},function(t,o){t.exports=e}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("leaflet"),require("react-leaflet")):"function"==typeof define&&define.amd?define(["leaflet","react-leaflet"],n):"object"==typeof exports?exports.ReactLeafletMagnifyingGlass=n(require("leaflet"),require("react-leaflet")):t.ReactLeafletMagnifyingGlass=n(t.L,t.ReactLeaflet)}(this,function(t,n){return function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(4),o=r(i);n.default=o.default},function(t,n){function e(t,n){var e=t[1]||"",i=t[3];if(!i)return e;if(n&&"function"==typeof btoa){var o=r(i),a=i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"});return[e].concat(a).concat([o]).join("\n")}return[e].join("\n")}function r(t){var n=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),e="sourceMappingURL=data:application/json;charset=utf-8;base64,"+n;return"/*# "+e+" */"}t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var r=e(n,t);return n[2]?"@media "+n[2]+"{"+r+"}":r}).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(e&&!a[2]?a[2]=e:e&&(a[2]="("+a[2]+") and ("+e+")"),n.push(a))}},n}},function(t,n,e){function r(t,n){for(var e=0;e<t.length;e++){var r=t[e],i=d[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(f(r.parts[o],n))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(f(r.parts[o],n));d[r.id]={id:r.id,refs:1,parts:a}}}}function i(t,n){for(var e=[],r={},i=0;i<t.length;i++){var o=t[i],a=n.base?o[0]+n.base:o[0],u=o[1],s=o[2],l=o[3],f={css:u,media:s,sourceMap:l};r[a]?r[a].parts.push(f):e.push(r[a]={id:a,parts:[f]})}return e}function o(t,n){var e=g(t.insertInto);if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=_[_.length-1];if("top"===t.insertAt)r?r.nextSibling?e.insertBefore(n,r.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),_.push(n);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function a(t){t.parentNode.removeChild(t);var n=_.indexOf(t);n>=0&&_.splice(n,1)}function u(t){var n=document.createElement("style");return t.attrs.type="text/css",l(n,t.attrs),o(t,n),n}function s(t){var n=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",l(n,t.attrs),o(t,n),n}function l(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function f(t,n){var e,r,i,o;if(n.transform&&t.css){if(o=n.transform(t.css),!o)return function(){};t.css=o}if(n.singleton){var l=b++;e=m||(m=u(n)),r=c.bind(null,e,l,!1),i=c.bind(null,e,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=s(n),r=h.bind(null,e,n),i=function(){a(e),e.href&&URL.revokeObjectURL(e.href)}):(e=u(n),r=p.bind(null,e),i=function(){a(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}function c(t,n,e,r){var i=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=L(n,i);else{var o=document.createTextNode(i),a=t.childNodes;a[n]&&t.removeChild(a[n]),a.length?t.insertBefore(o,a[n]):t.appendChild(o)}}function p(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function h(t,n,e){var r=e.css,i=e.sourceMap,o=void 0===n.convertToAbsoluteUrls&&i;(n.convertToAbsoluteUrls||o)&&(r=A(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),u=t.href;t.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}var d={},v=function(t){var n;return function(){return"undefined"==typeof n&&(n=t.apply(this,arguments)),n}},y=v(function(){return window&&document&&document.all&&!window.atob}),g=function(t){var n={};return function(e){return"undefined"==typeof n[e]&&(n[e]=t.call(this,e)),n[e]}}(function(t){return document.querySelector(t)}),m=null,b=0,_=[],A=e(9);t.exports=function(t,n){n=n||{},n.attrs="object"==typeof n.attrs?n.attrs:{},"undefined"==typeof n.singleton&&(n.singleton=y()),"undefined"==typeof n.insertInto&&(n.insertInto="head"),"undefined"==typeof n.insertAt&&(n.insertAt="bottom");var e=i(t,n);return r(e,n),function(t){for(var o=[],a=0;a<e.length;a++){var u=e[a],s=d[u.id];s.refs--,o.push(s)}if(t){var l=i(t,n);r(l,n)}for(var a=0;a<o.length;a++){var s=o[a];if(0===s.refs){for(var f=0;f<s.parts.length;f++)s.parts[f]();delete d[s.id]}}}};var L=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n){"use strict";L.Control.MagnifyingGlass=L.Control.extend({_magnifyingGlass:!1,options:{position:"topleft",title:"Toggle Magnifying Glass",forceSeparateButton:!1},initialize:function(t,n){this._magnifyingGlass=t;for(var e in n)n.hasOwnProperty(e)&&this.options.hasOwnProperty(e)&&(this.options[e]=n[e])},onAdd:function(t){var n,e="leaflet-control-magnifying-glass";return n=t.zoomControl&&!this.options.forceSeparateButton?t.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this._createButton(this.options.title,e,n,this._clicked,t,this._magnifyingGlass),n},_createButton:function(t,n,e,r,i,o){var a=L.DomUtil.create("a",n,e);return a.href="#",a.title=t,L.DomEvent.addListener(a,"click",L.DomEvent.stopPropagation).addListener(a,"click",L.DomEvent.preventDefault).addListener(a,"click",function(){r(i,o)},i),a},_clicked:function(t,n){n&&(t.hasLayer(n)?t.removeLayer(n):n.addTo(t))}}),L.control.magnifyingglass=function(t,n){return new L.Control.MagnifyingGlass(t,n)}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}(),s=e(14),l=e(13),f=r(l),c=e(12),p=r(c),h=e(5),d=r(h);e(6),e(3),e(11),e(10);var v=function(t){function n(){return i(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return a(n,t),u(n,[{key:"createLeafletElement",value:function(t){var n=this,e=this.context.map,r=t.position,i=void 0===r?"topleft":r;t.forceSeparateButton;this.layers={},e.on("layeradd",function(t){console.log(t),n._addLayer(t)}),e.on("layerremove",function(t){n._removeLayer(t)});var o={position:i,forceSeparateButton:!0};return f.default.control.magnifyingglass(null,o)}},{key:"_addLayer",value:function(t){var n=t.layer;if(!n.options.isMagnifyingGlassLayer){var e=function(t){var n=p.default.values(t);return p.default.some(n,function(t){return t instanceof f.default.Layer})};p.default.has(n,"_layers")||e(n.options)||!p.default.has(n,"_leaflet_id")||n.options.isMagnifyingGlassLayer||(this.layers[n._leaflet_id]=(0,d.default)(n)),this._updateMagnifyingGlass()}}},{key:"_removeLayer",value:function(t){var n=t.layer;n.options.isMagnifyingGlassLayer||(delete this.layers[n._leaflet_id],this._updateMagnifyingGlass())}},{key:"_updateMagnifyingGlass",value:function(){var t=this.context.map,n=this.props,e=n.position,r=void 0===e?"topleft":e,i=(n.forceSeparateButton,n.radius),o=void 0===i?100:i,a=n.zoomOffset,u=void 0===a?3:a,s=n.fixedZoom,l=void 0===s?-1:s,c=t.hasLayer(this.magnifyingGlass);c&&t.removeLayer(this.magnifyingGlass),t.removeControl(this.leafletElement);var h={position:r,forceSeparateButton:!0};this.magnifyingGlass=f.default.magnifyingGlass({radius:o,zoomOffset:u,fixedZoom:l,isMagnifyingGlassLayer:!0,layers:p.default.values(this.layers)}),this.leafletElement=f.default.control.magnifyingglass(this.magnifyingGlass,h),this.leafletElement.addTo(t),c&&this.magnifyingGlass.addTo(t)}}]),n}(s.MapControl);n.default=v},function(t,n,e){"use strict";function r(t){var n={};for(var e in t){var r=t[e];r&&r.clone?n[e]=r.clone():r instanceof L.Layer?n[e]=o(r):n[e]=r}return n}function i(t){var n=[];return t.eachLayer(function(t){n.push(o(t))}),n}function o(t){var n=r(t.options);if(t instanceof L.SVG)return L.svg(n);if(t instanceof L.Canvas)return L.canvas(n);if(t instanceof L.TileLayer.WMS)return L.tileLayer.wms(t._url,n);if(t instanceof L.TileLayer)return L.tileLayer(t._url,n);if(t instanceof L.ImageOverlay)return L.imageOverlay(t._url,t._bounds,n);if(t instanceof L.Marker)return L.marker(t.getLatLng(),n);if(t instanceof L.Circle)return L.circle(t.getLatLng(),t.getRadius(),n);if(t instanceof L.CircleMarker)return L.circleMarker(t.getLatLng(),n);if(t instanceof L.Rectangle)return L.rectangle(t.getBounds(),n);if(t instanceof L.Polygon)return L.polygon(t.getLatLngs(),n);if(t instanceof L.Polyline)return L.polyline(t.getLatLngs(),n);if(t instanceof L.GeoJSON)return L.geoJson(t.toGeoJSON(),n);if(t instanceof L.LayerGroup)return L.layerGroup(i(t));if(t instanceof L.FeatureGroup)return L.FeatureGroup(i(t));throw"Unknown layer, cannot clone this layer. Leaflet-version: "+L.version}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};"object"===a(n)&&(t.exports=o)},function(t,n){"use strict";L.MagnifyingGlass=L.Layer.extend({options:{radius:100,zoomOffset:3,layers:[],fixedPosition:!1,latLng:[0,0],fixedZoom:-1},initialize:function(t){L.Util.setOptions(this,t),this._fixedZoom=this.options.fixedZoom!=-1,this._mainMap=null,this._glassMap=null},getMap:function(){return this._glassMap},_createMiniMap:function(t){return new L.Map(t,{layers:this.options.layers,zoom:this._getZoom(),maxZoom:this._mainMap.getMaxZoom(),minZoom:this._mainMap.getMinZoom(),crs:this._mainMap.options.crs,fadeAnimation:!1,attributionControl:!1,zoomControl:!1,boxZoom:!1,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,dragging:!1,keyboard:!1})},_getZoom:function(){return this._fixedZoom?this.options.fixedZoom:this._mainMap.getZoom()+this.options.zoomOffset},_updateZoom:function(){this._glassMap.setZoom(this._getZoom())},setRadius:function(t){this.options.radius=t,this._wrapperElt&&(this._wrapperElt.style.width=2*this.options.radius+"px",this._wrapperElt.style.height=2*this.options.radius+"px")},setLatLng:function(t){this.options.latLng=t,this._update(t)},_updateFromMouse:function(t){this._update(t.latlng,t.layerPoint)},_updateFixed:function(){this._update(this.options.latLng)},_update:function(t,n){this._glassMap.setView(t,this._getZoom(),{pan:{animate:!1}}),n=n||this._mainMap.latLngToLayerPoint(t),this._wrapperElt.style.left=n.x-this.options.radius+"px",this._wrapperElt.style.top=n.y-this.options.radius+"px"},onAdd:function(t){this._mainMap=t,this._wrapperElt=L.DomUtil.create("div","leaflet-magnifying-glass");var n=L.DomUtil.create("div","",this._wrapperElt);L.Browser.webkit&&L.DomUtil.addClass(n,"leaflet-magnifying-glass-webkit"),this._glassMap=this._createMiniMap(n),L.DomEvent.addListener(this._wrapperElt,"click",this._fireClick,this);var e=this.options;return this.setRadius(e.radius),this.setLatLng(e.latLng),this._glassMap.whenReady(function(){e.fixedPosition?(this._mainMap.on("zoomend",this._updateFixed,this),L.DomUtil.addClass(this._wrapperElt,"leaflet-zoom-hide")):(this._mainMap.on("mousemove",this._updateFromMouse,this),this._fixedZoom||this._mainMap.on("zoomend",this._updateZoom,this))},this),t.getPanes().popupPane.appendChild(this._wrapperElt),this._glassMap.invalidateSize(),this},_fireClick:function(t){this.fire("click",t),L.DomEvent.stopPropagation(t)},onRemove:function(t){t.off("viewreset",this._updateFixed,this),t.off("mousemove",this._updateFromMouse,this),t.off("zoomend",this._updateZoom,this);for(var n=0,e=this.options.layers.length;n<e;n++)this._glassMap.removeLayer(this.options.layers[n]);return this._glassMap.remove(),L.DomEvent.removeListener(this._wrapperElt,"click",this._fireClick),t.getPanes().popupPane.removeChild(this._wrapperElt),this._mainMap=null,this}}),L.magnifyingGlass=function(t){return new L.MagnifyingGlass(t)}},function(t,n,e){n=t.exports=e(1)(!1),n.push([t.id,".leaflet-control-magnifying-glass{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAzUlEQVQoFQXBsUpCUQAA0INbvMlVcFC3UFJCEFpczOWB5hKCa+APJPgRLbk6h1+gUIuj0NgX2NKiGVE+64W3c4CCqVfBm5kKAABNHxY6zrU9SPQBgLydWwD07NUBYGIOALjzBABrXQBARSoCIFUFAESCAkDGuxwAIOdoC5Dx6BoA0PfsE4CyxBUAGr50AICBg3tlWSUj337FAAAXllLBn5WeocSNGgDAiaIIMBZs1QAAALj0I9g4AwAAoGUv2KkDAAAQOwheAAAAILZ2+g9v1zZYRtFGvAAAAABJRU5ErkJggg==)}",""])},function(t,n,e){n=t.exports=e(1)(!1),n.push([t.id,".leaflet-magnifying-glass{border-radius:50%;border:1px solid gray;box-shadow:0 0 5px gray;position:absolute;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box}.leaflet-magnifying-glass>.leaflet-container{height:100%;width:100%}.leaflet-magnifying-glass-webkit{border-radius:50%;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}",""])},function(t,n){t.exports=function(t){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var e=n.protocol+"//"+n.host,r=e+n.pathname.replace(/\/[^\/]*$/,"/"),i=t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,n){var i=n.trim().replace(/^"(.*)"$/,function(t,n){return n}).replace(/^'(.*)'$/,function(t,n){return n});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return t;var o;return o=0===i.indexOf("//")?i:0===i.indexOf("/")?e+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")"});return i}},function(t,n,e){var r=e(7);"string"==typeof r&&(r=[[t.id,r,""]]);var i,o={};o.transform=i;e(2)(r,o);r.locals&&(t.exports=r.locals)},function(t,n,e){var r=e(8);"string"==typeof r&&(r=[[t.id,r,""]]);var i,o={};o.transform=i;e(2)(r,o);r.locals&&(t.exports=r.locals)},function(t,n,e){var r,i;(function(){function e(t){function n(n,e,r,i,o,a){for(;o>=0&&o<a;o+=t){var u=i?i[o]:o;r=e(r,n[u],u,n)}return r}return function(e,r,i,o){r=x(r,o,4);var a=!S(e)&&L.keys(e),u=(a||e).length,s=t>0?0:u-1;return arguments.length<3&&(i=e[a?a[s]:s],s+=t),n(e,r,i,a,s,u)}}function o(t){return function(n,e,r){e=w(e,r);for(var i=E(n),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(e(n[o],o,n))return o;return-1}}function a(t,n,e){return function(r,i,o){var a=0,u=E(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+u,a):u=o>=0?Math.min(o+1,u):o+u+1;else if(e&&o&&u)return o=e(r,i),r[o]===i?o:-1;if(i!==i)return o=n(d.call(r,a,u),L.isNaN),o>=0?o+a:-1;for(o=t>0?a:u-1;o>=0&&o<u;o+=t)if(r[o]===i)return o;return-1}}function u(t,n){var e=R.length,r=t.constructor,i=L.isFunction(r)&&r.prototype||c,o="constructor";for(L.has(t,o)&&!L.contains(n,o)&&n.push(o);e--;)o=R[e],o in t&&t[o]!==i[o]&&!L.contains(n,o)&&n.push(o)}var s=this,l=s._,f=Array.prototype,c=Object.prototype,p=Function.prototype,h=f.push,d=f.slice,v=c.toString,y=c.hasOwnProperty,g=Array.isArray,m=Object.keys,b=p.bind,_=Object.create,A=function(){},L=function(t){return t instanceof L?t:this instanceof L?void(this._wrapped=t):new L(t)};"undefined"!=typeof t&&t.exports&&(n=t.exports=L),n._=L,L.VERSION="1.8.3";var x=function(t,n,e){if(void 0===n)return t;switch(null==e?3:e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)};case 4:return function(e,r,i,o){return t.call(n,e,r,i,o)}}return function(){return t.apply(n,arguments)}},w=function(t,n,e){return null==t?L.identity:L.isFunction(t)?x(t,n,e):L.isObject(t)?L.matcher(t):L.property(t)};L.iteratee=function(t,n){return w(t,n,1/0)};var M=function(t,n){return function(e){var r=arguments.length;if(r<2||null==e)return e;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),u=a.length,s=0;s<u;s++){var l=a[s];n&&void 0!==e[l]||(e[l]=o[l])}return e}},j=function(t){if(!L.isObject(t))return{};if(_)return _(t);A.prototype=t;var n=new A;return A.prototype=null,n},k=function(t){return function(n){return null==n?void 0:n[t]}},O=Math.pow(2,53)-1,E=k("length"),S=function(t){var n=E(t);return"number"==typeof n&&n>=0&&n<=O};L.each=L.forEach=function(t,n,e){n=x(n,e);var r,i;if(S(t))for(r=0,i=t.length;r<i;r++)n(t[r],r,t);else{var o=L.keys(t);for(r=0,i=o.length;r<i;r++)n(t[o[r]],o[r],t)}return t},L.map=L.collect=function(t,n,e){n=w(n,e);for(var r=!S(t)&&L.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var u=r?r[a]:a;o[a]=n(t[u],u,t)}return o},L.reduce=L.foldl=L.inject=e(1),L.reduceRight=L.foldr=e(-1),L.find=L.detect=function(t,n,e){var r;if(r=S(t)?L.findIndex(t,n,e):L.findKey(t,n,e),void 0!==r&&r!==-1)return t[r]},L.filter=L.select=function(t,n,e){var r=[];return n=w(n,e),L.each(t,function(t,e,i){n(t,e,i)&&r.push(t)}),r},L.reject=function(t,n,e){return L.filter(t,L.negate(w(n)),e)},L.every=L.all=function(t,n,e){n=w(n,e);for(var r=!S(t)&&L.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!n(t[a],a,t))return!1}return!0},L.some=L.any=function(t,n,e){n=w(n,e);for(var r=!S(t)&&L.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(n(t[a],a,t))return!0}return!1},L.contains=L.includes=L.include=function(t,n,e,r){return S(t)||(t=L.values(t)),("number"!=typeof e||r)&&(e=0),L.indexOf(t,n,e)>=0},L.invoke=function(t,n){var e=d.call(arguments,2),r=L.isFunction(n);return L.map(t,function(t){var i=r?n:t[n];return null==i?i:i.apply(t,e)})},L.pluck=function(t,n){return L.map(t,L.property(n))},L.where=function(t,n){return L.filter(t,L.matcher(n))},L.findWhere=function(t,n){return L.find(t,L.matcher(n))},L.max=function(t,n,e){var r,i,o=-(1/0),a=-(1/0);if(null==n&&null!=t){t=S(t)?t:L.values(t);for(var u=0,s=t.length;u<s;u++)r=t[u],r>o&&(o=r)}else n=w(n,e),L.each(t,function(t,e,r){i=n(t,e,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=t,a=i)});return o},L.min=function(t,n,e){var r,i,o=1/0,a=1/0;if(null==n&&null!=t){t=S(t)?t:L.values(t);for(var u=0,s=t.length;u<s;u++)r=t[u],r<o&&(o=r)}else n=w(n,e),L.each(t,function(t,e,r){i=n(t,e,r),(i<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},L.shuffle=function(t){for(var n,e=S(t)?t:L.values(t),r=e.length,i=Array(r),o=0;o<r;o++)n=L.random(0,o),n!==o&&(i[o]=i[n]),i[n]=e[o];return i},L.sample=function(t,n,e){return null==n||e?(S(t)||(t=L.values(t)),t[L.random(t.length-1)]):L.shuffle(t).slice(0,Math.max(0,n))},L.sortBy=function(t,n,e){return n=w(n,e),L.pluck(L.map(t,function(t,e,r){return{value:t,index:e,criteria:n(t,e,r)}}).sort(function(t,n){var e=t.criteria,r=n.criteria;if(e!==r){if(e>r||void 0===e)return 1;if(e<r||void 0===r)return-1}return t.index-n.index}),"value")};var C=function(t){return function(n,e,r){var i={};return e=w(e,r),L.each(n,function(r,o){var a=e(r,o,n);t(i,r,a)}),i}};L.groupBy=C(function(t,n,e){L.has(t,e)?t[e].push(n):t[e]=[n]}),L.indexBy=C(function(t,n,e){t[e]=n}),L.countBy=C(function(t,n,e){L.has(t,e)?t[e]++:t[e]=1}),L.toArray=function(t){return t?L.isArray(t)?d.call(t):S(t)?L.map(t,L.identity):L.values(t):[]},L.size=function(t){return null==t?0:S(t)?t.length:L.keys(t).length},L.partition=function(t,n,e){n=w(n,e);var r=[],i=[];return L.each(t,function(t,e,o){(n(t,e,o)?r:i).push(t)}),[r,i]},L.first=L.head=L.take=function(t,n,e){if(null!=t)return null==n||e?t[0]:L.initial(t,t.length-n)},L.initial=function(t,n,e){return d.call(t,0,Math.max(0,t.length-(null==n||e?1:n)))},L.last=function(t,n,e){if(null!=t)return null==n||e?t[t.length-1]:L.rest(t,Math.max(0,t.length-n))},L.rest=L.tail=L.drop=function(t,n,e){return d.call(t,null==n||e?1:n)},L.compact=function(t){return L.filter(t,L.identity)};var B=function(t,n,e,r){for(var i=[],o=0,a=r||0,u=E(t);a<u;a++){var s=t[a];if(S(s)&&(L.isArray(s)||L.isArguments(s))){n||(s=B(s,n,e));var l=0,f=s.length;for(i.length+=f;l<f;)i[o++]=s[l++]}else e||(i[o++]=s)}return i};L.flatten=function(t,n){return B(t,n,!1)},L.without=function(t){return L.difference(t,d.call(arguments,1))},L.uniq=L.unique=function(t,n,e,r){L.isBoolean(n)||(r=e,e=n,n=!1),null!=e&&(e=w(e,r));for(var i=[],o=[],a=0,u=E(t);a<u;a++){var s=t[a],l=e?e(s,a,t):s;n?(a&&o===l||i.push(s),o=l):e?L.contains(o,l)||(o.push(l),i.push(s)):L.contains(i,s)||i.push(s)}return i},L.union=function(){return L.uniq(B(arguments,!0,!0))},L.intersection=function(t){for(var n=[],e=arguments.length,r=0,i=E(t);r<i;r++){var o=t[r];if(!L.contains(n,o)){for(var a=1;a<e&&L.contains(arguments[a],o);a++);a===e&&n.push(o)}}return n},L.difference=function(t){var n=B(arguments,!0,!0,1);return L.filter(t,function(t){return!L.contains(n,t)})},L.zip=function(){return L.unzip(arguments)},L.unzip=function(t){for(var n=t&&L.max(t,E).length||0,e=Array(n),r=0;r<n;r++)e[r]=L.pluck(t,r);return e},L.object=function(t,n){for(var e={},r=0,i=E(t);r<i;r++)n?e[t[r]]=n[r]:e[t[r][0]]=t[r][1];return e},L.findIndex=o(1),L.findLastIndex=o(-1),L.sortedIndex=function(t,n,e,r){e=w(e,r,1);for(var i=e(n),o=0,a=E(t);o<a;){var u=Math.floor((o+a)/2);e(t[u])<i?o=u+1:a=u}return o},L.indexOf=a(1,L.findIndex,L.sortedIndex),L.lastIndexOf=a(-1,L.findLastIndex),L.range=function(t,n,e){null==n&&(n=t||0,t=0),e=e||1;for(var r=Math.max(Math.ceil((n-t)/e),0),i=Array(r),o=0;o<r;o++,t+=e)i[o]=t;return i};var U=function(t,n,e,r,i){if(!(r instanceof n))return t.apply(e,i);var o=j(t.prototype),a=t.apply(o,i);return L.isObject(a)?a:o};L.bind=function(t,n){if(b&&t.bind===b)return b.apply(t,d.call(arguments,1));if(!L.isFunction(t))throw new TypeError("Bind must be called on a function");var e=d.call(arguments,2),r=function(){return U(t,r,n,this,e.concat(d.call(arguments)))};return r},L.partial=function(t){var n=d.call(arguments,1),e=function(){for(var r=0,i=n.length,o=Array(i),a=0;a<i;a++)o[a]=n[a]===L?arguments[r++]:n[a];for(;r<arguments.length;)o.push(arguments[r++]);return U(t,e,this,this,o)};return e},L.bindAll=function(t){var n,e,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(n=1;n<r;n++)e=arguments[n],t[e]=L.bind(t[e],t);return t},L.memoize=function(t,n){var e=function(r){var i=e.cache,o=""+(n?n.apply(this,arguments):r);return L.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return e.cache={},e},L.delay=function(t,n){var e=d.call(arguments,2);return setTimeout(function(){return t.apply(null,e)},n)},L.defer=L.partial(L.delay,L,1),L.throttle=function(t,n,e){var r,i,o,a=null,u=0;e||(e={});var s=function(){u=e.leading===!1?0:L.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var l=L.now();u||e.leading!==!1||(u=l);var f=n-(l-u);return r=this,i=arguments,f<=0||f>n?(a&&(clearTimeout(a),a=null),u=l,o=t.apply(r,i),a||(r=i=null)):a||e.trailing===!1||(a=setTimeout(s,f)),o}},L.debounce=function(t,n,e){var r,i,o,a,u,s=function(){var l=L.now()-a;l<n&&l>=0?r=setTimeout(s,n-l):(r=null,e||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=L.now();var l=e&&!r;return r||(r=setTimeout(s,n)),l&&(u=t.apply(o,i),o=i=null),u}},L.wrap=function(t,n){return L.partial(n,t)},L.negate=function(t){return function(){return!t.apply(this,arguments)}},L.compose=function(){var t=arguments,n=t.length-1;return function(){for(var e=n,r=t[n].apply(this,arguments);e--;)r=t[e].call(this,r);return r}},L.after=function(t,n){return function(){if(--t<1)return n.apply(this,arguments)}},L.before=function(t,n){var e;return function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=null),e}},L.once=L.partial(L.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];L.keys=function(t){if(!L.isObject(t))return[];if(m)return m(t);var n=[];for(var e in t)L.has(t,e)&&n.push(e);return G&&u(t,n),n},L.allKeys=function(t){if(!L.isObject(t))return[];var n=[];for(var e in t)n.push(e);return G&&u(t,n),n},L.values=function(t){for(var n=L.keys(t),e=n.length,r=Array(e),i=0;i<e;i++)r[i]=t[n[i]];return r},L.mapObject=function(t,n,e){n=w(n,e);for(var r,i=L.keys(t),o=i.length,a={},u=0;u<o;u++)r=i[u],a[r]=n(t[r],r,t);return a},L.pairs=function(t){for(var n=L.keys(t),e=n.length,r=Array(e),i=0;i<e;i++)r[i]=[n[i],t[n[i]]];return r},L.invert=function(t){for(var n={},e=L.keys(t),r=0,i=e.length;r<i;r++)n[t[e[r]]]=e[r];return n},L.functions=L.methods=function(t){var n=[];for(var e in t)L.isFunction(t[e])&&n.push(e);return n.sort()},L.extend=M(L.allKeys),L.extendOwn=L.assign=M(L.keys),L.findKey=function(t,n,e){n=w(n,e);for(var r,i=L.keys(t),o=0,a=i.length;o<a;o++)if(r=i[o],n(t[r],r,t))return r},L.pick=function(t,n,e){var r,i,o={},a=t;if(null==a)return o;L.isFunction(n)?(i=L.allKeys(a),r=x(n,e)):(i=B(arguments,!1,!1,1),r=function(t,n,e){return n in e},a=Object(a));for(var u=0,s=i.length;u<s;u++){var l=i[u],f=a[l];r(f,l,a)&&(o[l]=f)}return o},L.omit=function(t,n,e){if(L.isFunction(n))n=L.negate(n);else{var r=L.map(B(arguments,!1,!1,1),String);n=function(t,n){return!L.contains(r,n)}}return L.pick(t,n,e)},L.defaults=M(L.allKeys,!0),L.create=function(t,n){var e=j(t);return n&&L.extendOwn(e,n),e},L.clone=function(t){return L.isObject(t)?L.isArray(t)?t.slice():L.extend({},t):t},L.tap=function(t,n){return n(t),t},L.isMatch=function(t,n){var e=L.keys(n),r=e.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=e[o];if(n[a]!==i[a]||!(a in i))return!1}return!0};var F=function(t,n,e,r){if(t===n)return 0!==t||1/t===1/n;if(null==t||null==n)return t===n;t instanceof L&&(t=t._wrapped),n instanceof L&&(n=n._wrapped);var i=v.call(t);if(i!==v.call(n))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!==+t?+n!==+n:0===+t?1/+t===1/n:+t===+n;case"[object Date]":case"[object Boolean]":return+t===+n}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof n)return!1;var a=t.constructor,u=n.constructor;if(a!==u&&!(L.isFunction(a)&&a instanceof a&&L.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in n)return!1}e=e||[],r=r||[];for(var s=e.length;s--;)if(e[s]===t)return r[s]===n;if(e.push(t),r.push(n),o){if(s=t.length,s!==n.length)return!1;for(;s--;)if(!F(t[s],n[s],e,r))return!1}else{var l,f=L.keys(t);if(s=f.length,L.keys(n).length!==s)return!1;for(;s--;)if(l=f[s],!L.has(n,l)||!F(t[l],n[l],e,r))return!1}return e.pop(),r.pop(),!0};L.isEqual=function(t,n){return F(t,n)},L.isEmpty=function(t){return null==t||(S(t)&&(L.isArray(t)||L.isString(t)||L.isArguments(t))?0===t.length:0===L.keys(t).length)},L.isElement=function(t){return!(!t||1!==t.nodeType)},L.isArray=g||function(t){return"[object Array]"===v.call(t)},L.isObject=function(t){var n=typeof t;return"function"===n||"object"===n&&!!t},L.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){L["is"+t]=function(n){return v.call(n)==="[object "+t+"]"}}),L.isArguments(arguments)||(L.isArguments=function(t){return L.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(L.isFunction=function(t){return"function"==typeof t||!1}),L.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},L.isNaN=function(t){return L.isNumber(t)&&t!==+t},L.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===v.call(t)},L.isNull=function(t){return null===t},L.isUndefined=function(t){return void 0===t},L.has=function(t,n){return null!=t&&y.call(t,n)},L.noConflict=function(){return s._=l,this},L.identity=function(t){return t},L.constant=function(t){return function(){return t}},L.noop=function(){},L.property=k,L.propertyOf=function(t){return null==t?function(){}:function(n){return t[n]}},L.matcher=L.matches=function(t){return t=L.extendOwn({},t),function(n){return L.isMatch(n,t)}},L.times=function(t,n,e){var r=Array(Math.max(0,t));n=x(n,e,1);for(var i=0;i<t;i++)r[i]=n(i);return r},L.random=function(t,n){return null==n&&(n=t,t=0),t+Math.floor(Math.random()*(n-t+1))},L.now=Date.now||function(){return(new Date).getTime()};var Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},I=L.invert(Z),N=function(t){var n=function(n){return t[n]},e="(?:"+L.keys(t).join("|")+")",r=RegExp(e),i=RegExp(e,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,n):t}};L.escape=N(Z),L.unescape=N(I),L.result=function(t,n,e){var r=null==t?void 0:t[n];return void 0===r&&(r=e),L.isFunction(r)?r.call(t):r};var P=0;L.uniqueId=function(t){var n=++P+"";return t?t+n:n},L.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,T={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+T[t]};L.template=function(t,n,e){!n&&e&&(n=e),n=L.defaults({},n,L.templateSettings);var r=RegExp([(n.escape||z).source,(n.interpolate||z).source,(n.evaluate||z).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(n,e,r,a,u){return o+=t.slice(i,u).replace(D,J),i=u+n.length,e?o+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),n}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(n.variable||"obj","_",o)}catch(t){throw t.source=o,t}var u=function(t){return a.call(this,t,L)},s=n.variable||"obj";return u.source="function("+s+"){\n"+o+"}",u},L.chain=function(t){var n=L(t);return n._chain=!0,n};var q=function(t,n){return t._chain?L(n).chain():n};L.mixin=function(t){L.each(L.functions(t),function(n){var e=L[n]=t[n];L.prototype[n]=function(){var t=[this._wrapped];return h.apply(t,arguments),q(this,e.apply(L,t))}})},L.mixin(L),L.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var n=f[t];L.prototype[t]=function(){var e=this._wrapped;return n.apply(e,arguments),"shift"!==t&&"splice"!==t||0!==e.length||delete e[0],q(this,e)}}),L.each(["concat","join","slice"],function(t){var n=f[t];L.prototype[t]=function(){return q(this,n.apply(this._wrapped,arguments))}}),L.prototype.value=function(){return this._wrapped},L.prototype.valueOf=L.prototype.toJSON=L.prototype.value,L.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return L}.apply(n,r),!(void 0!==i&&(t.exports=i))}).call(this)},function(n,e){n.exports=t},function(t,e){t.exports=n}])});

@@ -15,2 +15,10 @@ 'use strict';

var _underscore = require('underscore');
var _underscore2 = _interopRequireDefault(_underscore);
var _cloneLayer = require('./cloneLayer');
var _cloneLayer2 = _interopRequireDefault(_cloneLayer);
require('./leaflet.magnifyingglass');

@@ -20,2 +28,6 @@

require('./leaflet.magnifyingglass.css');
require('./Control.MagnifyingGlass.css');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -28,3 +40,5 @@

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
// import cloneLayer from 'leaflet-clonelayer';
var MagnifyingGlassControl = function (_MapControl) {

@@ -42,38 +56,83 @@ _inherits(MagnifyingGlassControl, _MapControl);

value: function createLeafletElement(props) {
var _this2 = this;
var map = this.context.map;
var _props$position = props.position,
position = _props$position === undefined ? 'topleft' : _props$position,
_props$forceSeparateB = props.forceSeparateButton,
forceSeparateButton = _props$forceSeparateB === undefined ? false : _props$forceSeparateB,
_props$radius = props.radius,
forceSeparateButton = _props$forceSeparateB === undefined ? false : _props$forceSeparateB;
this.layers = {};
map.on('layeradd', function (e) {
console.log(e);
_this2._addLayer(e);
});
map.on('layerremove', function (e) {
_this2._removeLayer(e);
});
var controlOptions = {
position: position,
forceSeparateButton: true // forced to use separate button otherwise the entire grouped button will be removed during update
};
return _leaflet2.default.control.magnifyingglass(null, controlOptions);
}
}, {
key: '_addLayer',
value: function _addLayer(e) {
var layer = e.layer;
if (layer.options.isMagnifyingGlassLayer) return;
var nested = function nested(option) {
var allOptions = _underscore2.default.values(option);
return _underscore2.default.some(allOptions, function (opt) {
return opt instanceof _leaflet2.default.Layer;
});
};
if (!_underscore2.default.has(layer, '_layers') && !nested(layer.options) && _underscore2.default.has(layer, '_leaflet_id') && !layer.options.isMagnifyingGlassLayer) this.layers[layer._leaflet_id] = (0, _cloneLayer2.default)(layer);
this._updateMagnifyingGlass();
}
}, {
key: '_removeLayer',
value: function _removeLayer(e) {
var layer = e.layer;
if (layer.options.isMagnifyingGlassLayer) return;
delete this.layers[layer._leaflet_id];
this._updateMagnifyingGlass();
}
}, {
key: '_updateMagnifyingGlass',
value: function _updateMagnifyingGlass() {
var map = this.context.map;
var _props = this.props,
_props$position2 = _props.position,
position = _props$position2 === undefined ? 'topleft' : _props$position2,
_props$forceSeparateB2 = _props.forceSeparateButton,
forceSeparateButton = _props$forceSeparateB2 === undefined ? false : _props$forceSeparateB2,
_props$radius = _props.radius,
radius = _props$radius === undefined ? 100 : _props$radius,
_props$zoomOffset = props.zoomOffset,
_props$zoomOffset = _props.zoomOffset,
zoomOffset = _props$zoomOffset === undefined ? 3 : _props$zoomOffset,
_props$fixedZoom = props.fixedZoom,
_props$fixedZoom = _props.fixedZoom,
fixedZoom = _props$fixedZoom === undefined ? -1 : _props$fixedZoom;
var magnifying = map.hasLayer(this.magnifyingGlass);
if (magnifying) map.removeLayer(this.magnifyingGlass);
map.removeControl(this.leafletElement);
var controlOptions = {
position: position,
forceSeparateButton: forceSeparateButton
forceSeparateButton: true // forced to use separate button otherwise the entire grouped button will be removed during update
};
var tileUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var tileOptions = {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
};
var magnifyingGlass = _leaflet2.default.magnifyingGlass({
this.magnifyingGlass = _leaflet2.default.magnifyingGlass({
radius: radius,
zoomOffset: zoomOffset,
fixedZoom: fixedZoom,
layers: [_leaflet2.default.tileLayer(tileUrl, tileOptions)]
isMagnifyingGlassLayer: true,
layers: _underscore2.default.values(this.layers)
});
return _leaflet2.default.control.magnifyingglass(magnifyingGlass, controlOptions);
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var map = this.context.map;
console.log(this.context);
this.leafletElement = _leaflet2.default.control.magnifyingglass(this.magnifyingGlass, controlOptions);
this.leafletElement.addTo(map);
if (magnifying) this.magnifyingGlass.addTo(map);
}

@@ -80,0 +139,0 @@ }]);

{
"name": "react-leaflet-magnifying-glass",
"version": "0.1.0",
"version": "0.1.1",
"description": "React wrapper of Leaflet.MagnifyingGlass. Add a 'magnifying glass' effect to a Leaflet map, able to display a portion of the map in a different zoom (and actually display different content).",

@@ -31,3 +31,4 @@ "main": "dist/react-leaflet-magnifying-glass.min.js",

"react": "^15.0.0 || ^16.0.0",
"react-leaflet": "^1.3.1"
"react-leaflet": "^1.3.1",
"underscore": "^1.8.3"
},

@@ -51,5 +52,10 @@ "devDependencies": {

"react-leaflet": "^1.0.1",
"underscore": "^1.8.3",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.12.1"
"webpack-dev-server": "^1.12.1",
"webpack-css-loaders": "^1.0.0"
},
"dependencies": {
"leaflet-clonelayer": "^1.0.4"
}
}

@@ -31,3 +31,2 @@ # react-leaflet-magnifying-glass

position: 'topleft',
forceSeparateButton: false,
radius: 100,

@@ -52,3 +51,2 @@ zoomOffset: 3

`position` | `string` | `topleft` | Magnifier control position. One of (`topleft`,`topright`,`bottomleft`,`bottomright`).
`forceSeparateButton` | `boolean` | `false` | `true` - Detached control button from `zoom` control buttons. `false` - attached control button to `zoom` control button.
`radius` | `Integer` | `100` | The radius of the magnifying glass, in pixels.

@@ -59,2 +57,7 @@ `zoomOffset` | `Integer` | `3` | The zoom level offset between the main map zoom and the magnifying glass.

# TODO
- Support magifying `Leaflet.markercluster` layer
# Credits

@@ -61,0 +64,0 @@ Credits goes to [bbecquet](https://github.com/bbecquet) and all the [contributors](https://github.com/bbecquet/Leaflet.MagnifyingGlass/graphs/contributors) for the original work.

import { MapControl } from 'react-leaflet';
import L from 'leaflet';
// import cloneLayer from 'leaflet-clonelayer';
import _ from 'underscore';
import cloneLayer from './cloneLayer';
import './leaflet.magnifyingglass';
import './L.MagnifyingGlass.Control';
import './leaflet.magnifyingglass.css';
import './Control.MagnifyingGlass.css';
export default class MagnifyingGlassControl extends MapControl {
createLeafletElement(props) {
const { position = 'topleft', forceSeparateButton = false, radius = 100, zoomOffset = 3, fixedZoom = -1 } = props;
const { map } = this.context;
const { position = 'topleft', forceSeparateButton = false } = props;
this.layers = {};
map.on('layeradd', (e) => {
console.log(e);
this._addLayer(e);
});
map.on('layerremove', (e) => {
this._removeLayer(e);
});
const controlOptions = {
position,
forceSeparateButton
forceSeparateButton: true // forced to use separate button otherwise the entire grouped button will be removed during update
};
return L.control.magnifyingglass(null, controlOptions);
}
const tileUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
const tileOptions = {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
_addLayer(e) {
const { layer } = e;
if (layer.options.isMagnifyingGlassLayer) return;
const nested = (option) => {
const allOptions = _.values(option);
return _.some(allOptions, (opt) => opt instanceof L.Layer);
};
const magnifyingGlass = L.magnifyingGlass({
if (!_.has(layer, '_layers') && !nested(layer.options) && _.has(layer, '_leaflet_id') && !layer.options.isMagnifyingGlassLayer) this.layers[layer._leaflet_id] = cloneLayer(layer);
this._updateMagnifyingGlass();
}
_removeLayer(e) {
const { layer } = e;
if (layer.options.isMagnifyingGlassLayer) return;
delete this.layers[layer._leaflet_id];
this._updateMagnifyingGlass();
}
_updateMagnifyingGlass() {
const { map } = this.context;
const { position = 'topleft', forceSeparateButton = false, radius = 100, zoomOffset = 3, fixedZoom = -1 } = this.props;
const magnifying = map.hasLayer(this.magnifyingGlass);
if (magnifying) map.removeLayer(this.magnifyingGlass);
map.removeControl(this.leafletElement);
const controlOptions = {
position,
forceSeparateButton: true // forced to use separate button otherwise the entire grouped button will be removed during update
};
this.magnifyingGlass = L.magnifyingGlass({
radius,
zoomOffset,
fixedZoom,
layers: [
L.tileLayer(tileUrl, tileOptions)
]
isMagnifyingGlassLayer: true,
layers: _.values(this.layers)
});
return L.control.magnifyingglass(magnifyingGlass, controlOptions);
}
componentDidMount() {
const { map } = this.context;
console.log(this.context);
this.leafletElement = L.control.magnifyingglass(this.magnifyingGlass, controlOptions);
this.leafletElement.addTo(map);
if (magnifying) this.magnifyingGlass.addTo(map);
}
}

@@ -43,3 +43,4 @@ /* eslint-disable */

loaders: [
{test: /\.js$/, exclude: /node_modules/, loader: 'babel'}
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
{ test: /\.css$/, exclude: /node_modules/, loader: 'style-loader!css-loader'}
]

@@ -46,0 +47,0 @@ }

Sorry, the diff of this file is too big to display