From 17f8d12cfaa19baaa8da04b5a1fdadd2650d2b44 Mon Sep 17 00:00:00 2001 From: Paul Le Cam Date: Mon, 25 Jan 2016 07:38:34 +0000 Subject: [PATCH] Set source argument in Popup creation --- CHANGELOG.md | 1 + dist/react-leaflet.js | 5 +++-- dist/react-leaflet.min.js | 2 +- lib/Popup.js | 5 +++-- package.json | 8 ++++---- src/Popup.js | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0c8dd7e..0dd1ff9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## HEAD (unreleased) +- Added the popup container as source layer to `Popup` creation, fixes [#113](https://github.com/PaulLeCam/react-leaflet/issues/113) ([PR #112](https://github.com/PaulLeCam/react-leaflet/pull/112) by *amarant*). - [internal] Updated Lodash to v4. ## v0.10.0 (22/12/15) diff --git a/dist/react-leaflet.js b/dist/react-leaflet.js index 39e0e608..2f353daa 100644 --- a/dist/react-leaflet.js +++ b/dist/react-leaflet.js @@ -6486,10 +6486,11 @@ return /******/ (function(modules) { // webpackBootstrap var _props = this.props; var children = _props.children; var map = _props.map; + var popupContainer = _props.popupContainer; - var props = _objectWithoutProperties(_props, ['children', 'map']); + var props = _objectWithoutProperties(_props, ['children', 'map', 'popupContainer']); - this.leafletElement = (0, _leaflet.popup)(props); + this.leafletElement = (0, _leaflet.popup)(props, popupContainer); this.leafletElement.on('open', this.renderPopupContent.bind(this)); this.leafletElement.on('close', this.removePopupContent.bind(this)); } diff --git a/dist/react-leaflet.min.js b/dist/react-leaflet.min.js index 016d7896..56538059 100644 --- a/dist/react-leaflet.min.js +++ b/dist/react-leaflet.min.js @@ -1,3 +1,3 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("leaflet"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["leaflet","react","react-dom"],e):"object"==typeof exports?exports.ReactLeaflet=e(require("leaflet"),require("react"),require("react-dom")):t.ReactLeaflet=e(t.L,t.React,t.ReactDOM)}(this,function(t,e,n){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.setIconDefaultImagePath=e.ZoomControl=e.WMSTileLayer=e.TileLayer=e.ScaleControl=e.Rectangle=e.Popup=e.Polyline=e.Polygon=e.Path=e.MultiPolyline=e.MultiPolygon=e.Marker=e.MapLayer=e.MapControl=e.MapComponent=e.Map=e.LayersControl=e.LayerGroup=e.ImageOverlay=e.GeoJson=e.FeatureGroup=e.CircleMarker=e.Circle=e.CanvasTileLayer=e.BaseTileLayer=e.AttributionControl=e.PropTypes=void 0;var i=n(1),u=o(i),a=n(79),c=r(a),l=n(58),f=o(l),p=n(13),s=o(p),y=n(59),v=o(y),b=n(60),h=o(b),d=n(61),O=o(d),m=n(62),j=o(m),g=n(63),P=o(g),_=n(64),w=o(_),x=n(65),E=o(x),T=n(66),M=o(T),k=n(67),C=o(k),S=n(14),L=o(S),W=n(12),R=o(W),A=n(7),D=o(A),I=n(68),U=o(I),F=n(69),B=o(F),q=n(70),z=o(q),G=n(4),N=o(G),$=n(71),Z=o($),J=n(72),V=o(J),H=n(73),K=o(H),Q=n(74),X=o(Q),Y=n(75),tt=o(Y),et=n(76),nt=o(et),rt=n(77),ot=o(rt),it=n(78),ut=o(it);e.PropTypes=c,e.AttributionControl=f["default"],e.BaseTileLayer=s["default"],e.CanvasTileLayer=v["default"],e.Circle=h["default"],e.CircleMarker=O["default"],e.FeatureGroup=j["default"],e.GeoJson=P["default"],e.ImageOverlay=w["default"],e.LayerGroup=E["default"],e.LayersControl=M["default"],e.Map=C["default"],e.MapComponent=L["default"],e.MapControl=R["default"],e.MapLayer=D["default"],e.Marker=U["default"],e.MultiPolygon=B["default"],e.MultiPolyline=z["default"],e.Path=N["default"],e.Polygon=Z["default"],e.Polyline=V["default"],e.Popup=K["default"],e.Rectangle=X["default"],e.ScaleControl=tt["default"],e.TileLayer=nt["default"],e.WMSTileLayer=ot["default"],e.ZoomControl=ut["default"];var at=e.setIconDefaultImagePath=function(t){u["default"].Icon.Default.imagePath=t};at("//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images")},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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 u(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)}var a=function(){function t(t,e){for(var n=0;n-1&&t%1==0&&r>=t}var r=9007199254740991;t.exports=n},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e,n){function r(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1&&t%1==0&&e>t}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){function r(t,e){return"number"==typeof t?!0:!o(t)&&(u.test(t)||!i.test(t)||null!=e&&t in Object(e))}var o=n(3),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=r},function(t,e,n){(function(e){function r(t){return o(t)&&a.call(t,"callee")&&(!l.call(t,"callee")||c.call(t)==i)}var o=n(54),i="[object Arguments]",u=e.Object.prototype,a=u.hasOwnProperty,c=u.toString,l=u.propertyIsEnumerable;t.exports=r}).call(e,function(){return this}())},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=r.PropTypes.oneOf(["topleft","topright","bottomleft","bottomright"])},function(t,e,n){function r(t,e,n){var r=null==t?void 0:o(t,e);return void 0===r?n:r}var o=n(45);t.exports=r},function(t,e){function n(t){return t}t.exports=n},function(t,e){(function(e){var n=e.Uint8Array;t.exports=n}).call(e,function(){return this}())},function(t,e){function n(t,e){for(var n=-1,r=t.length;++nn)return!1;var r=t.length-1;return n==r?t.pop():u.call(t,n,1),!0}var o=n(17),i=e.Array.prototype,u=i.splice;t.exports=r}).call(e,function(){return this}())},function(t,e,n){function r(t,e){var n=o(t,e);return 0>n?void 0:t[n][1]}var o=n(17);t.exports=r},function(t,e,n){function r(t,e){return o(t,e)>-1}var o=n(17);t.exports=r},function(t,e,n){function r(t,e,n){var r=o(t,e);0>r?t.push([e,n]):t[r][1]=n}var o=n(17);t.exports=r},function(t,e,n){var r=n(44),o=n(120),i=o(r);t.exports=i},function(t,e,n){function r(t,e){return t&&o(t,e,i)}var o=n(97),i=n(11);t.exports=r},function(t,e,n){function r(t,e){e=i(e,t)?[e+""]:o(e);for(var n=0,r=e.length;null!=t&&r>n;)t=t[e[n++]];return n&&n==r?t:void 0}var o=n(48),i=n(31);t.exports=r},function(t,e){(function(e){function n(t,e){return o.call(t,e)||"object"==typeof t&&e in t&&null===i(t)}var r=e.Object.prototype,o=r.hasOwnProperty,i=Object.getPrototypeOf;t.exports=n}).call(e,function(){return this}())},function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}t.exports=n},function(t,e,n){function r(t){return o(t)?t:i(t)}var o=n(3),i=n(150);t.exports=r},function(t,e,n){function r(t){var e=t.constructor,n=new e(t.byteLength),r=new o(n);return r.set(new o(t)),n}var o=n(36);t.exports=r},function(t,e,n){(function(e){function r(t){return p.call(t)}var o=n(9),i=n(86),u="[object Map]",a="[object Object]",c="[object Set]",l=e.Object.prototype,f=e.Function.prototype.toString,p=l.toString,s=o?f.call(o):"",y=i?f.call(i):"";(o&&r(new o)!=u||i&&r(new i)!=c)&&(r=function(t){var e=p.call(t),n=e==a?t.constructor:null,r="function"==typeof n?f.call(n):"";if(r){if(r==s)return u;if(r==y)return c}return e}),t.exports=r}).call(e,function(){return this}())},function(t,e,n){(function(e){function r(t,e){return o?void 0!==t[e]:u.call(t,e)}var o=n(19),i=e.Object.prototype,u=i.hasOwnProperty;t.exports=r}).call(e,function(){return this}())},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}t.exports=n},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}t.exports=n},function(t,e,n){function r(t){return i(t)&&o(t)}var o=n(20),i=n(10);t.exports=r},function(t,e,n){(function(e){function r(t){return"string"==typeof t||!o(t)&&i(t)&&c.call(t)==u}var o=n(3),i=n(10),u="[object String]",a=e.Object.prototype,c=a.toString;t.exports=r}).call(e,function(){return this}())},function(t,e,n){function r(t,e){if("function"!=typeof t)throw new TypeError(u);return e=a(void 0===e?t.length-1:i(e),0),function(){for(var n=arguments,r=-1,i=a(n.length-e,0),u=Array(i);++r=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 a(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)}var c=function(){function t(t,e){for(var n=0;ne&&(e=-e>o?0:o+e),n=n>o?o:n,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(u="function"==typeof u?(i--,u):void 0,a&&o(n[0],n[1],a)&&(u=3>i?void 0:u,i=1),e=Object(e);++rs))return!1;var v=c.get(t);if(v)return v==e;var b=!0;for(c.set(t,e);++lt?-1:1;return e*u}var n=t%1;return t===t?n?t-n:t:0}var o=n(162),i=1/0,u=1.7976931348623157e308;t.exports=r},function(t,e,n){function r(t){if(i(t)){var e=o(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=l.test(t);return n||f.test(t)?p(t.slice(2),n?2:8):c.test(t)?u:+t}var o=n(21),i=n(6),u=NaN,a=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,p=parseInt;t.exports=r},function(t,e,n){function r(t){return o(t,i(t))}var o=n(110),i=n(11);t.exports=r},function(t,e,n){function r(t){var e=++i;return o(t)+e}var o=n(57),i=0;t.exports=r},function(t,e){t.exports=n}])}); \ No newline at end of file diff --git a/lib/Popup.js b/lib/Popup.js index e603c6da..d117262d 100644 --- a/lib/Popup.js +++ b/lib/Popup.js @@ -48,10 +48,11 @@ var Popup = function (_MapComponent) { var _props = this.props; var children = _props.children; var map = _props.map; + var popupContainer = _props.popupContainer; - var props = _objectWithoutProperties(_props, ['children', 'map']); + var props = _objectWithoutProperties(_props, ['children', 'map', 'popupContainer']); - this.leafletElement = (0, _leaflet.popup)(props); + this.leafletElement = (0, _leaflet.popup)(props, popupContainer); this.leafletElement.on('open', this.renderPopupContent.bind(this)); this.leafletElement.on('close', this.removePopupContent.bind(this)); } diff --git a/package.json b/package.json index f209a923..3e59ff76 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "react-dom": "^0.14.0" }, "devDependencies": { - "babel-cli": "^6.4.0", - "babel-core": "^6.4.0", + "babel-cli": "^6.4.5", + "babel-core": "^6.4.5", "babel-eslint": "^5.0.0-beta6", "babel-jest": "^6.0.1", "babel-loader": "^6.2.1", @@ -61,14 +61,14 @@ "babel-preset-es2015": "^6.3.13", "babel-preset-react": "^6.3.13", "eslint": "^1.10.3", - "eslint-plugin-react": "^3.15.0", + "eslint-plugin-react": "^3.16.1", "jest-cli": "^0.8.2", "leaflet": "^0.7.7", "onchange": "^2.0.0", "react": "^0.14.6", "react-dom": "^0.14.6", "react-transform-hmr": "^1.0.1", - "webpack": "^1.12.11", + "webpack": "^1.12.12", "webpack-dev-server": "^1.14.1" }, "jest": { diff --git a/src/Popup.js b/src/Popup.js index 384e4a8d..df5f7118 100644 --- a/src/Popup.js +++ b/src/Popup.js @@ -15,9 +15,9 @@ export default class Popup extends MapComponent { componentWillMount() { super.componentWillMount(); - const { children, map, ...props } = this.props; + const { children, map, popupContainer, ...props } = this.props; - this.leafletElement = popup(props); + this.leafletElement = popup(props, popupContainer); this.leafletElement.on('open', ::this.renderPopupContent); this.leafletElement.on('close', ::this.removePopupContent); }