text: (window.webpackJsonp=window.webpackJsonp||[]).push([[26],{1081:function(e,t,n){"use strict";var o=l(n(1)),r=l(n(13)),i=n(2446),a=l(n(2448)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2449)),s=l(n(611));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){var o=e,r=o.fill_color_picker,a=t.data.features.map((function(e){return Object.assign({},e,{fillColor:[r.r,r.g,r.b,255*r.a]})}));o.js_data_mutator&&(a=(0,s.default)(o.js_data_mutator)(a));return new i.PolygonLayer(Object.assign({id:"path-layer-"+o.slice_id,data:a,filled:o.filled,stroked:o.stoked,extruded:o.extruded},u.commonLayerProps(o,n)))}e.exports={default:function(e,t,n){var i=c(e.formData,t,e),u=Object.assign({},e.formData.viewport,{width:e.width(),height:e.height()});r.default.render(o.default.createElement(a.default,{mapboxApiAccessToken:t.data.mapboxApiKey,viewport:u,layers:[i],mapStyle:e.formData.mapbox_style,setControlValue:n}),document.getElementById(e.containerId))},getLayer:c}},2448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(1)),a=l(n(0)),u=l(n(2472)),s=l(n(2446));function l(e){return e&&e.__esModule?e:{default:e}}n(2480);var c={viewport:a.default.object.isRequired,layers:a.default.array.isRequired,setControlValue:a.default.func.isRequired,mapStyle:a.default.string,mapboxApiAccessToken:a.default.string.isRequired,onViewportChange:a.default.func},p={mapStyle:"light",onViewportChange:function(){}},f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={viewport:e.viewport},n.tick=n.tick.bind(n),n.onViewportChange=n.onViewportChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentWillMount",value:function(){var e=setInterval(this.tick,1e3);this.setState((function(){return{timer:e}}))}},{key:"componentWillReceiveProps",value:function(e){var t=this;this.setState((function(){return{viewport:Object.assign({},e.viewport),previousViewport:t.state.viewport}}))}},{key:"componentWillUnmount",value:function(){this.clearInterval(this.state.timer)}},{key:"onViewportChange",value:function(e){var t=Object.assign({},e);delete t.width,delete t.height;var n=Object.assign({},this.state.viewport,t);this.setState((function(){return{viewport:n}})),this.props.onViewportChange(n)}},{key:"tick",value:function(){var e=this;if(this.state.previousViewport!==this.state.viewport){var t=this.props.setControlValue,n=this.state.viewport;t&&t("viewport",n),this.setState((function(){return{previousViewport:e.state.viewport}}))}}},{key:"layers",value:function(){return this.props.layers.some((function(e){return"function"==typeof e}))?this.props.layers.map((function(e){return"function"==typeof e?e():e})):this.props.layers}},{key:"render",value:function(){var e=this.state.viewport;return i.default.createElement(u.default,o({},e,{mapStyle:this.props.mapStyle,onViewportChange:this.onViewportChange,mapboxApiAccessToken:this.props.mapboxApiAccessToken}),i.default.createElement(s.default,o({},e,{layers:this.layers(),initWebGLParameters:!0})))}}]),t}(i.default.Component);t.default=f,f.propTypes=c,f.defaultProps=p},2449:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBounds=u,t.fitViewport=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;try{var o=u(t);return Object.assign({},e,(0,r.fitBounds)({height:e.height,width:e.width,padding:n,bounds:o}))}catch(t){return console.error("Could not auto zoom",t),e}},t.commonLayerProps=function(e,t){var n=e,r=void 0;if(n.js_tooltip){var a=(0,i.default)(n.js_tooltip);r=function(e){e.picked?t.setTooltip({content:o.default.sanitize(a(e)),x:e.x,y:e.y}):t.setTooltip(null)}}var u=void 0;n.js_onclick_href&&(u=function(e){var t=(0,i.default)(n.js_onclick_href)(e);window.open(t)});return{onClick:u,onHover:r,pickable:Boolean(r)}};var o=a(n(2461)),r=n(2457),i=a(n(611));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=d3.extent(e,(function(e){return e[1]})),n=d3.extent(e,(function(e){return e[0]}));return[[n[0],t[0]],[n[1],t[1]]]}},2477:function(e,t){},2478:function(e,t){},2479:function(e,t){}}]);