11667 lines
339 KiB
JavaScript
11667 lines
339 KiB
JavaScript
var markerList = [];
|
||
var markerLayers = null;
|
||
var markerList = [];
|
||
var markerLayers = null;
|
||
var mapradar = null;
|
||
var idkolcor = null;
|
||
var smarkerGhRa
|
||
var emarkerGhRa
|
||
var smarkerKarCh
|
||
var emarkerKarCh
|
||
var smarkerThSe
|
||
var emarkerThSe
|
||
var smarkerThKer
|
||
var emarkerThKer
|
||
var smarkerfirooz
|
||
var emarkerfirooz
|
||
var smarkertabriz
|
||
var emarkertabriz
|
||
var tabrizpoly = null;
|
||
var machinarydatavalid = "";
|
||
var ekiplistvalid = "";
|
||
var smarkerrasht
|
||
var emarkerrasht
|
||
var rashtpoly = null;
|
||
var startmarkerpin = [];
|
||
var endmarkerpin = [];
|
||
var project_update_list = []
|
||
var projectarraymachine = []
|
||
var ekiplist = []
|
||
var smarkeramol
|
||
var emarkeramol
|
||
var amolpoly = null;
|
||
var firstpolyline = null;
|
||
var firoozpoly = null;
|
||
var forthpolyline = null;
|
||
var fifthpolyline = null;
|
||
var seventhpolyline = null;
|
||
var startAbrarMarker = null;
|
||
var isSetStartAbrarMarker = false;
|
||
var ekipmarker = null;
|
||
var issetekipmarker = false;
|
||
var endAbrarMarker = null;
|
||
var isSetEndAbrarMarker = false;
|
||
var routeControls = [];
|
||
var routecolor = [];
|
||
var routeControlsPath = [];
|
||
var marker141List = [];
|
||
var marker141Layers = null;
|
||
var firoozlayer = [];
|
||
var amollayer = [];
|
||
var rashtlayer = [];
|
||
var markerfiroozkooh = [];
|
||
var markeramol = [];
|
||
var markerrasht = [];
|
||
var newrashtlayer = [];
|
||
var chalooslayer = [];
|
||
var semnanlayer = [];
|
||
var tabrizlayer = [];
|
||
var kermanlayer = [];
|
||
var colormodal = [];
|
||
var globalmodaldata = [];
|
||
var markershowdata = [];
|
||
var marker141LayersWithoutCluster = null;
|
||
var globalcolor = "";
|
||
var globalgeo = null;
|
||
var keepChartNum = null;
|
||
var onlineTrafficLayer = [];
|
||
var datacity;
|
||
var bokhorProvinceNameArray = [];
|
||
//pooria now
|
||
var number_data_city_persent;
|
||
//end pooria now
|
||
var flagPopupli = 0;
|
||
var flagPopup = 0;
|
||
var flag_li_city = 0;
|
||
var marker141List = [];
|
||
var markerlis1 = [];
|
||
var markerlis2 = [];
|
||
var markerlis3 = [];
|
||
var markerlis4 = [];
|
||
var markerlis5 = [];
|
||
var markerlis6 = [];
|
||
var markerlis7 = [];
|
||
var markerlis8 = [];
|
||
var markerrashtnew = [];
|
||
var markerlisfirooz = [];
|
||
var markerlistamo = [];
|
||
var markerlist
|
||
var markerchaloos = [];
|
||
var markersemnan = [];
|
||
var markertabriz = [];
|
||
var markerkermanshah = [];
|
||
var marker141Layers = null;
|
||
var marker141LayersWithoutCluster = null;
|
||
var middleLat = "";
|
||
var popupArrays = [];
|
||
var keepChartNum = null;
|
||
var routingArray = []
|
||
|
||
const API_ENDPOINT = "https://141.ir/api";
|
||
const MAP_ENDPOINT = "https://testmap.141.ir";
|
||
const MAP_MIN_ZOOM = 6;
|
||
const MAP_MAX_ZOOM = 15;
|
||
|
||
var routeControlsPath = [];
|
||
var popupArraysPath = [];
|
||
var polylinePath = null;
|
||
const windowWidth = $(window).width();
|
||
var frommDate, tooDate;
|
||
var marematDate, marematCity, marematOffice;
|
||
var imagekol;
|
||
var slideIndexlayer = 1;
|
||
var firoozkoohtest;
|
||
var firoozkoohstart;
|
||
var startRoute = [];
|
||
var testRoute = [];
|
||
var originMarkerArr = [];
|
||
var destMarkerArr = [];
|
||
var routeArray = [];
|
||
var markerlistfiroozarray = {};
|
||
var markerstartfirooz = null;
|
||
var markendfiroozkooh = null;
|
||
var markerstartamol = null;
|
||
var markerendamol = null;
|
||
var markerstartrasht = null;
|
||
var markerendrasht = null;
|
||
var markerstartrashtnew = null;
|
||
var markerendrashtnew = null;
|
||
var marketstartchaloos = null;
|
||
var marketendchaloos = null;
|
||
var markerstartsemnan = null;
|
||
var markerendsemnan = null;
|
||
var markerstarttabriz = null;
|
||
var markerendtabriz = null;
|
||
var markerstartkermanshah = null;
|
||
var markerendkermanshah = null;
|
||
var startroute0 = null;
|
||
var startroute1 = null;
|
||
var startroute2 = null;
|
||
var startroute3 = null;
|
||
var startroute4 = null;
|
||
var startroute5 = null;
|
||
var startroute6 = null;
|
||
var startroute7 = null;
|
||
var testroute0 = null;
|
||
var testroute1 = null;
|
||
var testroute2 = null;
|
||
var testroute3 = null;
|
||
var testroute5 = null;
|
||
var testroute6 = null;
|
||
var testroute4 = null;
|
||
var testroute7 = null;
|
||
|
||
|
||
|
||
var startAbrarDivIcon = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-start" class="pin-marker pin-set">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">شروع</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
var endAbrarDivIcon = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-end" class="pin-marker pin-set">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">پایان</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
|
||
var startAbrarDivIconrahdar = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-startrahdar" class="pin-marker">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">شروع</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
var endAbrarDivIconrahdar = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-endrahdar" class="pin-marker">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">پایان</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
// IRAN bounds, by this order:
|
||
// [North, East]
|
||
// [South, West]
|
||
var bounds = [
|
||
[42.9130026312, 75.6166317076],
|
||
[20.5782370061, 30.5092252948],
|
||
];
|
||
var itempoint = null;
|
||
|
||
var map = L.map("map", {
|
||
maxBounds: bounds,
|
||
minZoom: MAP_MIN_ZOOM,
|
||
//maxZoom: MAP_MAX_ZOOM,
|
||
zoomControl: false,
|
||
}).setView([35.5468992, 51.7300532], 7);
|
||
|
||
// Create map tile layer
|
||
L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map);
|
||
$(document).ready(function () {
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
bokhorProvinceNameArray = result.data;
|
||
},
|
||
error: function (error) { },
|
||
});
|
||
});
|
||
fisheyeMenu({
|
||
growRatio: 1.7,
|
||
verticalLimit: 10,
|
||
horizontalLimit: 1.8,
|
||
});
|
||
|
||
function fisheyeMenu(options) {
|
||
// get all items from fisheye-menu
|
||
var items = Array.prototype.slice.call(
|
||
document.querySelectorAll(".fisheye-menu button.layerButton")
|
||
);
|
||
var item = items[0];
|
||
//get horizontal center point of each item
|
||
var itemsMiddle = items.map(function (item) {
|
||
return item.offsetLeft + item.offsetWidth / 2;
|
||
});
|
||
//get vertical center point of each item
|
||
var itemsVertMiddle = items.map(function (item) {
|
||
return item.offsetTop + item.offsetHeight / 2;
|
||
});
|
||
|
||
var itemWidth = item.offsetWidth;
|
||
// vertical limits of function running
|
||
var topLimit = item.offsetParent.offsetTop - (options.verticalLimit || 10);
|
||
var bottomLimit =
|
||
item.offsetParent.offsetTop +
|
||
item.offsetHeight +
|
||
(options.verticalLimit || 10);
|
||
// ratio of new size to default
|
||
var growRatio = options.growRatio || 1.8;
|
||
// horizontal limit of grow reaction for single item
|
||
var limit = item.offsetWidth * (options.horizontalLimit || 1.5);
|
||
|
||
var sizeDiff = Math.round(itemWidth * (growRatio - 1));
|
||
|
||
var removeGoDown = function (evt) {
|
||
evt.target.parentNode.classList.remove("go-down");
|
||
};
|
||
var setListeners = (function () {
|
||
items.forEach(function (itm, index) {
|
||
itm.addEventListener("transitionend", removeGoDown);
|
||
});
|
||
})();
|
||
|
||
var makeItemBigger = function (x, y) {
|
||
var verticallyCorrect = y > topLimit && y < bottomLimit ? true : false;
|
||
|
||
// if mouse out from vertically cirrect area make items small with transition
|
||
if (!verticallyCorrect && !item.parentNode.classList.contains("go-down")) {
|
||
item.parentNode.classList.add("go-down");
|
||
}
|
||
|
||
// if (verticallyCorrect) {
|
||
// let menuWidth = $('.menu_vertical').css('width');
|
||
// $('.menu_vertical').css('width', 'calc(' + menuWidth + ' + 50px')
|
||
// }
|
||
|
||
items.forEach(function (item, index) {
|
||
var middlePoint = itemsMiddle[index];
|
||
// horizontal distance from center point to cursor
|
||
var dist = Math.abs(x - middlePoint);
|
||
|
||
// if distance is bigger than limit in any direction
|
||
// ratio is equal to 1 (item size not changed)
|
||
var ratio = dist > limit ? 1 : dist / limit;
|
||
|
||
ratio = verticallyCorrect ? ratio : 1;
|
||
|
||
var newSize = itemWidth + (1 - ratio) * sizeDiff;
|
||
// add negative top margin to item equal to half size difference
|
||
// to stay item vertical centered
|
||
var newMarginTop = -((1 - ratio) * (sizeDiff / 2));
|
||
item.style.width = newSize + "px";
|
||
item.style.height = newSize + "px";
|
||
item.style.marginTop = newMarginTop + "px";
|
||
});
|
||
};
|
||
|
||
document.body.addEventListener("mousemove", function (e) {
|
||
// position of cursor
|
||
var pointerX = e.pageX;
|
||
var pointerY = e.pageY;
|
||
makeItemBigger(pointerX, pointerY);
|
||
});
|
||
}
|
||
function showmodalaccvillage() {
|
||
$("#villageacc_modal").modal("show");
|
||
}
|
||
function showprojecttype() {
|
||
$("#project-choose").val(0);
|
||
$("#stepModalprojecttype").modal("show");
|
||
}
|
||
function showprojecttest(index) {
|
||
if (index == 1) {
|
||
window.open("https://rms.rmto.ir/road-maintenance-project");
|
||
// to do next page
|
||
} else if (index == 2) {
|
||
window.open("https://rms.rmto.ir/road-danger-prevention");
|
||
} else if (index == 3) {
|
||
window.open("https://rms.rmto.ir/road-upgrade-safety");
|
||
} else if (index == 4) {
|
||
window.open("https://rms.rmto.ir/road-technical-building");
|
||
} else if (index == 5) {
|
||
window.open("https://rms.rmto.ir/road-tollhouse-management");
|
||
} else if (index == 6) {
|
||
window.open("https://rms.rmto.ir/road-construction-rural");
|
||
}
|
||
}
|
||
function showpassmodal() {
|
||
// $("#changepass").modal("show");
|
||
$("#dropdown-contentside").css("display", "block");
|
||
}
|
||
$("#showcardproject").hover(function () {
|
||
$("#dropdown-contentside").css("display", "block");
|
||
});
|
||
//now pooria
|
||
$("#all_point_map").hover(function () {
|
||
$("#dropdown-contentside_edited").css("display", "block");
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
});
|
||
$("#all_point_now_dot").hover(function () {
|
||
$("#dropdown-contentside_first-").css("display", "block");
|
||
})
|
||
$("#all_point_filter").hover(function () {
|
||
$("#all-point-map").css("display", "block");
|
||
$("#dropdown-contentside_edited").css("display", "none");
|
||
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
|
||
})
|
||
$("#point_prevention_hover").hover(function () {
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
});
|
||
$("#Tollhouse").hover(function () {
|
||
$("#dropdown-contentside2").css("display", "block");
|
||
});
|
||
$("#uploadfile").hover(function () {
|
||
$("#dropdown-contentside2").css("display", "none");
|
||
});
|
||
$("#zirsakht").hover(function () {
|
||
$("#dropdown-contentside2").css("display", "none");
|
||
});
|
||
|
||
|
||
|
||
$("#all251-danger-pointsShow").hover(function () {
|
||
// $("#dropdown-contentside_edited").css("display", "none");
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
});
|
||
$("#all_point_now_dot").hover(function () {
|
||
$("#dropdown-contentside_edited").css("display", "none");
|
||
$("#all-point-map").css("display", "none");
|
||
|
||
});
|
||
$("#all_point_filter").hover(function () {
|
||
$("#dropdown-contentside_edited").css("display", "none");
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
// $("#all-point-map").css("display", "none");
|
||
});
|
||
$("#dropdownshow_all_dot").mouseleave(function () {
|
||
$("#dropdown-contentside_edited").css("display", "none");
|
||
$("#dropdown-contentside_first-").css("display", "none");
|
||
});
|
||
$("#dropdown-contentside2").mouseleave(function () {
|
||
$("#dropdown-contentside2").css("display", "none");
|
||
});
|
||
$("#all-point-map").mouseleave(function () {
|
||
$("#all-point-map").css("display", "none");
|
||
});
|
||
//End now pooria
|
||
$("#show-report-ul").hover(function () {
|
||
$("#dropdown-contentside").css("display", "none");
|
||
});
|
||
|
||
$("#show-maintenance-points").hover(function () {
|
||
$("#dropdown-contentside").css("display", "none");
|
||
});
|
||
$(".responsiveTopMenuname").hover(
|
||
function () {
|
||
$(".user-box").css("display", "block");
|
||
},
|
||
function () {
|
||
// $(".user-box").css("display", "none");
|
||
}
|
||
);
|
||
$(".user-box").mouseleave(function () {
|
||
$(this).hide();
|
||
});
|
||
|
||
// $("#showcardproject").mouseleave(function () {
|
||
// $("#dropdown-contentside").css('display', 'none')
|
||
// })
|
||
|
||
// $("dropdownthingy").mouseleave(function () {
|
||
// console.log("leave the sh")
|
||
// // if()
|
||
// // $("#dropdown-contentside").css('display', 'none')
|
||
// })
|
||
|
||
$("#dropdownshow").mouseenter(function () {
|
||
$("#dropdown-contentside").css("display", "none");
|
||
});
|
||
$("#dropTollShow").mouseenter(function () {
|
||
$("#dropdown-contentside2").css("display", "none");
|
||
});
|
||
|
||
$("#dropdown-contentside").mouseleave(function () {
|
||
$("#dropdown-contentside").css("display", "none");
|
||
});
|
||
$("#dropdown-contentside2").mouseleave(function () {
|
||
$("#dropdown-contentside2").css("display", "none");
|
||
});
|
||
//to do yasi
|
||
$("#project-choose").change(function () {
|
||
if ((value = $(this).val()) && $(this).val() != 0) {
|
||
if ($(this).val() == 1) {
|
||
window.open("https://rms.rmto.ir/road-maintenance-project");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
} else if ($(this).val() == 2) {
|
||
window.open("https://rms.rmto.ir/road-danger-prevention");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
} else if ($(this).val() == 3) {
|
||
window.open("https://rms.rmto.ir/road-upgrade-safety");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
} else if ($(this).val() == 4) {
|
||
window.open("https://rms.rmto.ir/road-technical-building");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
} else if ($(this).val() == 5) {
|
||
window.open("https://rms.rmto.ir/road-tollhouse-management");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
} else if ($(this).val() == 6) {
|
||
window.open("https://rms.rmto.ir/road-construction-rural");
|
||
$("#stepModalprojecttype").modal("hide");
|
||
}
|
||
}
|
||
});
|
||
|
||
frommDate = $("#datepickfromdate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
frommDate.touched = true;
|
||
|
||
$("#datepicktodate").prop("disabled", "");
|
||
|
||
if (
|
||
frommDate.getState().selected.unixDate >=
|
||
tooDate.getState().selected.unixDate
|
||
) {
|
||
tooDate.setDate(frommDate.getState().selected.unixDate);
|
||
}
|
||
|
||
if (tooDate && tooDate.options && tooDate.options.minDate != unix) {
|
||
let cachedValue = tooDate.getState().selected.unixDate;
|
||
|
||
tooDate.options = { minDate: unix };
|
||
|
||
if (tooDate.touched) {
|
||
tooDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
tooDate = $("#datepicktodate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
tooDate.touched = true;
|
||
|
||
/*if (fromDate && fromDate.options && fromDate.options.maxDate != unix) {
|
||
|
||
let cachedValue = fromDate.getState().selected.unixDate;
|
||
|
||
fromDate.options = { maxDate: unix };
|
||
|
||
if (fromDate.touched) {
|
||
|
||
fromDate.setDate(cachedValue);
|
||
|
||
}
|
||
|
||
}*/
|
||
},
|
||
});
|
||
|
||
$(".right-menu-toggle").on("click", function () {
|
||
if ($(this).css("right") == "0px") {
|
||
$(".right-menu-charts").css("right", "-60px");
|
||
$(this).css("right", "60px");
|
||
$(this).addClass("hide-menu-toggle");
|
||
$(this)
|
||
.find("i")
|
||
.addClass("fa-arrow-alt-circle-left")
|
||
.removeClass("fa-arrow-alt-circle-right");
|
||
} else {
|
||
$(".right-menu-charts").css("right", "30px");
|
||
$(this).css("right", "0px");
|
||
$(this).removeClass("hide-menu-toggle");
|
||
$(this)
|
||
.find("i")
|
||
.addClass("fa-arrow-alt-circle-right")
|
||
.removeClass("fa-arrow-alt-circle-left");
|
||
}
|
||
});
|
||
|
||
$(".item-menu-chart").on("click", function () {
|
||
let num = parseInt($(this).attr("chartId"));
|
||
|
||
keepChartNum = num;
|
||
|
||
if (!$(this).hasClass("item-menu-chart-disabled")) {
|
||
if ($(this).hasClass("item-menu-active")) {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
} else {
|
||
remove141Layer();
|
||
if ($(".item-menu-chart.item-menu-active").length > 0) {
|
||
handleChartButtonClick(0, this);
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(num);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
} else {
|
||
updateChartBox(num);
|
||
handleChartButtonClick(1, this);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
$(".menu-map-toggle").on("click", function () {
|
||
if ($(this).parent().css("width") == "500px") {
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
}
|
||
);
|
||
} else {
|
||
$(this).parent().css("z-index", "15");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "500",
|
||
height: "480",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").addClass("map-svg-box-open");
|
||
$(this).find(".menu-map-close").show();
|
||
}
|
||
);
|
||
}
|
||
});
|
||
|
||
$(".left-menu-map > .menu-map-close").on("click", function () {
|
||
if ($(this).parent().css("width") == "500px") {
|
||
$(this)
|
||
.parent()
|
||
.animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
}
|
||
);
|
||
}
|
||
});
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-sync-icon").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0, $(".item-menu-chart.item-menu-active"));
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(keepChartNum);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-filter-icon").on(
|
||
"click",
|
||
function () {
|
||
$(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).prop("disabled", "disabled");
|
||
$(".left-menu-view-chart > .chart-view-box").fadeOut(300, function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").fadeIn(300);
|
||
});
|
||
|
||
let fromDate, toDate;
|
||
fromDate = $(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterFromDate]"
|
||
).persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
fromDate.touched = true;
|
||
$(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).prop("disabled", "");
|
||
if (
|
||
fromDate.getState().selected.unixDate >=
|
||
toDate.getState().selected.unixDate
|
||
) {
|
||
toDate.setDate(fromDate.getState().selected.unixDate);
|
||
}
|
||
if (toDate && toDate.options && toDate.options.minDate != unix) {
|
||
let cachedValue = toDate.getState().selected.unixDate;
|
||
toDate.options = { minDate: unix };
|
||
if (toDate.touched) {
|
||
toDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
toDate = $(
|
||
".left-menu-view-chart > .chart-filter-box input[name=chartFilterToDate]"
|
||
).persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
toDate.touched = true;
|
||
/*if (fromDate && fromDate.options && fromDate.options.maxDate != unix) {
|
||
let cachedValue = fromDate.getState().selected.unixDate;
|
||
fromDate.options = { maxDate: unix };
|
||
if (fromDate.touched) {
|
||
fromDate.setDate(cachedValue);
|
||
}
|
||
}*/
|
||
},
|
||
});
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .filter-box-submit > .submit-cancel").on(
|
||
"click",
|
||
function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").fadeOut(300, function () {
|
||
$(".left-menu-view-chart > .chart-view-box").fadeIn(300);
|
||
});
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .filter-box-submit > .submit-send").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0, $(".item-menu-chart.item-menu-active"));
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
updateChartBox(keepChartNum);
|
||
handleChartButtonClick(1);
|
||
addFeaturesToMap();
|
||
addTopFeatureToStat();
|
||
}, 500);
|
||
}
|
||
);
|
||
|
||
$(".left-menu-view-chart .chart-tools-item.chart-close-icon").on(
|
||
"click",
|
||
function () {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
}
|
||
);
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-close").on("click", function () {
|
||
handleChartButtonClick(0);
|
||
removeFeaturesFromMap();
|
||
$(".item-menu-141.item-141-active").removeClass("item-141-active");
|
||
setAbrarProcess = 0;
|
||
setBokhorProcess = 0;
|
||
});
|
||
|
||
function handleChartButtonClick(openChart = 1, element = null) {
|
||
if (setAbrarProcess || setBokhorProcess) {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
$(".item-menu-141.item-141-active").removeClass("item-141-active");
|
||
removeFeaturesFromMap();
|
||
setTimeout(function () {
|
||
setAbrarProcess = 0;
|
||
setBokhorProcess = 0;
|
||
$(".menu-stat-list > .stat-list").empty();
|
||
handleChartButtonClickAfterAbrar(openChart, element);
|
||
}, 500);
|
||
} else {
|
||
handleChartButtonClickAfterAbrar(openChart, element);
|
||
}
|
||
}
|
||
|
||
function handleChartButtonClickAfterAbrar(openChart = 1, element = null) {
|
||
if (openChart) {
|
||
if ($(".left-menu-map").css("width") == "500px") {
|
||
$(".left-menu-map").animate(
|
||
{
|
||
width: "50",
|
||
height: "50",
|
||
},
|
||
500,
|
||
function () {
|
||
$(this).find(".map-svg-box").removeClass("map-svg-box-open");
|
||
$(this).css("z-index", "12");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(this).find(".menu-map-close").hide();
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-view-chart").css("z-index", "16");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
}
|
||
}
|
||
);
|
||
} else {
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-view-chart").css("z-index", "16");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
//test
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
$(".left-menu-view-chart").css("left", "30px");
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
}
|
||
}
|
||
} else {
|
||
if (element) {
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
$(".item-menu-chart.item-menu-active").removeClass("item-menu-active");
|
||
$(element).addClass("item-menu-active");
|
||
} else {
|
||
remove141Layer();
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
keepMapFeatureColor = null;
|
||
map.flyTo([32.62, 53.25], 6);
|
||
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
// $(".relatedWebsites").css("left", "30px");
|
||
//test
|
||
$(".left-menu-view-chart").css("z-index", "12");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
$(".item-menu-chart.item-menu-active").removeClass("item-menu-active");
|
||
}
|
||
setTimeout(function () {
|
||
$(".left-menu-view-chart > .chart-filter-box").hide();
|
||
$(".left-menu-view-chart > .chart-view-box").show();
|
||
}, 500);
|
||
}
|
||
}
|
||
|
||
function emptyStatItems() {
|
||
setTimeout(function () {
|
||
$(".menu-stat-list > .stat-list").empty();
|
||
}, 500);
|
||
}
|
||
|
||
// $(".left-menu-141 > .item-menu-141").on("click", function () {
|
||
// let get141Id = parseInt($(this).attr("id141"));
|
||
|
||
// if (get141Id == 20) {
|
||
// window.open("/abrar-projects", "_self");
|
||
// }
|
||
|
||
// if (get141Id < 13) {
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
|
||
// if (setAbrarProcess) {
|
||
// setAbrarProcess = 0;
|
||
// hideAbrarChartStat();
|
||
// setTimeout(function () {
|
||
// show141Layer(get141Id);
|
||
// }, 500);
|
||
// } else if (setBokhorProcess) {
|
||
// setBokhorProcess = 0;
|
||
// hideBokhorChartStat();
|
||
// setTimeout(function () {
|
||
// show141Layer(get141Id);
|
||
// }, 500);
|
||
// } else {
|
||
// show141Layer(get141Id);
|
||
// }
|
||
// } else {
|
||
// $(this).removeClass("item-141-active");
|
||
// remove141Layer();
|
||
// }
|
||
// } else if (get141Id === 13) {
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
|
||
// if (setAbrarProcess) {
|
||
// setAbrarProcess = 0;
|
||
// hideAbrarChartStat();
|
||
// setTimeout(function () {
|
||
// showmodalaccvillage();
|
||
// }, 500);
|
||
// } else if (setBokhorProcess) {
|
||
// setBokhorProcess = 0;
|
||
// hideBokhorChartStat();
|
||
// setTimeout(function () {
|
||
// showmodalaccvillage();
|
||
// }, 500);
|
||
// } else {
|
||
// showmodalaccvillage();
|
||
// }
|
||
// } else {
|
||
// $(this).removeClass("item-141-active");
|
||
// remove141Layer();
|
||
// }
|
||
// } else if (get141Id === 14) {
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
// setAbrarProcess = 1;
|
||
// removeFeaturesFromMap();
|
||
// if (setBokhorProcess) {
|
||
// setBokhorProcess = 0;
|
||
// hideBokhorChartStat();
|
||
// setTimeout(function () {
|
||
// showAbrarChartStat();
|
||
// }, 500);
|
||
// } else {
|
||
// showAbrarChartStat();
|
||
// }
|
||
// } else {
|
||
// setAbrarProcess = 0;
|
||
// $(this).removeClass("item-141-active");
|
||
// hideAbrarChartStat();
|
||
// }
|
||
// } else if (get141Id === 15) {
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
// setBokhorProcess = 1;
|
||
// removeFeaturesFromMap();
|
||
// if (setAbrarProcess) {
|
||
// setAbrarProcess = 0;
|
||
// hideAbrarChartStat();
|
||
// setTimeout(function () {
|
||
// showBokhorChartStat();
|
||
// }, 500);
|
||
// } else {
|
||
// showBokhorChartStat();
|
||
// }
|
||
// } else {
|
||
// setBokhorProcess = 0;
|
||
// $(this).removeClass("item-141-active");
|
||
// hideBokhorChartStat();
|
||
// }
|
||
// } else if (get141Id === 16) {
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
// fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
// fullCityGeoJSONTemp.features = fullCityGeoJSON.features;
|
||
// if (setAbrarProcess) {
|
||
// setAbrarProcess = 0;
|
||
// hideAbrarChartStat();
|
||
// setTimeout(function () {
|
||
// addCityFeaturesToMap();
|
||
// }, 500);
|
||
// } else if (setBokhorProcess) {
|
||
// setBokhorProcess = 0;
|
||
// hideBokhorChartStat();
|
||
// setTimeout(function () {
|
||
// addCityFeaturesToMap();
|
||
// }, 500);
|
||
// } else {
|
||
// addCityFeaturesToMap();
|
||
// }
|
||
// } else {
|
||
// $(this).removeClass("item-141-active");
|
||
// removeCityFeaturesFromMap();
|
||
// }
|
||
// } else {
|
||
// //
|
||
// }
|
||
// });
|
||
function showRmtoToll(id) {
|
||
// e.preventDefault();
|
||
if (id == 2) {
|
||
window.open("https://rms.rmto.ir/rahdari-points-table");
|
||
} else {
|
||
let get141Id = parseInt($(".left-menu-141 > .item-menu-141").attr("id141"));
|
||
console.log(get141Id);
|
||
if (get141Id < 13) {
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
show141Layer(get141Id);
|
||
}, 500);
|
||
} else if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
show141Layer(get141Id);
|
||
}, 500);
|
||
} else {
|
||
show141Layer(get141Id);
|
||
}
|
||
} else {
|
||
$(this).removeClass("item-141-active");
|
||
remove141Layer();
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
// $("#Tollhouse").on("click", function (e) {
|
||
// e.preventDefault();
|
||
// window.open("https://rms.rmto.ir/rahdari-points-table");
|
||
// // let get141Id = parseInt($(".left-menu-141 > .item-menu-141").attr("id141"));
|
||
// // console.log(get141Id);
|
||
// // if (get141Id < 13) {
|
||
// // if (!$(this).hasClass("item-141-active")) {
|
||
// // $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// // "item-141-active"
|
||
// // );
|
||
// // $(this).addClass("item-141-active");
|
||
|
||
// // if (setAbrarProcess) {
|
||
// // setAbrarProcess = 0;
|
||
// // hideAbrarChartStat();
|
||
// // setTimeout(function () {
|
||
// // show141Layer(get141Id);
|
||
// // }, 500);
|
||
// // } else if (setBokhorProcess) {
|
||
// // setBokhorProcess = 0;
|
||
// // hideBokhorChartStat();
|
||
// // setTimeout(function () {
|
||
// // show141Layer(get141Id);
|
||
// // }, 500);
|
||
// // } else {
|
||
// // show141Layer(get141Id);
|
||
// // }
|
||
// // } else {
|
||
// // $(this).removeClass("item-141-active");
|
||
// // remove141Layer();
|
||
// // }
|
||
// // }
|
||
// });
|
||
$("#ProjectV").on("click", function (e) {
|
||
e.preventDefault();
|
||
// alert("hiiiiu")
|
||
window.open("/abrar-projects", "_self");
|
||
});
|
||
$("#uploadfile").on("click", function (e) {
|
||
e.preventDefault();
|
||
if ($(".announcement-box").css("display") != "none") {
|
||
$(".announcement-box").css("display", "none");
|
||
} else {
|
||
$(".announcement-box").css("display", "block");
|
||
}
|
||
});
|
||
$("#Barkhord").on("click", function (e) {
|
||
e.preventDefault();
|
||
// if (!$(this).hasClass("item-141-active")) {
|
||
// $(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
// "item-141-active"
|
||
// );
|
||
// $(this).addClass("item-141-active");
|
||
//yasiiiiiiiooooooo
|
||
|
||
function loadIranGeoJson(callback) {
|
||
showLoaderScreen();
|
||
var xobj = new XMLHttpRequest();
|
||
xobj.overrideMimeType("application/json");
|
||
xobj.open("GET", "/api/provinces35geojson", true);
|
||
xobj.onreadystatechange = function () {
|
||
if (xobj.readyState == 4 && xobj.status == "200") {
|
||
//hideLoaderScreen();
|
||
callback(xobj.responseText);
|
||
}
|
||
};
|
||
xobj.send(null);
|
||
}
|
||
|
||
function loadCityGeoJson(callback) {
|
||
//showLoaderScreen();
|
||
var xobj = new XMLHttpRequest();
|
||
xobj.overrideMimeType("application/json");
|
||
xobj.open("GET", "/api/cities430geojson", true);
|
||
xobj.onreadystatechange = function () {
|
||
if (xobj.readyState == 4 && xobj.status == "200") {
|
||
hideLoaderScreen();
|
||
callback(xobj.responseText);
|
||
}
|
||
};
|
||
xobj.send(null);
|
||
}
|
||
|
||
function initIranGeoJson() {
|
||
loadIranGeoJson(function (response) {
|
||
iranGeoJSON = JSON.parse(response);
|
||
|
||
setBokhorProcess = 1;
|
||
removeFeaturesFromMap();
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
showBokhorChartStat();
|
||
}, 500);
|
||
} else {
|
||
showBokhorChartStat();
|
||
}
|
||
});
|
||
}
|
||
|
||
function initCityGeoJson() {
|
||
loadCityGeoJson(function (response) {
|
||
fullCityGeoJSON = JSON.parse(response);
|
||
|
||
setBokhorProcess = 1;
|
||
removeFeaturesFromMap();
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
showBokhorChartStat();
|
||
}, 500);
|
||
} else {
|
||
showBokhorChartStat();
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
|
||
initIranGeoJson()
|
||
initCityGeoJson()
|
||
|
||
// setBokhorProcess = 1;
|
||
// removeFeaturesFromMap();
|
||
// if (setAbrarProcess) {
|
||
// setAbrarProcess = 0;
|
||
// hideAbrarChartStat();
|
||
// setTimeout(function () {
|
||
// showBokhorChartStat();
|
||
// }, 500);
|
||
// } else {
|
||
// showBokhorChartStat();
|
||
// }
|
||
// } else {
|
||
// setBokhorProcess = 0;
|
||
// $(this).removeClass("item-141-active");
|
||
// hideBokhorChartStat();
|
||
// }
|
||
});
|
||
$("#PahneB").on("click", function (e) {
|
||
e.preventDefault();
|
||
if (!$(this).hasClass("item-141-active")) {
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
$(this).addClass("item-141-active");
|
||
fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
fullCityGeoJSONTemp.features = fullCityGeoJSON.features;
|
||
if (setAbrarProcess) {
|
||
setAbrarProcess = 0;
|
||
hideAbrarChartStat();
|
||
setTimeout(function () {
|
||
addCityFeaturesToMap();
|
||
}, 500);
|
||
} else if (setBokhorProcess) {
|
||
setBokhorProcess = 0;
|
||
hideBokhorChartStat();
|
||
setTimeout(function () {
|
||
addCityFeaturesToMap();
|
||
}, 500);
|
||
} else {
|
||
addCityFeaturesToMap();
|
||
}
|
||
} else {
|
||
$(this).removeClass("item-141-active");
|
||
removeCityFeaturesFromMap();
|
||
}
|
||
});
|
||
|
||
$("#all_village").on("click", function () {
|
||
$("#villageacc_modal").modal("hide");
|
||
showRoadAccidentLayerWithoutCluster();
|
||
});
|
||
|
||
$("#251_village").on("click", function () {
|
||
$("#villageacc_modal").modal("hide");
|
||
showRoadAccidentLayer251();
|
||
});
|
||
|
||
$("#251_village_edit").on("click", function () {
|
||
window.open("/accident-251-points/edit", "_self");
|
||
});
|
||
function clickfindshow(index) {
|
||
itempoint = index + 1;
|
||
// console.log("item", itempoint)
|
||
}
|
||
var showFastReactionPoint = false;
|
||
$("#chooseclock").on("click", function () {
|
||
// console.log("hiihii", itempoint)
|
||
$("#choosetime").modal("hide");
|
||
|
||
if (
|
||
$("#datepickfromdate").val() != " " &&
|
||
$("#datepicktodate").val() != " "
|
||
) {
|
||
let startDate = moment(
|
||
frommDate.getState().selected.year +
|
||
"/" +
|
||
frommDate.getState().selected.month +
|
||
"/" +
|
||
frommDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDate = moment(
|
||
tooDate.getState().selected.year +
|
||
"/" +
|
||
tooDate.getState().selected.month +
|
||
"/" +
|
||
tooDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
console.log(startDate);
|
||
console.log(endDate);
|
||
|
||
if (showFastReactionPoint) {
|
||
showFastFunction(startDate, endDate);
|
||
} else {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url:
|
||
"/homeprojects/roaditems/points" +
|
||
"?item=" +
|
||
itempoint +
|
||
"&end-date=" +
|
||
endDate +
|
||
"&start-date=" +
|
||
startDate,
|
||
type: "GET",
|
||
success: function (result) {
|
||
// console.log("resssss", result.data);
|
||
show_point(result.data);
|
||
|
||
// hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
function show_point(data) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
// console.log("index", index)
|
||
// console.log("data", data)
|
||
|
||
// marker141Layers = L.markerClusterGroup();
|
||
let markerG = [];
|
||
for (let index = 0; index < data.length; index++) {
|
||
let marker = L.circleMarker(
|
||
[data[index].start_lat, data[index].start_lng],
|
||
{
|
||
color: "#007bff",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}
|
||
).on("click", function (e) {
|
||
$("#datepoint").val(data[index].created_at);
|
||
$("#edarepoint").val(data[index].province_name);
|
||
$("#citypoint").val(data[index].city_name);
|
||
headermodal(data[index].item);
|
||
$("#showpoint").modal("show");
|
||
GenerateTable(data[index].sub_items, data[index].sub_items_data, index);
|
||
show_point_photo(data[index].files);
|
||
// console.log(e)
|
||
});
|
||
markerG.push(marker);
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
}
|
||
function headermodal(item) {
|
||
$("#headerid").empty();
|
||
if (item == 1) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> مرمت رویه </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 2) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> پاکسازی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 3) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> علائم </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 4) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> حفاظ </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 5) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> روشنایی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 6) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> خط کشی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 7) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> رنگ آمیزی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 8) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> شستشو </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 9) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> ایمن سازی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 10) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> حریم </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 11) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> پل </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 12) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> تونل و گالری </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 13) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> عملیات زمستانی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 14) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> ماشین آلات </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 15) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> راهدارخانه </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 16) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title"> موارد اضطراری </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
}
|
||
}
|
||
|
||
function show_point_photo(array) {
|
||
$("#showpicture").empty();
|
||
// console.log("array", array)
|
||
if (array.length > 0) {
|
||
array.forEach((element) =>
|
||
$("#showpicture").append('<img class="zoom" src ="' + element + '" >')
|
||
);
|
||
}
|
||
}
|
||
function subshow(index) {
|
||
if (itempoint == 1) {
|
||
// return index
|
||
if (index == 7) {
|
||
return "روکش";
|
||
}
|
||
if (index == 1) {
|
||
return "ترمیم افتادگی لبه آسفالت";
|
||
}
|
||
if (index == 2) {
|
||
return "شانه سازی";
|
||
}
|
||
if (index == 3) {
|
||
return "پر کردن گودافتادگی یا چاله با آسفالت";
|
||
}
|
||
if (index == 4) {
|
||
return "لکه گیری هندسی راه";
|
||
}
|
||
if (index == 5) {
|
||
return "مرمت آبشستگی راه ها و شانه راه ها";
|
||
}
|
||
if (index == 6) {
|
||
return "تنظیم سطح بستر حریم";
|
||
}
|
||
} else if (itempoint == 2) {
|
||
if (index == 1) {
|
||
return "پاک سازی و جاروزنی سطح راه";
|
||
}
|
||
if (index == 2) {
|
||
return "پاک سازی و تنقیه آبروهای کوچک";
|
||
}
|
||
if (index == 3) {
|
||
return "پاک سازی سطح راه از لاشه حیوانات";
|
||
}
|
||
if (index == 4) {
|
||
return "پاک سازی قنوها و آبروهای طولی";
|
||
}
|
||
if (index == 5) {
|
||
return "پاک سازی سطح راه از آثار تصادفات";
|
||
}
|
||
if (index == 6) {
|
||
return "علف کنی و بوته کنی" + "<br>";
|
||
}
|
||
if (index == 7) {
|
||
return "پاک سازی حریم راه از مواد زائد و نخاله های ساختمانی";
|
||
}
|
||
if (index == 8) {
|
||
return "جمع آوری قطعات آسیب دیده حفاظ، علائم و ...";
|
||
}
|
||
} else if (itempoint == 3) {
|
||
if (index == 1) {
|
||
return "نصب تابلوهای اخطاری، انتظامی و مسیرنما";
|
||
}
|
||
if (index == 2) {
|
||
return "نصب تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 3) {
|
||
return "تعویض شبرنگ تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 4) {
|
||
return "نصب بازتاب بر روی گاردریل و حفاظ های حاشیه راه و چشم گربه ای";
|
||
}
|
||
} else if (itempoint == 4) {
|
||
if (index == 1) {
|
||
return "ارتقای حفاظ میانی راه ها";
|
||
}
|
||
if (index == 2) {
|
||
return "ارتقای حفاظ پل ها و پرتگاه ها" + "<br>";
|
||
}
|
||
if (index == 3) {
|
||
return "بهسازی حفاظ های موجود" + "<br>";
|
||
}
|
||
} else if (itempoint == 5) {
|
||
if (index == 1) {
|
||
return "روشنایی طولی راه";
|
||
}
|
||
if (index == 2) {
|
||
return "روشنایی نقطه ای پارکینگ در حاشیه راه";
|
||
}
|
||
if (index == 3) {
|
||
return "روشنایی نقطه ای تقاطع در حاشیه راه";
|
||
}
|
||
if (index == 4) {
|
||
return "روشنایی نقطه ای محل نصب دوربین در حاشیه راه";
|
||
}
|
||
if (index == 5) {
|
||
return "روشنایی طولی نواحی یا گردنه های مه گیر";
|
||
}
|
||
if (index == 6) {
|
||
return "روشنایی تونل";
|
||
}
|
||
} else if (itempoint == 6) {
|
||
if (index == 1) {
|
||
return "خط کشی با رنگ گرم ترافیکی";
|
||
}
|
||
if (index == 2) {
|
||
return "خط کشی با رنگ سرد ترافیکی";
|
||
}
|
||
if (index == 3) {
|
||
return "ترسیم نقوش، فلش، خط نوشته و ...";
|
||
}
|
||
} else if (itempoint == 7) {
|
||
if (index == 1) {
|
||
return "رنگ آمیزی پایه تابلوها";
|
||
}
|
||
if (index == 2) {
|
||
return "رنگ آمیزی پایه چراغ ها";
|
||
}
|
||
if (index == 3) {
|
||
return "رنگ آمیزی پایه های روشنایی";
|
||
}
|
||
if (index == 4) {
|
||
return "رنگ آمیزی پل های عابر پیاده";
|
||
}
|
||
if (index == 5) {
|
||
return "رنگ آمیزی پایه تابلوهای دروازه ای";
|
||
}
|
||
if (index == 6) {
|
||
return "رنگ آمیزی حفاظ ها";
|
||
}
|
||
} else if (itempoint == 8) {
|
||
if (index == 1) {
|
||
return "شستشوی علائم ایمنی اخطاری، انتظامی، مسیرنما و ...";
|
||
}
|
||
if (index == 2) {
|
||
return " شستشوی تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 3) {
|
||
return " شستشوی جداول";
|
||
}
|
||
if (index == 4) {
|
||
return " شستشوی نیوجرسی ها";
|
||
}
|
||
if (index == 5) {
|
||
return " شستشوی گاردریل ها و هندریل ها";
|
||
}
|
||
if (index == 6) {
|
||
return "شستشوی دیواره تونل ها";
|
||
}
|
||
} else if (itempoint == 9) {
|
||
if (index == 1) {
|
||
return "ایمن سازی سرگاردریل، موانع صلب، دماغه ها و موانع صلب";
|
||
}
|
||
if (index == 2) {
|
||
return "ایمن سازی شیب شیروانی ها";
|
||
}
|
||
if (index == 3) {
|
||
return "اجرای استراحتگاه";
|
||
}
|
||
if (index == 4) {
|
||
return "نصب و راه اندازی چراغ های آذرخشی و چشمک زن";
|
||
}
|
||
if (index == 5) {
|
||
return "ایجاد شیراهای لرزاننده طولی";
|
||
}
|
||
if (index == 6) {
|
||
return "ضربه گیر استوانه ای";
|
||
}
|
||
if (index == 7) {
|
||
return "نصب سرعت گیر استاندارد پلاستیکی";
|
||
}
|
||
} else if (itempoint == 10) {
|
||
if (index == 1) {
|
||
return "ساخت و ساز";
|
||
}
|
||
if (index == 2) {
|
||
return "عبور تاسیسات زیربنایی";
|
||
}
|
||
if (index == 3) {
|
||
return "راه دسترسی اختصاصی";
|
||
}
|
||
if (index == 4) {
|
||
return "راه دسترسی تجمیع شده";
|
||
}
|
||
} else if (itempoint == 11) {
|
||
if (index == 1) {
|
||
return "تعمیرات الواسیون";
|
||
}
|
||
if (index == 2) {
|
||
return "دراواسیون و تنظیم بستر پل های بالای 6 متر";
|
||
}
|
||
if (index == 3) {
|
||
return "احداث رادیه و برید";
|
||
}
|
||
if (index == 4) {
|
||
return "مرمت و بازسازی درز انبساط";
|
||
}
|
||
if (index == 5) {
|
||
return "بازسازی نرده پل";
|
||
}
|
||
} else if (itempoint == 12) {
|
||
if (index == 1) {
|
||
return "زهکشی طاق تونل";
|
||
}
|
||
if (index == 2) {
|
||
return "مرمت و بازرسی آبروهای هدایت آب";
|
||
}
|
||
if (index == 3) {
|
||
return "لاینینگ";
|
||
}
|
||
if (index == 4) {
|
||
return "تعمیر و بازسازی گالری";
|
||
}
|
||
if (index == 5) {
|
||
return "گاباریت";
|
||
}
|
||
} else if (itempoint == 13) {
|
||
if (index == 1) {
|
||
return "عملیات یخ زدایی با شن و نمک پاشی";
|
||
}
|
||
if (index == 2) {
|
||
return "برف روبی با گریدر یا تیغه برف روب";
|
||
}
|
||
if (index == 3) {
|
||
return "برف روبی با بولدوزر و ماشین برف خور";
|
||
}
|
||
if (index == 4) {
|
||
return "برف روبی در شرایط کولاک و عدم دید";
|
||
}
|
||
if (index == 5) {
|
||
return "میزان نمک مصرفی";
|
||
}
|
||
if (index == 6) {
|
||
return "ریزش برداری";
|
||
}
|
||
if (index == 7) {
|
||
return "مسافرین اسکان داده شده";
|
||
}
|
||
if (index == 8) {
|
||
return "کمک رسانی به خودرو رهاشده";
|
||
}
|
||
} else if (itempoint == 14) {
|
||
if (index == 1) {
|
||
return "بنزین مصرفی کل ماشین آلات فعال";
|
||
}
|
||
if (index == 2) {
|
||
return "گازوئیل مصرفی کل ماشین آلات فعال";
|
||
}
|
||
if (index == 3) {
|
||
return "مواد مصرفی نفتی و انواع روغن";
|
||
}
|
||
if (index == 4) {
|
||
return "بازسازی و راه اندازی ماشین آلات";
|
||
}
|
||
if (index == 5) {
|
||
return "خرید ماشین آلات";
|
||
}
|
||
if (index == 6) {
|
||
return "خرید تجهیزآلات مرتبط به ماشین آلات";
|
||
}
|
||
if (index == 7) {
|
||
return "بازدید کارشناسان از ماشین آلات استان";
|
||
}
|
||
} else if (itempoint == 15) {
|
||
if (index == 1) {
|
||
return "راهدارخانه های بازسازی شده";
|
||
}
|
||
if (index == 2) {
|
||
return "خرید تجهیزآلات مرتبط با راهدارخانه ها";
|
||
}
|
||
if (index == 3) {
|
||
return "جلسات تشکیل شده در خصوص مدیریت بحران و پدافند غیرعامل";
|
||
}
|
||
} else if (itempoint == 16) {
|
||
if (index == 1) {
|
||
return (
|
||
"پاک سازی سطح راه و رفع انسداد ناشی از ریزش کوه و سقوط بهمن" + "<br>"
|
||
);
|
||
}
|
||
if (index == 2) {
|
||
return (
|
||
"برقراری تردد و رفع انسداد ناشی از وقوع تصادف یا واژگونی وسایط نقلیه و پخش محموله در سطح راه" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 3) {
|
||
return "برقراری ارتباط و رفع انسداد ناشی از شن های روان" + "<br>";
|
||
}
|
||
if (index == 4) {
|
||
return (
|
||
"برقراری ارتباط در راه هایی که به دلیل آب بردگی دچار قطع ارتباط شده اند" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 5) {
|
||
return (
|
||
"برقراری ارتباط موقت در راه هایی که به دلیل شکستگی پل یا ریزش تونل یا ... قطع شده اند" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 6) {
|
||
return "بستن راه و هدایت ترافیکی در مواقع اضطراری" + "<br>";
|
||
}
|
||
}
|
||
}
|
||
function showcount(item, data) {
|
||
if (itempoint == 1) {
|
||
let textfile = "";
|
||
|
||
if (item == 7) {
|
||
if (
|
||
data["reconstruction7-1-1"] != undefined &&
|
||
data["reconstruction7-1-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
"روکش آسفالت :" +
|
||
data["reconstruction7-1-1"] +
|
||
" " +
|
||
"کیلومتر " +
|
||
"تناژ" +
|
||
" " +
|
||
data["reconstruction7-1-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-1-1"] != undefined &&
|
||
data["reconstruction7-1-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
"روکش آسفالت :" +
|
||
data["reconstruction7-1-1"] +
|
||
" " +
|
||
"کیلومتر " +
|
||
" " +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-1-1"] == undefined &&
|
||
data["reconstruction7-1-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
"روکش آسفالت :" + "تناژ" + " " + data["reconstruction7-1-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-2-1"] != undefined &&
|
||
data["reconstruction7-2-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
"ماسه آسفالت :" +
|
||
" " +
|
||
data["reconstruction7-2-1"] +
|
||
" " +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
" " +
|
||
data["reconstruction7-2-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-2-1"] != undefined &&
|
||
data["reconstruction7-2-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
"ماسه آسفالت :" +
|
||
" " +
|
||
data["reconstruction7-2-1"] +
|
||
" " +
|
||
"کیلومتر " +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-2-1"] == undefined &&
|
||
data["reconstruction7-2-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
"ماسه آسفالت :" +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-1-2"] +
|
||
" " +
|
||
"<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-3-1"] != undefined &&
|
||
data["reconstruction7-3-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" باریافت سرد/گرم :" +
|
||
" " +
|
||
data["reconstruction7-3-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
" " +
|
||
data["reconstruction7-3-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-3-1"] != undefined &&
|
||
data["reconstruction7-3-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" باریافت سرد/گرم :" +
|
||
data["reconstruction7-3-1"] +
|
||
" " +
|
||
"کیلومتر " +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-3-1"] == undefined &&
|
||
data["reconstruction7-3-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" باریافت سرد/گرم :" + "تناژ" + data["reconstruction7-3-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-4-1"] != undefined &&
|
||
data["reconstruction7-4-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" میکروسرفیسینگ :" +
|
||
data["reconstruction7-4-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-4-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-4-1"] != undefined &&
|
||
data["reconstruction7-4-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" میکروسرفیسینگ :" +
|
||
data["reconstruction7-4-1"] +
|
||
"کیلومتر " +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-4-1"] == undefined &&
|
||
data["reconstruction7-4-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" میکروسرفیسینگ :" + "تناژ" + data["reconstruction7-4-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-5-1"] != undefined &&
|
||
data["reconstruction7-5-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" چیپ سیل" +
|
||
data["reconstruction7-5-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-5-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-5-1"] != undefined &&
|
||
data["reconstruction7-5-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" چیپ سیل" + data["reconstruction7-5-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-5-1"] == undefined &&
|
||
data["reconstruction7-5-2"] != undefined
|
||
) {
|
||
textfile += " چیپ سیل" + "تناژ" + data["reconstruction7-5-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-6-1"] != undefined &&
|
||
data["reconstruction7-6-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" اسلاری سیل" +
|
||
data["reconstruction7-6-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-6-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-6-1"] != undefined &&
|
||
data["reconstruction7-6-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" اسلاری سیل" + data["reconstruction7-6-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-6-1"] == undefined &&
|
||
data["reconstruction7-6-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" اسلاری سیل" + "تناژ" + data["reconstruction7-6-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-7-1"] != undefined &&
|
||
data["reconstruction7-7-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" اسکراب سیل :" +
|
||
data["reconstruction7-7-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-7-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-7-1"] != undefined &&
|
||
data["reconstruction7-7-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" اسکراب سیل :" + data["reconstruction7-7-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-7-1"] == undefined &&
|
||
data["reconstruction7-7-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" اسکراب سیل :" + "تناژ" + data["reconstruction7-7-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-8-1"] != undefined &&
|
||
data["reconstruction7-8-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" فوگ سیل :" +
|
||
data["reconstruction7-8-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-8-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-8-1"] != undefined &&
|
||
data["reconstruction7-8-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" فوگ سیل :" + data["reconstruction7-8-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-8-1"] == undefined &&
|
||
data["reconstruction7-8-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" فوگ سیل :" + "تناژ" + data["reconstruction7-8-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-9-1"] != undefined &&
|
||
data["reconstruction7-9-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" سیل کت :" +
|
||
data["reconstruction7-9-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-9-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-9-1"] != undefined &&
|
||
data["reconstruction7-9-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" سیل کت :" + data["reconstruction7-9-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-9-1"] == undefined &&
|
||
data["reconstruction7-9-2"] != undefined
|
||
) {
|
||
textfile += " سیل کت :" + "تناژ" + data["reconstruction7-9-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-10-1"] != undefined &&
|
||
data["reconstruction7-10-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" کیپ سیل :" +
|
||
data["reconstruction7-10-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-10-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-10-1"] != undefined &&
|
||
data["reconstruction7-10-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
" کیپ سیل :" + data["reconstruction7-10-1"] + "کیلومتر " + "<br>";
|
||
} else if (
|
||
data["reconstruction7-10-1"] == undefined &&
|
||
data["reconstruction7-10-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" کیپ سیل :" + "تناژ" + data["reconstruction7-10-2"] + "<br>";
|
||
}
|
||
|
||
if (
|
||
data["reconstruction7-11-1"] != undefined &&
|
||
data["reconstruction7-11-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" آسفالت سرد/ردمیکس :" +
|
||
data["reconstruction7-11-1"] +
|
||
"کیلومتر " +
|
||
" " +
|
||
"تناژ" +
|
||
data["reconstruction7-11-2"] +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-11-1"] != undefined &&
|
||
data["reconstruction7-11-2"] == undefined
|
||
) {
|
||
textfile +=
|
||
"آسفالت سرد/ردمیکس :" +
|
||
data["reconstruction7-11-1"] +
|
||
"کیلومتر " +
|
||
"<br>";
|
||
} else if (
|
||
data["reconstruction7-11-1"] == undefined &&
|
||
data["reconstruction7-11-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
" آسفالت سرد/ردمیکس :" +
|
||
"تناژ" +
|
||
data["reconstruction7-11-2"] +
|
||
"<br>";
|
||
}
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 1) {
|
||
if (data["reconstruction1-1"] != undefined) {
|
||
textfile = data["reconstruction1-1"] + "کیلومتر " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["reconstruction2-1"] != undefined) {
|
||
textfile = data["reconstruction2-1"] + " تن" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["reconstruction3-1"]) {
|
||
textfile = data["reconstruction3-1"] + " متر مربع" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["reconstruction4-1"] != undefined) {
|
||
textfile = data["reconstruction4-1"] + "متر مکعب " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["reconstruction5-1"] != undefined) {
|
||
textfile = data["reconstruction5-1"] + "کیلومتر " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 6) {
|
||
if (data["reconstruction6-1"] != undefined) {
|
||
textfile = data["reconstruction6-1"] + "کیلومتر " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 2) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["cleaning1-1"] != undefined) {
|
||
textfile += data["cleaning1-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["cleaning2-1"] != undefined) {
|
||
textfile += data["cleaning2-1"] + "متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["cleaning3-1"] != undefined) {
|
||
textfile += data["cleaning3-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["cleaning4-1"] != undefined) {
|
||
textfile += data["cleaning4-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["cleaning5-1"] != undefined) {
|
||
textfile += data["cleaning5-1"] + "مترطول-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["cleaning6-1"] != undefined) {
|
||
textfile += data["cleaning6-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["cleaning7-1"] != undefined) {
|
||
textfile += data["cleaning7-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["cleaning8-1"] != undefined) {
|
||
textfile += data["cleaning8-1"] + "تن" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 3) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["signs1-1"] != undefined) {
|
||
textfile += data["signs1-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["signs2-1"] != undefined) {
|
||
textfile += data["signs2-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["signs3-1"] != undefined) {
|
||
textfile += data["signs3-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["signs4-1"] != undefined) {
|
||
textfile += data["signs4-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 4) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (
|
||
data["shield1-1-1"] != undefined ||
|
||
data["shield1-1-2"] != undefined ||
|
||
data["shield1-1-3"] != undefined ||
|
||
data["shield1-1-4"] != undefined
|
||
) {
|
||
if (data["shield1-2-1"] != undefined) {
|
||
textfile += data["shield1-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["shield1-2-1"] + "کیلومتر" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (value == 2) {
|
||
if (
|
||
data["shield2-1-1"] != undefined ||
|
||
data["shield2-1-2"] != undefined ||
|
||
data["shield2-1-3"] != undefined ||
|
||
data["shield2-1-4"] != undefined
|
||
) {
|
||
if (data["shield2-2-1"] != undefined) {
|
||
textfile += data["shield2-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["shield2-2-1"] + "کیلومتر" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (value == 3) {
|
||
if (
|
||
data["shield3-1-1"] != undefined ||
|
||
data["shield3-1-2"] != undefined ||
|
||
data["shield3-1-3"] != undefined ||
|
||
data["shield3-1-4"] != undefined
|
||
) {
|
||
if (data["shield3-2-1"] != undefined) {
|
||
textfile += data["shield3-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["shield3-2-1"] + "کیلومتر" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 5) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (
|
||
data["lighting1-1-1"] != undefined ||
|
||
data["lighting1-1-2"] != undefined ||
|
||
data["lighting1-1-3"] != undefined
|
||
) {
|
||
if (data["lighting1-2-1"] != undefined) {
|
||
textfile += data["lighting1-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting1-2-1"] + "کیلومتر" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (
|
||
data["lighting2-1-1"] != undefined ||
|
||
data["lighting2-1-2"] != undefined ||
|
||
data["lighting2-1-3"] != undefined
|
||
) {
|
||
if (data["lighting2-2-1"] != undefined) {
|
||
textfile += data["lighting2-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting2-2-1"] + "موردی" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (
|
||
data["lighting3-1-1"] != undefined ||
|
||
data["lighting3-1-2"] != undefined ||
|
||
data["lighting3-1-3"] != undefined
|
||
) {
|
||
if (data["lighting3-2-1"] != undefined) {
|
||
textfile += data["lighting3-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting3-2-1"] + "موردی" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (
|
||
data["lighting4-1-1"] != undefined ||
|
||
data["lighting4-1-2"] != undefined ||
|
||
data["lighting4-1-3"] != undefined
|
||
) {
|
||
if (data["lighting4-2-1"] != undefined) {
|
||
textfile += data["lighting4-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting4-2-1"] + "موردی" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (
|
||
data["lighting5-1-1"] != undefined ||
|
||
data["lighting5-1-2"] != undefined ||
|
||
data["lighting5-1-3"] != undefined
|
||
) {
|
||
if (data["lighting5-2-1"] != undefined) {
|
||
textfile += data["lighting5-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting5-2-1"] + "کیلومتر" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (
|
||
data["lighting6-1-1"] != undefined ||
|
||
data["lighting6-1-2"] != undefined ||
|
||
data["lighting6-1-3"] != undefined
|
||
) {
|
||
if (data["lighting6-2-1"] != undefined) {
|
||
textfile += data["lighting6-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
} else {
|
||
textfile += data["lighting6-2-1"] + "موردی" + "<br>";
|
||
}
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 6) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["lining1-1"] != undefined) {
|
||
textfile += data["lining1-1"] + "کیلومتر-رنگ" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["lining2-1"] != undefined) {
|
||
textfile += data["lining2-1"] + "کیلومتر-رنگ" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["lining3-1"]) {
|
||
textfile += data["lining3-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 7) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["coloring1-1"] != undefined) {
|
||
textfile += data["coloring1-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["coloring2-1"] != undefined) {
|
||
textfile += data["coloring2-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["coloring3-1"] != undefined) {
|
||
textfile += data["coloring3-1"] + "اصله" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["coloring4-1"] != undefined) {
|
||
textfile += data["coloring4-1"] + "دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["coloring5-1"] != undefined) {
|
||
textfile += data["coloring5-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["coloring6-1"] != undefined) {
|
||
textfile += data["coloring6-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 8) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["washing1-1"] != undefined) {
|
||
textfile += data["washing1-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["washing2-1"] != undefined) {
|
||
textfile += data["washing2-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["washing3-1"] != undefined) {
|
||
textfile += data["washing3-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["washing4-1"] != undefined) {
|
||
textfile += data["washing4-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["washing5-1"] != undefined) {
|
||
textfile += data["washing5-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["washing6-1"] != undefined) {
|
||
textfile += data["washing6-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 9) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["securing1-1"] != undefined) {
|
||
textfile += data["securing1-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["securing2-1"] != undefined) {
|
||
textfile += data["securing2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["securing3-1"] != undefined) {
|
||
textfile += data["securing3-1"] + "باب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["securing4-1"] != undefined) {
|
||
textfile += data["securing4-1"] + "دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["securing5-1"] != undefined) {
|
||
textfile += data["securing5-1"] + "کیلومتر-شیار" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["securing6-1"] != undefined) {
|
||
textfile += data["securing6-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["securing7-1"] != undefined) {
|
||
textfile += data["securing7-1"] + "طول" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 10) {
|
||
return "_";
|
||
} else if (itempoint == 11) {
|
||
return "_";
|
||
} else if (itempoint == 12) {
|
||
return "_";
|
||
} else if (itempoint == 13) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["winterOperation1-1"] != undefined) {
|
||
textfile += data["winterOperation1-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["winterOperation1-2"] != undefined) {
|
||
textfile += data["winterOperation1-2"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["winterOperation3-1"] != undefined) {
|
||
textfile += data["winterOperation3-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["winterOperation4-1"] != undefined) {
|
||
textfile += data["winterOperation4-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["winterOperation5-1"] != undefined) {
|
||
textfile += data["winterOperation5-1"] + "تن" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["winterOperation6-1"] != undefined) {
|
||
textfile += data["winterOperation6-1"] + "مقطع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["winterOperation7-1"] != undefined) {
|
||
textfile += data["winterOperation7-1"] + "تعداد" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["winterOperation8-1"] != undefined) {
|
||
textfile += data["winterOperation8-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 14) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["machinery1-1"] != undefined) {
|
||
textfile += data["machinery1-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["machinery2-1"] != undefined) {
|
||
textfile += data["machinery2-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["machinery3-1"] != undefined) {
|
||
textfile += data["machinery3-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (
|
||
data["machinery4-1"] != undefined &&
|
||
data["machinery4-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["machinery4-1"] +
|
||
"تعداد دستگاه" +
|
||
data["machinery4-2"] +
|
||
"هزینه" +
|
||
"<br>";
|
||
} else if (
|
||
data["machinery4-1"] != undefined &&
|
||
data["machinery4-2"] == undefined
|
||
) {
|
||
textfile += data["machinery4-1"] + "تعداد دستگاه" + "<br>";
|
||
} else if (
|
||
data["machinery4-1"] == undefined &&
|
||
data["machinery4-2"] != undefined
|
||
) {
|
||
textfile += data["machinery4-2"] + "هزینه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (
|
||
data["machinery5-1"] != undefined &&
|
||
data["machinery5-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["machinery5-1"] +
|
||
"تعداد دستگاه" +
|
||
data["machinery5-2"] +
|
||
"نوع کاربری" +
|
||
"<br>";
|
||
} else if (
|
||
data["machinery5-1"] != undefined &&
|
||
data["machinery5-2"] == undefined
|
||
) {
|
||
textfile += data["machinery5-1"] + "تعداد دستگاه" + "<br>";
|
||
} else if (
|
||
data["machinery5-1"] == undefined &&
|
||
data["machinery5-2"] != undefined
|
||
) {
|
||
textfile += data["machinery5-2"] + "نوع کاربری " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (
|
||
data["machinery6-1"] != undefined &&
|
||
data["machinery6-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["machinery6-1"] +
|
||
"تعداد دستگاه" +
|
||
data["machinery6-2"] +
|
||
"نوع کاربری" +
|
||
"<br>";
|
||
} else if (
|
||
data["machinery6-1"] != undefined &&
|
||
data["machinery6-2"] == undefined
|
||
) {
|
||
textfile += data["machinery6-1"] + "تعداد دستگاه" + "<br>";
|
||
} else if (
|
||
data["machinery6-1"] == undefined &&
|
||
data["machinery6-2"] != undefined
|
||
) {
|
||
textfile += data["machinery6-2"] + "نوع کاربری" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (
|
||
data["machinery7-1"] != undefined &&
|
||
data["machinery7-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["machinery7-1"] +
|
||
"تعداد دستگاه" +
|
||
data["machinery7-2"] +
|
||
"تعداد بازدید " +
|
||
"<br>";
|
||
} else if (
|
||
data["machinery7-1"] != undefined &&
|
||
data["machinery7-2"] == undefined
|
||
) {
|
||
textfile += data["machinery7-1"] + "تعداد دستگاه" + "<br>";
|
||
} else if (
|
||
data["machinery7-1"] == undefined &&
|
||
data["machinery7-2"] != undefined
|
||
) {
|
||
textfile += data["machinery7-2"] + "تعداد بازدید " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 15) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (
|
||
data["tollhouse1-1"] != undefined &&
|
||
data["tollhouse1-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["tollhouse1-1"] +
|
||
"باب" +
|
||
data["tollhouse1-2"] +
|
||
"هزینه" +
|
||
"<br>";
|
||
} else if (
|
||
data["tollhouse1-1"] != undefined &&
|
||
data["tollhouse1-2"] == undefined
|
||
) {
|
||
textfile += data["tollhouse1-1"] + "باب" + "<br>";
|
||
} else if (
|
||
data["tollhouse1-1"] == undefined &&
|
||
data["tollhouse1-2"] != undefined
|
||
) {
|
||
textfile += data["tollhouse1-2"] + "هزینه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (
|
||
data["tollhouse2-1"] != undefined &&
|
||
data["tollhouse2-2"] != undefined
|
||
) {
|
||
textfile +=
|
||
data["tollhouse2-1"] +
|
||
"تعداد" +
|
||
data["tollhouse2-2"] +
|
||
"نوع" +
|
||
"<br>";
|
||
} else if (
|
||
data["tollhouse2-1"] != undefined &&
|
||
data["tollhouse2-2"] == undefined
|
||
) {
|
||
textfile += data["tollhouse2-1"] + "تعداد" + "<br>";
|
||
} else if (
|
||
data["tollhouse2-1"] == undefined &&
|
||
data["tollhouse2-2"] != undefined
|
||
) {
|
||
textfile += data["tollhouse2-2"] + "نوع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["tollhouse3-1"] != undefined) {
|
||
textfile += data["tollhouse3-1"] + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 16) {
|
||
return "_";
|
||
}
|
||
}
|
||
|
||
function GenerateTable(item, dataitem) {
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", "ریزفعالیت ", "مقدار"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([i + 1, subshow(item[i]), showcount(item[i], dataitem)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtable");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
function generatemachinary(data, flag) {
|
||
if (flag == 0) {
|
||
var item = data
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", " نوع دستگاه ", " نام راننده", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([i + 1, dastgahname(item[i].dastgahtype), drivername(item[i].drivername), showphone(item[i].driverphone)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showmachinekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
else {
|
||
var item = jQuery.parseJSON(data)
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", " نوع دستگاه ", " نام راننده", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([i + 1, dastgahname(item[i].dastgahtype), drivername(item[i].drivername), showphone(item[i].driverphone)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showmachinekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
|
||
}
|
||
|
||
|
||
// $('.machinlistcard').css('height' , '0px');
|
||
// $('.machinlistcard').css('margin-bottom' , '0px');
|
||
// $('.machinlistcard::before').css('transform' , 'rotate(90deg)');
|
||
|
||
|
||
// $('.machinlistcard').css('height' , '0px');
|
||
// $('.machinlistcard').css('margin-bottom' , '0px');
|
||
// $('.machinlistcard::before').css('transform' , 'rotate(90deg)');
|
||
|
||
}
|
||
function dastgahname(data) {
|
||
return data
|
||
}
|
||
function drivername(data) {
|
||
return data
|
||
}
|
||
function showphone(data) {
|
||
return data
|
||
}
|
||
function generatetablecoridor(data, flag) {
|
||
if (flag == 0) {
|
||
var item = data
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", "نام اکیپ ", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([i + 1, showekip(item[i].nameofekip), showphone(item[i].ekipphone)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showcoridorekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
|
||
}
|
||
else {
|
||
|
||
var item = jQuery.parseJSON(data)
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", "نام اکیپ ", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([i + 1, showekip(item[i].nameofekip), showphone(item[i].ekipphone)]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showcoridorekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
|
||
// $('.ekiptest').css('height' , '0px');
|
||
// $('.ekiptest').css('margin-bottom' , '0px');
|
||
// $('.ekiplistt::before').css('transform' , 'rotate(90deg)');
|
||
|
||
|
||
|
||
}
|
||
|
||
function showekip(data) {
|
||
console.log("num", data);
|
||
return data
|
||
}
|
||
function showphone(data) {
|
||
console.log("num", data);
|
||
return data
|
||
}
|
||
function showRoadAccidentLayer251() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
$.get("/accident-251-points", function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (roadAccidentPoints[i].progress == "100") {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
|
||
let marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
$("#pointid").val(datatext.id);
|
||
$("#opration").val(datatext.operation); //oparation
|
||
$("#target").val(datatext.target); //target
|
||
$("#action").val(datatext.actions); //action
|
||
$("#ac-point-lat").val(datatext.lat);
|
||
$("#ac-point-lng").val(datatext.lng);
|
||
valueprogress = datatext.progress;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
//$("#cost").attr('min', datatext.cost);//cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
markerG.push(marker);
|
||
} catch (e) {
|
||
//
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function getPopupContentAccident_251(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccident251PointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
function getpopupcoridor(data, num) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showcoridorfinall('+ data.id + ')">بروزرسانی</button>\
|
||
<button class="popup-btn-edit-point" onclick="deletecoridor('+ data.id + ')">حذف</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
function deletecoridor(num) {
|
||
|
||
formData = new FormData();
|
||
|
||
formData.append("id", num);
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/api/RahesEsential/delete",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
alert("hii")
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
function getpopcounterrahdari(data, num) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showrahdarModalcoridor('+ data.id + ')">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
function getPopupContentRahdar(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showrahdarModal('+ parseFloat(data.lat).toFixed(5) + ', ' + parseFloat(data.l).toFixed(5) + ')">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function showRoadAccidentLayerWithoutCluster() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/accident-points",
|
||
type: "GET",
|
||
success: function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
//console.log(roadAccidentPoints);
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
if (
|
||
roadAccidentPoints[i].progress == "100" ||
|
||
(roadAccidentPoints[i].accident251_point &&
|
||
roadAccidentPoints[i].accident251_point.progress == "100")
|
||
) {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = "#28a745";
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = "#dc3545";
|
||
}
|
||
}
|
||
|
||
try {
|
||
let marker = null;
|
||
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
//console.log(this.options.content)
|
||
let valueprogress = "";
|
||
let contentData = this.options.content;
|
||
$("#allpointid").val(contentData.id);
|
||
|
||
$("#allend-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
if (contentData.accident251_point) {
|
||
$("#alloperation").val(
|
||
contentData.accident251_point.operation
|
||
);
|
||
$("#alltarget").val(contentData.accident251_point.target);
|
||
$("#allaction").val(contentData.accident251_point.actions);
|
||
$("#allcost").val(contentData.accident251_point.cost);
|
||
//$("#allcost").attr('min', contentData.accident251_point.cost);
|
||
$("#allend-date").val(contentData.accident251_point.end_date);
|
||
valueprogress = contentData.accident251_point.progress;
|
||
} else {
|
||
$("#alloperation").val("-");
|
||
$("#alltarget").val("-");
|
||
$("#allaction").val("-");
|
||
$("#allcost").val(contentData.cost);
|
||
$("#allcost").val(contentData.cost);
|
||
//$("#allcost").attr('min', contentData.cost);
|
||
$("#allend-date").val("-");
|
||
valueprogress = contentData.progress;
|
||
}
|
||
|
||
$("#allac-point-lat").val(contentData.lat);
|
||
$("#allac-point-lng").val(contentData.lng);
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="allex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#allsliderphysici").empty();
|
||
|
||
$("#allsliderphysici").append(
|
||
'<label class="allslider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#allsliderphysici").append(test);
|
||
|
||
$(".allex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
} else {
|
||
marker = L.circleMarker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
color: setIcon,
|
||
stroke: false,
|
||
radius: 3,
|
||
fillOpacity: 1,
|
||
}
|
||
).bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
}
|
||
|
||
markerG.push(marker);
|
||
} catch (e) {
|
||
console.log(e);
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
$(".chart-province-item").on("click", function () {
|
||
let provinceId = $(this).attr("provinceId");
|
||
|
||
showProvinceChartBox(this, provinceId);
|
||
});
|
||
|
||
function handleTopMenuClick(num) {
|
||
switch (num) {
|
||
case 1: {
|
||
window.open("rmto", "_self");
|
||
break;
|
||
}
|
||
case 2: {
|
||
$("#reportModal").modal("show");
|
||
break;
|
||
}
|
||
case 3: {
|
||
window.open("rmtobi", "_self");
|
||
break;
|
||
}
|
||
case 4: {
|
||
window.open("rmto", "_self");
|
||
break;
|
||
}
|
||
case 5: {
|
||
if ($(".relatedWebsites").css("left") < "0") {
|
||
if (windowWidth <= 768) {
|
||
$(".relatedWebsites").css("left", "5%");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "30px");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".relatedWebsites").css("z-index", "16");
|
||
}
|
||
} else {
|
||
if (windowWidth <= "768") {
|
||
$(".relatedWebsites").css("left", "-95%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "-530px");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
$(".exitewebsites").on("click", function () {
|
||
if ($(".relatedWebsites").css("left") < "0") {
|
||
if (windowWidth <= 768) {
|
||
$(".relatedWebsites").css("left", "5%");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "30px");
|
||
$(".left-menu-map").css("left", "-80px");
|
||
$(".left-menu-141").css("left", "-80px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-view-chart").css("left", "-530px");
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".relatedWebsites").css("z-index", "16");
|
||
}
|
||
} else {
|
||
if (windowWidth <= "768") {
|
||
$(".relatedWebsites").css("left", "-95%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
} else {
|
||
$(".relatedWebsites").css("left", "-80%");
|
||
$(".left-menu-map").css("left", "30px");
|
||
$(".left-menu-141").css("left", "30px");
|
||
}
|
||
}
|
||
});
|
||
// --------------------------------------------------------------
|
||
|
||
Chart.defaults.global.defaultFontFamily = "IRANSansFaNum";
|
||
|
||
var chartItemCanvas = $("#myChart");
|
||
var chartItem = null;
|
||
var chartProvinceItemsCanvas = [];
|
||
var chartProvinceItems = [];
|
||
var chartColors = [
|
||
"rgba(255, 99, 132, 1)",
|
||
"rgba(54, 162, 235, 1)",
|
||
"rgba(255, 206, 86, 1)",
|
||
"rgba(75, 192, 192, 1)",
|
||
"rgba(153, 102, 255, 1)",
|
||
"rgba(255, 159, 64, 1)",
|
||
"rgba(255, 64, 159, 1)",
|
||
"rgba(159, 255, 64, 1)",
|
||
"rgba(255, 64, 255, 1)",
|
||
"rgba(159, 159, 64, 1)",
|
||
];
|
||
var Chartmostgreen = [
|
||
"rgba(204, 255, 102)",
|
||
"rgba(204, 255, 0)",
|
||
"rgba(204, 255, 204)",
|
||
];
|
||
var chartleastred = [
|
||
"rgba(255, 153, 102)",
|
||
"rgba(204, 102, 102)",
|
||
"rgba(255, 0, 0)",
|
||
];
|
||
|
||
function randomScalingFactor() {
|
||
return Math.round(Math.random() * 100);
|
||
}
|
||
|
||
function changeChartBoxTitle(str, area = "کل کشور", changeTitle = 1) {
|
||
if (changeTitle) {
|
||
$(".chart-title").text(str + " (" + area + ")");
|
||
} else {
|
||
let boxTitle = $(".chart-title").text();
|
||
boxTitle = boxTitle.substr(0, boxTitle.indexOf("("));
|
||
$(".chart-title").text(boxTitle + "(" + area + ")");
|
||
}
|
||
}
|
||
|
||
function makeConfigChart(num, showDetails) {
|
||
let config = null;
|
||
|
||
switch (num) {
|
||
case 1: {
|
||
config = {
|
||
type: "pie",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [randomScalingFactor(), randomScalingFactor()],
|
||
backgroundColor: [chartColors[0], chartColors[1]],
|
||
label: "Dataset 1",
|
||
},
|
||
],
|
||
labels: ["احداث", "نگه داری"],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راه روستایی");
|
||
break;
|
||
}
|
||
case 2: {
|
||
config = {
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
],
|
||
label: "تفکیک پروژه های راه روستایی",
|
||
},
|
||
],
|
||
labels: ["شریانی", "غیرشریانی", "فرعی", "اصلی", "شریانی-اصلی"],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "right",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
scale: {
|
||
ticks: {
|
||
display: showDetails,
|
||
beginAtZero: true,
|
||
},
|
||
reverse: false,
|
||
},
|
||
animation: {
|
||
animateRotate: false,
|
||
animateScale: true,
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راه روستایی");
|
||
break;
|
||
}
|
||
case 3: {
|
||
config = {
|
||
type: "doughnut",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
chartColors[5],
|
||
chartColors[6],
|
||
chartColors[7],
|
||
],
|
||
label: "تفکیک پروژه های راهداری",
|
||
},
|
||
],
|
||
labels: [
|
||
"پاکسازی",
|
||
"علایم",
|
||
"رنگ آمیزی",
|
||
"حریم",
|
||
"ایمن سازی",
|
||
"راهدار خانه",
|
||
"اضطراری",
|
||
"شستشو",
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "left",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های راهداری",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های راهداری");
|
||
break;
|
||
}
|
||
case 4: {
|
||
config = {
|
||
type: "line",
|
||
data: {
|
||
labels: ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور"],
|
||
datasets: [
|
||
{
|
||
label: "پیشرفت فیزیکی",
|
||
backgroundColor: chartColors[0],
|
||
borderColor: chartColors[0],
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
fill: false,
|
||
},
|
||
{
|
||
label: "پیشرفت ریالی",
|
||
fill: false,
|
||
backgroundColor: chartColors[1],
|
||
borderColor: chartColors[1],
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "نسبت پیشرفت فیزیکی به ریالی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
mode: "index",
|
||
intersect: false,
|
||
},
|
||
hover: {
|
||
mode: "nearest",
|
||
intersect: true,
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: showDetails,
|
||
scaleLabel: {
|
||
display: showDetails,
|
||
labelString: "ماه",
|
||
},
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: showDetails,
|
||
scaleLabel: {
|
||
display: showDetails,
|
||
labelString: "مقدار",
|
||
},
|
||
},
|
||
],
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("نسبت پیشرفت فیزیکی به ریالی");
|
||
break;
|
||
}
|
||
case 5: {
|
||
config = {
|
||
type: "bar",
|
||
data: {
|
||
labels: ["مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"],
|
||
datasets: [
|
||
{
|
||
label: "راه روستایی",
|
||
backgroundColor: chartColors[0],
|
||
borderColor: chartColors[0],
|
||
borderWidth: 1,
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
{
|
||
label: "راهداری",
|
||
backgroundColor: chartColors[1],
|
||
borderColor: chartColors[1],
|
||
borderWidth: 1,
|
||
data: [
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
randomScalingFactor(),
|
||
],
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
responsive: true,
|
||
legend: {
|
||
display: showDetails,
|
||
position: "top",
|
||
},
|
||
title: {
|
||
display: showDetails,
|
||
text: "تفکیک پروژه های انجام شده تاکنون",
|
||
position: "bottom",
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: showDetails,
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: showDetails,
|
||
},
|
||
],
|
||
},
|
||
tooltips: {
|
||
enabled: showDetails,
|
||
},
|
||
},
|
||
};
|
||
changeChartBoxTitle("تفکیک پروژه های انجام شده تاکنون");
|
||
break;
|
||
}
|
||
case 6: {
|
||
break;
|
||
}
|
||
case 7: {
|
||
break;
|
||
}
|
||
case 8: {
|
||
break;
|
||
}
|
||
case 9: {
|
||
break;
|
||
}
|
||
case 10: {
|
||
break;
|
||
}
|
||
}
|
||
|
||
return config;
|
||
}
|
||
|
||
function updateChartBox(num) {
|
||
if (chartItem) {
|
||
chartItem.destroy();
|
||
}
|
||
|
||
if (num == 2) {
|
||
chartItem = new Chart.PolarArea(
|
||
chartItemCanvas,
|
||
makeConfigChart(num, true)
|
||
);
|
||
} else {
|
||
chartItem = new Chart(chartItemCanvas, makeConfigChart(num, true));
|
||
}
|
||
|
||
for (let i = 1; i <= 36; i++) {
|
||
if (chartProvinceItems[i]) {
|
||
chartProvinceItems[i].destroy();
|
||
}
|
||
|
||
if (num == 2) {
|
||
chartProvinceItems[i] = new Chart.PolarArea(
|
||
chartProvinceItemsCanvas[i],
|
||
makeConfigChart(num, false)
|
||
);
|
||
} else {
|
||
chartProvinceItems[i] = new Chart(
|
||
chartProvinceItemsCanvas[i],
|
||
makeConfigChart(num, false)
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showProvinceChartBox(element, id) {
|
||
let mainChartDataLength = chartItem.data.datasets[0].data.length;
|
||
let provinceChartData = chartProvinceItems[id].data;
|
||
let countDataset = 0;
|
||
|
||
for (let i = 0; i < mainChartDataLength; i++) {
|
||
chartRemoveData(chartItem);
|
||
}
|
||
|
||
provinceChartData.datasets.forEach((dataset) => {
|
||
for (let i = 0; i < dataset.data.length; i++) {
|
||
chartAddData(chartItem, countDataset, dataset.data[i]);
|
||
}
|
||
countDataset++;
|
||
});
|
||
|
||
changeChartBoxTitle(
|
||
"",
|
||
$(element).find(".chart-province-item-title").text(),
|
||
0
|
||
);
|
||
}
|
||
|
||
function chartAddData(chart, count, data, label) {
|
||
//chart.data.labels.push(label);
|
||
chart.data.datasets[count].data.push(data);
|
||
chart.update();
|
||
}
|
||
|
||
function chartRemoveData(chart) {
|
||
//chart.data.labels.pop();
|
||
chart.data.datasets.forEach((dataset) => {
|
||
dataset.data.pop();
|
||
});
|
||
chart.update();
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
for (let i = 1; i <= 36; i++) {
|
||
chartProvinceItemsCanvas[i] = $("#myChart" + i);
|
||
}
|
||
|
||
// initIranGeoJson();
|
||
// initCityGeoJson();
|
||
//pooria now
|
||
abrarProvinceNameArray.sort(function (itemA, itemB) {
|
||
return itemB.abrar_process - itemA.abrar_process;
|
||
});
|
||
|
||
bokhorProvinceNameArray.sort(function (itemA, itemB) {
|
||
return itemB.abrar_process - itemA.abrar_process;
|
||
});
|
||
//end pooria now
|
||
$("#show-maintenance-points").on("click", function () {
|
||
getMaintenanceProjects();
|
||
$(".guid-custom-box").css("display", "block");
|
||
});
|
||
|
||
//getMaintenanceProjects();
|
||
|
||
showFastReactionCounter();
|
||
|
||
$("#rishe1").on("click", function () {
|
||
if ($("#rishe1").is(":checked")) {
|
||
$("#rishe1").removeAttr("checked");
|
||
map.addLayer(marker141Layers);
|
||
} else {
|
||
$("#rishe1").attr("Checked", "Checked");
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
});
|
||
$("#rishe2").on("click", function () {
|
||
if ($("#rishe2").is(":checked")) {
|
||
$("#rishe2").removeAttr("checked");
|
||
map.addLayer(marker141LayersDangerPrevention);
|
||
} else {
|
||
$("#rishe2").attr("Checked", "Checked");
|
||
map.removeLayer(marker141LayersDangerPrevention);
|
||
}
|
||
});
|
||
$("#rishe3").on("click", function () {
|
||
if ($("#rishe3").is(":checked")) {
|
||
$("#rishe3").removeAttr("checked");
|
||
map.addLayer(marker141LayersUpgradeSafety);
|
||
} else {
|
||
$("#rishe3").attr("Checked", "Checked");
|
||
map.removeLayer(marker141LayersUpgradeSafety);
|
||
}
|
||
});
|
||
$("#rishe4").on("click", function () {
|
||
if ($("#rishe4").is(":checked")) {
|
||
$("#rishe4").removeAttr("checked");
|
||
map.addLayer(marker141LayersTechnicalBuilding);
|
||
} else {
|
||
$("#rishe4").attr("Checked", "Checked");
|
||
map.removeLayer(marker141LayersTechnicalBuilding);
|
||
}
|
||
});
|
||
$("#rishe5").on("click", function () {
|
||
if ($("#rishe5").is(":checked")) {
|
||
$("#rishe5").removeAttr("checked");
|
||
map.addLayer(marker141LayersTollhouseManagement);
|
||
} else {
|
||
$("#rishe5").attr("Checked", "Checked");
|
||
map.removeLayer(marker141LayersTollhouseManagement);
|
||
}
|
||
});
|
||
$("#rishe6").on("click", function () {
|
||
if ($("#rishe6").is(":checked")) {
|
||
$("#rishe6").removeAttr("checked");
|
||
map.addLayer(marker141LayersConstructionRural);
|
||
} else {
|
||
$("#rishe6").attr("Checked", "Checked");
|
||
map.removeLayer(marker141LayersConstructionRural);
|
||
}
|
||
});
|
||
$(".left-menu-view-chartt").css("left", "30px");
|
||
$(".right-menu-stat-chartt").css("top", "88px");
|
||
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/bama-homepage",
|
||
type: "GET",
|
||
cache: false,
|
||
success: function (result) {
|
||
console.log(result);
|
||
ShowBi(result);
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
},
|
||
});
|
||
});
|
||
$(".left-menu-view-chartt .chart-tools-item.chart-close-icon").on(
|
||
"click",
|
||
function () {
|
||
// yasiu uuuu
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
$(".right-menu-stat-chartt").css("top", "-858px");
|
||
}
|
||
);
|
||
$(".left-menu-view-chartcoridor .chart-tools-item.chart-close-icon").on(
|
||
"click",
|
||
function () {
|
||
// yasiu uuuu
|
||
$("left-menu-view-chartcoridor").css("left", "-1600px");
|
||
$(".right-menu-stat-chartt").css("top", "-858px");
|
||
$(".left-menu-view-chartcoridor").css("left", "-1600px");
|
||
}
|
||
);
|
||
$(".right-menu-stat-chartt > .menu-stat-close").on("click", function () {
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
$(".right-menu-stat-chartt").css("top", "-858px");
|
||
});
|
||
|
||
function ShowBi(res) {
|
||
$("#showTitle").append(
|
||
'<span class="count-this filteritem" style="font-size: 43px;">' +
|
||
res.count_all +
|
||
"</span>"
|
||
);
|
||
console.log(res.project_years[1395]);
|
||
$(".count-this").each(function () {
|
||
// Start the counting from a specified number - in this case, 0!
|
||
$(this)
|
||
.prop("Counter", 0)
|
||
.animate(
|
||
{
|
||
Counter: $(this).text(),
|
||
},
|
||
{
|
||
// Speed of counter in ms, default animation style
|
||
duration: 2000,
|
||
easing: "swing",
|
||
step: function (now) {
|
||
// Round up the number
|
||
$(this).text(Math.ceil(now));
|
||
},
|
||
}
|
||
);
|
||
});
|
||
var FirstChartLeft = document.getElementById("myChartfirst").getContext("2d");
|
||
|
||
var myChartFirstLeft = new Chart(FirstChartLeft, {
|
||
type: "pie",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
res.counts.tollhouse_management_count,
|
||
res.counts.technical_building_count,
|
||
res.counts.upgrade_safety_count,
|
||
res.counts.danger_prevention_count,
|
||
res.counts.maintenance_project_count,
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
],
|
||
},
|
||
],
|
||
labels: [
|
||
"راهدارخانه (بهسازی و نوسازی)",
|
||
"ابنیه فنی (نگهداری و ساخت )",
|
||
"ارتقای ایمنی راه ",
|
||
" رفع نقاط حادثه خیز / پرتصادف",
|
||
"روکش آسفالت (نگهداری راه )",
|
||
],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
anchor: "center",
|
||
align: "center",
|
||
offset: 10,
|
||
color: "#fffff",
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "left",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
var SecondChartLeft = document
|
||
.getElementById("myChartsecond")
|
||
.getContext("2d");
|
||
|
||
var myChartSecLeft = new Chart(SecondChartLeft, {
|
||
type: "pie",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
res.project_status[8],
|
||
res.project_status[7],
|
||
res.project_status[6],
|
||
res.project_status[5],
|
||
res.project_status[4],
|
||
res.project_status[3],
|
||
res.project_status[2],
|
||
res.project_status[1],
|
||
res.project_status[0],
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
chartColors[4],
|
||
chartColors[5],
|
||
chartColors[6],
|
||
chartColors[7],
|
||
chartColors[8],
|
||
],
|
||
label: "Dataset 1",
|
||
},
|
||
],
|
||
labels: [
|
||
"تکمیل و خاتمه یافته و بهره برداری شده ",
|
||
"در حال آماده سازی برای افتتاح",
|
||
"در حال اجرا متوقف",
|
||
"در حال اجرا /فعال",
|
||
"در حال تجهیز کارگاه",
|
||
"در دست مناقصه",
|
||
"در دست مطالعه و تهیه اسناد مناقصه",
|
||
"در دست برنامه ریزی اولیه",
|
||
"توسط استان بروزرسانی نشده ",
|
||
],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
anchor: "center",
|
||
align: "end",
|
||
offset: 10,
|
||
color: "#fffff",
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "left",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
|
||
var chartpie = document.getElementById("chartaxistype").getContext("2d");
|
||
var piechartshow = new Chart(chartpie, {
|
||
type: "pie",
|
||
data: {
|
||
datasets: [
|
||
{
|
||
data: [
|
||
res.axis_type_count[4],
|
||
res.axis_type_count[3],
|
||
res.axis_type_count[2],
|
||
res.axis_type_count[1],
|
||
],
|
||
backgroundColor: [
|
||
chartColors[0],
|
||
chartColors[1],
|
||
chartColors[2],
|
||
chartColors[3],
|
||
],
|
||
label: "Dataset 1",
|
||
},
|
||
],
|
||
labels: ["شریانی", "اصلی", "فرعی ", "روستایی"],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
anchor: "center",
|
||
align: "center",
|
||
offset: 10,
|
||
color: "#fffff",
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "left",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های راه روستایی",
|
||
position: "bottom",
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
var yearsarray = [];
|
||
var yearsnum = [];
|
||
$.each(res.project_years, function (key, value) {
|
||
if (value != 0) {
|
||
yearsarray.push(key);
|
||
yearsnum.push(value);
|
||
}
|
||
});
|
||
var yearshownchart = document
|
||
.getElementById("yearshownchart")
|
||
.getContext("2d");
|
||
var chartyear = new Chart(yearshownchart, {
|
||
type: "bar",
|
||
data: {
|
||
labels: yearsarray,
|
||
datasets: [
|
||
{
|
||
label: "تعداد",
|
||
backgroundColor: chartColors[1],
|
||
borderColor: chartColors[1],
|
||
borderWidth: 1,
|
||
data: yearsnum,
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
display: false,
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "top",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های انجام شده تاکنون",
|
||
position: "bottom",
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: true,
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: true,
|
||
},
|
||
],
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
var numbers_array = [];
|
||
$.each(res.province_count, function (key, value) {
|
||
if (value != 0) {
|
||
numbers_array.push(value);
|
||
}
|
||
});
|
||
var leastValue = [];
|
||
var mostValue = [];
|
||
var nameleast = [];
|
||
var namemost = [];
|
||
leastValue.push(res.final_province[Object.keys(res.final_province)[0]]);
|
||
leastValue.push(res.final_province[Object.keys(res.final_province)[1]]);
|
||
leastValue.push(res.final_province[Object.keys(res.final_province)[2]]);
|
||
nameleast.push(Object.keys(res.final_province)[0]);
|
||
nameleast.push(Object.keys(res.final_province)[1]);
|
||
nameleast.push(Object.keys(res.final_province)[2]);
|
||
|
||
mostValue.push(res.final_province[Object.keys(res.final_province)[34]]);
|
||
mostValue.push(res.final_province[Object.keys(res.final_province)[33]]);
|
||
mostValue.push(res.final_province[Object.keys(res.final_province)[32]]);
|
||
namemost.push(Object.keys(res.final_province)[34]);
|
||
namemost.push(Object.keys(res.final_province)[33]);
|
||
namemost.push(Object.keys(res.final_province)[32]);
|
||
var minchart =
|
||
parseInt(res.final_province[Object.keys(res.final_province)[32]]) - 10;
|
||
var mostchart =
|
||
parseInt(res.final_province[Object.keys(res.final_province)[32]]) + 20;
|
||
console.log(namemost);
|
||
var leastcity = document.getElementById("leastciyt").getContext("2d");
|
||
var chartleast = new Chart(leastcity, {
|
||
type: "bar",
|
||
data: {
|
||
labels: nameleast,
|
||
datasets: [
|
||
{
|
||
label: "تعداد",
|
||
data: leastValue,
|
||
backgroundColor: [
|
||
chartleastred[2],
|
||
chartleastred[1],
|
||
chartleastred[0],
|
||
],
|
||
borderWidth: 1,
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
display: false,
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "top",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های انجام شده تاکنون",
|
||
position: "bottom",
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: true,
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
display: true,
|
||
},
|
||
],
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
console.log("min", minchart);
|
||
var mostcity = document.getElementById("mostcity").getContext("2d");
|
||
var chartmost = new Chart(mostcity, {
|
||
type: "bar",
|
||
data: {
|
||
labels: namemost,
|
||
datasets: [
|
||
{
|
||
label: "تعداد",
|
||
data: mostValue,
|
||
backgroundColor: [
|
||
Chartmostgreen[1],
|
||
Chartmostgreen[0],
|
||
Chartmostgreen[2],
|
||
],
|
||
borderWidth: 1,
|
||
},
|
||
],
|
||
},
|
||
options: {
|
||
plugins: {
|
||
datalabels: {
|
||
display: false,
|
||
},
|
||
},
|
||
responsive: true,
|
||
legend: {
|
||
display: true,
|
||
position: "top",
|
||
},
|
||
title: {
|
||
display: false,
|
||
text: "تفکیک پروژه های انجام شده تاکنون",
|
||
position: "bottom",
|
||
},
|
||
scales: {
|
||
xAxes: [
|
||
{
|
||
display: true,
|
||
},
|
||
],
|
||
yAxes: [
|
||
{
|
||
ticks: {
|
||
beginAtZero: true,
|
||
},
|
||
display: true,
|
||
},
|
||
],
|
||
},
|
||
tooltips: {
|
||
enabled: true,
|
||
},
|
||
},
|
||
});
|
||
}
|
||
|
||
// -----------------------------------------
|
||
|
||
function showFastReactionCounter() {
|
||
$.ajax({
|
||
url: "/webapi/fast-reaction/count",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
if (result.data > 0) {
|
||
$("#fast-counter").text(result.data);
|
||
$("#fast-counter").show();
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
},
|
||
});
|
||
}
|
||
|
||
var iranGeoJSON = null;
|
||
var fullCityGeoJSON = null;
|
||
var fullCityGeoJSONTemp = new Object();
|
||
var iranMapGeo = null;
|
||
var iranCityMapGeo = null;
|
||
var setAbrarProcess = 0;
|
||
var setBokhorProcess = 0;
|
||
var iranNameArray = [];
|
||
var abrarProvinceNameArray = [
|
||
{
|
||
row: 1,
|
||
feature: 0,
|
||
name: "آذربايجان شرقی",
|
||
process: 25,
|
||
},
|
||
{
|
||
row: 2,
|
||
feature: 1,
|
||
name: "آذربايجان غربی",
|
||
process: 28,
|
||
},
|
||
{
|
||
row: 3,
|
||
feature: 2,
|
||
name: "اردبيل",
|
||
process: 29.9,
|
||
},
|
||
{
|
||
row: 4,
|
||
feature: 3,
|
||
name: "اصفهان",
|
||
process: 14.1,
|
||
},
|
||
{
|
||
row: 5,
|
||
feature: 4,
|
||
name: "البرز",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 6,
|
||
feature: 5,
|
||
name: "ايرانشهر",
|
||
process: 7.4,
|
||
},
|
||
{
|
||
row: 7,
|
||
feature: 6,
|
||
name: "ايلام",
|
||
process: 42.1,
|
||
},
|
||
{
|
||
row: 8,
|
||
feature: 7,
|
||
name: "بوشهر",
|
||
process: 12.4,
|
||
},
|
||
{
|
||
row: 9,
|
||
feature: 8,
|
||
name: "تهران",
|
||
process: 18.1,
|
||
},
|
||
{
|
||
row: 10,
|
||
feature: 9,
|
||
name: "چهار محال و بختياری",
|
||
process: 57.8,
|
||
},
|
||
{
|
||
row: 11,
|
||
feature: 10,
|
||
name: "خراسان جنوبی",
|
||
process: 20.8,
|
||
},
|
||
{
|
||
row: 12,
|
||
feature: 11,
|
||
name: "خراسان رضوی",
|
||
process: 9.4,
|
||
},
|
||
{
|
||
row: 13,
|
||
feature: 12,
|
||
name: "خراسان شمالی",
|
||
process: 19.5,
|
||
},
|
||
{
|
||
row: 14,
|
||
feature: 13,
|
||
name: "خوزستان",
|
||
process: 33.6,
|
||
},
|
||
{
|
||
row: 15,
|
||
feature: 14,
|
||
name: "زنجان",
|
||
process: 41,
|
||
},
|
||
{
|
||
row: 16,
|
||
feature: 34,
|
||
name: "سمنان شرق",
|
||
process: 32.7,
|
||
},
|
||
{
|
||
row: 17,
|
||
feature: 33,
|
||
name: "سمنان غرب",
|
||
process: 18.3,
|
||
},
|
||
{
|
||
row: 18,
|
||
feature: 18,
|
||
name: "سيستان و بلوچستان",
|
||
process: 25.5,
|
||
},
|
||
{
|
||
row: 19,
|
||
feature: 16,
|
||
name: "فارس",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 20,
|
||
feature: 17,
|
||
name: "قزوين",
|
||
process: 45.5,
|
||
},
|
||
{
|
||
row: 21,
|
||
feature: 18,
|
||
name: "قم",
|
||
process: 4.7,
|
||
},
|
||
{
|
||
row: 22,
|
||
feature: 19,
|
||
name: "كرمان جنوب",
|
||
process: 45,
|
||
},
|
||
{
|
||
row: 23,
|
||
feature: 20,
|
||
name: "كردستان",
|
||
process: 43.3,
|
||
},
|
||
{
|
||
row: 24,
|
||
feature: 21,
|
||
name: "كرمان",
|
||
process: 59.5,
|
||
},
|
||
{
|
||
row: 25,
|
||
feature: 22,
|
||
name: "كرمانشاه",
|
||
process: 41.1,
|
||
},
|
||
{
|
||
row: 26,
|
||
feature: 23,
|
||
name: "كهگيلويه و بويراحمد",
|
||
process: 61.4,
|
||
},
|
||
{
|
||
row: 27,
|
||
feature: 24,
|
||
name: "گلستان",
|
||
process: 16.5,
|
||
},
|
||
{
|
||
row: 28,
|
||
feature: 25,
|
||
name: "گيلان",
|
||
process: 18.4,
|
||
},
|
||
{
|
||
row: 29,
|
||
feature: 26,
|
||
name: "لارستان",
|
||
process: 70.2,
|
||
},
|
||
{
|
||
row: 30,
|
||
feature: 27,
|
||
name: "لرستان",
|
||
process: 40,
|
||
},
|
||
{
|
||
row: 31,
|
||
feature: 28,
|
||
name: "مازندران",
|
||
process: 13.4,
|
||
},
|
||
{
|
||
row: 32,
|
||
feature: 29,
|
||
name: "مركزی",
|
||
process: 45.8,
|
||
},
|
||
{
|
||
row: 33,
|
||
feature: 30,
|
||
name: "هرمزگان",
|
||
process: 23.9,
|
||
},
|
||
{
|
||
row: 34,
|
||
feature: 31,
|
||
name: "همدان",
|
||
process: 36.1,
|
||
},
|
||
{
|
||
row: 35,
|
||
feature: 32,
|
||
name: "يزد",
|
||
process: 33,
|
||
},
|
||
];
|
||
|
||
var iranArrayCount = 0;
|
||
var keepMapFeatureColor = null;
|
||
|
||
function getRandomFeatureColor() {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
let randomNum = Math.floor(Math.random() * 101);
|
||
console.log(randomNum);
|
||
return randomNum >= 83
|
||
? { num: randomNum, color: "#a366ff" }
|
||
: randomNum >= 67
|
||
? { num: randomNum, color: "#2e86ab" }
|
||
: randomNum >= 50
|
||
? { num: randomNum, color: "#66cc66" }
|
||
: randomNum >= 31
|
||
? { num: randomNum, color: "#ffeda0" }
|
||
: { num: randomNum, color: "#ff3f3f" };
|
||
}
|
||
}
|
||
|
||
function getForArrayFeatureColor(arrayNum) {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
return arrayNum >= 83
|
||
? { num: arrayNum, color: "#a366ff" }
|
||
: arrayNum >= 67
|
||
? { num: arrayNum, color: "#80b3ff" }
|
||
: arrayNum >= 50
|
||
? { num: arrayNum, color: "#66cc66" }
|
||
: arrayNum >= 31
|
||
? { num: arrayNum, color: "#ffeda0" }
|
||
: { num: arrayNum, color: "#ff704d" };
|
||
}
|
||
}
|
||
|
||
function initStyleMapFeatures(feature) {
|
||
let getRandom = null;
|
||
|
||
if (setAbrarProcess) {
|
||
getRandom = getForArrayFeatureColor(
|
||
findFeatureInAbrarItems(iranArrayCount).abrar_process
|
||
);
|
||
} else if (setBokhorProcess) {
|
||
getRandom = getForArrayFeatureColor(
|
||
findFeatureInBokhorItems(iranArrayCount).abrar_process
|
||
);
|
||
} else {
|
||
getRandom = getRandomFeatureColor();
|
||
}
|
||
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.7,
|
||
};
|
||
|
||
if (getRandom.num != -1) {
|
||
if (iranArrayCount == 35) {
|
||
iranArrayCount = 0;
|
||
}
|
||
|
||
iranNameArray[iranArrayCount] = {
|
||
name: feature.properties.province_name,
|
||
feature: feature.properties.feature_id,
|
||
random: getRandom.num,
|
||
};
|
||
|
||
iranNameArray.sort(function (itemA, itemB) {
|
||
return itemB.random - itemA.random;
|
||
});
|
||
|
||
iranArrayCount++;
|
||
}
|
||
|
||
return makeStyle;
|
||
}
|
||
|
||
function initStyleCityMapFeatures(feature) {
|
||
let getRandom = getRandomFeatureColor();
|
||
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.5,
|
||
};
|
||
|
||
return makeStyle;
|
||
}
|
||
function showscity(index) {
|
||
$(".stat-list-li").remove();
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
for (let i = 0; i < bokhorProvinceNameArray.length; i++) {
|
||
let databokhor = bokhorProvinceNameArray[i].id;
|
||
let idcity = index;
|
||
if (databokhor - 1 == idcity) {
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces/" + databokhor,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (data) {
|
||
datacity = data.data;
|
||
console.log(datacity);
|
||
for (let i = 0; i < datacity.length; i++) {
|
||
let statItemList = $(
|
||
'<li city_id="' +
|
||
datacity[i].id +
|
||
'" class="stat-list-li" indexid="' +
|
||
i +
|
||
'"></li>'
|
||
);
|
||
statItem = $(
|
||
'<div id="infoCity' +
|
||
datacity[i].id +
|
||
'" class="stat-list-item" ></div>'
|
||
);
|
||
statItem.append(
|
||
'<span class="item-title">' + datacity[i].name_fa + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
datacity[i].abrar_process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (datacity[i].abrar_process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (datacity[i].abrar_process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (datacity[i].abrar_process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (datacity[i].abrar_process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", datacity[i].abrar_process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
},
|
||
});
|
||
}
|
||
}
|
||
}
|
||
function highlightMapFeature(e) {
|
||
let featureLayer = null;
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
keepMapFeatureColor = featureLayer.options.fillColor;
|
||
|
||
featureLayer.setStyle({
|
||
weight: 4,
|
||
color: "#666",
|
||
fillOpacity: 0.85,
|
||
});
|
||
|
||
if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
|
||
featureLayer.bringToFront();
|
||
}
|
||
if (e.target) {
|
||
var latpo =
|
||
bokhorProvinceNameArray[e.target.feature.properties.province_id - 1]
|
||
.center_lat;
|
||
var longpo =
|
||
bokhorProvinceNameArray[e.target.feature.properties.province_id - 1]
|
||
.center_long;
|
||
if (flagPopup == 0) {
|
||
for (i = 0; i < bokhorProvinceNameArray.length; i++) {
|
||
if (
|
||
bokhorProvinceNameArray[i].id ==
|
||
e.target.feature.properties.province_id
|
||
) {
|
||
var numberpo = bokhorProvinceNameArray[i].abrar_process;
|
||
PopupHoverMap = L.popup();
|
||
PopupHoverMap.setLatLng([latpo, longpo])
|
||
.setContent(
|
||
`<div class='d-flex flex-column'>
|
||
<div class="popUpBox" style="font-family:IRANSans"><span style="color:#0051CD">مقدار</span><div class="popUpBoxContent">
|
||
${numberpo.toString()}%
|
||
</div>
|
||
</div>
|
||
<a href=${bokhorProvinceNameArray[i].abrar_link
|
||
} class="popUpBox click-popup_" style="font-family:IRANSans"><div class="popUpBoxContent">
|
||
<i class="fas fa-hand-pointer"></i>
|
||
</div>
|
||
</a>
|
||
</div>`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//toooodo
|
||
let all_li_right_side = $(".menu-stat-list .stat-list li.stat-list-li");
|
||
for (var i = 0; i < all_li_right_side.length; i++) {
|
||
if (e.target) {
|
||
let provincehover = e.target.feature.properties.province_id;
|
||
let lihover = $(all_li_right_side[i]).attr("indexid");
|
||
let lihoverInt = parseInt(lihover);
|
||
if (provincehover - 1 == lihoverInt) {
|
||
if ($(all_li_right_side[i]).attr("indexid") == lihover) {
|
||
$("#info" + lihoverInt).css("width", "100%");
|
||
$("#info" + lihoverInt)
|
||
.parent()
|
||
.css("padding-right", "0px");
|
||
$("#info" + lihoverInt).addClass("vibe_li");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//End toooodo
|
||
//toodo
|
||
if (e.target) {
|
||
let all_li_city = $(".menu-stat-list .stat-list li.stat-list-li");
|
||
let city_li_hover = e.target.feature.properties.city_id;
|
||
for (let i = 0; i < all_li_city.length; i++) {
|
||
if (e.target) {
|
||
let lihover_city = $(all_li_right_side[i]).attr("city_id");
|
||
if (city_li_hover == lihover_city) {
|
||
$("#infoCity" + lihover_city).css("width", "100%");
|
||
$("#infoCity" + lihover_city)
|
||
.parent()
|
||
.css("padding-right", "0px");
|
||
$("#infoCity" + lihover_city).addClass("vibe_li");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//End toodoo
|
||
//todoo
|
||
//pooria now
|
||
if (flag_li_city == 1) {
|
||
if (e.target) {
|
||
for (i = 0; i < bokhorProvinceNameArray.length; i++) {
|
||
if (
|
||
bokhorProvinceNameArray[i].id ==
|
||
e.target.feature.properties.province_id
|
||
) {
|
||
let PopupHoverMap = L.popup();
|
||
console.log(number_data_city_persent);
|
||
|
||
if (number_data_city_persent) {
|
||
for (let i = 0; i < number_data_city_persent.length; i++) {
|
||
if (
|
||
number_data_city_persent[i].id ==
|
||
e.target.feature.properties.city_id
|
||
) {
|
||
console.log("hi hi");
|
||
PopupHoverMap.setLatLng(e.latlng)
|
||
.setContent(
|
||
`<div class='d-flex flex-column'>
|
||
<div class="popUpBox" style="font-family:IRANSans"><span style="color:#0051CD">مقدار</span><div class="popUpBoxContent">
|
||
${number_data_city_persent[i].abrar_process.toString()}%
|
||
</div>
|
||
</div>
|
||
</div>`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
} else if (datacity) {
|
||
for (let i = 0; i < datacity.length; i++) {
|
||
if (datacity[i].id == e.target.feature.properties.city_id) {
|
||
console.log("hi hi");
|
||
PopupHoverMap.setLatLng(e.latlng)
|
||
.setContent(
|
||
`<div class='d-flex flex-column'>
|
||
<div class="popUpBox" style="font-family:IRANSans"><span style="color:#0051CD">مقدار</span><div class="popUpBoxContent">
|
||
${datacity[i].abrar_process.toString()}%
|
||
</div>
|
||
</div>
|
||
</div>`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//end pooria now
|
||
//End todoo
|
||
}
|
||
|
||
function resetMapFeatureHighlight(e) {
|
||
let featureLayer = null;
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
iranMapGeo.resetStyle(featureLayer);
|
||
keepMapFeatureColor = null;
|
||
//toooodo
|
||
let all_li_right_side = $(".menu-stat-list .stat-list li.stat-list-li");
|
||
for (var i = 0; i < all_li_right_side.length; i++) {
|
||
if (e.target) {
|
||
let provincehover = e.target.feature.properties.province_id;
|
||
let lihover = $(all_li_right_side[i]).attr("indexid");
|
||
let lihoverInt = parseInt(lihover);
|
||
if (provincehover - 1 == lihoverInt) {
|
||
if ($(all_li_right_side[i]).attr("indexid") == lihover) {
|
||
$("#info" + lihoverInt).css(
|
||
"width",
|
||
bokhorProvinceNameArray[lihover].abrar_process + "%"
|
||
);
|
||
$("#info" + lihoverInt).parent().css("padding-right", "105px");
|
||
$("#info" + lihoverInt).removeClass("vibe_li");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//End toooodo
|
||
//toodo
|
||
var idkol_city;
|
||
var all_li_city;
|
||
var loop_get_li;
|
||
if (e.target) {
|
||
all_li_city = $(".menu-stat-list .stat-list li.stat-list-li");
|
||
idkol_city = e.target.feature.properties.province_id;
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces/" + idkol_city,
|
||
type: "GET",
|
||
success: function (data) {
|
||
var data_city_li_next = data.data;
|
||
for (let i = 0; i < data_city_li_next.length; i++) {
|
||
for (let i = 0; i < all_li_city.length; i++) {
|
||
loop_get_li = $(all_li_city[i]).attr("city_id");
|
||
if (e.target.feature.properties.city_id == loop_get_li) {
|
||
if (data_city_li_next[i]) {
|
||
$("#infoCity" + loop_get_li).css(
|
||
"width",
|
||
data_city_li_next[i].abrar_process + "%"
|
||
);
|
||
$("#infoCity" + loop_get_li).parent().css("padding-right", "105px");
|
||
$("#infoCity" + loop_get_li).removeClass("vibe_li");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
});
|
||
}
|
||
|
||
//End toodoo
|
||
}
|
||
|
||
function zoomMapToFeature(e) {
|
||
let featureLayer = null;
|
||
let featuresLayerCity = [];
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
|
||
map.flyToBounds(featureLayer.getBounds());
|
||
|
||
showLoaderScreen();
|
||
removeFeaturesFromMap();
|
||
removeCityFeaturesFromMap();
|
||
fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
|
||
$.each(fullCityGeoJSON.features, function (key, value) {
|
||
if (
|
||
value &&
|
||
featureLayer.feature.properties.province_id ===
|
||
value.properties.province_id
|
||
) {
|
||
featuresLayerCity.push(value);
|
||
} else {
|
||
//
|
||
}
|
||
});
|
||
|
||
setTimeout(function () {
|
||
fullCityGeoJSONTemp.features = featuresLayerCity;
|
||
addCityFeaturesToMap();
|
||
}, 1000);
|
||
|
||
setTimeout(function () {
|
||
hideLoaderScreen();
|
||
}, 1500);
|
||
var all_li_right_side = $(".menu-stat-list .stat-list li.stat-list-li");
|
||
for (var i = 0; i < all_li_right_side.length; i++) {
|
||
var provinceclick = e.target.feature.properties.province_id;
|
||
var liclick = $(all_li_right_side[i]).attr("indexid");
|
||
if (provinceclick - 1 == liclick) {
|
||
var ppp = $(all_li_right_side[provinceclick - 1]);
|
||
ppp.click();
|
||
}
|
||
}
|
||
//pooria now
|
||
if (e.target) {
|
||
console.log();
|
||
$.ajax({
|
||
url:
|
||
"https://rms.rmto.ir/public/contents/provinces/" +
|
||
e.target.feature.properties.province_id,
|
||
type: "GET",
|
||
success: function (data) {
|
||
number_data_city_persent = data.data;
|
||
},
|
||
});
|
||
}
|
||
// end pooria now
|
||
$(".stat-list-li").remove();
|
||
flagPopup = 1;
|
||
flag_li_city = 1;
|
||
}
|
||
|
||
function onEachFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
click: zoomMapToFeature,
|
||
});
|
||
}
|
||
|
||
function onEachCityFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
//click: zoomMapToFeature
|
||
});
|
||
}
|
||
|
||
function addTopFeatureToStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text("رتبهبندی ادارات کل");
|
||
|
||
if (!setAbrarProcess && !setBokhorProcess && iranNameArray.length > 0) {
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $(
|
||
'<li class="stat-list-li" indexid="' + i + '"></li>'
|
||
);
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
// statItem.append('<span class="item-rate">' + (i + 1) + '</span>');
|
||
statItem.append(
|
||
'<span class="item-title">' + iranNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' + iranNameArray[i].random + "٪" + "</span>"
|
||
);
|
||
if (iranNameArray[i].random >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (iranNameArray[i].random >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (iranNameArray[i].random >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (iranNameArray[i].random >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", iranNameArray[i].random + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
showscity(parseInt($(this).attr("indexid")));
|
||
zoomBokhorProvinceInfo(parseInt($(this).attr("indexid")));
|
||
flagPopupli = 1;
|
||
});
|
||
} else {
|
||
setTimeout(function () {
|
||
for (let i = 0; i < 35; i++) {
|
||
statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
// statItem.append('<span class="item-rate">' + (i + 1) + '</span>');
|
||
statItem.append(
|
||
'<span class="item-title">' + iranNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' + iranNameArray[i].random + "٪" + "</span>"
|
||
);
|
||
if (iranNameArray[i].random >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (iranNameArray[i].random >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (iranNameArray[i].random >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (iranNameArray[i].random >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", iranNameArray[i].random + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showItemProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomItemProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
}, 500);
|
||
}
|
||
}
|
||
|
||
function addFeaturesToMap() {
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
remove141Layer();
|
||
keepMapFeatureColor = null;
|
||
|
||
if (!setAbrarProcess && !setBokhorProcess && iranGeoJSON) {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
} else {
|
||
setTimeout(function () {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
}, 500);
|
||
}
|
||
|
||
map.flyTo([32.62, 53.25], 6);
|
||
}
|
||
|
||
function removeFeaturesFromMap() {
|
||
if (iranMapGeo) {
|
||
map.removeLayer(iranMapGeo);
|
||
//iranMapGeo = null;
|
||
}
|
||
}
|
||
|
||
function addCityFeaturesToMap() {
|
||
remove141Layer();
|
||
removeCityFeaturesFromMap();
|
||
removeFeaturesFromMap();
|
||
keepMapFeatureColor = null;
|
||
|
||
if (fullCityGeoJSONTemp) {
|
||
iranCityMapGeo = L.geoJson(fullCityGeoJSONTemp, {
|
||
style: initStyleCityMapFeatures,
|
||
onEachFeature: onEachCityFeature,
|
||
});
|
||
iranCityMapGeo.addTo(map);
|
||
}
|
||
}
|
||
|
||
function removeCityFeaturesFromMap() {
|
||
if (iranCityMapGeo) {
|
||
map.removeLayer(iranCityMapGeo);
|
||
//iranCityMapGeo = null;
|
||
}
|
||
}
|
||
|
||
//here bood
|
||
|
||
// ------------- Ali ------------------------
|
||
|
||
var provinces = [
|
||
{
|
||
id: 1,
|
||
name: "آذربایجان شرقی",
|
||
lat: 37.9211202,
|
||
lng: 46.6821517,
|
||
},
|
||
{
|
||
id: 2,
|
||
name: "آذربایجان غربی",
|
||
lat: 37.7416484,
|
||
lng: 45.0207638,
|
||
},
|
||
{
|
||
id: 3,
|
||
name: "اردبیل",
|
||
lat: 38.4583983,
|
||
lng: 47.9313001,
|
||
},
|
||
{
|
||
id: 4,
|
||
name: "اصفهان",
|
||
lat: 33.196733,
|
||
lng: 50.7884216,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 33.096733,
|
||
lng: 50.7884216,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 33.396733,
|
||
lng: 50.7884216,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 2,
|
||
lat: 33.196733,
|
||
lng: 50.4884216,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 33.196733,
|
||
lng: 50.8884216,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 33.196733,
|
||
lng: 51.1884216,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 33.496733,
|
||
lng: 50.9884216,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 2,
|
||
lat: 33.696733,
|
||
lng: 50.1884216,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 3,
|
||
lat: 33.296733,
|
||
lng: 51.4884216,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 32,
|
||
name: "البرز",
|
||
lat: 35.996,
|
||
lng: 50.9289,
|
||
},
|
||
{
|
||
id: 5,
|
||
name: "ایلام",
|
||
lat: 33.1545696,
|
||
lng: 46.7576343,
|
||
},
|
||
{
|
||
id: 6,
|
||
name: "بوشهر",
|
||
lat: 28.8936645,
|
||
lng: 51.3204877,
|
||
},
|
||
{
|
||
id: 7,
|
||
name: "تهران",
|
||
lat: 35.5021945,
|
||
lng: 51.3269098,
|
||
},
|
||
{
|
||
id: 8,
|
||
name: "چهارمحال و بختیاری",
|
||
lat: 32.0163307,
|
||
lng: 50.685709,
|
||
},
|
||
{
|
||
id: 29,
|
||
name: "خراسان جنوبی",
|
||
lat: 33.0006776,
|
||
lng: 58.3262335,
|
||
},
|
||
{
|
||
id: 30,
|
||
name: "خراسان رضوی",
|
||
lat: 35.756361,
|
||
lng: 59.1280992,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 35.756361,
|
||
lng: 59.1280992,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 36.756361,
|
||
lng: 59.3280992,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 35.456361,
|
||
lng: 60.1280992,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 35.956361,
|
||
lng: 60.5280992,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 34.156361,
|
||
lng: 60.5280992,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 34.756361,
|
||
lng: 59.6280992,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 1,
|
||
lat: 34.156361,
|
||
lng: 58.6280992,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 2,
|
||
lat: 35.156361,
|
||
lng: 58.4280992,
|
||
},
|
||
{
|
||
id: 9,
|
||
type: 2,
|
||
lat: 36.056361,
|
||
lng: 58.1280992,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 31,
|
||
name: "خراسان شمالی",
|
||
lat: 37.5378855,
|
||
lng: 56.9526137,
|
||
},
|
||
{
|
||
id: 10,
|
||
name: "خوزستان",
|
||
lat: 31.5535141,
|
||
lng: 49.0077168,
|
||
},
|
||
{
|
||
id: 11,
|
||
name: "زنجان",
|
||
lat: 36.515854,
|
||
lng: 48.4777616,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 36.515854,
|
||
lng: 48.4777616,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 35.415854,
|
||
lng: 47.5777616,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 2,
|
||
lat: 37.315854,
|
||
lng: 48.3777616,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 4,
|
||
lat: 36.915854,
|
||
lng: 48.5777616,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 2,
|
||
lat: 37.115854,
|
||
lng: 49.4777616,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 12,
|
||
name: "سمنان",
|
||
lat: 35.4380386,
|
||
lng: 54.8626294,
|
||
},
|
||
{
|
||
id: 13,
|
||
name: "سیستان و بلوچستان",
|
||
lat: 28.1292481,
|
||
lng: 60.8236848,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 29.1292481,
|
||
lng: 60.8236848,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 28.1292481,
|
||
lng: 61.8236848,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 27.1292481,
|
||
lng: 61.8236848,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 28.1292481,
|
||
lng: 59.8236848,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 3,
|
||
lat: 30.1292481,
|
||
lng: 60.4236848,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 4,
|
||
lat: 31.1292481,
|
||
lng: 61.4236848,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 4,
|
||
lat: 27.7292481,
|
||
lng: 60.8236848,
|
||
},
|
||
{
|
||
id: 8,
|
||
type: 2,
|
||
lat: 27.1292481,
|
||
lng: 59.2236848,
|
||
},
|
||
],
|
||
},
|
||
{
|
||
id: 14,
|
||
name: "فارس",
|
||
lat: 29.299051,
|
||
lng: 53.218456,
|
||
},
|
||
{
|
||
id: 28,
|
||
name: "قزوین",
|
||
lat: 36.0156291,
|
||
lng: 49.8398161,
|
||
},
|
||
{
|
||
id: 26,
|
||
name: "قم",
|
||
lat: 34.7191915,
|
||
lng: 51.0122844,
|
||
},
|
||
{
|
||
id: 16,
|
||
name: "کردستان",
|
||
lat: 35.672803,
|
||
lng: 47.0124376,
|
||
},
|
||
{
|
||
id: 15,
|
||
name: "کرمان",
|
||
lat: 29.571858,
|
||
lng: 57.301047,
|
||
},
|
||
{
|
||
id: 17,
|
||
name: "کرمانشاه",
|
||
lat: 34.3789744,
|
||
lng: 46.7010122,
|
||
},
|
||
{
|
||
id: 18,
|
||
name: "کهگیلویه و بویراحمد",
|
||
lat: 30.8143476,
|
||
lng: 50.8661454,
|
||
},
|
||
{
|
||
id: 27,
|
||
name: "گلستان",
|
||
lat: 37.1984436,
|
||
lng: 55.070672,
|
||
},
|
||
{
|
||
id: 19,
|
||
name: "گیلان",
|
||
lat: 37.5115476,
|
||
lng: 49.3554429,
|
||
},
|
||
{
|
||
id: 20,
|
||
name: "لرستان",
|
||
lat: 33.5372643,
|
||
lng: 48.2435197,
|
||
},
|
||
{
|
||
id: 21,
|
||
name: "مازندران",
|
||
lat: 36.3159159,
|
||
lng: 51.8968597,
|
||
},
|
||
{
|
||
id: 22,
|
||
name: "مرکزی",
|
||
lat: 34.5302705,
|
||
lng: 49.7864561,
|
||
},
|
||
{
|
||
id: 23,
|
||
name: "هرمزگان",
|
||
lat: 27.7198095,
|
||
lng: 56.335807,
|
||
},
|
||
{
|
||
id: 24,
|
||
name: "همدان",
|
||
lat: 34.973321,
|
||
lng: 48.6555779,
|
||
},
|
||
{
|
||
id: 25,
|
||
name: "یزد",
|
||
lat: 32.2452686,
|
||
lng: 55.105172,
|
||
projectCoordinates: [
|
||
{
|
||
id: 1,
|
||
type: 1,
|
||
lat: 32.1452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 2,
|
||
type: 1,
|
||
lat: 31.8452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 3,
|
||
type: 1,
|
||
lat: 31.8452686,
|
||
lng: 55.405172,
|
||
},
|
||
{
|
||
id: 4,
|
||
type: 2,
|
||
lat: 31.6452686,
|
||
lng: 55.605172,
|
||
},
|
||
{
|
||
id: 5,
|
||
type: 2,
|
||
lat: 32.3452686,
|
||
lng: 55.205172,
|
||
},
|
||
{
|
||
id: 6,
|
||
type: 3,
|
||
lat: 32.9452686,
|
||
lng: 55.105172,
|
||
},
|
||
{
|
||
id: 7,
|
||
type: 3,
|
||
lat: 33.2452686,
|
||
lng: 55.905172,
|
||
},
|
||
],
|
||
},
|
||
];
|
||
|
||
$("svg #iran polygon").on("click", function () {
|
||
if ($(".left-menu-map").css("width") == "500px") {
|
||
let selectedProvince = provinces.find(
|
||
(entry) => entry.id == parseInt(this.id.substring(3))
|
||
);
|
||
|
||
// areaChart = new Chart(areaChartCanvas, {
|
||
// type: 'line',
|
||
// data: areaChartData2,
|
||
// options: areaChartOptions
|
||
// });
|
||
|
||
// let numberOfProjects = $('.numberOfProjects');
|
||
// let numberOfActiveProjects = $('#numberOfActiveProjects');
|
||
// let numberOfOpenedProjects = $('#numberOfOpenedProjects');
|
||
// let numberOfFinishedProjects = $('#numberOfFinishedProjects');
|
||
// let numberOfStoppedProjects = $('#numberOfStoppedProjects');
|
||
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 700 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 400 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfActiveProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 250 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfOpenedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 100) + 100 }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfFinishedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
// jQuery({ Counter: 0 }).animate({ Counter: Math.floor(Math.random() * 50) }, {
|
||
// duration: 1000,
|
||
// easing: 'swing',
|
||
// step: function () {
|
||
// numberOfStoppedProjects.text(Math.ceil(this.Counter));
|
||
// }
|
||
// });
|
||
|
||
map.removeLayer(markerLayers);
|
||
|
||
map.flyTo([selectedProvince.lat, selectedProvince.lng], 9);
|
||
|
||
for (
|
||
let index = 0;
|
||
index < selectedProvince.projectCoordinates.length;
|
||
index++
|
||
) {
|
||
switch (selectedProvince.projectCoordinates[index].type) {
|
||
case 1: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: blueIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 2: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: greenIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 3: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: yellowIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
case 4: {
|
||
L.marker(
|
||
[
|
||
selectedProvince.projectCoordinates[index].lat,
|
||
selectedProvince.projectCoordinates[index].lng,
|
||
],
|
||
{ icon: redIcon }
|
||
)
|
||
.bindPopup(getCustomPopupContent(selectedProvince.name, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
function showpassmodal() {
|
||
$("#changepass").modal("show");
|
||
}
|
||
|
||
// Project icons
|
||
var rahdariIconY = L.icon({
|
||
iconUrl: "../../dist/images/icons/tollHouse_pin.png",
|
||
iconSize: [26, 26],
|
||
});
|
||
var rahdariIconO = L.icon({
|
||
iconUrl: "../../dist/images/icons/tollHouseO_pin.png",
|
||
iconSize: [22, 22],
|
||
});
|
||
var blueIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var greenIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var yellowIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-yellow'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var redIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-red'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
///// icons of negahdari
|
||
var dangerPreventionIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html:
|
||
"<span class='beacon beacon-danger-prevention' style=\"color: rgb(255, 13, 255)\"></span>",
|
||
iconSize: [30, 72],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var technicalBuildingIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html:
|
||
"<span class='beacon beacon-technical-building' style=\"color: rgb(0, 153, 255)\"></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var upgradeSafetyIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html:
|
||
"<span class='beacon beacon-upgrade-safety' style=\"color: rgb(89, 0, 255)\"></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var constructionRuralIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html:
|
||
"<span class='beacon beacon-construction-rural' style=\"color: rgb(0, 66, 88)\"></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
var tollhouseManagementIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html:
|
||
"<span class='beacon beacon-tollhouse-management' style=\"color: rgb(12, 78, 23)\"></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
///// end of icons of negahdari
|
||
|
||
var redIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-red-fix'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
|
||
var greenIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green-fix'></span>",
|
||
iconSize: [30, 42],
|
||
// iconAnchor: [15, 42]
|
||
});
|
||
function getPopupContent(type) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
operationType +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
getProjectStatus(type) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
selectedProvince +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
|
||
function getPopupContentAccident(data, edit_id) {
|
||
let popupTitle251 = "";
|
||
|
||
if (data.accident251_point) {
|
||
popupTitle251 = " (اولویت ۲۵۱ نقطه)";
|
||
}
|
||
|
||
if (edit_id == data.province_id) {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
} else {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
}
|
||
function getProjectStatus(type) {
|
||
switch (type) {
|
||
case 1:
|
||
return "فعال";
|
||
case 2:
|
||
return "افتتاح شده";
|
||
case 3:
|
||
return "خاتمه یافته";
|
||
case 4:
|
||
return "متوقف شده";
|
||
}
|
||
}
|
||
|
||
function getProjectProgress() {
|
||
let percentage = Math.floor(Math.random() * 100) + 1; // returns a random integer from 0 to 99 + 1
|
||
return percentage;
|
||
}
|
||
|
||
function getParameterByName(name) {
|
||
let url = window.location.href;
|
||
name = name.replace(/[\[\]]/g, "\\$&");
|
||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||
results = regex.exec(url);
|
||
if (!results) return null;
|
||
if (!results[2]) return "";
|
||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||
}
|
||
|
||
if (getParameterByName("operationType")) {
|
||
var operationType = getParameterByName("operationType");
|
||
var projectStatus = getParameterByName("projectStatus");
|
||
var selectedProvince = getParameterByName("selectedProvince");
|
||
var selectedTown = getParameterByName("selectedTown");
|
||
var sourceLat = getParameterByName("sourceLat");
|
||
var sourceLng = getParameterByName("sourceLng");
|
||
|
||
L.marker([sourceLat, sourceLng], { icon: greenIcon })
|
||
.bindPopup(getPopupContent(returnOperationType(projectStatus)), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.addTo(map);
|
||
}
|
||
|
||
function returnOperationType(status) {
|
||
switch (status) {
|
||
case "فعال": {
|
||
return 1;
|
||
}
|
||
case "متوقف": {
|
||
return 4;
|
||
}
|
||
case "خاتمهیافته": {
|
||
return 3;
|
||
}
|
||
}
|
||
}
|
||
|
||
function getCustomPopupContent(data, type) {
|
||
if (type == 1) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
generateRandom(1) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
generateRandom(2) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
returnProvinceString(data.ProvinceID) +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="dist/images/road.svg" alt="">\
|
||
<span class="popupHeader">پهنه بندی جاده های روستایی</span>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span>نوع عملیات</span><div class="popUpBoxContent">' +
|
||
generateRandom(1) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>وضعیت فعلی پروژه</span><div class="popUpBoxContent">' +
|
||
generateRandom(2) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span>اداره کل</span><div class="popUpBoxContent">' +
|
||
data +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span>درصد پیشرفت فیزیکی</span><div class="popUpBoxContent">' +
|
||
getProjectProgress() +
|
||
"%</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function generateRandom(index) {
|
||
switch (index) {
|
||
case 1: {
|
||
// Operation Type
|
||
let randomNumber = Math.floor(Math.random() * 2) + 1; // 1 or 2
|
||
if (randomNumber == 1) return "احداث";
|
||
else return "نگهداری";
|
||
}
|
||
case 2: {
|
||
// Project Status
|
||
let randomNumber = Math.floor(Math.random() * 3) + 1; // 1, 2, or 3
|
||
switch (randomNumber) {
|
||
case 1:
|
||
return "فعال";
|
||
case 2:
|
||
return "متوقف";
|
||
case 3:
|
||
return "خاتمه یافته";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function returnProvinceString(provinceId) {
|
||
switch (provinceId) {
|
||
case "1":
|
||
return "مازندران";
|
||
case "2":
|
||
return "تهران";
|
||
case "3":
|
||
return "فارس";
|
||
case "4":
|
||
return "خراسان رضوی";
|
||
case "5":
|
||
return "آذربایجان غربی";
|
||
case "6":
|
||
return "آذربایجان شرقی";
|
||
case "7":
|
||
return "اردبیل";
|
||
case "8":
|
||
return "گیلان";
|
||
case "9":
|
||
return "زنجان";
|
||
case "10":
|
||
return "کردستان";
|
||
case "11":
|
||
return "کرمانشاه";
|
||
case "12":
|
||
return "همدان";
|
||
case "13":
|
||
return "قزوین";
|
||
case "14":
|
||
return "البرز";
|
||
case "15":
|
||
return "گلستان";
|
||
case "16":
|
||
return "خراسان شمالی";
|
||
case "17":
|
||
return "سمنان";
|
||
case "18":
|
||
return "قم";
|
||
case "19":
|
||
return "مرکزی";
|
||
case "20":
|
||
return "لرستان";
|
||
case "21":
|
||
return "ایلام";
|
||
case "22":
|
||
return "اصفهان";
|
||
case "23":
|
||
return "یزد";
|
||
case "24":
|
||
return "خراسان جنوبی";
|
||
case "25":
|
||
return "چهارمحال و بختیاری";
|
||
case "26":
|
||
return "خوزستان";
|
||
case "27":
|
||
return "کهگیلویه و بویر احمد";
|
||
case "28":
|
||
return "بوشهر";
|
||
case "29":
|
||
return "کرمان";
|
||
case "30":
|
||
return "سیستان و بلوچستان";
|
||
case "31":
|
||
return "هرمزگان";
|
||
}
|
||
}
|
||
function showlayer(index) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
//showLoaderScreen();
|
||
|
||
switch (index) {
|
||
case 0: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
break;
|
||
}
|
||
case 1: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 2: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 3: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 4: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 5: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 6: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 7: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 8: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 9: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 10: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 11: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 12: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 13: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 14: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 15: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 16: {
|
||
$("#choosetime").modal("show");
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 17: {
|
||
$("#choosetime").modal("show");
|
||
showFastReactionPoint = true;
|
||
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
// function showLayer(index) {
|
||
// if (markerLayers != null) {
|
||
// map.removeLayer(markerLayers);
|
||
// }
|
||
|
||
// switch (index) {
|
||
// case 0: {
|
||
// $("#choosetime").modal('show')
|
||
// break;
|
||
// }
|
||
// case 1: {
|
||
// $.post("https://141.ir/api/roadoperation", function (data) {
|
||
// markerLayers = L.markerClusterGroup({ disableClusteringAtZoom: 5 });
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// break;
|
||
// }
|
||
// case 2: {
|
||
// $.post("https://141.ir/api/roadaccident", function (data) {
|
||
// markerLayers = L.markerClusterGroup({ disableClusteringAtZoom: 5 });
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// break;
|
||
// }
|
||
// case 3: {
|
||
// $.post("https://141.ir/api/weather", function (data) {
|
||
// markerLayers = L.markerClusterGroup();
|
||
|
||
// for (let index = 0; index < data.length; index++) {
|
||
// let marker = L.marker([data[index].lat, data[index].lng], {
|
||
// icon: blueIcon,
|
||
// }).bindPopup(getCustomPopupContent(data[index], 1), {
|
||
// className: "customPopupStyle",
|
||
// });
|
||
// markerList.push(marker);
|
||
// }
|
||
// markerLayers.addLayers(markerList);
|
||
// map.addLayer(markerLayers);
|
||
// });
|
||
// }
|
||
// }
|
||
// }
|
||
|
||
// ------------- Ali End ------------------------
|
||
|
||
function showLoaderScreen() {
|
||
$(".starter-loader-container").css("display", "flex").hide().fadeIn();
|
||
}
|
||
|
||
function hideLoaderScreen() {
|
||
$(".starter-loader-container").fadeOut();
|
||
}
|
||
|
||
function show141Layer(index) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
showLoaderScreen();
|
||
|
||
switch (index) {
|
||
case 0: {
|
||
$.post(API_ENDPOINT + "/camera", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("دوربین: " + data[i].Title);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 1: {
|
||
$.post(API_ENDPOINT + "/otfapi", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("ترددشمار: " + data[i].m_n);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 2: {
|
||
$.post(API_ENDPOINT + "/roadoperation", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("کارگاه: " + data[i].OperationName);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 3: {
|
||
$.post(API_ENDPOINT + "/roadblock", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("انسداد: " + data[i].Title);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 4: {
|
||
$.post(API_ENDPOINT + "/emdad", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.ikco.length; i++) {
|
||
let marker = L.marker([data.ikco[i].lat, data.ikco[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("امداد فنی: " + data.ikco[i].onvan);
|
||
marker141List.push(marker);
|
||
}
|
||
for (let i = 0; i < data.saipa.length; i++) {
|
||
let marker = L.marker([data.saipa[i].lat, data.saipa[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("امداد فنی");
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 5: {
|
||
$.post(API_ENDPOINT + "/weather", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("آب و هوا: " + data[i].Station_Name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 6: {
|
||
$.post(API_ENDPOINT + "/gasstation", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("جایگاه سوخت: " + data[i].station_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 7: {
|
||
$.post(API_ENDPOINT + "/complex", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("خدمات رفاهی: " + data[i].complex_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 8: {
|
||
$.post(API_ENDPOINT + "/mosque", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("نمازخانه: " + data[i].mosque_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 9: {
|
||
$.post(API_ENDPOINT + "/roadaccident", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("تصادفات: " + data[i].CollisionTypeTitle);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 10: {
|
||
$.get("/rahdari-points", function (result) {
|
||
data = result.data;
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (result.edit_id == data[i].province_id) {
|
||
setIcon = rahdariIconO;
|
||
} else {
|
||
setIcon = rahdariIconY;
|
||
}
|
||
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0"
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
console.log("eeeeeee", e)
|
||
$("[data-mask]").inputmask();
|
||
console.log("test", this.options.content)
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (result.edit_id == data[i].province_id) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 11: {
|
||
$.post(API_ENDPOINT + "/hospital", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("خدمات درمانی: " + data[i].hos_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
case 12: {
|
||
$.post(API_ENDPOINT + "/repair", function (data) {
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: blueIcon,
|
||
}).bindPopup("تعمیرگاه: " + data[i].repair_name);
|
||
marker141List.push(marker);
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
$("#tollhousepoint").on('click', function () {
|
||
$.get("https://rms.rmto.ir/public/rahdari-points", function (result) {
|
||
data = result.data;
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (result.edit_id == data[i].province_id) {
|
||
setIcon = rahdariIconO;
|
||
} else {
|
||
setIcon = rahdariIconY;
|
||
}
|
||
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0"
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
console.log("eeeeeee", e)
|
||
$("[data-mask]").inputmask();
|
||
console.log("test", this.options.content)
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (result.edit_id == data[i].province_id) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
});
|
||
})
|
||
function remove141Layer() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
|
||
$(".left-menu-141 > .item-menu-141.item-141-active").removeClass(
|
||
"item-141-active"
|
||
);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
}
|
||
|
||
function showAbrarChartStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text(
|
||
"پیشرفت فیزیکی پروژههای طرح ابرار"
|
||
);
|
||
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div class="stat-list-item"></div>');
|
||
statItem.append(
|
||
'<span class="item-title">' + abrarProvinceNameArray[i].name + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
abrarProvinceNameArray[i].process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (abrarProvinceNameArray[i].process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (abrarProvinceNameArray[i].process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (abrarProvinceNameArray[i].process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (abrarProvinceNameArray[i].process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", abrarProvinceNameArray[i].process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showAbrarProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showAbrarProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
zoomAbrarProvinceInfo(parseInt($(this).attr("indexid")));
|
||
});
|
||
|
||
handleAbrarButtonClick(1);
|
||
addFeaturesToMap();
|
||
}
|
||
|
||
function hideAbrarChartStat() {
|
||
handleAbrarButtonClick(0);
|
||
}
|
||
|
||
function handleAbrarButtonClick(openStat = 1) {
|
||
if (openStat) {
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-stat-chart-info").css("top", "88px");
|
||
} else {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
removeFeaturesFromMap();
|
||
}
|
||
}
|
||
|
||
function findFeatureInAbrarItems(featureRow) {
|
||
for (let i = 0; i < 35; i++) {
|
||
if (abrarProvinceNameArray[i].feature == featureRow) {
|
||
return abrarProvinceNameArray[i];
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
// -----------------------------------------------------------------------
|
||
|
||
function showBokhorChartStat() {
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
|
||
$(".right-menu-stat-chart > .menu-stat-title").text(
|
||
"برخورداری راههای روستایی آسفالته کشور"
|
||
);
|
||
|
||
for (let i = 0; i < 35; i++) {
|
||
let statItemList = $('<li class="stat-list-li" indexid="' + i + '"></li>');
|
||
statItem = $('<div id="info' + i + '" class="stat-list-item"></div>');
|
||
statItem.append(
|
||
'<span class="item-title">' +
|
||
bokhorProvinceNameArray[i].name_fa +
|
||
"</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
bokhorProvinceNameArray[i].abrar_process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (bokhorProvinceNameArray[i].abrar_process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (bokhorProvinceNameArray[i].abrar_process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (bokhorProvinceNameArray[i].abrar_process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (bokhorProvinceNameArray[i].abrar_process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", bokhorProvinceNameArray[i].abrar_process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
|
||
$(".stat-list-li").on({
|
||
mouseenter: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 1);
|
||
},
|
||
mouseleave: function () {
|
||
showBokhorProvinceInfo(parseInt($(this).attr("indexid")), 0);
|
||
},
|
||
});
|
||
|
||
$(".stat-list-li").on("click", function () {
|
||
showscity(parseInt($(this).attr("indexid")));
|
||
zoomBokhorProvinceInfo(parseInt($(this).attr("indexid")));
|
||
flagPopupli = 1;
|
||
});
|
||
|
||
handleBokhorButtonClick(1);
|
||
addFeaturesToMap();
|
||
}
|
||
|
||
function hideBokhorChartStat() {
|
||
handleBokhorButtonClick(0);
|
||
}
|
||
function showscity(index) {
|
||
$(".stat-list-li").remove();
|
||
let statItem = null;
|
||
let statMenu = $(".menu-stat-list > .stat-list");
|
||
for (let i = 0; i < bokhorProvinceNameArray.length; i++) {
|
||
let databokhor = bokhorProvinceNameArray[i].id;
|
||
let idcity = index;
|
||
if (databokhor - 1 == idcity) {
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces/" + databokhor,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (data) {
|
||
datacity = data.data;
|
||
// console.log(datacity);
|
||
for (let i = 0; i < datacity.length; i++) {
|
||
let statItemList = $(
|
||
'<li city_id="' +
|
||
datacity[i].id +
|
||
'" class="stat-list-li" indexid="' +
|
||
i +
|
||
'"></li>'
|
||
);
|
||
statItem = $(
|
||
'<div id="infoCity' +
|
||
datacity[i].id +
|
||
'" class="stat-list-item" ></div>'
|
||
);
|
||
statItem.append(
|
||
'<span class="item-title">' + datacity[i].name_fa + "</span>"
|
||
);
|
||
statItem.append(
|
||
'<span class="item-stat">' +
|
||
datacity[i].abrar_process +
|
||
"٪" +
|
||
"</span>"
|
||
);
|
||
if (datacity[i].abrar_process >= 83) {
|
||
statItem.addClass("stat-item-top-1");
|
||
} else if (datacity[i].abrar_process >= 67) {
|
||
statItem.addClass("stat-item-top-2");
|
||
} else if (datacity[i].abrar_process >= 50) {
|
||
statItem.addClass("stat-item-top-3");
|
||
} else if (datacity[i].abrar_process >= 31) {
|
||
statItem.addClass("stat-item-top-4");
|
||
} else {
|
||
statItem.addClass("stat-item-top-5");
|
||
}
|
||
statItem.css("width", datacity[i].abrar_process + "%");
|
||
statMenu.append(statItemList.append(statItem));
|
||
}
|
||
},
|
||
});
|
||
}
|
||
}
|
||
}
|
||
function handleBokhorButtonClick(openStat = 1) {
|
||
if (openStat) {
|
||
$(".right-menu-stat-chart").css("top", "88px");
|
||
$(".left-menu-stat-chart-info").css("top", "88px");
|
||
} else {
|
||
$(".right-menu-stat-chart").css("top", "-858px");
|
||
$(".left-menu-stat-chart-info").css("top", "-308px");
|
||
emptyStatItems();
|
||
removeFeaturesFromMap();
|
||
}
|
||
}
|
||
|
||
function findFeatureInBokhorItems(featureRow) {
|
||
for (let i = 0; i < 35; i++) {
|
||
if (bokhorProvinceNameArray[i].abrar_feature == featureRow) {
|
||
return bokhorProvinceNameArray[i];
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
function showItemProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (iranNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[iranNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
if (featureItem) {
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showAbrarProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (abrarProvinceNameArray[index].abrar_feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[
|
||
abrarProvinceNameArray[index].abrar_feature
|
||
]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
$(".menu-stat-info-title").text(abrarProvinceNameArray[index].name_fa);
|
||
$(".menu-stat-info-content").empty();
|
||
$(".menu-stat-info-content").text(
|
||
abrarProvinceNameArray[index].abrar_process
|
||
);
|
||
if (featureItem) {
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
$(".menu-stat-info-title").text("اطلاعات بیشتر");
|
||
$(".menu-stat-info-content")
|
||
.empty()
|
||
.append(
|
||
"<span>برای نمایش اطلاعات هر بخش بر روی نقشه یا نمودار آماری آن حرکت کنید.</span>"
|
||
);
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showBokhorProvinceInfo(index, show) {
|
||
let featureItem = null;
|
||
if (bokhorProvinceNameArray[index].abrar_feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[
|
||
bokhorProvinceNameArray[index].abrar_feature
|
||
]
|
||
];
|
||
}
|
||
|
||
if (show) {
|
||
$(".menu-stat-info-title").text(bokhorProvinceNameArray[index].name_fa);
|
||
$(".menu-stat-info-content").empty();
|
||
$(".menu-stat-info-content").text(
|
||
bokhorProvinceNameArray[index].abrar_process
|
||
);
|
||
if (featureItem) {
|
||
shownumber(index);
|
||
highlightMapFeature(featureItem);
|
||
}
|
||
} else {
|
||
$(".menu-stat-info-title").text("اطلاعات بیشتر");
|
||
$(".menu-stat-info-content")
|
||
.empty()
|
||
.append(
|
||
"<span>برای نمایش اطلاعات هر بخش بر روی نقشه یا نمودار آماری آن حرکت کنید.</span>"
|
||
);
|
||
if (featureItem) {
|
||
resetMapFeatureHighlight(featureItem);
|
||
}
|
||
}
|
||
}
|
||
//todo pooria
|
||
// function close_popup_root() {
|
||
// if ($(".leaflet-popup-close-button")) {
|
||
// $(".leaflet-popup-close-button").click();
|
||
// console.log("raft");
|
||
// }
|
||
// // $(".leaflet-popup-close-button").click();
|
||
// }
|
||
//End todo pooria
|
||
function shownumber(id) {
|
||
for (let i = 0; i < bokhorProvinceNameArray.length; i++) {
|
||
if (id == bokhorProvinceNameArray[i].id - 1) {
|
||
if (flagPopupli == 0) {
|
||
var popup = L.popup();
|
||
popup
|
||
.setLatLng([
|
||
bokhorProvinceNameArray[i].center_lat,
|
||
bokhorProvinceNameArray[i].center_long,
|
||
])
|
||
.setContent(
|
||
`<div class='d-flex flex-column'>
|
||
<div class="popUpBox" style="font-family:IRANSans"><span style="color:#0051CD">مقدار</span><div class="popUpBoxContent">
|
||
${bokhorProvinceNameArray[i].abrar_process.toString()}%
|
||
</div>
|
||
</div>
|
||
<a href=${bokhorProvinceNameArray[i].abrar_link
|
||
} class="popUpBox click-popup_" style="font-family:IRANSans"><div class="popUpBoxContent">
|
||
<i class="fas fa-hand-pointer"></i>
|
||
</div>
|
||
</a>
|
||
</div>`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function zoomItemProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (iranNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[iranNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function zoomAbrarProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (abrarProvinceNameArray[index].feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[abrarProvinceNameArray[index].feature]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function zoomBokhorProvinceInfo(index) {
|
||
let featureItem = null;
|
||
if (bokhorProvinceNameArray[index].abrar_feature !== -1 && iranMapGeo) {
|
||
featureItem =
|
||
iranMapGeo._layers[
|
||
Object.keys(iranMapGeo._layers)[
|
||
bokhorProvinceNameArray[index].abrar_feature
|
||
]
|
||
];
|
||
}
|
||
|
||
zoomMapToFeature(featureItem);
|
||
}
|
||
|
||
function showrahdarModal(start, end) {
|
||
// alert("hiiii")
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
globalcolor = color.toHexString()
|
||
console.log("gloo", globalcolor)
|
||
console.log("hexx", color.toHexString())
|
||
}
|
||
});
|
||
$("#rahdaredit").modal("show");
|
||
if (mapradar == null) {
|
||
setTimeout(() => {
|
||
// alert("hiiii")
|
||
createLeafletMap([35.6892, 51.389], [35.6892, 51.389], 0);
|
||
}, 200);
|
||
}
|
||
else {
|
||
initialMarkerMapValue(35.6892, 51.389, 0);
|
||
}
|
||
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
function showcoridorfinall(id) {
|
||
$("#ekipname").val('');
|
||
$("#ekipphone").val('');
|
||
$("#typeofdastgah").val('');
|
||
$("#machiner_name").val('');
|
||
$("#telephone_num").val('');
|
||
|
||
console.log("tets", markershowdata.machine_data)
|
||
$("#basic-log").css('display', 'none');
|
||
console.log(id)
|
||
var lat = null;
|
||
var lng = null;
|
||
for (var i = 0; i < markershowdata.length; i++) {
|
||
// console.log("i")
|
||
if (markershowdata[i].id == id) {
|
||
idkolcor = markershowdata[i].id;
|
||
|
||
console.log("markershowntest", markershowdata[i].id)
|
||
$("[data-mask]").inputmask();
|
||
$("#edarekolcoridor").val(markershowdata[i].name);
|
||
$("#mainCitycor").val(markershowdata[i].city_name);
|
||
$("#ROfficeAgent").val(markershowdata[i].responsible_name);
|
||
$("#houserahdarcoridor").val(markershowdata[i].name);
|
||
$("#ROfficeAgentTell").val(markershowdata[i].responsible_mobile); //action
|
||
if (markershowdata[i].machine_data != null && markershowdata[i].machine_data != "[]") {
|
||
|
||
console.log("kkkkkkkkkkkkkkkkkkkkkkkkkkkkk", markershowdata[i].machine_data)
|
||
var markermachin = jQuery.parseJSON(markershowdata[i].machine_data)
|
||
console.log("jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj", markermachin)
|
||
for (var z = 0; z < markermachin.length; z++) {
|
||
projectarraymachine.push(markermachin[z])
|
||
}
|
||
console.log("tteeeeeeeeeeeeeeeeeeeeeeeeee", projectarraymachine)
|
||
generatemachinary(markershowdata[i].machine_data, 1)
|
||
}
|
||
if (markershowdata[i].team_data != null && markershowdata[i].team_data != "[]") {
|
||
ekiplistvalid = jQuery.parseJSON(markershowdata[i].team_data)
|
||
for (var j = 0; j < ekiplistvalid.length; j++) {
|
||
ekiplist.push(ekiplistvalid[j])
|
||
}
|
||
generatetablecoridor(markershowdata[i].team_data, 1)
|
||
}
|
||
lat = markershowdata[i].lat;
|
||
lng = markershowdata[i].lng;
|
||
startmarkerpin = [markershowdata[i].start_lat, markershowdata[i].start_lng];
|
||
endmarkerpin = [markershowdata[i].end_lat, markershowdata[i].end_lng];
|
||
}
|
||
}
|
||
// alert("hiiii")
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").css('display', 'block');
|
||
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
globalcolor = color.toHexString()
|
||
console.log("gloo", globalcolor)
|
||
console.log("hexx", color.toHexString())
|
||
}
|
||
});
|
||
$("#coridoredit").modal("show");
|
||
console.log("hh", startmarkerpin, endmarkerpin)
|
||
if (mapradar == null) {
|
||
|
||
setTimeout(() => {
|
||
// alert("hiiii")
|
||
console.log("far fara far", lat, lng)
|
||
if (endmarkerpin[0] != null) {
|
||
|
||
createLeafletMap([lat, lng], startmarkerpin, endmarkerpin, 1);
|
||
}
|
||
else {
|
||
|
||
createLeafletMap([lat, lng], startmarkerpin, endmarkerpin, 0);
|
||
|
||
}
|
||
}, 200);
|
||
}
|
||
else {
|
||
if (endmarkerpin[0] != null) {
|
||
|
||
initialMarkerMapValue(lat, lng, startmarkerpin, endmarkerpin, 1);
|
||
}
|
||
else {
|
||
initialMarkerMapValue(lat, lng, startmarkerpin, endmarkerpin, 0);
|
||
|
||
}
|
||
}
|
||
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
function showrahdarModalcoridor(id) {
|
||
$("#basic-log").css('display', 'none');
|
||
|
||
// alert("ihii")
|
||
console.log("test", globalmodaldata)
|
||
console.log(id)
|
||
var lat = null;
|
||
var lng = null;
|
||
for (var i = 0; i < globalmodaldata.length; i++) {
|
||
console.log("i")
|
||
if (globalmodaldata[i].id == id) {
|
||
$("[data-mask]").inputmask();
|
||
$("#edarekolcoridor").val(globalmodaldata[i].name);
|
||
$("#rahdarid").val(globalmodaldata[i].id);
|
||
$("#edarekolcoridor").val(globalmodaldata[i].province_name);
|
||
$("#mainCity").val(globalmodaldata[i].city_name);
|
||
$("#sit").val(globalmodaldata[i].status); //action
|
||
$("#type").val(globalmodaldata[i].type);
|
||
$("#phone").val(globalmodaldata[i].phone);
|
||
$("#ekipnum").val(globalmodaldata[i].team_num);
|
||
$("#personelnum").val(globalmodaldata[i].staff_num);
|
||
$("#masol").val(globalmodaldata[i].responsible_name);
|
||
$("#masolmobile").val(globalmodaldata[i].responsible_mobile);
|
||
$("#janeshin").val(globalmodaldata[i].successor_name);
|
||
$("#janeshinmobile").val(globalmodaldata[i].successor_mobile);
|
||
$("#lightmachine").val(globalmodaldata[i].machines_light);
|
||
$("#meduimachin").val(globalmodaldata[i].machines_sheavy);
|
||
$("#bigmachin").val(globalmodaldata[i].machines_heavy);
|
||
$("#lat-rahdar").val(globalmodaldata[i].lat);
|
||
$("#lng-rahdar").val(globalmodaldata[i].lng);
|
||
lat = globalmodaldata[i].lat;
|
||
lng = globalmodaldata[i].lng;
|
||
startmarkerpin = [globalmodaldata[i].lat_from, globalmodaldata[i].lng_from];
|
||
endmarkerpin = [globalmodaldata[i].lat_to, globalmodaldata[i].lng_to];
|
||
}
|
||
}
|
||
// alert("hiiii")
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").css('display', 'block');
|
||
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
globalcolor = color.toHexString()
|
||
console.log("gloo", globalcolor)
|
||
console.log("hexx", color.toHexString())
|
||
}
|
||
});
|
||
$("#rahdaredit").modal("show");
|
||
if (mapradar == null) {
|
||
setTimeout(() => {
|
||
// alert("hiiii")
|
||
console.log("far fara far", lat, lng)
|
||
if (endmarkerpin[0] != null) {
|
||
|
||
createLeafletMap([lat, lng], startmarkerpin, endmarkerpin, 1);
|
||
}
|
||
else {
|
||
createLeafletMap([lat, lng], startmarkerpin, endmarkerpin, 0);
|
||
|
||
}
|
||
}, 200);
|
||
}
|
||
else {
|
||
if (endmarkerpin[0] != null) {
|
||
|
||
initialMarkerMapValue(lat, lng, startmarkerpin, endmarkerpin, 1);
|
||
}
|
||
else {
|
||
initialMarkerMapValue(lat, lng, startmarkerpin, endmarkerpin, 0);
|
||
|
||
}
|
||
}
|
||
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
$("#editrahdar").on("click", function () {
|
||
saveRahdariEdited();
|
||
});
|
||
$("#editcoridor").on("click", function () {
|
||
saveRahdariEditedCoridor();
|
||
});
|
||
function showRahdariPoints() {
|
||
remove141Layer();
|
||
//showLoaderScreen();
|
||
|
||
$.get("/rahdari-points", function (result) {
|
||
data = result.data;
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (result.edit_id == data[i].province_id) {
|
||
setIcon = rahdariIconO;
|
||
} else {
|
||
setIcon = rahdariIconY;
|
||
}
|
||
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0"
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
console.log("eeeeeee", e)
|
||
$("[data-mask]").inputmask();
|
||
console.log("test", this.options.content)
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (result.edit_id == data[i].province_id) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function showAccidentPointEditModal() {
|
||
$("#allpointedit").modal("show");
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
|
||
function showAccident251PointEditModal() {
|
||
$("#pointedit").modal("show");
|
||
//alert('این بخش به صورت آزمایشی فعال است و تغییرات ذخیره نمیشود.')
|
||
}
|
||
|
||
$("#alleditpoints").on("click", function () {
|
||
saveAccidentEditedPoint();
|
||
});
|
||
|
||
$("#editpoints").on("click", function () {
|
||
saveEditedPoint();
|
||
});
|
||
|
||
function saveAccidentEditedPointOld() {
|
||
$("#allpointedit").modal("hide");
|
||
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/accident-points/" + $("#allpointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
//data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function saveAccidentEditedPoint() {
|
||
if (accidentEditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("operation", $("#alloperation").val());
|
||
formData.append("target", $("#alltarget").val());
|
||
formData.append("actions", $("#allaction").val());
|
||
formData.append("progress", $(".allex2").slider("getValue"));
|
||
formData.append("cost", $("#allcost").val());
|
||
formData.append("end_date", $("#allend-date").val());
|
||
|
||
let lat = $("#allac-point-lat").val().slice(1, -1);
|
||
let lng = $("#allac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=allmodalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=allmodalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
//if ($('.allex2').slider('getValue') >= $('.allex2').attr('data-slider-value')) {
|
||
$("#allpointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-points/" + $("#allpointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showRoadAccidentLayerWithoutCluster();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
/*} else {
|
||
$('#allsliderphysici').find('.allslider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
||
$('#allsliderphysici').find('.allslider-label').css('color', 'red');
|
||
}*/
|
||
}
|
||
}
|
||
|
||
function accidentEditedPointValidate() {
|
||
let isValidate = true;
|
||
|
||
if (
|
||
!$("#alloperation").val() ||
|
||
!checkPersianWordValidation($("#alloperation").val())
|
||
) {
|
||
$("#alloperation").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alloperation").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#alltarget").val() ||
|
||
!checkPersianWordValidation($("#alltarget").val())
|
||
) {
|
||
$("#alltarget").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alltarget").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#allaction").val() ||
|
||
!checkPersianWordValidation($("#allaction").val())
|
||
) {
|
||
$("#allaction").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allaction").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allcost").val()) {
|
||
$("#allcost").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allcost").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allend-date").val()) {
|
||
$("#allend-date").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allend-date").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lat").val()) {
|
||
$("#allac-point-lat").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lat").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lng").val()) {
|
||
$("#allac-point-lng").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lng").removeClass("is-invalid");
|
||
}
|
||
|
||
return isValidate;
|
||
}
|
||
|
||
function showAccident251Points() {
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
|
||
$.get("/accident-251-points", function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (roadAccidentPoints[i].progress == "100") {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
|
||
let marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
|
||
$("#pointid").val(datatext.id);
|
||
$("#opration").val(datatext.operation); //oparation
|
||
$("#target").val(datatext.target); //target
|
||
$("#action").val(datatext.actions); //action
|
||
$("#ac-point-lat").val(datatext.lat);
|
||
$("#ac-point-lng").val(datatext.lng);
|
||
valueprogress = datatext.progress;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
//$("#cost").attr('min', datatext.cost);//cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
markerG.push(marker);
|
||
} catch (e) { }
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function rahdariEditedValidate() {
|
||
let checkValidation = true;
|
||
|
||
if (!$("#sit").val() || !checkPersianWordValidation($("#sit").val())) {
|
||
$("#sit").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#sit").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#type").val() || !checkPersianWordValidation($("#type").val())) {
|
||
$("#type").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#type").removeClass("is-invalid");
|
||
}
|
||
|
||
if ($("#phone").val()) {
|
||
let reg = /^([0-9]|[۰-۹])+$/;
|
||
|
||
if (!reg.test($("#phone").val())) {
|
||
$("#phone").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#phone").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#masol").val()) {
|
||
if (!checkPersianWordValidation($("#masol").val())) {
|
||
$("#masol").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#masol").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#janeshin").val()) {
|
||
if (!checkPersianWordValidation($("#janeshin").val())) {
|
||
$("#janeshin").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#janeshin").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#masolmobile").val()) {
|
||
let reg = /^9([0-9]){9}$/;
|
||
|
||
if (!reg.test($("#masolmobile").val())) {
|
||
$("#masolmobile").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#masolmobile").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
if ($("#janeshinmobile").val()) {
|
||
let reg = /^9([0-9]){9}$/;
|
||
|
||
if (!reg.test($("#janeshinmobile").val())) {
|
||
$("#janeshinmobile").addClass("is-invalid");
|
||
checkValidation = false;
|
||
} else {
|
||
$("#janeshinmobile").removeClass("is-invalid");
|
||
}
|
||
}
|
||
|
||
return checkValidation;
|
||
}
|
||
|
||
function saveRahdariEdited() {
|
||
console.log("glo", globalcolor)
|
||
// if (rahdariEditedValidate()) {
|
||
// console.log("input[name=abrar-project-latlng-start]", "input[name=abrar-project-latlng-start]".val())
|
||
// console.log("input[name=abrar-project-latlng-end]", "input[name=abrar-project-latlng-end]".val())
|
||
console.log(endAbrarMarker.getLatLng().lat.toFixed(6))
|
||
|
||
console.log(endAbrarMarker.getLatLng().lng.toFixed(6))
|
||
console.log(startAbrarMarker.getLatLng().lat.toFixed(6))
|
||
|
||
console.log(startAbrarMarker.getLatLng().lng.toFixed(6))
|
||
|
||
formData = new FormData();
|
||
|
||
formData.append("status", $("#sit").val());
|
||
formData.append("type", $("#type").val());
|
||
formData.append("phone", $("#phone").val());
|
||
formData.append("team_num", $("#ekipnum").val());
|
||
formData.append("staff_num", $("#personelnum").val());
|
||
formData.append("responsible_name", $("#masol").val());
|
||
formData.append("responsible_mobile", $("#masolmobile").val());
|
||
formData.append("successor_name", $("#janeshin").val());
|
||
formData.append("successor_mobile", $("#janeshinmobile").val());
|
||
formData.append("machines_light", $("#lightmachine").val());
|
||
formData.append("machines_sheavy", $("#meduimachin").val());
|
||
formData.append("machines_heavy", $("#bigmachin").val());
|
||
//new paramas yasiu
|
||
formData.append("lat-from", startAbrarMarker.getLatLng().lat.toFixed(6));
|
||
formData.append("lng-from", startAbrarMarker.getLatLng().lng.toFixed(6));
|
||
// formData.append("geometry",);
|
||
formData.append("color", globalcolor);
|
||
formData.append("lat-to", endAbrarMarker.getLatLng().lat.toFixed(6));
|
||
formData.append("lng-to", endAbrarMarker.getLatLng().lng.toFixed(6));
|
||
|
||
|
||
let lat = $("#lat-rahdar").val().slice(1, -1);
|
||
let lng = $("#lng-rahdar").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_overview]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"overview_files_" + i,
|
||
$("input[name=modalUpFileRahdari_overview]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_machinery]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"machinery_files_" + i,
|
||
$("input[name=modalUpFileRahdari_machinery]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_store]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"store_files_" + i,
|
||
$("input[name=modalUpFileRahdari_store]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_office]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"office_files_" + i,
|
||
$("input[name=modalUpFileRahdari_office]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_others]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"others_files_" + i,
|
||
$("input[name=modalUpFileRahdari_others]")[0].files[i]
|
||
);
|
||
}
|
||
for (var pair of formData.entries()) {
|
||
console.log(pair[0] + ', ' + pair[1]);
|
||
}
|
||
$("#rahdaredit").modal("hide");
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/rahdari-points/" + $("#rahdarid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
console.log("ressd", result.data.start_lat)
|
||
if (result.data.color) {
|
||
console.log("smmmmmmm", result.data.start_lat)
|
||
drawPathwithColor(result.data.start_lat, result.data.start_lng, result.data.end_lat, result.data.end_lng, result.data.color);
|
||
}
|
||
|
||
// showCoridorLayer(routeArray, num)
|
||
// alert("success")
|
||
//console.log(result);
|
||
|
||
// showRahdariPoints();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
// alert("eroor")
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
|
||
}
|
||
$("#submitekip").on('click', function () {
|
||
var nameofdastgah = ""
|
||
var drivername = ""
|
||
var phonedriver = ""
|
||
nameofdastgah = $("#typeofdastgah").val();
|
||
drivername = $("#machiner_name").val();
|
||
phonedriver = $("#telephone_num").val();
|
||
var obj = {};
|
||
obj = {
|
||
dastgahtype: nameofdastgah,
|
||
drivername: drivername,
|
||
driverphone: phonedriver
|
||
}
|
||
projectarraymachine.push(obj)
|
||
console.log("test", projectarraymachine)
|
||
generatemachinary(projectarraymachine, 0)
|
||
|
||
})
|
||
$("#ekiplist").on('click', function () {
|
||
console.log("pppppppppppppppppppppppppp", ekiplist)
|
||
var nameofekip = ""
|
||
var ekipphone = ""
|
||
nameofekip = $("#ekipname").val();
|
||
ekipphone = $("#ekipphone").val();
|
||
var obj = {};
|
||
obj = {
|
||
nameofekip: nameofekip,
|
||
ekipphone: ekipphone,
|
||
}
|
||
ekiplist.push(obj)
|
||
console.log("test", ekiplist)
|
||
generatetablecoridor(ekiplist, 0)
|
||
})
|
||
function saveRahdariEditedCoridor() {
|
||
console.log("glo", globalcolor)
|
||
console.log("ئئئئئئئئئئئئئئئئئئئئئئ", ekiplist)
|
||
|
||
console.log("pitikofirst", endAbrarMarker.getLatLng().lat.toFixed(6))
|
||
|
||
console.log("pitikofirst", endAbrarMarker.getLatLng().lng.toFixed(6))
|
||
console.log("pitikofirst", startAbrarMarker.getLatLng().lat.toFixed(6))
|
||
|
||
console.log("pitikofirst", startAbrarMarker.getLatLng().lng.toFixed(6))
|
||
console.log("idkol", idkolcor)
|
||
formData = new FormData();
|
||
|
||
formData.append("id", idkolcor);
|
||
|
||
formData.append("successor_name", $("#ROfficeAgent").val());
|
||
formData.append("name", $("#houserahdarcoridor").val());
|
||
formData.append("responsible_mobile", $("#ROfficeAgentTell").val());
|
||
formData.append("machine_data", JSON.stringify(projectarraymachine));
|
||
formData.append("team_data", JSON.stringify(ekiplist));
|
||
formData.append("start_lat", startAbrarMarker.getLatLng().lat.toFixed(6));
|
||
formData.append("start_lng", startAbrarMarker.getLatLng().lng.toFixed(6));
|
||
formData.append("color", globalcolor);
|
||
formData.append("end_lat", endAbrarMarker.getLatLng().lat.toFixed(6));
|
||
formData.append("end_lng", endAbrarMarker.getLatLng().lng.toFixed(6));
|
||
|
||
for (var pair of formData.entries()) {
|
||
console.log(pair[0] + ', ' + pair[1]);
|
||
}
|
||
$("#coridoredit").modal("hide");
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/api/RahesEsential/update",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
console.log("ressd", result)
|
||
if (result.data.color) {
|
||
drawPathwithColor(result.data.start_lat, result.data.start_lng, result.data.end_lat, result.data.end_lng, result.data.color);
|
||
|
||
}
|
||
|
||
// showCoridorLayer(routeArray, num)
|
||
// alert("success")
|
||
//console.log(result);
|
||
|
||
// showRahdariPoints();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
// alert("eroor")
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
|
||
}
|
||
function accident251EditedPointValidate() {
|
||
let isValidate = true;
|
||
|
||
if (!$("#action").val() || !checkPersianWordValidation($("#action").val())) {
|
||
$("#action").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#action").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#cost").val()) {
|
||
$("#cost").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#cost").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#end-date").val()) {
|
||
$("#end-date").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#end-date").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#ac-point-lat").val()) {
|
||
$("#ac-point-lat").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#ac-point-lat").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#ac-point-lng").val()) {
|
||
$("#ac-point-lng").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#ac-point-lng").removeClass("is-invalid");
|
||
}
|
||
|
||
return isValidate;
|
||
}
|
||
|
||
function checkPersianWordValidation(str) {
|
||
let reg = /^[\u0600-\u06FF\s\.]+$/;
|
||
|
||
if (!reg.test(str)) {
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function saveEditedPoint() {
|
||
if (accident251EditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("actions", $("#action").val());
|
||
formData.append("progress", $(".ex2").slider("getValue"));
|
||
formData.append("cost", $("#cost").val());
|
||
formData.append("end_date", $("#end-date").val());
|
||
|
||
let lat = $("#ac-point-lat").val().slice(1, -1);
|
||
let lng = $("#ac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=modalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=modalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
//if ($('.ex2').slider('getValue') >= $('.ex2').attr('data-slider-value')) {
|
||
$("#pointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-251-points/" + $("#pointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showAccident251Points();
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
/*} else {
|
||
$('#sliderphysici').find('.slider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
||
$('#sliderphysici').find('.slider-label').css('color', 'red');
|
||
}*/
|
||
}
|
||
}
|
||
|
||
function showChangePasswordModal() {
|
||
$("#changepass").modal({ backdrop: "static", keyboard: false });
|
||
$("#changepass").modal("show");
|
||
}
|
||
|
||
$("#savepass").on("click", function () {
|
||
saveEditedPassword();
|
||
});
|
||
|
||
function saveEditedPassword() {
|
||
formData = new FormData();
|
||
|
||
formData.append("fname", $("#name").val());
|
||
formData.append("lname", $("#familyname").val());
|
||
formData.append("position", $("#postsazman").val());
|
||
formData.append("mobile", $("#sazmanmobile").val());
|
||
formData.append("password", $("#newpass").val());
|
||
formData.append("password_confirmation", $("#repeatpass").val());
|
||
|
||
$.ajax({
|
||
url: "/users/0",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
window.open("/rmto", "_self");
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
if (error.responseJSON.errors) {
|
||
//console.log(error.responseJSON.errors);
|
||
showUserUpdateValidateErrors(error.responseJSON.errors);
|
||
}
|
||
},
|
||
});
|
||
}
|
||
|
||
function showUserUpdateValidateErrors(errors) {
|
||
if (errors.fname) {
|
||
$("#name").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#name").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.lname) {
|
||
$("#familyname").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#familyname").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.position) {
|
||
$("#postsazman").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#postsazman").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.mobile) {
|
||
$("#sazmanmobile").removeClass("is-valid").addClass("is-invalid");
|
||
} else {
|
||
$("#sazmanmobile").removeClass("is-invalid").addClass("is-valid");
|
||
}
|
||
|
||
if (errors.password) {
|
||
$("#newpass").removeClass("is-valid").addClass("is-invalid");
|
||
$("#password-invalid-msg").text(
|
||
"رمز عبور باید حداقل ۸ کاراکتر و شامل حداقل یک حرف بزرگ لاتین یک حرف کوچک لاتین و یک عدد باشد."
|
||
);
|
||
} else {
|
||
$("#newpass").removeClass("is-invalid").addClass("is-valid");
|
||
$("#password-invalid-msg").text("");
|
||
}
|
||
}
|
||
|
||
if (getParameterByName("newAbrarProjectId")) {
|
||
let projectId = getParameterByName("newAbrarProjectId");
|
||
|
||
$.ajax({
|
||
url: "/abrar-projects/" + projectId,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showAbrarProjectOnMap(result.data);
|
||
},
|
||
error: function (error) {
|
||
//console.log(error);
|
||
},
|
||
});
|
||
}
|
||
|
||
var abrarProjectIcon1 = L.icon({
|
||
iconUrl: "../../dist/images/icons/flag-1.png",
|
||
iconSize: [22, 22],
|
||
iconAnchor: [2, 22],
|
||
});
|
||
|
||
var abrarProjectIcon9 = L.icon({
|
||
iconUrl: "../../dist/images/icons/flag-9.png",
|
||
iconSize: [22, 22],
|
||
iconAnchor: [2, 22],
|
||
});
|
||
|
||
function showAbrarProjectOnMap(data) {
|
||
if (data.project_start_latlng != null) {
|
||
if (data.project_status < 9) {
|
||
drawStartToEndPath(
|
||
"line",
|
||
data.project_start_latlng,
|
||
data.project_end_latlng,
|
||
"#e6d037"
|
||
);
|
||
|
||
L.marker([data.project_start_latlng[0], data.project_start_latlng[1]], {
|
||
icon: abrarProjectIcon1,
|
||
})
|
||
.bindPopup(getPopupAbrarProjectContent(data), {
|
||
className: "customPopupStyle",
|
||
offset: L.point(0, -15),
|
||
})
|
||
.addTo(map);
|
||
} else {
|
||
drawStartToEndPath(
|
||
"line",
|
||
data.project_start_latlng,
|
||
data.project_end_latlng,
|
||
"#439c0f"
|
||
);
|
||
|
||
L.marker([data.project_start_latlng[0], data.project_start_latlng[1]], {
|
||
icon: abrarProjectIcon9,
|
||
})
|
||
.bindPopup(getPopupAbrarProjectContent(data), {
|
||
className: "customPopupStyle",
|
||
offset: L.point(0, -15),
|
||
})
|
||
.addTo(map);
|
||
}
|
||
|
||
L.circleMarker(
|
||
[data.project_start_latlng[0], data.project_start_latlng[1]],
|
||
{
|
||
color: "#cc7a00",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}
|
||
).addTo(map);
|
||
|
||
L.circleMarker([data.project_end_latlng[0], data.project_end_latlng[1]], {
|
||
color: "#cc7a00",
|
||
stroke: false,
|
||
radius: 2,
|
||
fillOpacity: 1,
|
||
}).addTo(map);
|
||
}
|
||
}
|
||
|
||
function convertNumtoStrAbrarProjectType(num) {
|
||
switch (num) {
|
||
case "1": {
|
||
return "تعریض";
|
||
}
|
||
case "2": {
|
||
return "ابنیه فنی";
|
||
}
|
||
case "3": {
|
||
return "عملیات خاکی و تثبیت";
|
||
}
|
||
case "4": {
|
||
return "آسفالت";
|
||
}
|
||
}
|
||
}
|
||
|
||
function convertAbrarProjectType(type) {
|
||
let projectType = "";
|
||
|
||
type.forEach(function (value, index) {
|
||
projectType += convertNumtoStrAbrarProjectType(value) + "، ";
|
||
});
|
||
|
||
return projectType.slice(0, -2);
|
||
}
|
||
|
||
function convertAbrarProjectStatus(status) {
|
||
switch (status) {
|
||
case 1: {
|
||
return "در دست بررسیهای مقدماتی";
|
||
}
|
||
case 2: {
|
||
return "در دست مطالعه";
|
||
}
|
||
case 3: {
|
||
return "در دست مناقصه";
|
||
}
|
||
case 4: {
|
||
return "در حال مبادله و انعقاد قرارداد";
|
||
}
|
||
case 5: {
|
||
return "در حال اجرا - فعال";
|
||
}
|
||
case 6: {
|
||
return "در حال اجرا - متوقف";
|
||
}
|
||
case 7: {
|
||
return "در مراحل تکمیل و آمادهسازی افتتاح";
|
||
}
|
||
case 8: {
|
||
return "آماده افتتاح و بهرهبرداری";
|
||
}
|
||
case 9: {
|
||
return "افتتاح شده";
|
||
}
|
||
}
|
||
}
|
||
|
||
function getPopupAbrarProjectContent(data) {
|
||
if (data.project_status == 9) {
|
||
specificStatus = ` (` + data.project_status_date + `)`;
|
||
} else if ([2, 5, 6].includes(data.project_status)) {
|
||
specificStatus = ` (` + data.project_status_progress + ` درصد)`;
|
||
} else {
|
||
specificStatus = ``;
|
||
}
|
||
|
||
return (
|
||
`
|
||
<div class="popup">
|
||
<div class="popupTitle">
|
||
<img width="22px" src="dist/images/layer-141/construction.svg" alt="">
|
||
<span class="popupHeader"> پروژه ساخت راه روستایی </span>
|
||
</div>
|
||
<div class="popupHeaderContent">
|
||
<div class="popUpBanner"> اداره کل: ` +
|
||
data.province_name +
|
||
`، شهرستان: ` +
|
||
data.city_name +
|
||
`</div>
|
||
</div>
|
||
<div class="popupContent">
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> نام پروژه - نام محور </span>
|
||
<div class="popUpBoxContent">` +
|
||
data.axis_name +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> طول محور (کیلومتر) </span>
|
||
<div class="popUpBoxContent">` +
|
||
data.axis_length +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> ماهیت پروژه </span>
|
||
<div class="popUpBoxContent">` +
|
||
convertAbrarProjectType(data.project_type) +
|
||
`</div>
|
||
</div>
|
||
<div class="popUpBox" style="width:75px">
|
||
<span> آخرین وضعیت پروژه </span>
|
||
<div class="popUpBoxContent">` +
|
||
convertAbrarProjectStatus(data.project_status) +
|
||
specificStatus +
|
||
`</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`
|
||
);
|
||
}
|
||
|
||
function drawStartToEndPath(pathType, source, dest, pathColor) {
|
||
if (routeControlsPath.length) {
|
||
$(routeControlsPath).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routeControlsPath.splice(routeControlsPath.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (polylinePath != null) {
|
||
map.removeLayer(polylinePath);
|
||
}
|
||
switch (pathType) {
|
||
case "line": {
|
||
polylinePath = L.polyline(
|
||
[
|
||
[source[0], source[1]],
|
||
[dest[0], dest[1]],
|
||
],
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
}
|
||
).addTo(map);
|
||
break;
|
||
}
|
||
case "axis": {
|
||
$.get(
|
||
`https://testmap.141.ir/route/v1/driving/${source[1]},${source[0]};${dest[1]},${dest[0]}?overview=full&alternatives=false`,
|
||
function (data) {
|
||
alert("ppp")
|
||
routeControlsPath.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(parseFloat(source[0]), parseFloat(source[1])),
|
||
L.latLng(parseFloat(dest[0]), parseFloat(dest[1])),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
draggableWaypoints: true,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routesfound", function (e) {
|
||
for (let index = 0; index < popupArraysPath.length; index++) {
|
||
if (popupArraysPath[index] !== null) {
|
||
map.removeLayer(popupArraysPath[index]);
|
||
}
|
||
}
|
||
|
||
/*let popup = new L.Popup({
|
||
'maxWidth': '300',
|
||
'maxHeight': '150',
|
||
'className': 'customRouteEstimate'
|
||
});
|
||
|
||
let popupLocation = new L.LatLng(e.routes[0].coordinates[parseInt(e.routes[0]
|
||
.coordinates
|
||
.length /
|
||
2)].lat,
|
||
e.routes[0].coordinates[parseInt(e.routes[0].coordinates.length / 2)]
|
||
.lng);
|
||
let popupContent = "<span style=\"color:#FF5630 ; font-size:11px\">مسافت : </span>" + parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2) + " کیلومتر";
|
||
popup.setLatLng(popupLocation);
|
||
popup.setContent(popupContent);
|
||
popupArraysPath.push(popup);
|
||
map.addLayer(popup);*/
|
||
})
|
||
.addTo(map)
|
||
);
|
||
}
|
||
);
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
function getMaintenanceProjects() {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/road-maintenance-project/getpoints",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
// console.log(result.data[2]);
|
||
|
||
let markerG = [];
|
||
let markerGConstructionRural = [];
|
||
let markerGTechnicalBuilding = [];
|
||
let markerGUpgradeSafety = [];
|
||
let markerGTollhouseManagement = [];
|
||
let markerGDangerPrevention = [];
|
||
let roadMaintenancePoints = result.data;
|
||
let roadConstructionRuralPoints = result.RoadConstructionRural;
|
||
let roadTechnicalBuildingPoints = result.RoadTechnicalBuilding;
|
||
let roadUpgradeSafetyPoints = result.RoadUpgradeSafety;
|
||
let roadTollhouseManagementPoints = result.RoadTollhouseManagement;
|
||
let roadDangerPreventionPoints = result.RoadDangerPrevention;
|
||
// console.log("all "+result)
|
||
$.each(roadMaintenancePoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = greenIcon;
|
||
if (value.physical_progress < "50") setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 1), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
1
|
||
);
|
||
});
|
||
markerG.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
$.each(roadConstructionRuralPoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = redIconFix;
|
||
// if (value.physical_progress < "50")
|
||
// setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
// console.log("imagekol" , imagekol)
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
2
|
||
);
|
||
});
|
||
markerGConstructionRural.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
$.each(roadTechnicalBuildingPoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = technicalBuildingIcon;
|
||
// if (value.physical_progress < "50")
|
||
// setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 3), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
// console.log("imagekol" , imagekol)
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
3
|
||
);
|
||
});
|
||
markerGTechnicalBuilding.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
$.each(roadUpgradeSafetyPoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = upgradeSafetyIcon;
|
||
// if (value.physical_progress < "50")
|
||
// setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 4), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
// console.log("imagekol" , imagekol)
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
4
|
||
);
|
||
});
|
||
markerGUpgradeSafety.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
$.each(roadTollhouseManagementPoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = tollhouseManagementIcon;
|
||
// if (value.physical_progress < "50")
|
||
// setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 5), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
// console.log("imagekol" , imagekol)
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
5
|
||
);
|
||
});
|
||
markerGTollhouseManagement.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
$.each(roadDangerPreventionPoints, function (key, value) {
|
||
// console.log( value.id );
|
||
try {
|
||
// console.log(value.physical_progress);
|
||
// imagekol = value.images
|
||
// console.log("imagekol" , imagekol)
|
||
let setIcon = dangerPreventionIcon;
|
||
// if (value.physical_progress < "50")
|
||
// setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
// content: roadMaintenancePoints[i],
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 6), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
// console.log("imagekol" , imagekol)
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
6
|
||
);
|
||
});
|
||
markerGDangerPrevention.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
});
|
||
// console.log("roadMaintenancePoints" , roadMaintenancePoints.length)
|
||
|
||
// for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
|
||
// }
|
||
marker141Layers = L.layerGroup(markerG);
|
||
marker141LayersConstructionRural = L.layerGroup(markerGConstructionRural);
|
||
marker141LayersTechnicalBuilding = L.layerGroup(markerGTechnicalBuilding);
|
||
marker141LayersUpgradeSafety = L.layerGroup(markerGUpgradeSafety);
|
||
marker141LayersDangerPrevention = L.layerGroup(markerGDangerPrevention);
|
||
marker141LayersTollhouseManagement = L.layerGroup(
|
||
markerGTollhouseManagement
|
||
);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersConstructionRural);
|
||
map.addLayer(marker141LayersTechnicalBuilding);
|
||
map.addLayer(marker141LayersUpgradeSafety);
|
||
map.addLayer(marker141LayersDangerPrevention);
|
||
map.addLayer(marker141LayersTollhouseManagement);
|
||
console.log("hi every thing is ok");
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function getPopupContentMaintenance(data, index) {
|
||
// console.log(imagekol)
|
||
console.log("data", data);
|
||
var title = "";
|
||
if (index == 1) {
|
||
title = "روکش آسفالت (نگهداری راه )";
|
||
} else if (index == 2) {
|
||
title = "احداث راه روستایی";
|
||
} else if (index == 3) {
|
||
title = "ابنیه فنی ";
|
||
} else if (index == 4) {
|
||
title = " ارتقای ایمنی راه ";
|
||
} else if (index == 5) {
|
||
title = "پروژه راهدارخانه ها (بهسازی و نوسازی )";
|
||
} else if (index == 6) {
|
||
title = "رفع نقاط حادثه خیز/پرتصادف";
|
||
}
|
||
var upload =
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src=".../../dist/images/icons/caution.svg" alt="">\
|
||
<span class="popupHeader">' +
|
||
title +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province.name +
|
||
"، شهرستان: " +
|
||
showcity(data.cities) +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> نام محور </span><div class="popUpBoxContent">' +
|
||
data.axis_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> نوع محور </span><div class="popUpBoxContent">' +
|
||
showaxistype(data.axis_type) +
|
||
'</div></div> </div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px">\
|
||
<span> عنوان پروژه </span><div class="popUpBoxContent">' +
|
||
data.project_name +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> آخرین وضعیت پروژه </span><div class="popUpBoxContent">' +
|
||
showstatus(data.project_status) +
|
||
'</div></div>\
|
||
</div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> پیمانکار </span><div class="popUpBoxContent">' +
|
||
data.contractor_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> سال شروع </span><div class="popUpBoxContent">' +
|
||
data.contract_date +
|
||
"" +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تاریخ ثبت سامانه </span><div class="popUpBoxContent">' +
|
||
data.submited_at +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تاریخ آخرین بروزرسانی </span><div class="popUpBoxContent">' +
|
||
data.last_updated_at +
|
||
'</div></div>\
|
||
<div class="popupContent">\
|
||
<div class="popupFooter" ><span> نوع و طول عملیات </span><div class="popUpBoxContent" id="showtabel' +
|
||
data.id +
|
||
'">' +
|
||
'</div></div>\
|
||
<button class=" popUpBox popup-btn-edit-point" id="popup-btn-edit-pointphoto" onclick="show_point_photo1()" style=" color: white;background-color: #0051cd;">نمایش تصاویر</button>\
|
||
<button class=" popUpBox popup-btn-edit-point" onclick="upadate(' +
|
||
index +
|
||
')" style=" color: white;background-color: #0051cd;"> بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>';
|
||
// GenerateTable(project_distance)
|
||
return upload;
|
||
}
|
||
function showstatus(num) {
|
||
console.log("num", num);
|
||
if (num == 1) {
|
||
return " در دست برنامه ریزی اولیه";
|
||
} else if (num == 2) {
|
||
return " در دست مطالعه و تهیه اسناد مناقصه";
|
||
} else if (num == 3) {
|
||
return "در دست مناقصه";
|
||
} else if (num == 4) {
|
||
return "در حال تجهیز کارگاه";
|
||
} else if (num == 5) {
|
||
return " در حال اجرا/فعال";
|
||
} else if (num == 6) {
|
||
return "در حال اجرا/متوقف ";
|
||
} else if (num == 7) {
|
||
return " در حال آماده سازی برای افتتاح";
|
||
} else if (num == 8) {
|
||
return " تکمیل و خاتمه یافته و بهره برداری شده ";
|
||
} else {
|
||
return "-";
|
||
}
|
||
}
|
||
function upadate(index) {
|
||
switch (index) {
|
||
case 1:
|
||
window.open("https://rms.rmto.ir/road-maintenance-project");
|
||
break;
|
||
case 2:
|
||
window.open("https://rms.rmto.ir/road-maintenance-project");
|
||
break;
|
||
case 3:
|
||
window.open("https://rms.rmto.ir/road-technical-building");
|
||
break;
|
||
case 4:
|
||
window.open("https://rms.rmto.ir/road-upgrade-safety");
|
||
break;
|
||
case 5:
|
||
window.open("https://rms.rmto.ir/road-tollhouse-management");
|
||
break;
|
||
case 6:
|
||
window.open("https://rms.rmto.ir/road-danger-prevention");
|
||
break;
|
||
default:
|
||
window.open("https://rms.rmto.ir/road-maintenance-project");
|
||
}
|
||
}
|
||
function GenerateTablestart(id, object, num) {
|
||
console.log("obj", id, object);
|
||
// $("#showtabel").empty()
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
if (num == 1) {
|
||
customers.push([" نوع عملیات ", "کیلومتر", "تناژ"]);
|
||
|
||
// for (var i = 0; i < item.length; i++) {
|
||
|
||
// customers.push([i + 1, subshow(item[i]), showcount(item[i], dataitem)]);
|
||
// }
|
||
$.each(object, function (index, value) {
|
||
customers.push([
|
||
subshow1(index, num),
|
||
showcount1(index, value),
|
||
showtonazh1(index, value),
|
||
]);
|
||
});
|
||
} else {
|
||
customers.push([" نوع عملیات ", " درصد پیشرفت فیزیکی"]);
|
||
|
||
// for (var i = 0; i < item.length; i++) {
|
||
|
||
// customers.push([i + 1, subshow(item[i]), showcount(item[i], dataitem)]);
|
||
// }
|
||
$.each(object, function (index, value) {
|
||
customers.push([subshow1(index, num), showcount1(index, value)]);
|
||
});
|
||
}
|
||
|
||
// console.log(customers)
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablepopup");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
//Add the data rows.
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtabel" + id);
|
||
dvTable.innerHTML = "";
|
||
// console.log("dvtt",dvTable)
|
||
dvTable.appendChild(table);
|
||
}
|
||
function subshow1(index, num) {
|
||
console.log("num", num);
|
||
// return index
|
||
if (num == 1) {
|
||
if (index == 1) {
|
||
return "روکش آسفالت";
|
||
}
|
||
if (index == 2) {
|
||
return "ماسه آسفالت";
|
||
}
|
||
if (index == 3) {
|
||
return " بازیافت سرد و گرم ";
|
||
}
|
||
if (index == 4) {
|
||
return "میکروسرفیسینگ";
|
||
}
|
||
if (index == 5) {
|
||
return " چیپ سیل ";
|
||
}
|
||
if (index == 6) {
|
||
return "اسلاری سیل ";
|
||
}
|
||
if (index == 7) {
|
||
return "اسکراب سیل ";
|
||
}
|
||
if (index == 8) {
|
||
return "فوگ سیل";
|
||
}
|
||
if (index == 9) {
|
||
return " سیل کت ";
|
||
}
|
||
if (index == 10) {
|
||
return " کیپ سیل ";
|
||
}
|
||
if (index == 11) {
|
||
return " آسفالت سرد / ردمیکس";
|
||
}
|
||
if (index == 12) {
|
||
return " لکه گیری ";
|
||
}
|
||
|
||
if (index == 13) {
|
||
return " درز گیری ";
|
||
}
|
||
} else if (num == 2) {
|
||
if (index == 1) {
|
||
return "احداث ابنیه فنی ";
|
||
}
|
||
if (index == 2) {
|
||
return "عملیات خاکی ";
|
||
}
|
||
if (index == 3) {
|
||
return " روسازی ";
|
||
}
|
||
if (index == 4) {
|
||
return "آسفالت";
|
||
}
|
||
} else if (num == 3) {
|
||
if (index == 1) {
|
||
return " تعریض پل / آبرو ";
|
||
}
|
||
if (index == 2) {
|
||
return " تعمیرات اساسی پل ";
|
||
}
|
||
if (index == 3) {
|
||
return " تعمیرات تونل ";
|
||
}
|
||
if (index == 4) {
|
||
return "تعمیر یا احداث دیوار حائل";
|
||
}
|
||
if (index == 5) {
|
||
return "احداث پل جدید";
|
||
}
|
||
if (index == 6) {
|
||
return " احداث کنارگذر پل / تونل";
|
||
}
|
||
if (index == 7) {
|
||
return "سایر ";
|
||
}
|
||
} else if (num == 4) {
|
||
if (index == 1) {
|
||
return "نصب حفاظ بتنی";
|
||
}
|
||
if (index == 2) {
|
||
return "نصب حفاظ فلزی /گارد ریل";
|
||
}
|
||
if (index == 3) {
|
||
return "اجرای روشنایی طولی/نقطه ای";
|
||
}
|
||
if (index == 4) {
|
||
return " نصب علائم ایمنی";
|
||
}
|
||
if (index == 5) {
|
||
return "خط کشی";
|
||
}
|
||
if (index == 6) {
|
||
return "سایر اقدامات ایمنی راه";
|
||
}
|
||
} else if (num == 5) {
|
||
if (index == 1) {
|
||
return " احداث راهدارخانه";
|
||
}
|
||
if (index == 2) {
|
||
return " احداث انبار شن و نمک ";
|
||
}
|
||
if (index == 3) {
|
||
return "نوسازی و بهسازی راهدارخانه";
|
||
}
|
||
if (index == 4) {
|
||
return " احداث آشیانه ماشین آلات";
|
||
}
|
||
if (index == 5) {
|
||
return " تغییرات جزئی راهدارخانه";
|
||
}
|
||
if (index == 6) {
|
||
return " محوطه سازی راهدارخانه";
|
||
}
|
||
if (index == 7) {
|
||
return "سایر";
|
||
}
|
||
} else if (num == 6) {
|
||
if (index == 1) {
|
||
return " تعریض و روکش";
|
||
}
|
||
if (index == 2) {
|
||
return " اصلاح قوس ";
|
||
}
|
||
if (index == 3) {
|
||
return " تراشه برداری ";
|
||
}
|
||
if (index == 4) {
|
||
return " روشنایی نقطه ای";
|
||
}
|
||
if (index == 5) {
|
||
return " احداث تقاطع غیر همسطح(پل/زیرگذر)";
|
||
}
|
||
if (index == 6) {
|
||
return "ایمن سازی علائم و حفاظ";
|
||
}
|
||
if (index == 7) {
|
||
return "اصلاح وروردی /خروجی";
|
||
}
|
||
if (index == 8) {
|
||
return "تعریض ابنیه فنی";
|
||
}
|
||
}
|
||
}
|
||
function showcount1(index, value) {
|
||
let textfile = "";
|
||
if (index == 1) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 2) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 3) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 4) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 5) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 6) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 7) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 8) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 9) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 10) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 11) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
|
||
if (index == 12) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
if (index == 13) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[0];
|
||
}
|
||
}
|
||
return textfile;
|
||
}
|
||
function showtonazh1(index, value) {
|
||
let textfile = "";
|
||
if (index == 1) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 2) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 3) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 4) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 5) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 6) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 7) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 8) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 9) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 10) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
if (index == 11) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[1];
|
||
}
|
||
}
|
||
|
||
if (index == 12) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = value[2];
|
||
}
|
||
}
|
||
if (index == 13) {
|
||
for (var i = 0; i < value.length; i++) {
|
||
textfile = "_";
|
||
}
|
||
}
|
||
return textfile;
|
||
}
|
||
function showcity(array) {
|
||
var dataname = "";
|
||
for (let i = 0; i < array.length; i++) {
|
||
dataname += array[i].name + " ";
|
||
// console.log(i, array[i].name )
|
||
}
|
||
// console.log(dataname)
|
||
return dataname;
|
||
}
|
||
function showaxistype(num) {
|
||
if (num == 1) {
|
||
return "شریانی";
|
||
} else if (num == 2) {
|
||
return "اصلی";
|
||
} else if (num == 3) {
|
||
return "فرعی";
|
||
} else return "روستایی";
|
||
}
|
||
//yasi
|
||
$("#slideroverlay > .camera-overlay").on("click", function () {
|
||
$(this).parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay .close").on("click", function () {
|
||
$(this).parent().parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay #slideshow-slide .prev").on("click", function () {
|
||
layerslidershow((slideIndexlayer -= 1));
|
||
});
|
||
|
||
$("#slideroverlay #slideshow-slide .next").on("click", function () {
|
||
layerslidershow((slideIndexlayer += 1));
|
||
});
|
||
|
||
function show_point_photo1() {
|
||
console.log("hi");
|
||
|
||
console.log("arrayimage", imagekol);
|
||
var dataLength = imagekol.length;
|
||
console.log("lenghth", dataLength);
|
||
|
||
if (dataLength != 0) {
|
||
// $("#slideroverlay").css('display' , 'block')
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
$(imagekol).each(function (index, item) {
|
||
// console.log(index,item)
|
||
let divSlide =
|
||
'<div class="mySlides"><div class="numbertext">' +
|
||
dataLength +
|
||
" / " +
|
||
(index + 1) +
|
||
'</div><img src="' +
|
||
item +
|
||
'"><div class="text" style="display:none>' +
|
||
"</div></div>";
|
||
$("#slideshow-slide").append(divSlide);
|
||
$("#slideshow-dot").append(
|
||
'<span class="dot" onclick="currentCameraSlide(' +
|
||
(index + 1) +
|
||
')"></span>'
|
||
);
|
||
});
|
||
if (dataLength > 0) {
|
||
slideindex = 1;
|
||
layerslidershow(slideindex);
|
||
$("#slideroverlay").css("display", "block");
|
||
}
|
||
// console.log(array.length)
|
||
} else {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "فایلی جهت نمایش وجود ندارد .",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
}
|
||
}
|
||
function layerslidershow(n) {
|
||
let slides = $("#slideroverlay #slideshow-slide .mySlides");
|
||
let dots = $("#slideroverlay #slideshow-dot .dot");
|
||
|
||
if (n > slides.length) {
|
||
slideIndexlayer = 1;
|
||
}
|
||
if (n < 1) {
|
||
slideIndexlayer = slides.length;
|
||
}
|
||
|
||
$(slides).each(function () {
|
||
$(this).css("display", "none");
|
||
});
|
||
$(dots).each(function () {
|
||
$(this).removeClass("active");
|
||
});
|
||
|
||
$(slides[slideIndexlayer - 1]).css("display", "block");
|
||
$(dots[slideIndexlayer - 1]).addClass("active");
|
||
}
|
||
|
||
//yasi
|
||
|
||
$("#all-danger-pointsShow").on("click", function () {
|
||
$("#all_village").click();
|
||
});
|
||
|
||
$("#all251-danger-pointsShow").on("click", function () {
|
||
$("#251_village").click();
|
||
});
|
||
|
||
function getPopupContentFastReaction(data) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/layer-icons/emergency.svg" alt="">\
|
||
<span class="popupHeader">واکنش سریع (کد پیگیری: ' +
|
||
data.uid +
|
||
')</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.ProvinceName +
|
||
"، شهرستان " +
|
||
data.TownName +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> موضوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.Title +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> نوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.EventTypeTitle +
|
||
'</div></div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:266px!important"><span> توضیح شکایت </span><div class="popUpBoxContent">' +
|
||
data.Description +
|
||
"</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
|
||
function showFastPoint() {
|
||
$("#choosetime").modal("show");
|
||
}
|
||
$("#popup-btn-edit-pointphoto").on("click", function () {
|
||
console.log("hi");
|
||
console.log("pitikoo", imagekol);
|
||
// to do yasiiuu
|
||
});
|
||
function showFastFunction(startDate, endDate) {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url:
|
||
"/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDate +
|
||
"&start-date=" +
|
||
startDate,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
//console.log(result);
|
||
showFastReactionPoint = false;
|
||
|
||
let roadMaintenancePoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
let pos = null;
|
||
|
||
if (roadMaintenancePoints[i].rms_status == 0) {
|
||
setIcon = redIcon;
|
||
pos = [roadMaintenancePoints[i].lat, roadMaintenancePoints[i].lng];
|
||
} else {
|
||
setIcon = greenIcon;
|
||
pos = roadMaintenancePoints[i].rms_start_latlng;
|
||
}
|
||
|
||
if (pos != null) {
|
||
let marker = L.marker(pos, {
|
||
icon: setIcon,
|
||
content: roadMaintenancePoints[i],
|
||
}).bindPopup(
|
||
getPopupContentFastReaction(roadMaintenancePoints[i]),
|
||
{
|
||
className: "customPopupStyle",
|
||
}
|
||
);
|
||
markerG.push(marker);
|
||
} else {
|
||
console.log("Number of null coordinates!");
|
||
}
|
||
//marker141Layers.push(marker);
|
||
//map.addLayer(marker)
|
||
} catch (e) {
|
||
//
|
||
}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
// marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function showsecondtime() {
|
||
if ($(".left-menu-view-chartt").css("left") == "30px") {
|
||
|
||
// console.log("hii")
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
} else {
|
||
// console.log("bii")
|
||
$(".left-menu-view-chartcoridor").css("left", "-1600px");
|
||
|
||
$(".left-menu-view-chartt").css("left", "30px");
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/bama-homepage",
|
||
type: "GET",
|
||
cache: false,
|
||
success: function (result) {
|
||
console.log(result);
|
||
$("#showTitle").find("span").remove();
|
||
ShowBi(result);
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
},
|
||
});
|
||
}
|
||
}
|
||
$(document).mouseup(function (e) {
|
||
var container = $(".left-menu-view-chartt");
|
||
|
||
// if the target of the click isn't the container nor a descendant of the container
|
||
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
|
||
// container.hide();
|
||
}
|
||
});
|
||
$("#maincor").on("click", function () {
|
||
$(".left-menu-view-chartcoridor").css("left", "30px");
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
})
|
||
|
||
$("#karaj-chaloos").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#karaj-chaloos").css("background-color", "rgb(255, 86, 48)")
|
||
$("#karaj-chaloos").css("color", "#fff")
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [36.65851701025201, 51.424223549477404]
|
||
map.flyTo([36.1223, 51.5176], 9);
|
||
calculateRouteCoridor(origin, dest, 4);
|
||
routingArray.push("chaloos")
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (chalooslayer != null) {
|
||
markerlis5 = [];
|
||
map.removeLayer(chalooslayer);
|
||
}
|
||
// console.log("routingarray", routingArray)
|
||
$("#karaj-chaloos").css("background-color", "rgb(255, 255, 255)")
|
||
$("#karaj-chaloos").css("color", "#000")
|
||
|
||
map.removeLayer(smarkerKarCh);
|
||
map.removeLayer(emarkerKarCh);
|
||
|
||
map.removeLayer(forthpolyline)
|
||
}
|
||
|
||
});
|
||
$("#firoozkooh").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
console.log("fff", color)
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#firoozkooh").css("background-color", "rgb(255, 86, 48)")
|
||
$("#firoozkooh").css("color", "#fff")
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [36.45714233035437, 52.86483042728247]
|
||
map.flyTo([35.9936, 52.2647], 9);
|
||
calculateRouteCoridor(origin, dest, 0);
|
||
routingArray.push("firoozkooh")
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
console.log("routeControlspitikoo", routeControls)
|
||
if (firoozlayer != null) {
|
||
markerlis1 = [];
|
||
map.removeLayer(firoozlayer);
|
||
}
|
||
console.log("routingarray", routingArray)
|
||
$("#firoozkooh").css("background-color", "rgb(255, 255, 255)")
|
||
$("#firoozkooh").css("color", "#000")
|
||
map.removeLayer(smarkerfirooz);
|
||
map.removeLayer(emarkerfirooz);
|
||
map.removeLayer(firoozpoly)
|
||
|
||
}
|
||
});
|
||
$("#amol").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#amol").css("background-color", "rgb(255, 86, 48)")
|
||
$("#amol").css("color", "#fff")
|
||
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [36.47189472825926, 52.34990088821553]
|
||
map.flyTo([36.0269, 51.8994], 9);
|
||
calculateRouteCoridor(origin, dest, 1);
|
||
routingArray.push("amol")
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
console.log("routeControlspitikoo", routeControls)
|
||
if (amollayer != null) {
|
||
markerlis2 = [];
|
||
map.removeLayer(amollayer);
|
||
}
|
||
console.log("routingarray", routingArray)
|
||
$("#amol").css("background-color", "rgb(255, 255, 255)")
|
||
$("#amol").css("color", "#000")
|
||
map.removeLayer(smarkeramol);
|
||
map.removeLayer(emarkeramol);
|
||
map.removeLayer(amolpoly)
|
||
|
||
}
|
||
|
||
});
|
||
$("#ghazvin").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#ghazvin").css("background-color", "rgb(255, 86, 48)")
|
||
$("#ghazvin").css("color", "#fff")
|
||
|
||
var origin = [36.28308897867362, 50.00192014879593]
|
||
var dest = [37.279360690543456, 49.584610211991674]
|
||
var city_name = 'ghazvin';
|
||
calculateRouteCoridor(origin, dest, 2);
|
||
routingArray.push("ghazvin")
|
||
map.flyTo([36.9084, 49.8947], 9);
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (rashtlayer != null) {
|
||
markerlis3 = [];
|
||
map.removeLayer(rashtlayer);
|
||
}
|
||
// console.log("routingarray", routingArray)
|
||
$("#ghazvin").css("background-color", "rgb(255, 255, 255)")
|
||
$("#ghazvin").css("color", "#000")
|
||
|
||
map.removeLayer(smarkerGhRa);
|
||
map.removeLayer(emarkerGhRa);
|
||
|
||
|
||
|
||
map.removeLayer(firstpolyline)
|
||
}
|
||
|
||
});
|
||
$("#newrasht").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#newrasht").css("background-color", "rgb(255, 86, 48)")
|
||
$("#newrasht").css("color", "#fff")
|
||
|
||
var origin = [36.28308897867362, 50.00192014879593]
|
||
var dest = [37.279360690543456, 49.584610211991674]
|
||
calculateRouteCoridor(origin, dest, 3);
|
||
routingArray.push("newrasht")
|
||
map.flyTo([36.9084, 49.8947], 9);
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
console.log("routeControlspitikoo", routeControls)
|
||
if (newrashtlayer != null) {
|
||
markerlis4 = [];
|
||
map.removeLayer(newrashtlayer);
|
||
}
|
||
console.log("routingarray", routingArray)
|
||
$("#newrasht").css("background-color", "rgb(255, 255, 255)")
|
||
map.removeLayer(smarkerrasht);
|
||
map.removeLayer(emarkerrasht);
|
||
map.removeLayer(rashtpoly)
|
||
|
||
}
|
||
|
||
|
||
});
|
||
$("#semnan").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#semnan").css("background-color", "rgb(255, 86, 48)")
|
||
$("#semnan").css("color", "#fff")
|
||
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [35.57781784221976, 53.38200041498726]
|
||
map.flyTo([35.6392, 52.3916], 9);
|
||
calculateRouteCoridor(origin, dest, 5);
|
||
routingArray.push("semnan")
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (semnanlayer != null) {
|
||
markerlis6 = [];
|
||
map.removeLayer(semnanlayer);
|
||
}
|
||
// console.log("routingarray", routingArray)
|
||
$("#semnan").css("background-color", "rgb(255, 255, 255)")
|
||
$("#semnan").css("color", "#000")
|
||
map.removeLayer(smarkerThSe);
|
||
map.removeLayer(emarkerThSe);
|
||
|
||
map.removeLayer(fifthpolyline)
|
||
}
|
||
|
||
});
|
||
$("#tabriz").on("click", function () {
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#tabriz").css("background-color", "rgb(255, 86, 48)")
|
||
$("#tabriz").css("color", "#fff")
|
||
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [38.07399638132807, 46.29619515208469]
|
||
map.flyTo([36.8869, 48.8487], 9);
|
||
calculateRouteCoridor(origin, dest, 6);
|
||
routingArray.push("tabriz")
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
console.log("routeControlspitikoo", routeControls)
|
||
|
||
if (tabrizlayer != null) {
|
||
markerlis7 = [];
|
||
map.removeLayer(tabrizlayer);
|
||
}
|
||
console.log("routingarray", routingArray)
|
||
$("#tabriz").css("background-color", "rgb(255, 255, 255)")
|
||
$("#tabriz").css("color", "#000")
|
||
map.removeLayer(smarkertabriz);
|
||
map.removeLayer(emarkertabriz);
|
||
map.removeLayer(tabrizpoly)
|
||
}
|
||
|
||
});
|
||
|
||
// $("#kermanshah").css('display', 'none');
|
||
$("#kermanshah").on("click", function () {
|
||
|
||
var color = $(this).css("background-color");
|
||
if (color == "rgb(255, 255, 255)") {
|
||
$("#kermanshah").css("background-color", "rgb(255, 86, 48)")
|
||
$("#kermanshah").css("color", "#fff")
|
||
|
||
var origin = [35.70061770364413, 51.40137849422223]
|
||
var dest = [34.32394142945338, 47.073589114346305]
|
||
map.flyTo([35.0198, 49.2374], 9);
|
||
calculateRouteCoridor(origin, dest, 7);
|
||
routingArray.push("kermanshah")
|
||
|
||
}
|
||
else if (color == "rgb(255, 86, 48)") {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (kermanlayer != null) {
|
||
markerlis8 = [];
|
||
map.removeLayer(kermanlayer);
|
||
}
|
||
console.log("routingarray", routingArray)
|
||
$("#kermanshah").css("background-color", "rgb(255, 255, 255)")
|
||
$("#kermanshah").css("color", "#000")
|
||
map.removeLayer(smarkerThKer);
|
||
map.removeLayer(emarkerThKer);
|
||
map.removeLayer(seventhpolyline)
|
||
}
|
||
|
||
});
|
||
//yasi coridor
|
||
function calculateRouteCoridor(first, last, num) {
|
||
let routeArray = [];
|
||
// if (routeControls.length) {
|
||
// // alert("hi")
|
||
// $(routeControls).each(function (index, control) {
|
||
// map.removeControl(control);
|
||
// routeControls.splice(routeControls.indexOf(index), 1);
|
||
// });
|
||
// }
|
||
|
||
let result = new Promise(function (resolve, reject) {
|
||
console.log("nummmmm", num)
|
||
if (num == 0) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;52.8579311,36.4636399?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 1) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;52.3499009,36.4718947?overview=full&alternatives=true&steps=true"
|
||
,
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 2) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/49.5846102,37.2793607;49.589109420776374,37.01365617294853;49.39663410186768,36.76501688279228;49.41307067871094,36.71865951515749;49.53460693359376,36.618903290216785;49.59546089172364,36.3709172544364;49.81874942779541,36.31037025501364;50.006663,36.2804074?overview=full&alternatives=true&steps=true"
|
||
,
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 3) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/50.006663,36.2804074;49.5846102,37.2793607?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
else if (num == 4) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.0073853,35.8121955;51.4222349,36.6506071?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
else if (num == 5) {
|
||
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;53.3882906,35.5834074?overview=full&alternatives=true&steps=true"
|
||
,
|
||
function (data) {
|
||
console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
else if (num == 6) {
|
||
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;46.2961952,38.0739964?overview=full&alternatives=true&steps=true"
|
||
,
|
||
function (data) {
|
||
console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
else if (num == 7) {
|
||
$.get(
|
||
"https://testmap.141.ir/route/v1/driving/51.4013785,35.7006177;50.21301269531251,35.00862766620555;49.531173706054695,35.12440157992044;48.740158081054695,35.09463077862675;47.0735891,34.3239414?overview=full&alternatives=true&steps=true"
|
||
,
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
|
||
else {
|
||
console.log("else milad");
|
||
$.get(
|
||
"https://testmap.141.ir" +
|
||
"/route/v1/driving/" +
|
||
first[1] +
|
||
"," +
|
||
first[0] +
|
||
";" +
|
||
last[1] +
|
||
"," +
|
||
last[0] +
|
||
"?overview=full&alternatives=false"
|
||
,
|
||
function (data) {
|
||
// console.log(data.routes[0].geometry)
|
||
// console.log("decoooooooode",decode(data.routes[0].geometry, 6));
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
|
||
});
|
||
|
||
result
|
||
.then((response) => {
|
||
// alert("hiii")
|
||
routeArray = response;
|
||
console.log("routeArray" , routeArray);
|
||
showCoridorLayer(routeArray, num);
|
||
if (num == 0) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
firoozpoly = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
firoozpoly.addTo(map);
|
||
}
|
||
if (num == 1) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
amolpoly = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
amolpoly.addTo(map);
|
||
}
|
||
else if (num == 2) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
firstpolyline = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
firstpolyline.addTo(map);
|
||
}
|
||
else if (num == 3) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
rashtpoly = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
rashtpoly.addTo(map);
|
||
}
|
||
else if (num == 4) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
forthpolyline = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
forthpolyline.addTo(map);
|
||
}
|
||
else if (num == 5) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
fifthpolyline = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
fifthpolyline.addTo(map);
|
||
}
|
||
else if (num == 6) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
tabrizpoly = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
tabrizpoly.addTo(map);
|
||
}
|
||
else if (num == 7) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10));
|
||
}
|
||
// var pointA = new L.LatLng(35.635308, 51.22496);
|
||
// var pointB = new L.LatLng(33.984461, 62.70641);
|
||
// var pointList = [pointA, pointB];
|
||
console.log("myarray ", myarray)
|
||
seventhpolyline = new L.Polyline(myarray, {
|
||
color: 'blue',
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1
|
||
});
|
||
seventhpolyline.addTo(map);
|
||
}
|
||
})
|
||
.catch((error) => console.log(error));
|
||
|
||
if (num != 0 && num != 1 && num != 2 && num != 6 && num != 7 && num != 5 && num != 4 && num != 3) {
|
||
routeControls.push(
|
||
L.Routing.control({
|
||
routeWhileDragging: true,
|
||
reverseWaypoints: true,
|
||
addWaypoints: false,
|
||
waypoints: [
|
||
L.latLng(first[0], first[1]),
|
||
L.latLng(last[0], last[1]),
|
||
],
|
||
lineOptions: {
|
||
styles: [
|
||
{
|
||
color: "#5789f2",
|
||
opacity: 1,
|
||
weight: 5,
|
||
},
|
||
],
|
||
},
|
||
createMarker: function (i, wp) {
|
||
|
||
if (i == 0) {
|
||
return L.marker(wp.latLng, { icon: startAbrarDivIcon, });
|
||
} else {
|
||
return L.marker(wp.latLng, { icon: endAbrarDivIcon, });
|
||
}
|
||
},
|
||
}).addTo(map)
|
||
);
|
||
} else if (num == 0) {
|
||
|
||
smarkerfirooz = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerfirooz = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
}
|
||
else if (num == 1) {
|
||
|
||
smarkeramol = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkeramol = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
}
|
||
else if (num == 2) {
|
||
|
||
smarkerGhRa = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerGhRa = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
}
|
||
else if (num == 3) {
|
||
|
||
smarkerrasht = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerrasht = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
} else if (num == 4) {
|
||
|
||
smarkerKarCh = L.marker([35.8121955, 51.0073853], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerKarCh = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
} else if (num == 5) {
|
||
smarkerThSe = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerThSe = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
|
||
} else if (num == 6) {
|
||
smarkertabriz = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkertabriz = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
|
||
}
|
||
else if (num == 7) {
|
||
|
||
smarkerThKer = L.marker([first[0], first[1]], { icon: startAbrarDivIcon }).addTo(map);
|
||
emarkerThKer = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(map);
|
||
}
|
||
|
||
// var pointA = new L.LatLng(28.635308, 77.22496);
|
||
// var pointB = new L.LatLng(28.984461, 77.70641);
|
||
// var pointList = [pointA, pointB];
|
||
|
||
|
||
for (var i = 0; i < routeControls.length; i++) {
|
||
console.log("routeControls", routeControls[i].options.waypoints[1].lat)
|
||
|
||
}
|
||
console.log("routeControls", routeControls)
|
||
if ($(".leaflet-routing-container").length) {
|
||
$(".leaflet-routing-container").remove();
|
||
}
|
||
|
||
}
|
||
// function calculateRouteCoridor(first, last, num) {
|
||
// console.log("desttt", destMarkerArr)
|
||
// startRoute = [];
|
||
// testRoute = [];
|
||
// console.log("onlineTrafficLayer", onlineTrafficLayer)
|
||
// // showRmtoToll(1)
|
||
|
||
// $("#pin-marker-start").removeClass("pin-move pin-warn").addClass("pin-set");
|
||
// $("#pin-marker-end").removeClass("pin-move pin-warn").addClass("pin-set");
|
||
// let originValue = "تهران";
|
||
// let destinationValue = "چالوس";
|
||
// if (originValue && destinationValue) {
|
||
// let routeUrl, routeData;
|
||
|
||
// let origin= first[1] + "," + first[0];
|
||
// let destination= last[1] + "," + last[0];
|
||
// routeUrl = `https://testmap.141.ir/route/v1/driving/${origin};${destination}?overview=full&alternatives=true&steps=true`;
|
||
// $.ajax({
|
||
// url: routeUrl,
|
||
// type: "GET",
|
||
// // data: routeData,
|
||
// dataType: "json",
|
||
// success: function (data,showCoridorLayer) {
|
||
// console.log(data.routes[0].geometry)
|
||
// routeArray = decode(data.routes[0].geometry, 6)
|
||
// for (var i = 0; i < routeArray.length; i++) {
|
||
// routeArray[i]['lat'] = routeArray[i][0] / 10
|
||
// routeArray[i]['lng'] = routeArray[i][1] / 10
|
||
|
||
// }
|
||
// showCoridorLayer(routeArray , num);
|
||
|
||
// routeControlsPath.push(
|
||
// L.Routing.control({
|
||
// waypoints: [
|
||
// L.latLng(parseFloat(first[0]), parseFloat(first[1])),
|
||
// L.latLng(parseFloat(last[0]), parseFloat(last[1])),
|
||
// ],
|
||
// fitSelectedRoutes: false,
|
||
// draggableWaypoints: true,
|
||
// createMarker: function () {
|
||
// return null;
|
||
// },
|
||
// lineOptions: {
|
||
// addWaypoints: false,
|
||
// styles: [
|
||
// {
|
||
// color: '#1e90ff',
|
||
// opacity: 0.8,
|
||
// weight: 3,
|
||
// },
|
||
// ],
|
||
// },
|
||
// })
|
||
// .on("routesfound", function (e) {
|
||
// for (let index = 0; index < popupArraysPath.length; index++) {
|
||
// if (popupArraysPath[index] !== null) {
|
||
// map.removeLayer(popupArraysPath[index]);
|
||
// }
|
||
// }
|
||
|
||
// /*let popup = new L.Popup({
|
||
// 'maxWidth': '300',
|
||
// 'maxHeight': '150',
|
||
// 'className': 'customRouteEstimate'
|
||
// });
|
||
|
||
// let popupLocation = new L.LatLng(e.routes[0].coordinates[parseInt(e.routes[0]
|
||
// .coordinates
|
||
// .length /
|
||
// 2)].lat,
|
||
// e.routes[0].coordinates[parseInt(e.routes[0].coordinates.length / 2)]
|
||
// .lng);
|
||
// let popupContent = "<span style=\"color:#FF5630 ; font-size:11px\">مسافت : </span>" + parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2) + " کیلومتر";
|
||
// popup.setLatLng(popupLocation);
|
||
// popup.setContent(popupContent);
|
||
// popupArraysPath.push(popup);
|
||
// map.addLayer(popup);*/
|
||
// })
|
||
// .addTo(map)
|
||
// );
|
||
|
||
// }
|
||
// });
|
||
// } else {
|
||
// // console.log("NO ROUTING");
|
||
// }
|
||
// }
|
||
|
||
function showDistancePopup(routes) {
|
||
var customOptions = {
|
||
maxWidth: "300",
|
||
maxHeight: "150",
|
||
className: "customRouteEstimate",
|
||
closeOnClick: false,
|
||
};
|
||
|
||
for (let index = 0; index < routes.length; index++) {
|
||
var popup = new L.Popup(customOptions);
|
||
|
||
let divideBy = parseInt(routes[index].legs[0].steps.length / 2);
|
||
// console.log(divideBy);
|
||
let popupCoordinates = routes[index].legs[0].steps[divideBy].start_location;
|
||
|
||
var popupLocation = new L.LatLng(popupCoordinates[1], popupCoordinates[0]);
|
||
|
||
var popupContent =
|
||
'<span style="color:#FF5630 ; font-size:11px">مسافت: </span>' +
|
||
returnRouteDistance(routes[index].legs) +
|
||
" کیلومتر" +
|
||
"<br> " +
|
||
'<span style="color:#FF5630 ;font-size:11px">زمان: </span>' +
|
||
returnRouteDuration(routes[index].legs);
|
||
|
||
popup.setLatLng(popupLocation);
|
||
popup.setContent(popupContent);
|
||
|
||
popupArrays.push(popup);
|
||
map.addLayer(popup);
|
||
}
|
||
}
|
||
|
||
function returnRouteDistance(legs) {
|
||
let routeDistance;
|
||
if (middleLat != "") {
|
||
routeDistance = legs[0].distance.value + legs[1].distance.value;
|
||
routeDistance = parseInt(routeDistance / 1000);
|
||
} else {
|
||
routeDistance = legs[0].distance.value;
|
||
routeDistance = parseInt(routeDistance / 1000);
|
||
}
|
||
return routeDistance;
|
||
}
|
||
|
||
function returnRouteDuration(legs) {
|
||
let routeDuration;
|
||
if (middleLat != "") {
|
||
routeDuration = legs[0].duration.value + legs[1].duration.value;
|
||
} else {
|
||
routeDuration = legs[0].duration.value;
|
||
}
|
||
let hours = Math.floor(routeDuration / 3600);
|
||
let minutes = Math.floor((routeDuration % 3600) / 60);
|
||
let hoursText = hours > 0 ? hours + " ساعت" : "";
|
||
let minutesText =
|
||
minutes > 0 ? (hours > 0 ? " و " : "") + minutes + " دقیقه" : "";
|
||
return hoursText + minutesText;
|
||
}
|
||
|
||
function clearLayers() {
|
||
// Remove all layers
|
||
if (markerLayers != null) {
|
||
let activeLayerElements = document.querySelectorAll(".activeLayer");
|
||
if ($(activeLayerElements).length) {
|
||
$(activeLayerElements).each(function (index, element) {
|
||
$(element)
|
||
.find("img")
|
||
.attr(
|
||
"src",
|
||
returnLayerImage(
|
||
layerFlags.findIndex(function (flag) {
|
||
return flag == 1;
|
||
}),
|
||
1
|
||
)
|
||
);
|
||
$(element).removeClass("activeLayer");
|
||
});
|
||
}
|
||
map.removeLayer(marker141Layers);
|
||
marker141Layers = null;
|
||
marker141List = [];
|
||
// console.log("rmto layer before remove", RMTOLayers);
|
||
// console.log("rmto list before remove", RMTOList);
|
||
|
||
}
|
||
console.log("lll", marker141Layers)
|
||
|
||
}
|
||
|
||
function clearMap() {
|
||
for (i in map._layers) {
|
||
if (map._layers[i]._path != undefined) {
|
||
// console.log("pitikoo" ,map._layers )
|
||
|
||
// console.log(";l;l;'l;l",map._layers[i])
|
||
try {
|
||
console.log("ii", i)
|
||
console.log("maplayers", map._layers[i])
|
||
map.removeLayer(map._layers[193]);
|
||
map.removeLayer(map._layers[195]);
|
||
}
|
||
catch (e) {
|
||
console.log("problem with " + e + map._layers[i]);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function decode(src, precision) {
|
||
var i = 0;
|
||
var lat = 0;
|
||
var lng = 0;
|
||
var filteredCallSets = [];
|
||
var shift = 0;
|
||
var result = 0;
|
||
var digit = null;
|
||
var latDelta;
|
||
var granularity;
|
||
var count = Math.pow(10, Number.isInteger(precision) ? precision : 5);
|
||
for (; i < src.length;) {
|
||
digit = null;
|
||
shift = 0;
|
||
result = 0;
|
||
do {
|
||
digit = src.charCodeAt(i++) - 63;
|
||
result = result | (digit & 31) << shift;
|
||
shift = shift + 5;
|
||
} while (digit >= 32);
|
||
latDelta = result & 1 ? ~(result >> 1) : result >> 1;
|
||
shift = result = 0;
|
||
do {
|
||
digit = src.charCodeAt(i++) - 63;
|
||
result = result | (digit & 31) << shift;
|
||
shift = shift + 5;
|
||
} while (digit >= 32);
|
||
granularity = result & 1 ? ~(result >> 1) : result >> 1;
|
||
lat = lat + latDelta;
|
||
lng = lng + granularity;
|
||
filteredCallSets.push([lat / count, lng / count]);
|
||
}
|
||
return filteredCallSets;
|
||
}
|
||
|
||
|
||
function showCoridorLayer(routeArray, num) {
|
||
showLoaderScreen()
|
||
$.post(
|
||
"https://rms.rmto.ir/api/RahesEsential/all",
|
||
{
|
||
latlng: routeArray,
|
||
type: 1,
|
||
},
|
||
function (data) {
|
||
globalmodaldata = [];
|
||
globalmodaldata = data.data;
|
||
markershowdata = [];
|
||
markershowdata = data.data;
|
||
console.log("tets", num)
|
||
console.log(data.data);
|
||
hideLoaderScreen()
|
||
if (num == 0) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
// console.log(markershowdata[i].lat);
|
||
markerlis1 = L.marker([markershowdata[i].lat, markershowdata[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerfiroozkooh.push(markerlis1);
|
||
// if((markershowdata[i].color!=null) && (markershowdata[i].start_lat!=null) && (markershowdata[i].start_lng!=null) && (markershowdata[i].end_lat!=null) && (markershowdata[i].end_lng!=null))
|
||
// drawPathwithColor(markershowdata[i].start_lat,markershowdata[i].start_lng,markershowdata[i].end_lat,markershowdata[i].end_lng,markershowdata[i].color);
|
||
}
|
||
firoozlayer = L.layerGroup(markerfiroozkooh);
|
||
map.addLayer(firoozlayer);
|
||
}
|
||
if (num == 1) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerli2 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markeramol.push(markerli2);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
amollayer = L.layerGroup(markeramol);
|
||
map.addLayer(amollayer);
|
||
}
|
||
if (num == 2) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis3 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerrasht.push(markerlis3);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
rashtlayer = L.layerGroup(markerrasht);
|
||
map.addLayer(rashtlayer);
|
||
}
|
||
if (num == 3) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis4 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerrashtnew.push(markerlis4);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
newrashtlayer = L.layerGroup(markerrashtnew);
|
||
map.addLayer(newrashtlayer);
|
||
}
|
||
if (num == 4) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis5 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerchaloos.push(markerlis5);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
chalooslayer = L.layerGroup(markerchaloos);
|
||
map.addLayer(chalooslayer);
|
||
}
|
||
if (num == 5) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis6 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markersemnan.push(markerlis6);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
semnanlayer = L.layerGroup(markersemnan);
|
||
map.addLayer(semnanlayer);
|
||
}
|
||
if (num == 6) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis7 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markertabriz.push(markerlis7);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
tabrizlayer = L.layerGroup(markertabriz);
|
||
map.addLayer(tabrizlayer);
|
||
|
||
}
|
||
if (num == 7) {
|
||
for (let i = 0; i < data.length; i++) {
|
||
markerlis8 = L.marker([data[i].lat, data[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
})
|
||
.bindPopup(getpopupcoridor(data[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerkermanshah.push(markerlis8);
|
||
if (data[i].color)
|
||
drawPathwithColor(data[i].lat_from, data[i].lng_from, data[i].lat_to, data[i].lng_to, data[i].color);
|
||
}
|
||
kermanlayer = L.layerGroup(markerkermanshah);
|
||
map.addLayer(kermanlayer);
|
||
|
||
}
|
||
|
||
}
|
||
);
|
||
|
||
|
||
// END Add slides / photos of camera to slideshow
|
||
}
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
}
|
||
});
|
||
function createLeafletMap(ekipP, startP, endP, update) {
|
||
// alert("ihii")
|
||
|
||
console.log("ekipP", ekipP)
|
||
console.log("startP", startP)
|
||
console.log("endP", endP)
|
||
console.log("update", update)
|
||
|
||
console.log("createLeafletMap");
|
||
|
||
|
||
let bounds = [
|
||
[42.9130026312, 75.6166317076],
|
||
[20.5782370061, 35.5092252948],
|
||
];
|
||
mapradar = new L.map("abrar-map", {
|
||
maxBounds: bounds,
|
||
minZoom: 6,
|
||
}).setView(ekipP, 14);
|
||
|
||
L.tileLayer("https://testmap.141.ir/141map/{z}/{x}/{y}.png", {}).addTo(
|
||
mapradar
|
||
);
|
||
if (endP[0] != null) {
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(startP);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(endP);
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
startAbrarMarker = new L.marker(startP, {
|
||
icon: startAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
ekipmarker = new L.marker(ekipP, {
|
||
icon: rahdariIconO,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
|
||
isSetStartAbrarMarker = true;
|
||
endAbrarMarker = new L.marker(endP, {
|
||
icon: endAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
isSetEndAbrarMarker = true;
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
checkMarkersAndDrawPath(update);
|
||
|
||
startAbrarMarker.on("click", function () {
|
||
console.log("clickstart");
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#coridoredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
|
||
// if(!endAbrarMarker){
|
||
// endAbrarMarker = new L.marker(endP, {
|
||
// icon: endAbrarDivIcon,
|
||
// draggable: true,
|
||
// });
|
||
// }
|
||
|
||
// endAbrarMarker.setLatLng(markerLatLng);
|
||
// endAbrarMarker.addTo(mapradar);
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-set")
|
||
.addClass("pin-move");
|
||
startAbrarMarker = new L.marker(ekipP, {
|
||
icon: startAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
ekipmarker = new L.marker(ekipP, {
|
||
icon: rahdariIconO,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
|
||
endAbrarMarker = new L.marker(endP, {
|
||
icon: endAbrarDivIconrahdar,
|
||
draggable: true,
|
||
});
|
||
startAbrarMarker.on("click", function () {
|
||
console.log("clickstart");
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#coridoredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
|
||
// if(!endAbrarMarker){
|
||
// endAbrarMarker = new L.marker(endP, {
|
||
// icon: endAbrarDivIcon,
|
||
// draggable: true,
|
||
// });
|
||
// }
|
||
|
||
endAbrarMarker.setLatLng(markerLatLng);
|
||
endAbrarMarker.addTo(mapradar);
|
||
}
|
||
});
|
||
}
|
||
|
||
mapradar.on("move", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker && !update) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
});
|
||
|
||
mapradar.on("moveend", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker && !update) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
});
|
||
|
||
|
||
|
||
if (endAbrarMarker) {
|
||
endAbrarMarker.on("click", function () {
|
||
console.log("clickend");
|
||
if (!isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetEndAbrarMarker = true;
|
||
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#coridoredit input[name=abrar-project-latlng-end]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
checkMarkersAndDrawPath(update);
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-endrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath(update);
|
||
});
|
||
|
||
endAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-endrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-endrahdar").hasClass("pin-set") || isSetEndAbrarMarker) {
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#coridoredit input[name=abrar-project-latlng-end]"
|
||
).removeClass("is-invalid-input");
|
||
$("#pin-marker-endrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath(update);
|
||
} else {
|
||
mapradar.setView(endAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
|
||
startAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-startrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath(update);
|
||
});
|
||
|
||
startAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-startrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-startrahdar").hasClass("pin-set") || isSetStartAbrarMarker) {
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#coridoredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
$("#pin-marker-startrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath(update);
|
||
} else {
|
||
mapradar.setView(startAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
|
||
function checkMarkersAndDrawPath(update) {
|
||
if (
|
||
$("#pin-marker-startrahdar").hasClass("pin-set") &&
|
||
!$("#pin-marker-startrahdar").hasClass("pin-move") &&
|
||
$("#pin-marker-endrahdar").hasClass("pin-set") &&
|
||
!$("#pin-marker-endrahdar").hasClass("pin-move")
|
||
) {
|
||
|
||
|
||
drawPath(update);
|
||
}
|
||
}
|
||
|
||
function drawPath(update) {
|
||
if (routeControls.length) {
|
||
$(routeControls).each(function (index, control) {
|
||
mapradar.removeControl(control);
|
||
routeControls.splice(routeControls.indexOf(index), 1);
|
||
});
|
||
}
|
||
|
||
// routeControls.push(
|
||
// L.polyline(
|
||
// [
|
||
// L.latLng(
|
||
// parseFloat(startAbrarMarker.getLatLng().lat),
|
||
// parseFloat(startAbrarMarker.getLatLng().lng)
|
||
// ),
|
||
// L.latLng(
|
||
// parseFloat(endAbrarMarker.getLatLng().lat),
|
||
// parseFloat(endAbrarMarker.getLatLng().lng)
|
||
// ),
|
||
// ],
|
||
// {
|
||
// color: "blue",
|
||
// weight: 3,
|
||
// opacity: 0.5,
|
||
// smoothFactor: 1,
|
||
// }
|
||
// )
|
||
// );
|
||
|
||
// map.addLayer(routeControls[0]);
|
||
|
||
routeControls.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(
|
||
parseFloat(startAbrarMarker.getLatLng().lat),
|
||
parseFloat(startAbrarMarker.getLatLng().lng)
|
||
),
|
||
L.latLng(
|
||
parseFloat(endAbrarMarker.getLatLng().lat),
|
||
parseFloat(endAbrarMarker.getLatLng().lng)
|
||
),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
|
||
draggableWaypoints: true,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: "#28a745",
|
||
opacity: 0.8,
|
||
weight: 5,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routingstart ", function (e) {
|
||
console.log("eeeeee", e)
|
||
})
|
||
// .on("routesfound", function (e) {
|
||
// var divideBy = 2;
|
||
|
||
// for (let index = 0; index < popupArrays.length; index++) {
|
||
// map.removeLayer(popupArrays[index]);
|
||
// }
|
||
|
||
// var customOptions = {
|
||
// maxWidth: "300",
|
||
// maxHeight: "150",
|
||
// className: "customRouteEstimate",
|
||
// };
|
||
// var popup = new L.Popup(customOptions);
|
||
|
||
// var popupLocation = new L.LatLng(
|
||
// e.routes[0].coordinates[
|
||
// parseInt(e.routes[0].coordinates.length / divideBy)
|
||
// ].lat,
|
||
// e.routes[0].coordinates[
|
||
// parseInt(e.routes[0].coordinates.length / divideBy)
|
||
// ].lng
|
||
// );
|
||
|
||
// var popupContent =
|
||
// '<span style="color:#FF5630; font-size:11px; font-family: IRANSansFaNum;">مسافت: </span>' +
|
||
// parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2) +
|
||
// " کیلومتر";
|
||
|
||
// saveTotalDistance = parseFloat(
|
||
// parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2)
|
||
// );
|
||
|
||
// popup.setLatLng(popupLocation);
|
||
// popup.setContent(popupContent);
|
||
|
||
// popupArrays.push(popup);
|
||
// map.addLayer(popup);
|
||
|
||
// // showItemSelectionModal();
|
||
// })
|
||
.addTo(mapradar)
|
||
);
|
||
console.log("routeControls", routeControls)
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
}
|
||
function drawPathwithColor(lat_from, lng_from, lat_to, lng_to, color) {
|
||
console.log("hffffffffffffffffffffffffffffffffffffffff", lat_from, lng_from, lat_to, lng_to, color)
|
||
// alert("draw path with color",lat_to,color);
|
||
routecolor.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(
|
||
parseFloat(lat_from),
|
||
parseFloat(lng_from)
|
||
),
|
||
L.latLng(
|
||
parseFloat(lat_to),
|
||
parseFloat(lng_to)
|
||
),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
|
||
draggableWaypoints: false,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: color,
|
||
opacity: 1,
|
||
weight: 10,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routingstart ", function (e) {
|
||
console.log("eeeeee", e)
|
||
})
|
||
// .on("routesfound", function (e) {
|
||
// var divideBy = 2;
|
||
|
||
// for (let index = 0; index < popupArrays.length; index++) {
|
||
// map.removeLayer(popupArrays[index]);
|
||
// }
|
||
|
||
// var customOptions = {
|
||
// maxWidth: "300",
|
||
// maxHeight: "150",
|
||
// className: "customRouteEstimate",
|
||
// };
|
||
// var popup = new L.Popup(customOptions);
|
||
|
||
// var popupLocation = new L.LatLng(
|
||
// e.routes[0].coordinates[
|
||
// parseInt(e.routes[0].coordinates.length / divideBy)
|
||
// ].lat,
|
||
// e.routes[0].coordinates[
|
||
// parseInt(e.routes[0].coordinates.length / divideBy)
|
||
// ].lng
|
||
// );
|
||
|
||
// var popupContent =
|
||
// '<span style="color:#FF5630; font-size:11px; font-family: IRANSansFaNum;">مسافت: </span>' +
|
||
// parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2) +
|
||
// " کیلومتر";
|
||
|
||
// saveTotalDistance = parseFloat(
|
||
// parseFloat(e.routes[0].summary.totalDistance / 1000.0).toFixed(2)
|
||
// );
|
||
|
||
// popup.setLatLng(popupLocation);
|
||
// popup.setContent(popupContent);
|
||
|
||
// popupArrays.push(popup);
|
||
// map.addLayer(popup);
|
||
|
||
// // showItemSelectionModal();
|
||
// })
|
||
.addTo(map)
|
||
);
|
||
console.log("routeControls", routeControls)
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
}
|
||
|
||
function initialMarkerMapValue(latP, lngP, startPin, endPin, update) {
|
||
console.log("initialMarkerMapValue");
|
||
if (endPin[0] == null) {
|
||
if (isSetStartAbrarMarker) {
|
||
endAbrarMarker.remove();
|
||
}
|
||
isSetEndAbrarMarker = false;
|
||
startAbrarMarker.setLatLng([latP, lngP]);
|
||
endAbrarMarker.setLatLng([latP, lngP]);
|
||
|
||
isSetStartAbrarMarker = false;
|
||
removeStartToEndPath(0);
|
||
// $("#pin-marker-startrahdar").removeClass("pin-marker pin-set");
|
||
$("#pin-marker-endrahdar").removeClass("pin-marker pin-set");
|
||
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val("");
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val("");
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
console.log("createLeafletMap");
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-set")
|
||
.addClass("pin-move");
|
||
startAbrarMarker.on("click", function () {
|
||
console.log("clickstart");
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#rahdaredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
|
||
// if(!endAbrarMarker){
|
||
// endAbrarMarker = new L.marker(endP, {
|
||
// icon: endAbrarDivIcon,
|
||
// draggable: true,
|
||
// });
|
||
// }
|
||
|
||
endAbrarMarker.setLatLng(markerLatLng);
|
||
endAbrarMarker.addTo(mapradar);
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val(startPin);
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val(endPin);
|
||
isSetEndAbrarMarker = true;
|
||
isSetStartAbrarMarker = true;
|
||
startAbrarMarker.setLatLng(startPin);
|
||
endAbrarMarker.setLatLng(endPin);
|
||
checkMarkersAndDrawPath(update);
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
$("#pin-marker-endrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
startAbrarMarker.on("click", function () {
|
||
console.log("clickstart");
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#rahdaredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
|
||
// if(!endAbrarMarker){
|
||
// endAbrarMarker = new L.marker(endP, {
|
||
// icon: endAbrarDivIcon,
|
||
// draggable: true,
|
||
// });
|
||
// }
|
||
|
||
// endAbrarMarker.setLatLng(markerLatLng);
|
||
// endAbrarMarker.addTo(mapradar);
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
mapradar.setView([latP, lngP], 9);
|
||
ekipmarker.setLatLng([latP, lngP]);
|
||
|
||
|
||
|
||
|
||
mapradar.on("move", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker && !update) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
});
|
||
|
||
mapradar.on("moveend", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker && !update) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
});
|
||
|
||
|
||
|
||
if (endAbrarMarker) {
|
||
endAbrarMarker.on("click", function () {
|
||
console.log("clickend");
|
||
if (!isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetEndAbrarMarker = true;
|
||
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#rahdaredit input[name=abrar-project-latlng-end]"
|
||
).removeClass("is-invalid-input");
|
||
|
||
checkMarkersAndDrawPath(update);
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-endrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath(update);
|
||
});
|
||
|
||
endAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-endrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-endrahdar").hasClass("pin-set") || isSetEndAbrarMarker) {
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#rahdaredit input[name=abrar-project-latlng-end]"
|
||
).removeClass("is-invalid-input");
|
||
$("#pin-marker-endrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath(update);
|
||
} else {
|
||
mapradar.setView(endAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
|
||
startAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-startrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath(update);
|
||
});
|
||
|
||
startAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-startrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-startrahdar").hasClass("pin-set") || isSetStartAbrarMarker) {
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$(
|
||
"#rahdaredit input[name=abrar-project-latlng-start]"
|
||
).removeClass("is-invalid-input");
|
||
$("#pin-marker-startrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath(update);
|
||
} else {
|
||
mapradar.setView(startAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
function removeStartToEndPath(update) {
|
||
if (routeControls.length) {
|
||
$(routeControls).each(function (index, control) {
|
||
|
||
|
||
mapradar.removeControl(control);
|
||
|
||
routeControls.splice(routeControls.indexOf(index), 1);
|
||
});
|
||
}
|
||
}
|
||
$(function () {
|
||
|
||
$("#TeamList").jsGrid({
|
||
width: "100%",
|
||
height: "250px",
|
||
filtering: true,
|
||
editing: true,
|
||
sorting: true,
|
||
paging: true,
|
||
data: friends,
|
||
fields: [
|
||
{ name: "نام", type: "text", width: 100 },
|
||
{ name: "تلفن", type: "number", width: 50 },
|
||
// countries,
|
||
// { name: "Cool", type: "checkbox", width: 40, title: "Is Cool", sorting: false },
|
||
{ type: "control" }
|
||
]
|
||
})
|
||
|
||
|
||
$('#TeamList').css('font-size', '12px');
|
||
|
||
})
|
||
//=====================MAchines========================================//
|
||
$(function () {
|
||
|
||
$("#MachinList").jsGrid({
|
||
width: "100%",
|
||
height: "250px",
|
||
filtering: true,
|
||
editing: true,
|
||
sorting: true,
|
||
paging: true,
|
||
data: friends,
|
||
fields: [
|
||
{ name: "نوع دستگاه", type: "text", width: 100 },
|
||
{ name: "نام راننده", type: "text", width: 100 },
|
||
{ name: "تلفن", type: "number", width: 50 },
|
||
// countries,
|
||
// { name: "Cool", type: "checkbox", width: 40, title: "Is Cool", sorting: false },
|
||
{ type: "control" }
|
||
]
|
||
})
|
||
|
||
|
||
$('#MachinList').css('font-size', '12px');
|
||
|
||
})
|
||
|
||
|
||
|
||
var friends = [
|
||
{
|
||
Name: "Ada Lovelace",
|
||
Age: 36,
|
||
Country: 3,
|
||
Cool: true,
|
||
},
|
||
{
|
||
Name: "Grace Hopper",
|
||
Age: 85,
|
||
Country: 1,
|
||
Cool: true,
|
||
},
|
||
{
|
||
Name: "Alan Turing",
|
||
Age: 41,
|
||
Country: 3,
|
||
Cool: true,
|
||
},
|
||
{
|
||
Name: "Miguel Alcubierre",
|
||
Age: 53,
|
||
Country: 5,
|
||
Cool: true,
|
||
}
|
||
];
|
||
|
||
var countries = {
|
||
name: "Country",
|
||
type: "select",
|
||
items: [
|
||
{ Name: "", Id: 0 },
|
||
{ Name: "United States", Id: 1 },
|
||
{ Name: "France", Id: 2 },
|
||
{ Name: "United Kingdom", Id: 3 },
|
||
{ Name: "Spain", Id: 4 },
|
||
{ Name: "Mexico", Id: 5 }
|
||
],
|
||
valueField: "Id",
|
||
textField: "Name"
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
//===========================================
|
||
window.onload = init();
|
||
|
||
function init() {
|
||
const accordion_items = document.querySelectorAll(".accordion_title");
|
||
for (var i = 0; i < accordion_items.length; i++) {
|
||
accordion_items[i].addEventListener("click", function () {
|
||
this.nextElementSibling.classList.toggle("show");
|
||
this.classList.toggle("active");
|
||
if (this.classList.contains("active")) {
|
||
this.nextElementSibling.style.height =
|
||
|
||
this.nextElementSibling.children[0].clientHeight + 10 + "px";
|
||
} else {
|
||
this.nextElementSibling.style.height = 0;
|
||
}
|
||
});
|
||
}
|
||
}
|
||
//==================================================
|
||
function restrictInputOtherThanArabic($field) {
|
||
// Arabic characters fall in the Unicode range 0600 - 06FF
|
||
var arabicCharUnicodeRange = /[\u0600-\u06FF-0-9-45]/;
|
||
|
||
$field.bind("keypress", function (event) {
|
||
var key = event.which;
|
||
// 0 = numpad
|
||
// 8 = backspace
|
||
// 32 = space
|
||
if (key == 8 || key == 0 || key === 32) {
|
||
return true;
|
||
}
|
||
|
||
var str = String.fromCharCode(key);
|
||
if (arabicCharUnicodeRange.test(str)) {
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
});
|
||
}
|
||
|
||
restrictInputOtherThanArabic($("#ROfficeAgent"));
|
||
restrictInputOtherThanArabic($("#houserahdarcoridor"));
|
||
restrictInputOtherThanArabic($("#ROfficeAgentTell"));
|
||
restrictInputOtherThanArabic($("#ekipname"));
|
||
restrictInputOtherThanArabic($("#ekipphone"));
|
||
restrictInputOtherThanArabic($("#typeofdastgah"));
|
||
restrictInputOtherThanArabic($("#machiner_name"));
|
||
restrictInputOtherThanArabic($("#telephone_num"));
|
||
|