YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/OpenStreetMap/resources/Map.min.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */"use strict";jQuery.Class("OpenStreetMap_Map_Js",{},{container:!1,mapInstance:!1,selectedParams:!1,layerMarkers:!1,markers:!1,cacheMarkers:[],polygonLayer:!1,routeLayer:!1,recordsIds:"",cacheLayerMarkers:{},indirectPointLayer:{},setSelectedParams:function setSelectedParams(params){delete params.view,this.selectedParams=params;},registerMap:function registerMap(startCoordinate,startZoom){var attribution="&copy; <a href=\"https://yetiforce.com/en/yetiforce/license\" rel=\"noreferrer noopener\">YetiForce Map powered by Open Street Map</a>";return CONFIG.disableBranding&&(attribution=""),this.mapInstance=L.map("mapid").setView(startCoordinate,startZoom),L.tileLayer($(".js-tile-layer-server").val(),{maxZoom:19,attribution:attribution}).addTo(this.mapInstance),this.mapInstance},setMarkers:function setMarkers(data){var thisInstance=this,markerArray=[],container=this.container,map=this.mapInstance;if("undefined"!=typeof data.coordinates){var markers=L.markerClusterGroup({maxClusterRadius:10});"boolean"!=typeof this.layerMarkers&&map.removeLayer(this.layerMarkers);var records=[];data.coordinates.forEach(function(e){markerArray.push([e.lat,e.lon]);var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"blue",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);markers.addLayer(marker),records.push(e.recordId);}),this.recordsIds=records,this.markers=data.coordinates,this.layerMarkers=markers,map.addLayer(markers);}if("boolean"!=typeof this.polygonLayer&&map.removeLayer(this.polygonLayer),"undefined"!=typeof data.coordinatesCenter)if("undefined"==typeof data.coordinatesCenter.error){var radius=container.find(".js-radius").val();markerArray.push([data.coordinatesCenter.lat,data.coordinatesCenter.lon]);var marker=L.marker([data.coordinatesCenter.lat,data.coordinatesCenter.lon],{icon:L.AwesomeMarkers.icon({icon:"search",markerColor:"red",prefix:"fa"})}).bindPopup(this.getMarkerPopup(container.find(".js-search-address").val(),data.coordinatesCenter));if(map.addLayer(marker),$.isNumeric(radius)){radius=1e3*parseInt(radius);var circle=L.circle([data.coordinatesCenter.lat,data.coordinatesCenter.lon],radius,{color:"red",fillColor:"#f03",fillOpacity:.05});this.polygonLayer=L.featureGroup([circle]),map.addLayer(this.polygonLayer);}}else Vtiger_Helper_Js.showMessage({title:app.vtranslate("JS_LBL_PERMISSION"),text:data.coordinatesCenter.error,type:"error"});"undefined"!=typeof data.cache&&Object.keys(data.cache).forEach(function(key){"undefined"!=typeof thisInstance.cacheLayerMarkers[key]&&map.removeLayer(thisInstance.cacheLayerMarkers[key]);var markersCache=L.markerClusterGroup({maxClusterRadius:10}),coordinates=data.cache[key];coordinates.forEach(function(e){if(-1===thisInstance.recordsIds.indexOf(e.recordId)){markerArray.push([e.lat,e.lon]);var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"orange",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);markersCache.addLayer(marker);}}),thisInstance.cacheMarkers[key]=coordinates,map.addLayer(markersCache),thisInstance.cacheLayerMarkers[key]=markersCache;});var legendContainer=this.container.find(".js-legend-container");if("undefined"!=typeof data.legend){var html="";data.legend.forEach(function(e){html+="<div class=\"float-left mt-2\"><span class=\"leegendIcon mt-1\" style=\"background:"+e.color+"\"></span> "+e.value+"</div>";}),legendContainer.html(html);}else legendContainer.html("");markerArray.length&&map.fitBounds(markerArray),this.container.find(".groupNeighbours").prop("checked",!0);},showCalculateBtn:function showCalculateBtn(){var container=this.container,endAddress=container.find(".end").val(),startAddress=container.find(".start").val();0<endAddress.length&&0<startAddress.length&&container.find(".js-calculate-route").parent().removeClass("d-none");},registerCacheEvents:function registerCacheEvents(container){var _this=this,thisInstance=this;container.find(".showRecordsFromCache").on("change",function(e){var currentTarget=$(e.currentTarget),moduleName=currentTarget.data("module");currentTarget.is(":checked")?AppConnector.request({module:"OpenStreetMap",action:"GetMarkers",srcModule:app.getModuleName(),cache:[moduleName]}).done(function(response){_this.setMarkers(response.result);}):_this.mapInstance.removeLayer(_this.cacheLayerMarkers[moduleName]);}),container.find(".copyToClipboard").on("click",function(){var params={module:"OpenStreetMap",action:"ClipBoard",mode:"save",recordIds:JSON.stringify(thisInstance.recordsIds),srcModule:app.getModuleName()};AppConnector.request(params).done(function(response){Vtiger_Helper_Js.showMessage({text:app.vtranslate("JS_NOTIFY_COPY_TEXT"),type:"success"});var countRecords=container.find(".countRecords"+app.getModuleName());countRecords.html(response.result),countRecords.closest(".cacheModuleContainer").find(".js-delete-clip-board").removeClass("d-none");});}),container.find(".js-delete-clip-board").on("click",function(e){var currentTarget=$(e.currentTarget),moduleName=currentTarget.data("module");AppConnector.request({module:"OpenStreetMap",action:"ClipBoard",mode:"delete",srcModule:moduleName}).done(function(){Vtiger_Helper_Js.showMessage({title:app.vtranslate("JS_LBL_PERMISSION"),text:app.vtranslate("JS_SAVE_NOTIFY_OK"),type:"success"});var countRecords=container.find(".countRecords"+moduleName);countRecords.html(""),currentTarget.addClass("d-none"),countRecords.closest(".cacheModuleContainer").find(".showRecordsFromCache").prop("checked",!1),countRecords.closest(".cacheModuleContainer").find(".showRecordsFromCache").trigger("change");});}),container.find(".addAllRecords").on("click",function(e){var currentTarget=$(e.currentTarget),moduleName=currentTarget.data("module");AppConnector.request({module:"OpenStreetMap",action:"ClipBoard",mode:"addAllRecords",srcModule:moduleName}).done(function(response){Vtiger_Helper_Js.showMessage({text:app.vtranslate("JS_MESSAGE_DOWNLOADED_ADDRESS_DATA"),type:"success"}),container.find(".countRecords"+moduleName).html(response.result.count);var moduleContainer=currentTarget.closest(".cacheModuleContainer");moduleContainer.find(".showRecordsFromCache").prop("checked",!0),moduleContainer.find(".showRecordsFromCache").trigger("change"),"0"!=response.result.count&&moduleContainer.find(".js-delete-clip-board").removeClass("d-none");});});},getCacheParamsToRequest:function getCacheParamsToRequest(){var params=[];return this.container.find(".showRecordsFromCache").each(function(){var currentObject=$(this);currentObject.is(":checked")&&params.push(currentObject.data("module"));}),params},registerSearchCompany:function registerSearchCompany(){var _this2=this,searchValue=this.container.find(".js-search-company"),searchModule=this.container.find(".searchModule");$.widget("custom.ivAutocomplete",$.ui.autocomplete,{_create:function _create(){this._super(),this.widget().menu("option","items","> :not(.ui-autocomplete-category)");},_renderMenu:function _renderMenu(ul,items){var that=this,currentCategory="";$.each(items,function(_index,item){var li;console.log(item.category!=currentCategory,item),item.category!=currentCategory&&(ul.append("<li class='ui-autocomplete-category'>"+item.category+"</li>"),currentCategory=item.category),li=that._renderItemData(ul,item),item.category&&li.attr("aria-label",item.category+" : "+item.label);});},_renderItemData:function _renderItemData(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item)},_renderItem:function _renderItem(ul,item){return $("<li>").data("item.autocomplete",item).append($("<a></a>").html(item.label)).appendTo(ul)}}),searchValue.ivAutocomplete({delay:"600",minLength:"3",source:function source(_request,response){AppConnector.request({module:searchModule.val(),currentModule:app.getModuleName(),searchModule:searchModule.val(),view:"BasicAjax",mode:"showSearchResults",value:searchValue.val(),html:!1}).done(function(responseAjax){responseAjax=JSON.parse(responseAjax);var responseDataList=responseAjax.result;0>=responseDataList.length&&responseDataList.push({label:app.vtranslate("JS_NO_RESULTS_FOUND"),type:"no results",category:""}),response(responseDataList);});},select:function select(_event,ui){_this2.recordsIds.push(ui.item.id),AppConnector.request({module:"OpenStreetMap",action:"ClipBoard",mode:"addRecord",record:ui.item.id,srcModuleName:searchModule.val()}).done(function(response){if(1==response.result.length){var marker=L.marker([response.result[0].lat,response.result[0].lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"cadetblue",prefix:"fa",iconColor:response.result[0].color})}).bindPopup(response.result[0].label);_this2.layerMarkers.addLayer(marker),_this2.mapInstance.addLayer(_this2.layerMarkers),_this2.mapInstance.setView(new L.LatLng(response.result[0].lat,response.result[0].lon),13);}else Vtiger_Helper_Js.showMessage({title:app.vtranslate("JS_LBL_PERMISSION"),text:response.result,type:"error"});});}});},registerSearchAddress:function registerSearchAddress(){var _this3=this,searchValue=this.container.find(".js-search-address"),searchBtn=this.container.find(".js-search-btn"),operator=this.container.find(".js-select-operator");operator.length&&operator.val()&&(searchValue.autocomplete({delay:600,minLength:3,source:function source(request,response){AppConnector.request({module:app.getModuleName(),action:"Fields",mode:"findAddress",type:operator.val(),value:request.term}).done(function(requestData){!1===requestData.result?app.showNotify({title:app.vtranslate("JS_ERROR"),type:"error"}):requestData.result.length?response(requestData.result):response([{label:app.vtranslate("JS_NO_RESULTS_FOUND"),value:""}]);}).fail(function(_textStatus,_errorThrown,jqXHR){app.showNotify({title:app.vtranslate("JS_ERROR"),text:jqXHR.responseJSON.error.message,type:"error",animation:"show"}),response([{label:app.vtranslate("JS_NO_RESULTS_FOUND"),value:""}]);});},select:function select(_event,ui){if(ui.item.coordinates){var marker=L.marker([ui.item.coordinates.lat,ui.item.coordinates.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"cadetblue",prefix:"fa"})}).bindPopup(_this3.getMarkerPopup(ui.item.label,ui.item.coordinates));_this3.layerMarkers.addLayer(marker),_this3.mapInstance.addLayer(_this3.layerMarkers),_this3.mapInstance.setView(new L.LatLng(ui.item.coordinates.lat,ui.item.coordinates.lon),10);}else searchValue.val(ui.item.label),searchBtn.trigger("click");}}).autocomplete("instance")._renderItem=function(ul,item){return $("<li>").append("<div><span class=\"fi fi-".concat(item.countryCode,"\"></span> ").concat(item.label,"</div>")).appendTo(ul)}),this.container.find(".js-search-address,.js-radius").on("keydown",function(e){"Enter"===e.code&&searchBtn.trigger("click");}),searchBtn.on("click",function(){var progressIndicatorElement=jQuery.progressIndicator({position:_this3.container,blockInfo:{enabled:!0}}),params={module:"OpenStreetMap",action:"GetMarkers",srcModule:app.getModuleName(),searchValue:_this3.container.find(".js-search-address").val(),cache:_this3.getCacheParamsToRequest()},radiusValue=_this3.container.find(".js-radius").val();""!==radiusValue&&parseInt(radiusValue)&&(params.radius=parseInt(radiusValue)),AppConnector.request($.extend(_this3.selectedParams,params)).done(function(response){progressIndicatorElement.progressIndicator({mode:"hide"}),_this3.setMarkers(response.result);});});},registerMyLocation:function registerMyLocation(){var _this4=this,locationBtn=this.container.find(".js-my-location-btn");return navigator.geolocation?void(navigator.permissions.query({name:"geolocation"}).then(function(response){"denied"===response.state&&locationBtn.addClass("d-none");}),locationBtn.on("click",function(){navigator.geolocation.getCurrentPosition(function(position){var marker=L.marker([position.coords.latitude,position.coords.longitude],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"cadetblue",prefix:"fa"})}).bindPopup(_this4.getMarkerPopup(locationBtn.data("label"),{lat:position.coords.latitude,lon:position.coords.longitude}));_this4.layerMarkers.addLayer(marker),_this4.mapInstance.addLayer(_this4.layerMarkers),_this4.mapInstance.setView(new L.LatLng(position.coords.latitude,position.coords.longitude),10);});})):void locationBtn.addClass("d-none")},registerBasicModal:function registerBasicModal(){var layer,description,thisInstance=this,container=this.container,map=thisInstance.mapInstance;app.registerBlockAnimationEvent(container),thisInstance.registerCacheEvents(container),container.find(".groupBy").on("click",function(){var progressIndicatorElement=jQuery.progressIndicator({position:container,blockInfo:{enabled:!0}}),params={module:"OpenStreetMap",action:"GetMarkers",srcModule:app.getModuleName(),groupBy:container.find(".fieldsToGroup").val(),searchValue:container.find(".js-search-address").val(),radius:container.find(".js-radius").val(),cache:thisInstance.getCacheParamsToRequest()};params=$.extend(thisInstance.selectedParams,params),AppConnector.request(params).done(function(response){progressIndicatorElement.progressIndicator({mode:"hide"}),thisInstance.setMarkers(response.result);});}),container.find(".groupNeighbours").on("change",function(e){var currentTarget=$(e.currentTarget);map.removeLayer(thisInstance.layerMarkers);var markers=thisInstance.markers;if(currentTarget.is(":checked"))layer=L.markerClusterGroup({maxClusterRadius:10}),markers.forEach(function(e){var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"blue",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);layer.addLayer(marker);}),Object.keys(thisInstance.cacheLayerMarkers).forEach(function(key){map.removeLayer(thisInstance.cacheLayerMarkers[key]);var cacheLayer=L.markerClusterGroup({maxClusterRadius:10});thisInstance.cacheMarkers[key].forEach(function(e){var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"orange",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);cacheLayer.addLayer(marker);}),thisInstance.cacheLayerMarkers[key]=cacheLayer,map.addLayer(cacheLayer);});else {var markerArray=[];markers.forEach(function(e){var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"blue",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);markerArray.push(marker);}),layer=L.featureGroup(markerArray),Object.keys(thisInstance.cacheLayerMarkers).forEach(function(key){map.removeLayer(thisInstance.cacheLayerMarkers[key]);var markerArray=[];thisInstance.cacheMarkers[key].forEach(function(e){var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"orange",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);markerArray.push(marker);}),thisInstance.cacheLayerMarkers[key]=L.featureGroup(markerArray),map.addLayer(thisInstance.cacheLayerMarkers[key]);});}thisInstance.layerMarkers=layer,map.addLayer(layer);});var startIconLayer=!1;container.on("click",".startTrack",function(e){startIconLayer&&map.removeLayer(startIconLayer);var currentTarget=$(e.currentTarget),containerPopup=currentTarget.closest(".leaflet-popup-content");description=containerPopup.find(".description").html();var startElement=container.find(".start"),coordinates=containerPopup.find(".coordinates");description=description.replace(/\<br\>/gi,", "),startElement.val(description),startElement.data("lat",coordinates.data("lat")),startElement.data("lon",coordinates.data("lon"));var marker=L.marker([coordinates.data("lat"),coordinates.data("lon")],{icon:L.AwesomeMarkers.icon({icon:"truck",markerColor:"green",prefix:"fa"})}).bindPopup(containerPopup.html());startIconLayer=L.featureGroup([marker]),map.addLayer(startIconLayer),thisInstance.showCalculateBtn();});var endIconLayer=!1;container.on("click",".endTrack",function(e){endIconLayer&&map.removeLayer(endIconLayer);var currentTarget=$(e.currentTarget),containerPopup=currentTarget.closest(".leaflet-popup-content");description=containerPopup.find(".description").html();var endElement=container.find(".end"),coordinates=containerPopup.find(".coordinates");description=description.replace(/\<br\>/gi,", "),endElement.val(description),endElement.data("lat",coordinates.data("lat")),endElement.data("lon",coordinates.data("lon"));var marker=L.marker([coordinates.data("lat"),coordinates.data("lon")],{icon:L.AwesomeMarkers.icon({icon:"flag-checkered",markerColor:"red",prefix:"fa"})}).bindPopup(containerPopup.html());endIconLayer=L.featureGroup([marker]),map.addLayer(endIconLayer),thisInstance.showCalculateBtn();}),container.on("click",".indirectPoint",function(e){var currentTarget=$(e.currentTarget),containerPopup=currentTarget.closest(".leaflet-popup-content");description=containerPopup.find(".description").html();var template=container.find(".indirectTemplate"),indirect=template.clone();template.before(indirect),indirect.removeClass("indirectTemplate"),indirect.removeClass("d-none");var coordinates=containerPopup.find(".coordinates");description=description.replace(/\<br\>/gi,", "),"undefined"!=typeof thisInstance.indirectPointLayer[description]&&map.removeLayer(thisInstance.indirectPointLayer[description]);var indirectField=indirect.find(".indirect");indirectField.val(description),indirectField.data("lat",coordinates.data("lat")),indirectField.data("lon",coordinates.data("lon"));var marker=L.marker([coordinates.data("lat"),coordinates.data("lon")],{icon:L.AwesomeMarkers.icon({icon:"flag",markerColor:"orange",prefix:"fa"})}).bindPopup(containerPopup.html());thisInstance.indirectPointLayer[description]=L.featureGroup([marker]),map.addLayer(thisInstance.indirectPointLayer[description]);}),container.on("click",".removeIndirect",function(e){var currentTarget=$(e.currentTarget),container=currentTarget.closest(".indirectContainer");map.removeLayer(thisInstance.indirectPointLayer[container.find(".indirect").val()]),currentTarget.closest(".indirectContainer").remove();}),container.on("click",".moveUp",function(e){var currentTarget=$(e.currentTarget),container=currentTarget.closest(".indirectContainer"),previousElement=container.prev();previousElement.hasClass("startContainer")||previousElement.before(container);}),container.on("click",".moveDown",function(e){var currentTarget=$(e.currentTarget),container=currentTarget.closest(".indirectContainer"),nextElement=container.next();nextElement.hasClass("indirectTemplate")||nextElement.after(container);}),container.on("click",".searchInRadius",function(e){endIconLayer&&map.removeLayer(endIconLayer);var currentTarget=$(e.currentTarget),containerPopup=currentTarget.closest(".leaflet-popup-content"),coordinates=containerPopup.find(".coordinates"),progressIndicatorElement=jQuery.progressIndicator({position:container,blockInfo:{enabled:!0}}),params={module:"OpenStreetMap",action:"GetMarkers",srcModule:app.getModuleName(),radius:container.find(".radius").val(),lat:coordinates.data("lat"),lon:coordinates.data("lon"),cache:thisInstance.getCacheParamsToRequest()};params=$.extend(thisInstance.selectedParams,params),AppConnector.request(params).done(function(response){progressIndicatorElement.progressIndicator({mode:"hide"}),thisInstance.setMarkers(response.result);});});var descriptionContainer=container.find(".js-description-container");container.find(".js-calculate-route").on("click",function(){var indirectLon=[],indirectLat=[];container.find(".indirectContainer:not(.d-none) input.indirect").each(function(){var currentTarget=$(this);indirectLat.push(currentTarget.data("lat")),indirectLon.push(currentTarget.data("lon"));});var endElement=container.find(".end"),startElement=container.find(".start"),progressIndicatorElement=jQuery.progressIndicator({position:container,blockInfo:{enabled:!0}});AppConnector.request({url:"index.php",data:{module:"OpenStreetMap",action:"GetRoute",flon:startElement.data("lon"),flat:startElement.data("lat"),ilon:indirectLon,ilat:indirectLat,tlon:endElement.data("lon"),tlat:endElement.data("lat")}}).done(function(response){progressIndicatorElement.progressIndicator({mode:"hide"}),thisInstance.routeLayer&&map.removeLayer(thisInstance.routeLayer);var route=L.geoJson(response.result.geoJson);thisInstance.routeLayer=L.featureGroup([route]),map.addLayer(thisInstance.routeLayer),descriptionContainer.removeClass("d-none");var instruction=container.find(".js-instruction_block");response.result.properties.description?(instruction.removeClass("d-none"),descriptionContainer.find(".js-instruction_body").html(response.result.properties.description)):instruction.addClass("d-none"),descriptionContainer.find(".distance").html(App.Fields.Double.formatToDisplay(response.result.properties.distance)),descriptionContainer.find(".travelTime").html(App.Fields.Double.formatToDisplay(response.result.properties.traveltime/60));}).fail(function(error){progressIndicatorElement.progressIndicator({mode:"hide"}),app.showNotify({titleTrusted:!1,textTrusted:!1,title:app.vtranslate("JS_UNEXPECTED_ERROR"),text:error,type:"error"});});}),container.on("click",".setView",function(e){var currentTarget=$(e.currentTarget),inputInstance=currentTarget.closest(".input-group").find(".end,.start,.indirect"),lat=inputInstance.data("lat"),lon=inputInstance.data("lon");"undefined"==typeof lat&&"undefined"==typeof lon||map.setView(new L.LatLng(lat,lon),11);}),this.registerSearchCompany(),this.registerSearchAddress(),this.registerMyLocation();},registerModalView:function registerModalView(container){var thisInstance=this,progressIndicatorElement=jQuery.progressIndicator({position:container,blockInfo:{enabled:!0}});this.container=container,$("#mapid").css({height:$("body").height()-160}),this.registerMap([0,0],2);var params={module:"OpenStreetMap",action:"GetMarkers",srcModule:app.getModuleName()};params=$.extend(this.selectedParams,params),thisInstance.registerBasicModal(),AppConnector.request(params).done(function(response){progressIndicatorElement.progressIndicator({mode:"hide"}),thisInstance.setMarkers(response.result);});},getMarkerPopup:function getMarkerPopup(label,coordinates){return "<span class=\"description\">".concat(label,"</span>\n\t\t\t<br /><input type=hidden class=\"coordinates\" data-lon=\"").concat(coordinates.lon,"\"\n\t\t\tdata-lat=\"").concat(coordinates.lat,"\">\n\t\t\t<button class=\"btn btn-success btn-sm p-1 startTrack mr-2\"><span class=\"fas  fa-truck\"></span></button>\n\t\t<button class=\"btn btn-warning btn-sm p-1 indirectPoint mr-2\"><span class=\"fas fa-flag-checkered\"></span></button>\n\t\t<button class=\"btn btn-danger btn-sm p-1 endTrack\"><span class=\"fas fa-flag-checkered\"></span></button>")},registerDetailView:function registerDetailView(container){this.container=container;var coordinates=container.find("#coordinates").val();coordinates=JSON.parse(coordinates);var startCoordinate=[0,0],startZoom=2,$map=container.find("#mapid");coordinates.length&&(startCoordinate=coordinates[0],startZoom=6),$(".mainBody").length?1e3>$(".mainBody").height()?$map.height($(".mainBody").height()-($(".detailViewTitle").height()+$(".detailViewContainer .related").height()+25)):$map.height(1e3):1e3>$(".bodyContents").height()?$map.height($(".bodyContents").height()-($(".detailViewTitle").height()+$(".detailViewContainer .related").height()+25)):$map.height(1e3);var myMap=this.registerMap(startCoordinate,startZoom),markers=L.markerClusterGroup({maxClusterRadius:10});coordinates.forEach(function(e){var marker=L.marker([e.lat,e.lon],{icon:L.AwesomeMarkers.icon({icon:"home",markerColor:"blue",prefix:"fa",iconColor:e.color})}).bindPopup(e.label);markers.addLayer(marker);}),myMap.addLayer(markers);}});
//# sourceMappingURL=Map.min.js.map