function simpleheat(e){return this instanceof simpleheat?(this._canvas=e="string"==typeof e?document.getElementById(e):e,this._ctx=e.getContext("2d"),this._width=e.width,this._height=e.height,this._max=1,void(this._data=[])):new simpleheat(e)}function toWKT(e){var t,n,r=[];if(e instanceof L.Polygon||e instanceof L.Polyline){for(var a=e.getLatLngs(),i=0;i

This feature allows you to initially hide a layer. This can be used to achieve a desired layer presentation as well as to provide faster map loading for larger layers.

',html:!0,trigger:"hover",container:"body"}),jQuery(".at_active_chk").bootstrapSwitch({size:"mini",onSwitchChange:function(t,n){t.preventDefault();var r=jQuery(this).parents("ul:first"),a=r.attr("data-id"),i=getIndex(selectedLayers,"unique_id",a);selectedLayers[i].settings||"undefined"!=typeof selectedLayers[i].settings||(selectedLayers[i].settings=new Object),n===!0?(selectedLayers[i].settings.active=1,jQuery("#at-"+e.unique_id+" a.dropdown-toggle span").removeClass("label-danger").addClass("label-primary"),mymap.addLayer(featureGroup[a][selectedLayers[i].name])):(selectedLayers[i].settings.active=0,jQuery("#at-"+e.unique_id+" a.dropdown-toggle span").addClass("label-danger").removeClass("label-primary"),mymap.removeLayer(featureGroup[a][selectedLayers[i].name])),calculateBounds()}})),1==e.type||4==e.type){var n={format:"image/png",layers:e.Name,transparent:!0,crs:L.CRS.EPSG4326,unique_id:e.unique_id,srs1:e.SRS,layer_type:e.type};"undefined"!=typeof e.geometry_area&&(n.geometry=e.geometry_area),"undefined"!=typeof e.time&&(n.time=e.time),L.tileLayer.betterWms(e.url,n).addTo(featureGroup[e.unique_id][e.name])}else 2==e.type?""==t?"phantom"==page?filterGlobalData():(e.cache_timer||"undefined"!=typeof e.cache_timer||(e.cache_timer=15),t={datasource:e.connection_id,sql_layer_name:e.name,query_box:e.query,_token:jQuery('[name="_token"]').val(),cache_key:e.cache_key,cache_timer:e.cache_timer,type:2,map_id:map.id},ajaxRequest("map/layer/json","post","json",t,function(t){"200"==t.status?processSQLJSON(t,e):showMsg(t.status,t.msg)})):processSQLJSON(t,e):3==e.type;overlayers_controls(e),overlays[e.name]=featureGroup[e.unique_id][e.name],layerSelector.addOverlay(featureGroup[e.unique_id][e.name],e.name),3==e.type&&jQuery("#at-"+e.unique_id).find(".style-at-layer").remove(),calculateBounds()}function getPopupContent(e,t){return $.each(e.features,function(e,n){$.each(n.properties,function(e,n){t=t.replace("<"+e+">",n)})}),t}function processSQLJSON(e,t){t=defaultLayerStyle(t),3==e.more_data.sql_type?processheatmapJSON(e,t):(clearLayersAndControls(e,t),jQuery.each(e.result,function(e,n){L.geoJson(n,{onEachFeature:function(e,n){if(n instanceof L.Marker){var r=!1;"nr"==t.style.type?$.each(t.style.custom,function(a,i){if(between(e.properties[t.style.field],i.val))return r=!0,custom_marker_icon(i.style,n),!1}):"g"==t.style.type&&$.each(t.style.custom,function(a,i){if(e.properties[t.style.field]==i.val)return r=!0,custom_marker_icon(i.style,n),!1}),0==r&&custom_marker_icon(t.style.marker,n)}n.on("click",function(r){var a=getSQLPopupContent(e.properties,t.pc);n.bindPopup(a)})},style:function(e,n){return t.style.polygon}}).addTo(featureGroup[t.unique_id][t.name])}),1==t.settings.active&&add_sql_legend(t,!0),"phantom"==page&&add_sql_legend(t,!0))}function initLayer(){selectedLayers.sort(sort_value_layer),selectedBaseLayers.length>0&&jQuery("#visiable-layers").find(".baselayers-control").removeClass("hide"),jQuery.each(selectedBaseLayers,function(e,t){if(layerSelector.addBaseLayer(baseLayers.mymap[t.name],t.name),baselayers_controls(t.name),"undefined"!=typeof page&&"manage"==page){var n=jQuery("#base_layer_selection").find('input:checkbox[data-name="'+t.name+'"]');n.length>0&&(n.prop("checked","checked"),baseLayerMap(n,!1))}}),jQuery.each(selectedLayers,function(e,t){renderLayer(t,"")});var e={type:5,id:map.id,_token:jQuery('[name="_token"]').val()};ajaxRequest("map/layer/json","post","json",e,function(e){"200"==e.status?processFreeHand(e):showMsg(e.status,e.msg)});var e={type:6,id:map.id,_token:jQuery('[name="_token"]').val()};ajaxRequest("map/layer/json","post","json",e,function(e){"200"==e.status?processFreeHand(e):showMsg(e.status,e.msg)});var e={type:3,id:map.id,_token:jQuery('[name="_token"]').val()};ajaxRequest("map/layer/json","post","json",e,function(e){"200"==e.status?processFreeHand(e):showMsg(e.status,e.msg)});var e={type:"farm_boundary",id:map.id,_token:jQuery('[name="_token"]').val()};if(ajaxRequest("map/layer/json","post","json",e,function(e){"200"==e.status?isEmpty(e.result)||custom_boundary(e,"farm","boundary"):showMsg(e.status,e.msg)}),"undefined"!=typeof page&&"user_farm"==page){var e={type:"draw_boundary",id:map.id,_token:jQuery('[name="_token"]').val()};ajaxRequest("map/layer/json","post","json",e,function(e){"200"==e.status?isEmpty(e.result)||custom_boundary(e,"draw",e.name):showMsg(e.status,e.msg)})}}function processFreeHand(e){jQuery.each(e.result,function(e,n){index=getIndex(selectedLayers,"unique_id",e),t=selectedLayers[index],"undefined"==typeof featureGroup[t.unique_id]&&(featureGroup[t.unique_id]=new Array),featureGroup[t.unique_id][t.name]=new L.FeatureGroup,"undefined"!=typeof t.settings?1==t.settings.active?featureGroup[t.unique_id][t.name].addTo(mymap):t.settings.active=0:(featureGroup[t.unique_id][t.name].addTo(mymap),t.settings=new Object,t.settings.active=1),L.geoJson(n,{onEachFeature:function(e,n){selectedLayers[index].layer=n,1==t.settings.active&&drawingGroup.addLayer(n),featureGroup[t.unique_id][t.name].addLayer(n),n instanceof L.Marker&&n.setIcon(L.AwesomeMarkers.icon(selectedLayers[index].style.marker)),n.bindPopup(selectedLayers[index].pc)},style:function(e,n){return t.style.polygon},pointToLayer:function(e,n){return"undefined"!=typeof t.radius?L.circle(n,parseInt(t.radius,10)):L.marker(n)}})}),calculateBounds()}function custom_boundary(e,t,n){featureGroup[t]=new Array,featureGroup[t][n]=new L.FeatureGroup,"manage"==page&&featureGroup[t][n].addTo(mymap),jQuery.each(e.result,function(e,r){L.geoJson(r,{onEachFeature:function(e,r){featureGroup[t][n].addLayer(r)},style:function(e,t){return e.style},pointToLayer:function(e,t){return"undefined"!=typeof e.properties.radius?L.circle(t,parseInt(e.properties.radius,10)):L.marker(t)}})}),"boundary"==n&&mymap.fitBounds(featureGroup[t][n].getBounds())}function calculateBounds(){}function extend_bounds(e){}function getLayersIndex(e){var t=selectedLayers.length;for(i=0;i',t=t.replace("<"+e+">",n)):t=t.replace("<"+e+">",n)}),t}function defaultSettings(){map.settings=""!=map.settings?JSON.parse(map.settings):new Object,"undefined"==typeof map.settings.width&&(map.settings.width=500),"undefined"==typeof map.settings.height&&(map.settings.height=500),"undefined"==typeof map.settings.zoom&&(map.settings.zoom=6),"undefined"==typeof map.settings.fullscreen&&(map.settings.fullscreen=1),"undefined"==typeof map.settings.https&&(map.settings.https=1)}function assingSettings(){}function saveMapData(e,t){var n=selectedLayers.length,r=new Array;for(i=0;i").attr("data-key",e.unique_id).attr("data-name",e.name).addClass("overlay_control_"+e.unique_id).html(Mustache.render(n,e)).appendTo("#visiable-layers div.dropdown-menu .custom-control-layers").find('input[type="checkbox"]').bootstrapSwitch({size:"mini",onSwitchChange:function(e,t){e.preventDefault();var n=jQuery(this).parents("li:first"),r=n.attr("data-key"),a=n.attr("data-name"),i=getIndex(selectedLayers,"unique_id",r);selectedLayers[i];t===!0?mymap.addLayer(featureGroup[r][a]):mymap.removeLayer(featureGroup[r][a])}})),"undefined"!=typeof page&&"manage"==page&&$("#visiable-layers div.dropdown-menu .custom-control-layers").sortable({stop:sortLayers}).disableSelection()}function addSubOverLayer(e){var t=jQuery('li[data-key="'+e.unique_id+'"]'),n=document.getElementById("map-overlayer-sub-controls-tmpl").innerHTML;$.each(e.style.custom,function(r,a){$("
  • ").attr("data-key",e.unique_id).attr("data-name",e.name).attr("data-val",a.val).html(Mustache.render(n,{val:a.val,t:e})).appendTo(t.find("ul")).find('input[type="checkbox"]').bootstrapSwitch({size:"mini",onSwitchChange:function(e,t){e.preventDefault();var n=jQuery(this).parents("li:first"),r=n.attr("data-key"),a=n.attr("data-name"),i=n.attr("data-val"),o=getIndex(selectedLayers,"unique_id",r),s=selectedLayers[o],u=featureGroup[r][a].getLayers();$.each(u,function(e,n){n.eachLayer(function(e){"nr"==s.style.type?between(e.feature.properties[s.style.field],i)&&(t===!0?mymap.addLayer(e):mymap.removeLayer(e)):"g"==s.style.type&&e.feature.properties[s.style.field]==i&&(t===!0?mymap.addLayer(e):mymap.removeLayer(e))})})}})}),jQuery(".subcontrol-layer-action").slimScroll({alwaysVisible:!0,height:100}),jQuery(".submenu-overlay-controls").click(function(e){e.preventDefault();var t=jQuery(this);t.toggleClass("in");var n=$(t.attr("href"));return n.hasClass("in")?n.collapse("hide"):n.collapse("show"),!1})}function baselayers_controls(e){var t=document.getElementById("map-baselayer-controls-tmpl").innerHTML;Mustache.parse(t),$("
  • ").attr("data-name",e).addClass("baselayer_control_"+e).html(Mustache.render(t,{name:e})).prependTo("#visiable-layers div.dropdown-menu .baselayers-control-layers").find('input[type="radio"]').bootstrapSwitch({size:"mini",onSwitchChange:function(e,t){e.preventDefault();var n=jQuery(this).parents("li:first"),r=n.attr("data-name");$.each(baseLayers.mymap,function(e,t){mymap.removeLayer(baseLayers.mymap[e])}),t===!0&&mymap.addLayer(baseLayers.mymap[r])}})}function removeOverlayerControl(e){jQuery("#visiable-layers").find(".overlay_control_"+e).remove()}function applyLiveStyle(e){var t=jQuery('#map-sidebar-container [name="my_unique_id"]').val(),n=getIndex(selectedLayers,"unique_id",t),r={};jQuery("#layer-polygon-styling input").each(function(){var e=jQuery(this);r[e.attr("name")]=e.val()});var a={};if(jQuery("#layer-marker-styling .default-marker-style select").each(function(){var e=jQuery(this);a[e.attr("data-name")]=e.val()}),2==selectedLayers[n].type){var i=featureGroup[selectedLayers[n].unique_id][selectedLayers[n].name].getLayers();$.each(i,function(e,t){t.eachLayer(function(e){e instanceof L.Marker?custom_marker_icon(a,e):(e instanceof L.Polyline||e instanceof L.Polygon||e instanceof L.Rectangle||e instanceof L.Circle)&&e.setStyle(r)})})}else if(3==selectedLayers[n].type){var o=selectedLayers[n].layer;o instanceof L.Marker?custom_marker_icon(a,o):(o instanceof L.Polyline||o instanceof L.Polygon||o instanceof L.Rectangle||o instanceof L.Circle)&&o.setStyle(r)}selectedLayers[n].style.polygon=r,selectedLayers[n].style.marker=a}function defaultLayerStyle(e){var t=new Object,n=new Object;"undefined"==typeof e.style&&(e.style=new Object),"undefined"!=typeof e.style.polygon?t=e.style.polygon:e.style.polygon=new Object,"undefined"!=typeof e.style.marker?n=e.style.marker:e.style.marker=new Object,"undefined"==typeof t.color&&(t.color="#ccc"),"undefined"==typeof t.opacity&&(t.opacity=1),"undefined"==typeof t.fillOpacity&&(t.fillOpacity=1),"undefined"==typeof t.fillColor&&(t.fillColor="#ccc"),"undefined"==typeof t.weight&&(t.weight=1),"undefined"==typeof n.icon&&(n.icon=""),"undefined"==typeof n.color&&(n.color="blue"),e.style.polygon=t,e.style.marker=n;var r=getIndex(selectedLayers,"unique_id",e.unique_id);return selectedLayers[r].style=e.style,e}function getLayerIndex1(e){var t=selectedLayers.length;for(i=0;i=n[0]&&e<=n[1]}function getMarkerStyle(e){if(""==e.markerColor){var t=jQuery("#default_style_marker_color").val();""!=t?e.markerColor=t:e.markerColor="blue"}if(""==e.icon){var n=jQuery("#default_style_marker_icon").val();""!=n?e.icon=n:e.icon=""}return e}function isEmpty(e){if(null==e)return!0;if(e.length>0)return!1;if(0===e.length)return!0;if("object"!=typeof e)return!0;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}function custom_marker_icon(e,t){var n=e.icon;if(n.indexOf(".png")!==-1){var r=baseURL+"assets/img/markers/"+e.markerColor+"-"+e.icon,a=L.Icon.extend({options:{iconUrl:r}});t.setIcon(new a)}else t.setIcon(L.AwesomeMarkers.icon(e))}function tinyMCEInit_Popup(e){tinyMCE.init({selector:e,theme:"modern",plugins:[],toolbar1:"insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image jbimages",toolbar2:"print preview media | forecolor backcolor emoticons | mapshapes",image_advtab:!0,relative_urls:!1,remove_script_host:!1,convert_urls:!0,autosave_ask_before_unload:!1,extended_valid_elements:"a[onclick|style|href|title|id|class|target]",setup:function(e){e.on("change",function(t){var n=jQuery(e.targetElm),r=getIndex(selectedLayers,"unique_id",n.attr("data-uniqueid"));selectedLayers[r].pc=e.getContent()})}})}function runFilterElementJS(){if(jQuery(".datepicker").length>0&&jQuery(".datepicker").datepicker({format:"yyyy-mm-dd",autoclose:!0}),jQuery(".input-daterange").length>0&&$(".input-daterange input.form-control").each(function(){$self1=$(this),$self1.daterangepicker({format:"YYYY-MM-DD",autoclose:!0,ranges:{Today:[moment(),moment()],Yesterday:[moment().subtract(1,"days"),moment().subtract(1,"days")],"Last 7 Days":[moment().subtract(6,"days"),moment()],"Last 30 Days":[moment().subtract(29,"days"),moment()],"This Month":[moment().startOf("month"),moment().endOf("month")],"Last Month":[moment().subtract(1,"month").startOf("month"),moment().subtract(1,"month").endOf("month")]}}).on("apply.daterangepicker",function(e,t){var n=$self1.attr("data-startname"),r=$self1.attr("data-endname");$self1.parents(".input-daterange:first").find('[name="'+n+'"]').val(t.startDate.format("YYYY-MM-DD")),$self1.parents(".input-daterange:first").find('[name="'+r+'"]').val(t.endDate.format("YYYY-MM-DD"))})}),jQuery(".dbisunique").length>0){var e=jQuery("select.dbisunique");e.each(function(){jQuery(this).select2({placeholder:"Select Filter",width:"100%"})})}}function filterGlobalData(){$.each(selectedLayers,function(e,t){if(2==t.type){var n=jQuery("#global_filter").serializeArray();n.push({name:"type",value:2}),n.push({name:"datasource",value:t.connection_id}),n.push({name:"layer_id",value:t._id}),n.push({name:"map_id",value:map.id}),n.push({name:"_token",value:jQuery('[name="_token"]').val()}),n.push({name:"sql_layer_name",value:t.name}),n.push({name:"query_box",value:t.query}),n.push({name:"cache_key",value:t.cache_key}),n.push({name:"cache_timer",value:0}),ajaxRequest("map/layer/json","post","json",n,function(e){"200"==e.status?processSQLJSON(e,t):showMsg(e.status,e.msg)})}})}function clearLayersAndControls(e,t){layer=featureGroup[t.unique_id][t.name],layer&&layer.clearLayers()}function getSQLFeatureData(e){var t=featureGroup[e.unique_id][e.name].getLayers(),n=new Array,r=0;return $.each(t,function(t,a){"undefined"!=typeof e.cluster&&1==e.cluster?n[r++]=a.feature.properties:a.eachLayer(function(e){n[r++]=e.feature.properties})}),n}function processheatmapJSON(e,t){"undefined"==typeof heatmap[t.unique_id]?heatmap[t.unique_id]=L.heatLayer(e.result,{radius:30}).addTo(featureGroup[t.unique_id][t.name]):heatmap[t.unique_id].setLatLngs(e.result).setOptions({radius:30}).redraw()}function deleteLayer(e){var t=getLayersIndex(e);3==selectedLayers[t].type&&drawingGroup.removeLayer(selectedLayers[t].layer),jQuery("#at-"+e).remove(),selectedLayers.splice(t,1),saveMapData("map",function(e){showMsg("success","Map saved successfully.")}),featureGroup[selectedLayers[t].unique_id][selectedLayers[t].name].clearLayers(),layerSelector.removeLayer(featureGroup[selectedLayers[t].unique_id][selectedLayers[t].name])}function add_sql_legend(e,t){1==t&&(2!=e.type||"nr"!=e.style.type&&"g"!=e.style.type||(legend[e.unique_id]=L.control({position:"bottomright"}),legend[e.unique_id].onAdd=function(t){var n=L.DomUtil.create("div","info mapfig-legend");return n.innerHTML+='
    '+e.name+"
    ",$.each(e.style.custom,function(e,t){var r=t.style.icon;if(r.indexOf(".png")!==-1){var a=baseURL+"assets/img/markers/"+t.style.markerColor+"-"+t.style.icon;n.innerHTML+='
    '+t.val+"
    "}else n.innerHTML+='
    '+t.val+"
    "}),n},mymap.addControl(legend[e.unique_id])))}function user_sidebar_chk(){"undefined"!=typeof page&&"user_farm"==page&&jQuery(".custom-theme-sidebar,#current-active-layer").on("change",'input[type="checkbox"]',function(e){e.preventDefault();var t=jQuery(this),n=t.is(":checked"),r=t.parents("li:first"),a=r.attr("data-key"),i=r.attr("data-name"),o=getIndex(selectedLayers,"unique_id",a),s=selectedLayers[o];if("undefined"==typeof s)return void(n===!0?mymap.addLayer(featureGroup[a][i]):mymap.removeLayer(featureGroup[a][i]));if(n===!0)activeLayers.push({id:s._id,order:0}),order_current_active_layers(),t.hasClass("active-layer-chk")||add_current_layer_text(s),mymap.addLayer(featureGroup[s.unique_id][s.name]),featureGroup[s.unique_id][s.name].bringToFront(),add_sql_legend(s,!0);else{var o=getIndex(activeLayers,"id",s._id);activeLayers.splice(o,1),t.hasClass("active-layer-chk")||jQuery("#user-farm-at-layers-"+s.unique_id).remove(),mymap.removeLayer(featureGroup[s.unique_id][s.name]),"undefined"!=typeof legend[a]&&legend[s.unique_id].removeFrom(mymap)}})}function add_current_layer_text(e){if("undefined"!=typeof page&&"user_farm"==page){var t=document.getElementById("user-farm-active-layers-tmpl").innerHTML;Mustache.parse(t),jQuery("#current-active-layer ul").prepend(Mustache.render(t,e))}}function order_current_active_layers(){activeLayers.sort(sort_value_layer);var e=activeLayers.length;for(i=0;i"'`=\/]/g,function(e){return v[e]})}function u(t,n){function a(){if(g&&!v)for(;m.length;)delete y[m.pop()];else m=[];g=!1,v=!1}function i(e){if("string"==typeof e&&(e=e.split(L,2)),!h(e)||2!==e.length)throw new Error("Invalid tags: "+e);s=new RegExp(r(e[0])+"\\s*"),u=new RegExp("\\s*"+r(e[1])),p=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var s,u,p,d=[],y=[],m=[],g=!1,v=!1;i(n||e.tags);for(var k,x,S,M,q,O,T=new f(t);!T.eos();){if(k=T.pos,S=T.scanUntil(s))for(var I=0,C=S.length;I0?i[i.length-1][4]:r;break;default:a.push(t)}return r}function f(e){this.string=e,this.tail=e,this.pos=0}function p(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function d(){this.cache={}}var y=Object.prototype.toString,h=Array.isArray||function(e){return"[object Array]"===y.call(e)},m=RegExp.prototype.test,g=/\S/,v={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},_=/\s*/,L=/\s+/,w=/\s*=/,b=/\s*\}/,j=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},p.prototype.push=function(e){return new p(e,this)},p.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var i,o,s=this,u=!1;s;){if(e.indexOf(".")>0)for(n=s.view,i=e.split("."),o=0;null!=n&&o"===i?o=this.renderPartial(a,t,n,r):"&"===i?o=this.unescapedValue(a,t):"name"===i?o=this.escapedValue(a,t):"text"===i&&(o=this.rawValue(a)),void 0!==o&&(s+=o);return s},d.prototype.renderSection=function(e,n,r,a){function i(e){return o.render(e,n,r)}var o=this,s="",u=n.lookup(e[1]);if(u){if(h(u))for(var l=0,c=u.length;l=0&&o>i;i+=e){var s=a?a[i]:i;r=n(r,t[s],s,t)}return r}return function(n,r,a,i){ r=_(r,i,4);var o=!S(n)&&v.keys(n),s=(o||n).length,u=e>0?0:s-1;return arguments.length<3&&(a=n[o?o[u]:u],u+=e),t(n,r,a,o,u,s)}}function t(e){return function(t,n,r){n=L(n,r);for(var a=x(t),i=e>0?0:a-1;i>=0&&a>i;i+=e)if(n(t[i],i,t))return i;return-1}}function n(e,t,n){return function(r,a,i){var o=0,s=x(r);if("number"==typeof i)e>0?o=i>=0?i:Math.max(i+s,o):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return i=n(r,a),r[i]===a?i:-1;if(a!==a)return i=t(c.call(r,o,s),v.isNaN),i>=0?i+o:-1;for(i=e>0?o:s-1;i>=0&&s>i;i+=e)if(r[i]===a)return i;return-1}}function r(e,t){var n=I.length,r=e.constructor,a=v.isFunction(r)&&r.prototype||s,i="constructor";for(v.has(e,i)&&!v.contains(t,i)&&t.push(i);n--;)i=I[n],i in e&&e[i]!==a[i]&&!v.contains(t,i)&&t.push(i)}var a=this,i=a._,o=Array.prototype,s=Object.prototype,u=Function.prototype,l=o.push,c=o.slice,f=s.toString,p=s.hasOwnProperty,d=Array.isArray,y=Object.keys,h=u.bind,m=Object.create,g=function(){},v=function(e){return e instanceof v?e:this instanceof v?void(this._wrapped=e):new v(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):a._=v,v.VERSION="1.8.3";var _=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)};case 4:return function(n,r,a,i){return e.call(t,n,r,a,i)}}return function(){return e.apply(t,arguments)}},L=function(e,t,n){return null==e?v.identity:v.isFunction(e)?_(e,t,n):v.isObject(e)?v.matcher(e):v.property(e)};v.iteratee=function(e,t){return L(e,t,1/0)};var w=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var a=1;r>a;a++)for(var i=arguments[a],o=e(i),s=o.length,u=0;s>u;u++){var l=o[u];t&&void 0!==n[l]||(n[l]=i[l])}return n}},b=function(e){if(!v.isObject(e))return{};if(m)return m(e);g.prototype=e;var t=new g;return g.prototype=null,t},j=function(e){return function(t){return null==t?void 0:t[e]}},k=Math.pow(2,53)-1,x=j("length"),S=function(e){var t=x(e);return"number"==typeof t&&t>=0&&k>=t};v.each=v.forEach=function(e,t,n){t=_(t,n);var r,a;if(S(e))for(r=0,a=e.length;a>r;r++)t(e[r],r,e);else{var i=v.keys(e);for(r=0,a=i.length;a>r;r++)t(e[i[r]],i[r],e)}return e},v.map=v.collect=function(e,t,n){t=L(t,n);for(var r=!S(e)&&v.keys(e),a=(r||e).length,i=Array(a),o=0;a>o;o++){var s=r?r[o]:o;i[o]=t(e[s],s,e)}return i},v.reduce=v.foldl=v.inject=e(1),v.reduceRight=v.foldr=e(-1),v.find=v.detect=function(e,t,n){var r;return r=S(e)?v.findIndex(e,t,n):v.findKey(e,t,n),void 0!==r&&r!==-1?e[r]:void 0},v.filter=v.select=function(e,t,n){var r=[];return t=L(t,n),v.each(e,function(e,n,a){t(e,n,a)&&r.push(e)}),r},v.reject=function(e,t,n){return v.filter(e,v.negate(L(t)),n)},v.every=v.all=function(e,t,n){t=L(t,n);for(var r=!S(e)&&v.keys(e),a=(r||e).length,i=0;a>i;i++){var o=r?r[i]:i;if(!t(e[o],o,e))return!1}return!0},v.some=v.any=function(e,t,n){t=L(t,n);for(var r=!S(e)&&v.keys(e),a=(r||e).length,i=0;a>i;i++){var o=r?r[i]:i;if(t(e[o],o,e))return!0}return!1},v.contains=v.includes=v.include=function(e,t,n,r){return S(e)||(e=v.values(e)),("number"!=typeof n||r)&&(n=0),v.indexOf(e,t,n)>=0},v.invoke=function(e,t){var n=c.call(arguments,2),r=v.isFunction(t);return v.map(e,function(e){var a=r?t:e[t];return null==a?a:a.apply(e,n)})},v.pluck=function(e,t){return v.map(e,v.property(t))},v.where=function(e,t){return v.filter(e,v.matcher(t))},v.findWhere=function(e,t){return v.find(e,v.matcher(t))},v.max=function(e,t,n){var r,a,i=-1/0,o=-1/0;if(null==t&&null!=e){e=S(e)?e:v.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],r>i&&(i=r)}else t=L(t,n),v.each(e,function(e,n,r){a=t(e,n,r),(a>o||a===-1/0&&i===-1/0)&&(i=e,o=a)});return i},v.min=function(e,t,n){var r,a,i=1/0,o=1/0;if(null==t&&null!=e){e=S(e)?e:v.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],i>r&&(i=r)}else t=L(t,n),v.each(e,function(e,n,r){a=t(e,n,r),(o>a||1/0===a&&1/0===i)&&(i=e,o=a)});return i},v.shuffle=function(e){for(var t,n=S(e)?e:v.values(e),r=n.length,a=Array(r),i=0;r>i;i++)t=v.random(0,i),t!==i&&(a[i]=a[t]),a[t]=n[i];return a},v.sample=function(e,t,n){return null==t||n?(S(e)||(e=v.values(e)),e[v.random(e.length-1)]):v.shuffle(e).slice(0,Math.max(0,t))},v.sortBy=function(e,t,n){return t=L(t,n),v.pluck(v.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return e.index-t.index}),"value")};var M=function(e){return function(t,n,r){var a={};return n=L(n,r),v.each(t,function(r,i){var o=n(r,i,t);e(a,r,o)}),a}};v.groupBy=M(function(e,t,n){v.has(e,n)?e[n].push(t):e[n]=[t]}),v.indexBy=M(function(e,t,n){e[n]=t}),v.countBy=M(function(e,t,n){v.has(e,n)?e[n]++:e[n]=1}),v.toArray=function(e){return e?v.isArray(e)?c.call(e):S(e)?v.map(e,v.identity):v.values(e):[]},v.size=function(e){return null==e?0:S(e)?e.length:v.keys(e).length},v.partition=function(e,t,n){t=L(t,n);var r=[],a=[];return v.each(e,function(e,n,i){(t(e,n,i)?r:a).push(e)}),[r,a]},v.first=v.head=v.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:v.initial(e,e.length-t)},v.initial=function(e,t,n){return c.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},v.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:v.rest(e,Math.max(0,e.length-t))},v.rest=v.tail=v.drop=function(e,t,n){return c.call(e,null==t||n?1:t)},v.compact=function(e){return v.filter(e,v.identity)};var q=function(e,t,n,r){for(var a=[],i=0,o=r||0,s=x(e);s>o;o++){var u=e[o];if(S(u)&&(v.isArray(u)||v.isArguments(u))){t||(u=q(u,t,n));var l=0,c=u.length;for(a.length+=c;c>l;)a[i++]=u[l++]}else n||(a[i++]=u)}return a};v.flatten=function(e,t){return q(e,t,!1)},v.without=function(e){return v.difference(e,c.call(arguments,1))},v.uniq=v.unique=function(e,t,n,r){v.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=L(n,r));for(var a=[],i=[],o=0,s=x(e);s>o;o++){var u=e[o],l=n?n(u,o,e):u;t?(o&&i===l||a.push(u),i=l):n?v.contains(i,l)||(i.push(l),a.push(u)):v.contains(a,u)||a.push(u)}return a},v.union=function(){return v.uniq(q(arguments,!0,!0))},v.intersection=function(e){for(var t=[],n=arguments.length,r=0,a=x(e);a>r;r++){var i=e[r];if(!v.contains(t,i)){for(var o=1;n>o&&v.contains(arguments[o],i);o++);o===n&&t.push(i)}}return t},v.difference=function(e){var t=q(arguments,!0,!0,1);return v.filter(e,function(e){return!v.contains(t,e)})},v.zip=function(){return v.unzip(arguments)},v.unzip=function(e){for(var t=e&&v.max(e,x).length||0,n=Array(t),r=0;t>r;r++)n[r]=v.pluck(e,r);return n},v.object=function(e,t){for(var n={},r=0,a=x(e);a>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},v.findIndex=t(1),v.findLastIndex=t(-1),v.sortedIndex=function(e,t,n,r){n=L(n,r,1);for(var a=n(t),i=0,o=x(e);o>i;){var s=Math.floor((i+o)/2);n(e[s])i;i++,e+=n)a[i]=e;return a};var O=function(e,t,n,r,a){if(!(r instanceof t))return e.apply(n,a);var i=b(e.prototype),o=e.apply(i,a);return v.isObject(o)?o:i};v.bind=function(e,t){if(h&&e.bind===h)return h.apply(e,c.call(arguments,1));if(!v.isFunction(e))throw new TypeError("Bind must be called on a function");var n=c.call(arguments,2),r=function(){return O(e,r,t,this,n.concat(c.call(arguments)))};return r},v.partial=function(e){var t=c.call(arguments,1),n=function(){for(var r=0,a=t.length,i=Array(a),o=0;a>o;o++)i[o]=t[o]===v?arguments[r++]:t[o];for(;r=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=v.bind(e[n],e);return e},v.memoize=function(e,t){var n=function(r){var a=n.cache,i=""+(t?t.apply(this,arguments):r);return v.has(a,i)||(a[i]=e.apply(this,arguments)),a[i]};return n.cache={},n},v.delay=function(e,t){var n=c.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},v.defer=v.partial(v.delay,v,1),v.throttle=function(e,t,n){var r,a,i,o=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:v.now(),o=null,i=e.apply(r,a),o||(r=a=null)};return function(){var l=v.now();s||n.leading!==!1||(s=l);var c=t-(l-s);return r=this,a=arguments,0>=c||c>t?(o&&(clearTimeout(o),o=null),s=l,i=e.apply(r,a),o||(r=a=null)):o||n.trailing===!1||(o=setTimeout(u,c)),i}},v.debounce=function(e,t,n){var r,a,i,o,s,u=function(){var l=v.now()-o;t>l&&l>=0?r=setTimeout(u,t-l):(r=null,n||(s=e.apply(i,a),r||(i=a=null)))};return function(){i=this,a=arguments,o=v.now();var l=n&&!r;return r||(r=setTimeout(u,t)),l&&(s=e.apply(i,a),i=a=null),s}},v.wrap=function(e,t){return v.partial(t,e)},v.negate=function(e){return function(){return!e.apply(this,arguments)}},v.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},v.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},v.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},v.once=v.partial(v.before,2);var T=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];v.keys=function(e){if(!v.isObject(e))return[];if(y)return y(e);var t=[];for(var n in e)v.has(e,n)&&t.push(n);return T&&r(e,t),t},v.allKeys=function(e){if(!v.isObject(e))return[];var t=[];for(var n in e)t.push(n);return T&&r(e,t),t},v.values=function(e){for(var t=v.keys(e),n=t.length,r=Array(n),a=0;n>a;a++)r[a]=e[t[a]];return r},v.mapObject=function(e,t,n){t=L(t,n);for(var r,a=v.keys(e),i=a.length,o={},s=0;i>s;s++)r=a[s],o[r]=t(e[r],r,e);return o},v.pairs=function(e){for(var t=v.keys(e),n=t.length,r=Array(n),a=0;n>a;a++)r[a]=[t[a],e[t[a]]];return r},v.invert=function(e){for(var t={},n=v.keys(e),r=0,a=n.length;a>r;r++)t[e[n[r]]]=n[r];return t},v.functions=v.methods=function(e){var t=[];for(var n in e)v.isFunction(e[n])&&t.push(n);return t.sort()},v.extend=w(v.allKeys),v.extendOwn=v.assign=w(v.keys),v.findKey=function(e,t,n){t=L(t,n);for(var r,a=v.keys(e),i=0,o=a.length;o>i;i++)if(r=a[i],t(e[r],r,e))return r},v.pick=function(e,t,n){var r,a,i={},o=e;if(null==o)return i;v.isFunction(t)?(a=v.allKeys(o),r=_(t,n)):(a=q(arguments,!1,!1,1),r=function(e,t,n){return t in n},o=Object(o));for(var s=0,u=a.length;u>s;s++){var l=a[s],c=o[l];r(c,l,o)&&(i[l]=c)}return i},v.omit=function(e,t,n){if(v.isFunction(t))t=v.negate(t);else{var r=v.map(q(arguments,!1,!1,1),String);t=function(e,t){return!v.contains(r,t)}}return v.pick(e,t,n)},v.defaults=w(v.allKeys,!0),v.create=function(e,t){var n=b(e);return t&&v.extendOwn(n,t),n},v.clone=function(e){return v.isObject(e)?v.isArray(e)?e.slice():v.extend({},e):e},v.tap=function(e,t){return t(e),e},v.isMatch=function(e,t){var n=v.keys(t),r=n.length;if(null==e)return!r;for(var a=Object(e),i=0;r>i;i++){var o=n[i];if(t[o]!==a[o]||!(o in a))return!1}return!0};var C=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof v&&(e=e._wrapped),t instanceof v&&(t=t._wrapped);var a=f.call(e);if(a!==f.call(t))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var i="[object Array]"===a;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var o=e.constructor,s=t.constructor;if(o!==s&&!(v.isFunction(o)&&o instanceof o&&v.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!C(e[u],t[u],n,r))return!1}else{var l,c=v.keys(e);if(u=c.length,v.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!v.has(t,l)||!C(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0};v.isEqual=function(e,t){return C(e,t)},v.isEmpty=function(e){return null==e||(S(e)&&(v.isArray(e)||v.isString(e)||v.isArguments(e))?0===e.length:0===v.keys(e).length)},v.isElement=function(e){return!(!e||1!==e.nodeType)},v.isArray=d||function(e){return"[object Array]"===f.call(e)},v.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},v.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){v["is"+e]=function(t){return f.call(t)==="[object "+e+"]"}}),v.isArguments(arguments)||(v.isArguments=function(e){return v.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(v.isFunction=function(e){return"function"==typeof e||!1}),v.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},v.isNaN=function(e){return v.isNumber(e)&&e!==+e},v.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===f.call(e)},v.isNull=function(e){return null===e},v.isUndefined=function(e){return void 0===e},v.has=function(e,t){return null!=e&&p.call(e,t)},v.noConflict=function(){return a._=i,this},v.identity=function(e){return e},v.constant=function(e){return function(){return e}},v.noop=function(){},v.property=j,v.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},v.matcher=v.matches=function(e){return e=v.extendOwn({},e),function(t){return v.isMatch(t,e)}},v.times=function(e,t,n){var r=Array(Math.max(0,e));t=_(t,n,1);for(var a=0;e>a;a++)r[a]=t(a);return r},v.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},v.now=Date.now||function(){return(new Date).getTime()};var G={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Q=v.invert(G),A=function(e){var t=function(t){return e[t]},n="(?:"+v.keys(e).join("|")+")",r=RegExp(n),a=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(a,t):e}};v.escape=A(G),v.unescape=A(Q),v.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),v.isFunction(r)?r.call(e):r};var P=0;v.uniqueId=function(e){var t=++P+"";return e?e+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,E={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\u2028|\u2029/g,R=function(e){return"\\"+E[e]};v.template=function(e,t,n){!t&&n&&(t=n),t=v.defaults({},t,v.templateSettings);var r=RegExp([(t.escape||F).source,(t.interpolate||F).source,(t.evaluate||F).source].join("|")+"|$","g"),a=0,i="__p+='";e.replace(r,function(t,n,r,o,s){return i+=e.slice(a,s).replace(N,R),a=s+t.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(s){throw s.source=i,s}var u=function(e){return o.call(this,e,v)},l=t.variable||"obj";return u.source="function("+l+"){\n"+i+"}",u},v.chain=function(e){var t=v(e);return t._chain=!0,t};var D=function(e,t){return e._chain?v(t).chain():t};v.mixin=function(e){v.each(v.functions(e),function(t){var n=v[t]=e[t];v.prototype[t]=function(){var e=[this._wrapped];return l.apply(e,arguments),D(this,n.apply(v,e))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];v.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],D(this,n)}}),v.each(["concat","join","slice"],function(e){var t=o[e];v.prototype[e]=function(){return D(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}.call(this),"undefined"!=typeof module&&(module.exports=simpleheat),simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t){t=void 0===t?15:t;var n=this._circle=this._createCanvas(),r=n.getContext("2d"),a=this._r=e+t;return n.width=n.height=2*a,r.shadowOffsetX=r.shadowOffsetY=2*a,r.shadowBlur=t,r.shadowColor="black",r.beginPath(),r.arc(-a,-a,e,0,2*Math.PI,!0),r.closePath(),r.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){var t=this._createCanvas(),n=t.getContext("2d"),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(var a in e)r.addColorStop(+a,e[a]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var n,r=0,a=this._data.length;rthis._max&&(this._max=r[2])}for(this._heat.max(this._max),e=0,t=d.length;e0?layername=selectedBaseLayers[0].name:$.each(baseLayers.mymap,function(e,t){layername=e}),currentBaseMap=isGoogle()?L.tileLayer("https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",{maxZoom:20,subdomains:["mt0","mt1","mt2","mt3"]}).addTo(mymap):L.tileLayer(baseLayers.mymap[layername]._url,{maxZoom:18,attribution:baseLayers.mymap[layername].options.attribution,id:baseLayers.mymap[layername].options.id}).addTo(mymap),layerSelector=L.control.layers({},{}),mymap.addControl(layerSelector),assingSettings()}),jQuery(document).ready(function(){initLayer();var e=getDetailsByAttr(selectedLayers,"type",2);0==e.length&&ajaxLoadSucess()}).ajaxStop(function(){ajaxLoadSucess()});