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