Этот коммит содержится в:
2023-03-11 17:30:20 +00:00
Коммит b6c4e025bc
5124 изменённых файлов: 1153349 добавлений и 0 удалений
+190
Просмотреть файл
@@ -0,0 +1,190 @@
var Unibase;
(function (Unibase) {
let Platform;
(function (Platform) {
let Analytics;
(function (Analytics) {
let Viewers;
(function (Viewers) {
class MapViewer extends Platform.Core.BaseComponent {
constructor() {
super();
this.reportManager = Analytics.Managers.ReportManager.Instance();
this.viewerManager = Analytics.Managers.ViewerManager.Instance();
this.ViewerSettings = new Analytics.Providers.ViewerSettings();
}
loadView(reportresponse, reportid, MapViewId, page, pageSize, containerid, ViewerSettings, callback, reportwidgetdata) {
var instance = this;
var LatIdColumnName = "", LngIdColumnName = "", Template = "", HeaderTemplate = "", DetailTemplate = "", FooterTemplate = "";
instance.viewerManager.getMapView(MapViewId).then(function (response) {
var res = response.result;
LatIdColumnName = res.LatColumn;
LngIdColumnName = res.LngColumn;
Template = res.TemplateText;
HeaderTemplate = res.HeaderTemplateText;
DetailTemplate = res.DetailTemplateText;
FooterTemplate = res.FooterTemplateText;
let postdata = {
ReportId: reportid,
page: page,
pageSize: 50,
IsJson: true
};
$("#Table_View_" + containerid).removeClass("hidden");
instance.reportManager.getReportViewerData(postdata).then(function (mapresponse) {
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
var Lat_columns = [];
var Lng_columns = [];
var finalvalues = [];
var locations = [];
var contentString = [];
var response = JSON.parse(mapresponse.result);
var data = "";
if (response.Data)
data = JSON.parse(response.Data);
$("#ViewerFooter_" + containerid).removeClass("hidden");
if (!data) {
$("#Viewer_" + containerid + "").removeClass("hidden");
$("#Viewer_" + containerid + "").empty().append(`<div class='alert alert-primary text-center mb-0 border-0 w-100 font-14 rounded-0'>No data available</div>`);
return "";
}
data = Unibase.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(data);
let Tmplt_html = "";
let DetailTmplt_html = "";
var templateScript = Handlebars.compile(Template);
for (let i = 0; i < data.length; i++) {
let LatValue = data[i][LatIdColumnName.toLowerCase()];
let LngValue = data[i][LngIdColumnName.toLowerCase()];
let ContactId = data[i]["contactid"];
if ((jQuery.inArray(LatValue, Lat_columns) == -1) && (jQuery.inArray(LngValue, Lng_columns) == -1)) {
finalvalues.push({ LatValue: LatValue, LngValue: LngValue, ContactId: ContactId });
Lat_columns.push(LatValue);
Lng_columns.push(LngValue);
if (Template != "" && Template != null) {
Tmplt_html = templateScript(data[i]);
}
else {
Tmplt_html = "<strong> LatId: " + LatValue + ", LngId: " + LngValue + "</strong>";
}
contentString.push(Tmplt_html);
let html = `<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">` + DetailTemplate + `</div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">Close Trip </div></div></div></div></div>`;
var DetailTemplateScript = Handlebars.compile(DetailTemplate);
DetailTmplt_html += DetailTemplateScript(data[i]);
}
else {
let index = 0;
for (var k = 0; k < finalvalues.length; k++) {
if ((finalvalues[k].LatValue == LatValue) && (finalvalues[k].LngValue == LngValue)) {
index = k;
}
}
contentString[index] = contentString[index] + templateScript(data[i]);
}
}
for (var f = 0; f < finalvalues.length; f++) {
if (finalvalues[f].LatValue != 0 && finalvalues[f].LngValue != 0) {
locations.push({ LatId: finalvalues[f].LatValue, LngId: finalvalues[f].LngValue, ContactId: finalvalues[f].ContactId });
}
}
let MapSideHtml = `<div class="row"><div class="col-md-12">
<div id="map_canvas_` + containerid + `" class="gmap"></div></div>
<div class="col-md-5 d-none pr-10 pb-10"><div id="map-sidebar"><div class="card mb-0"><div class="card-header" style="height:10vh;" id="map_header">` + HeaderTemplate + `</div><div class="card-body" id="mapside_body" style="overflow-y:scroll; height:71vh"> <div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">` + DetailTmplt_html + ` </div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">Close Trip </div></div></div><div class="card-footer" style="height:10vh;" id="footer_section">` + FooterTemplate + `</div></div></div></div>`;
$("#Viewer_" + containerid + "").html(MapSideHtml).addClass("pa-10");
$(".list-content-section" + containerid + "").removeClass("hidden");
$(".Templateheader").addClass("hidden");
$(".card-footer").addClass("hidden");
$(".btn-list-load-more").addClass("hidden");
$(".list-content-section" + containerid).find("#map_canvas").css('height', $(window).outerHeight() - $(".list-content-section" + containerid).find(".card-header").outerHeight() - 55);
var latd = locations[0].LatId;
var lgtd = locations[0].LngId;
var myLatlng = new google.maps.LatLng(latd, lgtd);
var mIcon = {
path: google.maps.SymbolPath.CIRCLE,
fillOpacity: 1,
fillColor: "green",
strokeOpacity: 1,
strokeWeight: 1,
strokeColor: '#333',
scale: 12,
scaledSize: new google.maps.Size(54, 44)
};
var mapOptions = {
zoom: 5,
center: myLatlng,
};
var mapElement = document.getElementById("map_canvas_" + containerid);
var map = new google.maps.Map(mapElement, mapOptions);
var marker, i;
var infoWindow;
var Lng_Ltd = [];
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i].LatId, locations[i].LngId),
map: map,
icon: mIcon
});
Lng_Ltd[locations[i].LatId + "_" + locations[i].LngId] = contentString[i];
infoWindow = new google.maps.InfoWindow({
content: contentString[i]
});
infoWindow.close();
google.maps.event.addListener(marker, 'click', (function (marker, i) {
var k = i;
return function () {
infoWindow.open(map, marker);
infoWindow.setContent(Lng_Ltd[marker.getPosition().lat() + "_" + marker.getPosition().lng()]);
};
})(marker, i));
google.maps.event.addListener(marker, 'mouseover', (function (marker, i) {
var k = i;
return function () {
infoWindow.open(map, marker);
infoWindow.setContent(Lng_Ltd[marker.getPosition().lat() + "_" + marker.getPosition().lng()]);
};
})(marker, i));
google.maps.event.addListener(marker, 'mouseout', function (e) {
infoWindow.close(map, marker);
});
}
let elem;
elem = $("#mapside_body");
elem.slimscroll({ color: '#d6d9da', disableFadeOut: true, borderRadius: 0, size: '6px', enableKeyNavigation: true, opacity: .8, height: "71vh" });
});
});
}
toCamel(o) {
var newO, origKey, newKey, value;
if (o instanceof Array) {
return o.map(function (value) {
if (typeof value === "object") {
value = Unibase.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(value);
}
return value;
});
}
else {
newO = {};
for (origKey in o) {
if (o.hasOwnProperty(origKey)) {
newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString();
value = o[origKey];
if (value instanceof Array || (value !== null && value.constructor === Object)) {
value = Unibase.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(value);
}
newO[newKey] = value;
}
}
}
return newO;
}
static Instance() {
return new Unibase.Platform.Analytics.Viewers.MapViewer();
}
}
Viewers.MapViewer = MapViewer;
})(Viewers = Analytics.Viewers || (Analytics.Viewers = {}));
})(Analytics = Platform.Analytics || (Platform.Analytics = {}));
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
})(Unibase || (Unibase = {}));
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
поставляемый Исполняемый файл
+5
Просмотреть файл
@@ -0,0 +1,5 @@
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.reportManager=i.Managers.ReportManager.Instance();this.viewerManager=i.Managers.ViewerManager.Instance();this.ViewerSettings=new i.Providers.ViewerSettings}loadView(t,i,r,u,f,e){var h=this,c="",l="",o="",a="",s="",v="";h.viewerManager.getMapView(r).then(function(t){var r=t.result;c=r.LatColumn;l=r.LngColumn;o=r.TemplateText;a=r.HeaderTemplateText;s=r.DetailTemplateText;v=r.FooterTemplateText;let f={ReportId:i,page:u,pageSize:50,IsJson:!0};$("#Table_View_"+e).removeClass("hidden");h.reportManager.getReportViewerData(f).then(function(t){var g,ft,w,h;n.Platform.Helpers.NavigationHelper.Instance().hideLoading();var tt=[],it=[],u=[],f=[],b=[],rt=JSON.parse(t.result),i="";if(rt.Data&&(i=JSON.parse(rt.Data)),$("#ViewerFooter_"+e).removeClass("hidden"),!i)return $("#Viewer_"+e+"").removeClass("hidden"),$("#Viewer_"+e+"").empty().append(`<div class='alert alert-primary text-center mb-0 border-0 w-100 font-14 rounded-0'>No data available</div>`),"";i=n.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(i);let d="",ut="";g=Handlebars.compile(o);for(let n=0;n<i.length;n++){let t=i[n][c.toLowerCase()],r=i[n][l.toLowerCase()],f=i[n].contactid;if(jQuery.inArray(t,tt)==-1&&jQuery.inArray(r,it)==-1){u.push({LatValue:t,LngValue:r,ContactId:f});tt.push(t);it.push(r);d=o!=""&&o!=null?g(i[n]):"<strong> LatId: "+t+", LngId: "+r+"<\/strong>";b.push(d);let e=`<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">`+s+`</div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">Close Trip </div></div></div></div></div>`;ft=Handlebars.compile(s);ut+=ft(i[n])}else{let f=0;for(w=0;w<u.length;w++)u[w].LatValue==t&&u[w].LngValue==r&&(f=w);b[f]=b[f]+g(i[n])}}for(h=0;h<u.length;h++)u[h].LatValue!=0&&u[h].LngValue!=0&&f.push({LatId:u[h].LatValue,LngId:u[h].LngValue,ContactId:u[h].ContactId});let ot=`<div class="row"><div class="col-md-12">
<div id="map_canvas_`+e+`" class="gmap"></div></div>
<div class="col-md-5 d-none pr-10 pb-10"><div id="map-sidebar"><div class="card mb-0"><div class="card-header" style="height:10vh;" id="map_header">`+a+`</div><div class="card-body" id="mapside_body" style="overflow-y:scroll; height:71vh"> <div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">`+ut+` </div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">Close Trip </div></div></div><div class="card-footer" style="height:10vh;" id="footer_section">`+v+`</div></div></div></div>`;$("#Viewer_"+e+"").html(ot).addClass("pa-10");$(".list-content-section"+e+"").removeClass("hidden");$(".Templateheader").addClass("hidden");$(".card-footer").addClass("hidden");$(".btn-list-load-more").addClass("hidden");$(".list-content-section"+e).find("#map_canvas").css("height",$(window).outerHeight()-$(".list-content-section"+e).find(".card-header").outerHeight()-55);for(var st=f[0].LatId,ht=f[0].LngId,ct=new google.maps.LatLng(st,ht),lt={path:google.maps.SymbolPath.CIRCLE,fillOpacity:1,fillColor:"green",strokeOpacity:1,strokeWeight:1,strokeColor:"#333",scale:12,scaledSize:new google.maps.Size(54,44)},at={zoom:5,center:ct},vt=document.getElementById("map_canvas_"+e),k=new google.maps.Map(vt,at),y,p,nt=[],r=0;r<f.length;r++)y=new google.maps.Marker({position:new google.maps.LatLng(f[r].LatId,f[r].LngId),map:k,icon:lt}),nt[f[r].LatId+"_"+f[r].LngId]=b[r],p=new google.maps.InfoWindow({content:b[r]}),p.close(),google.maps.event.addListener(y,"click",function(n,t){var i=t;return function(){p.open(k,n);p.setContent(nt[n.getPosition().lat()+"_"+n.getPosition().lng()])}}(y,r)),google.maps.event.addListener(y,"mouseover",function(n,t){var i=t;return function(){p.open(k,n);p.setContent(nt[n.getPosition().lat()+"_"+n.getPosition().lng()])}}(y,r)),google.maps.event.addListener(y,"mouseout",function(){p.close(k,y)});let et;et=$("#mapside_body");et.slimscroll({color:"#d6d9da",disableFadeOut:!0,borderRadius:0,size:"6px",enableKeyNavigation:!0,opacity:.8,height:"71vh"})})})}toCamel(t){var u,r,f,i;if(t instanceof Array)return t.map(function(t){return typeof t=="object"&&(t=n.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(t)),t});u={};for(r in t)t.hasOwnProperty(r)&&(f=(r.charAt(0).toLowerCase()+r.slice(1)||r).toString(),i=t[r],(i instanceof Array||i!==null&&i.constructor===Object)&&(i=n.Platform.Analytics.Viewers.MapViewer.Instance().toCamel(i)),u[f]=i);return u}static Instance(){return new n.Platform.Analytics.Viewers.MapViewer}}r.MapViewer=u})(r=i.Viewers||(i.Viewers={}))})(i=t.Analytics||(t.Analytics={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
+179
Просмотреть файл
@@ -0,0 +1,179 @@
var Unibase;
(function (Unibase) {
let Platform;
(function (Platform) {
let Analytics;
(function (Analytics) {
let Components;
(function (Components) {
class MapViewerSettings extends Platform.Core.BaseComponent {
constructor() {
super();
this.reportManager = Analytics.Managers.ReportManager.Instance();
this.viewerManager = Analytics.Managers.ViewerManager.Instance();
this.ReportId = 0;
}
jsFiles() {
return ["platform/analytics/components/mapviewer/mapviewer.settings.js"];
}
cssFiles() {
return [];
}
html(id, containerid) {
var html = `<div class="b-b bg-white modal-header">
<strong class="text-dark">Map</strong>
</div>
<div class="modal-body" id="MapViewer_modal">
<div id = "divMap_ErrorMessage"></div>
<div class="card"> <div class="card-body"><div class="row"><div class="col-sm-6">
<div id="div_MapName" class="floating-label-form-group">
<label for="mapname" id="lbl_MapName">Map Name</label>
<input type="text" class="form-control value-control floating-label-control" placeholder="Map Name" data-placeholder="Map Name" data-label="Map Name" id="txt_MapName">
</div></div>
<div class="col-sm-4">
<div id="div_DisplayName" class="floating-label-form-group floating-label-form-group-with-value">
<label for="displayname" id="lbl_DisplayName">Display Name</label>
<input type="text" id="Txt_Display_Name" class="form-control value-control floating-label-control" placeholder="Display Name" data-placeholder="Display Name" data-label="Display Name">
</div>
</div>
<div class="col-sm-6">
<div id="div_Latitude" class="">
<label for="latitude">Latitude</label>
<select type="text" class="form-control value-control floating-label-control" placeholder="Latitude" data-placeholder="Latitude" data-label="Latitude" id="txt_Latitude"><option value="0" selected="">Select Latitude Column</option></select>
</div>
</div>
<div class="col-sm-6">
<div id="div_Longitude" class="">
<label for="longitude" id="lbl_Longitude">Longitude</label>
<select type="text" class="form-control value-control floating-label-control" placeholder="Longitude" data-placeholder="Longitude" data-label="Longitude" id="txt_Longitude"> <option value="0" selected="">Select Longitude Column</option></select>
</div></div>
</div></div></div>
<div class="TemplateText_Section card">
<div class="card-header"> Template Text </div>
<div class="card-body">
<div id="div_TemplateText" class="">
<textarea class="" id="input_TemplateText" placeholder="Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="HeaderTemplateText_Section card">
<div class="card-header">Header Template Text </div>
<div class="card-body">
<div id="div_HeaderTemplateText" class="">
<textarea class="" id="input_HeaderTemplateText" placeholder="Header Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="DetailTemplateText_Section card">
<div class="card-header">Detail Template Text </div>
<div class="card-body">
<div id="div_DetailTemplateText" class="">
<textarea class="" id="input_DetailTemplateText" placeholder="Detail Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="FooterTemplateText_Section card">
<div class="card-header">Footer Template Text </div>
<div class="card-body">
<div id="div_FooterTemplateText" class="">
<textarea class="" id="input_FooterTemplateText" placeholder="Footer Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="bg-white modal-footer">
<a class="btn btn-light btn-sm btn-center mr-auto" id="btnClose">Close</a>
<a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save</a>
</div>`;
return html;
}
load(id, containerid, callback) {
var instance = this;
var reportid = Number(instance.ReportId);
$("#MapViewer_modal").css("height", $(window).outerHeight() - (Number($(".modal-header").outerHeight()) + Number($(".modal-footer").outerHeight())) + 'px');
var data = [];
instance.reportManager.getColumns(reportid).then(function (response) {
var res = response.result;
for (let i = 0; i < res.length; i++) {
data.push({ id: res[i].ReportColumnName, text: res[i].ReportColumnName });
}
$("#txt_Latitude").select2({
placeholder: 'Select Latitude Column',
data: data,
});
$("#txt_Longitude").select2({
placeholder: 'Select Longitude Column',
data: data,
});
if (id != 0) {
instance.getMapById(id);
}
});
$("#btnClose").click(function () {
$('#' + containerid).modal('hide');
$('#' + containerid).remove();
});
jQuery("#btnSave").click(function () {
instance.saveMap(id, reportid, containerid, null);
});
}
getMapById(id) {
var instance = this;
instance.viewerManager.getMapView(id).then(function (response) {
instance.response = response.result;
$("#Txt_Display_Name").val(instance.response.DisplayName ? instance.response.DisplayName.trim() : instance.response.MapName.trim());
$("#txt_MapName").val(instance.response.MapName.trim()).attr("readonly", 'true').css("cursor", "not-allowed");
$("#txt_Latitude").val(instance.response.LatColumn).trigger("change");
$("#txt_Longitude").val(instance.response.LngColumn).trigger("change");
$("#input_TemplateText").val(instance.response.TemplateText);
$("#input_HeaderTemplateText").val(instance.response.HeaderTemplateText);
$("#input_DetailTemplateText").val(instance.response.DetailTemplateText);
$("#input_FooterTemplateText").val(instance.response.FooterTemplateText);
});
}
saveMap(id, reportid, containerid, obj) {
var instance = this;
var PostData = obj;
if (obj == null) {
PostData = {
LatColumn: $("#txt_Latitude option:selected").text(),
LngColumn: $("#txt_Longitude option:selected").text(),
MapName: $("#txt_MapName").val(),
ValueColumn: $("#txt_ColumnName").val(),
ReportId: Number(reportid),
MapViewId: Number(id),
TemplateText: $("#input_TemplateText").val(),
HeaderTemplateText: $("#input_HeaderTemplateText").val(),
DetailTemplateText: $("#input_DetailTemplateText").val(),
FooterTemplateText: $("#input_FooterTemplateText").val(),
DisplayModeTypeId: 1,
ViewAll: instance.response && instance.response.ViewAll || true,
DisplayName: $("#Txt_Display_Name").val().toString().trim(),
IsFromUI: Number(id) == 0 ? true : false,
};
}
instance.fileCacheHelper.loadJsFile("platform/analytics/managers/reportmanager.js", function () {
instance.viewerManager.saveMapView(PostData).then(function (response) {
if (response.status == Unibase.Data.Status.Error) {
MessageHelper.Instance().showError(response.message, 'divMap_ErrorMessage');
}
else {
MessageHelper.Instance().showSuccess(response.message, '');
$('#' + containerid).modal('hide');
$('#' + containerid).remove();
}
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new Unibase.Platform.Analytics.Components.MapViewerSettings();
return this._instance;
}
}
Components.MapViewerSettings = MapViewerSettings;
})(Components = Analytics.Components || (Analytics.Components = {}));
})(Analytics = Platform.Analytics || (Platform.Analytics = {}));
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
})(Unibase || (Unibase = {}));
+1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E,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oCAC3D,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oCACnC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC;iCACjC;4BACL,CAAC,CAAC,CAAC;wBAEP,CAAC,CAAC,CAAC;oBACP,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;wBACnF,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBAEJ;gBA5KY,4BAAiB,oBA4K7B,CAAA;YACL,CAAC,EA9KgB,UAAU,GAAV,oBAAU,KAAV,oBAAU,QA8K1B;QACL,CAAC,EAhLgB,SAAS,GAAT,kBAAS,KAAT,kBAAS,QAgLzB;IACL,CAAC,EAlLgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAkLxB;AACL,CAAC,EApLS,OAAO,KAAP,OAAO,QAoLhB"}
поставляемый Исполняемый файл
+66
Просмотреть файл
@@ -0,0 +1,66 @@
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.reportManager=i.Managers.ReportManager.Instance();this.viewerManager=i.Managers.ViewerManager.Instance();this.ReportId=0}jsFiles(){return["platform/analytics/components/mapviewer/mapviewer.settings.js"]}cssFiles(){return[]}html(){return`<div class="b-b bg-white modal-header">
<strong class="text-dark">Map</strong>
</div>
<div class="modal-body" id="MapViewer_modal">
<div id = "divMap_ErrorMessage"></div>
<div class="card"> <div class="card-body"><div class="row"><div class="col-sm-6">
<div id="div_MapName" class="floating-label-form-group">
<label for="mapname" id="lbl_MapName">Map Name</label>
<input type="text" class="form-control value-control floating-label-control" placeholder="Map Name" data-placeholder="Map Name" data-label="Map Name" id="txt_MapName">
</div></div>
<div class="col-sm-4">
<div id="div_DisplayName" class="floating-label-form-group floating-label-form-group-with-value">
<label for="displayname" id="lbl_DisplayName">Display Name</label>
<input type="text" id="Txt_Display_Name" class="form-control value-control floating-label-control" placeholder="Display Name" data-placeholder="Display Name" data-label="Display Name">
</div>
</div>
<div class="col-sm-6">
<div id="div_Latitude" class="">
<label for="latitude">Latitude</label>
<select type="text" class="form-control value-control floating-label-control" placeholder="Latitude" data-placeholder="Latitude" data-label="Latitude" id="txt_Latitude"><option value="0" selected="">Select Latitude Column</option></select>
</div>
</div>
<div class="col-sm-6">
<div id="div_Longitude" class="">
<label for="longitude" id="lbl_Longitude">Longitude</label>
<select type="text" class="form-control value-control floating-label-control" placeholder="Longitude" data-placeholder="Longitude" data-label="Longitude" id="txt_Longitude"> <option value="0" selected="">Select Longitude Column</option></select>
</div></div>
</div></div></div>
<div class="TemplateText_Section card">
<div class="card-header"> Template Text </div>
<div class="card-body">
<div id="div_TemplateText" class="">
<textarea class="" id="input_TemplateText" placeholder="Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="HeaderTemplateText_Section card">
<div class="card-header">Header Template Text </div>
<div class="card-body">
<div id="div_HeaderTemplateText" class="">
<textarea class="" id="input_HeaderTemplateText" placeholder="Header Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="DetailTemplateText_Section card">
<div class="card-header">Detail Template Text </div>
<div class="card-body">
<div id="div_DetailTemplateText" class="">
<textarea class="" id="input_DetailTemplateText" placeholder="Detail Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
<div class="FooterTemplateText_Section card">
<div class="card-header">Footer Template Text </div>
<div class="card-body">
<div id="div_FooterTemplateText" class="">
<textarea class="" id="input_FooterTemplateText" placeholder="Footer Template Text" rows="3" cols="112"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="bg-white modal-footer">
<a class="btn btn-light btn-sm btn-center mr-auto" id="btnClose">Close</a>
<a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save</a>
</div>`}load(n,t){var i=this,u=Number(i.ReportId),r;$("#MapViewer_modal").css("height",$(window).outerHeight()-(Number($(".modal-header").outerHeight())+Number($(".modal-footer").outerHeight()))+"px");r=[];i.reportManager.getColumns(u).then(function(t){var u=t.result;for(let n=0;n<u.length;n++)r.push({id:u[n].ReportColumnName,text:u[n].ReportColumnName});$("#txt_Latitude").select2({placeholder:"Select Latitude Column",data:r});$("#txt_Longitude").select2({placeholder:"Select Longitude Column",data:r});n!=0&&i.getMapById(n)});$("#btnClose").click(function(){$("#"+t).modal("hide");$("#"+t).remove()});jQuery("#btnSave").click(function(){i.saveMap(n,u,t,null)})}getMapById(n){var t=this;t.viewerManager.getMapView(n).then(function(n){t.response=n.result;$("#Txt_Display_Name").val(t.response.DisplayName?t.response.DisplayName.trim():t.response.MapName.trim());$("#txt_MapName").val(t.response.MapName.trim()).attr("readonly","true").css("cursor","not-allowed");$("#txt_Latitude").val(t.response.LatColumn).trigger("change");$("#txt_Longitude").val(t.response.LngColumn).trigger("change");$("#input_TemplateText").val(t.response.TemplateText);$("#input_HeaderTemplateText").val(t.response.HeaderTemplateText);$("#input_DetailTemplateText").val(t.response.DetailTemplateText);$("#input_FooterTemplateText").val(t.response.FooterTemplateText)})}saveMap(t,i,r,u){var f=this,e=u;u==null&&(e={LatColumn:$("#txt_Latitude option:selected").text(),LngColumn:$("#txt_Longitude option:selected").text(),MapName:$("#txt_MapName").val(),ValueColumn:$("#txt_ColumnName").val(),ReportId:Number(i),MapViewId:Number(t),TemplateText:$("#input_TemplateText").val(),HeaderTemplateText:$("#input_HeaderTemplateText").val(),DetailTemplateText:$("#input_DetailTemplateText").val(),FooterTemplateText:$("#input_FooterTemplateText").val(),DisplayModeTypeId:1,ViewAll:f.response&&f.response.ViewAll||!0,DisplayName:$("#Txt_Display_Name").val().toString().trim(),IsFromUI:Number(t)==0?!0:!1});f.fileCacheHelper.loadJsFile("platform/analytics/managers/reportmanager.js",function(){f.viewerManager.saveMapView(e).then(function(t){t.status==n.Data.Status.Error?MessageHelper.Instance().showError(t.message,"divMap_ErrorMessage"):(MessageHelper.Instance().showSuccess(t.message,""),$("#"+r).modal("hide"),$("#"+r).remove())})})}static Instance(){return this._instance===undefined&&(this._instance=new n.Platform.Analytics.Components.MapViewerSettings),this._instance}}r.MapViewerSettings=u})(r=i.Components||(i.Components={}))})(i=t.Analytics||(t.Analytics={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));