(this.webpackJsonpstreamlit_folium=this.webpackJsonpstreamlit_folium||[]).push([[0],{10:function(t,n,e){"use strict";e.r(n);var a=e(2),i=e(4),l=6378137;function o(t){return t*Math.PI/180}function c(t){return 180*t/Math.PI}function r(t,n,e,a){var i=o(t[1]),l=o(t[0]),r=n/e,d=Math.asin(Math.sin(i)*Math.cos(r)+Math.cos(i)*Math.sin(r)*Math.cos(a));return[c(l+Math.atan2(Math.sin(a)*Math.sin(r)*Math.cos(i),Math.cos(r)-Math.sin(i)*Math.sin(d))),c(d)]}function d(t){window.__GLOBAL_DATA__.lat_lng_clicked=t.latlng,_(window.map)}var _=Object(i.a)(s,250);function s(t){var n=window.__GLOBAL_DATA__,e=t.getBounds(),i=t.getZoom();a.a.setComponentValue({last_clicked:n.lat_lng_clicked,last_object_clicked:n.last_object_clicked,all_drawings:n.all_drawings,last_active_drawing:n.last_active_drawing,bounds:e,zoom:i,last_circle_radius:n.last_circle_radius,last_circle_polygon:n.last_circle_polygon,center:t.getCenter()})}function u(t){_(window.map)}function w(t){var n=window.__GLOBAL_DATA__,e=t.layerType,a=t.layer;if("circle"===e){var i=[a._latlng.lng,a._latlng.lat],o=a.options.radius,c=function(t,n){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,a=[],i=0;i<e;++i)a.push(r(t,n,l,2*Math.PI*i/e));return a.push(a[0]),{type:"Polygon",coordinates:[a]}}(i,o);n.last_circle_radius=o/1e3,n.last_circle_polygon=c}return p(t)}function p(t){var n=window.__GLOBAL_DATA__;n.last_object_clicked=t.latlng;var e=[];t.layer&&t.layer.toGeoJSON&&(n.last_active_drawing=t.layer.toGeoJSON()),window.drawnItems.toGeoJSON&&(e=window.drawnItems.toGeoJSON().features),n.all_drawings=e,_(window.map)}window.initComponent=function(t){for(var n in t.on("click",d),t.on("moveend",u),t._layers){t._layers[n].on("click",p)}t.on("draw:created",w),t.on("draw:edited",w),t.on("draw:deleted",w),a.a.setFrameHeight(),s(t)},a.a.events.addEventListener(a.a.RENDER_EVENT,(function(t){var n=t.detail,e=n.args.script,a=n.args.height,i=n.args.width,l=n.args.html;if(!window.map){var o=document.getElementById("map_div"),c=document.getElementById("map_div2");if(c&&(c.style.height="".concat(a,"px"),c.style.width="".concat(i,"px")),o){if(o.style.height="".concat(a,"px"),o.style.width="".concat(i,"px"),-1!==e.indexOf("document.getElementById('export')")){var r=document.createElement("a");r.href="#",r.id="export",r.innerHTML="Export",document.body.appendChild(r)}var d=document.createElement("script");window.__GLOBAL_DATA__={lat_lng_clicked:null,last_object_clicked:null,all_drawings:null,last_active_drawing:null,zoom:null,last_circle_radius:null,last_circle_polygon:null},d.innerHTML=e+"window.map = map_div; window.initComponent(map_div);",document.body.appendChild(d);var _=document.createElement("div");_.innerHTML=l,document.body.appendChild(_)}}})),a.a.setComponentReady(),a.a.setFrameHeight()}},[[10,1,2]]]);
//# sourceMappingURL=main.f290f8f3.chunk.js.map