From 4e92aaed1b30700f16e6ba9d02296dbd3f7b9a7e Mon Sep 17 00:00:00 2001 From: hhx <1284857778@qq.com> Date: Fri, 11 Mar 2022 11:14:02 +0800 Subject: [PATCH] commit --- .../App/Content/scripts/beijing/map.js | 31 +++++++++++++++--- .../App/Content/scripts/menggu/map.js | 32 +++++++++++++++---- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/04.系统编码/App/Content/scripts/beijing/map.js b/04.系统编码/App/Content/scripts/beijing/map.js index 501f47b..85f987d 100644 --- a/04.系统编码/App/Content/scripts/beijing/map.js +++ b/04.系统编码/App/Content/scripts/beijing/map.js @@ -58,6 +58,8 @@ var Map = function (parent) { this.isSwitch = false; this.isSelected = false; this.showTimeTags = true; + this.lineColor = null; + this.lineWidth = null; this.currentButton = { cursorSelected: true, markSelected: true, @@ -86,6 +88,7 @@ var Map = function (parent) { this.InitCapture(); this.LoadWindTemplate(); this.LoadInfoPoint(); + this.GetLineConfig(); this.InfoPoint.Startup(); this.SelectPoint.Startup(); this.LatLngSwitch.Startup(); @@ -141,6 +144,23 @@ var Map = function (parent) { return parseFloat(value).toFixed(6) } + this.GetLineConfig = function () { + $.ajax({ + type: "POST", + dataType: 'json', + url: '/Config/All', + success: function (result) { + console.log() + this.lineColor = result.find(function (item) { + return item.Id === 'line-color'; + }).Value; + this.lineWidth = result.find(function (item) { + return item.Id === 'line-width'; + }).Value; + }.bind(this) + }); + }; + this.OnParticleButtonClick = function () { // Toggle switch on/off var parent = $(event.target).parent(); @@ -368,8 +388,8 @@ var Map = function (parent) { this.AddData(features, result.backward.average); this.AddData(features, result.forward.average); - this.AddPolyline(features, result.backward.points, '#ffffff', '#cccccc'); - this.AddPolyline(features, result.forward.points, '#ffffff', '#cccccc'); + this.AddPolyline(features, result.backward.points, this.lineColor, '#cccccc', this.lineWidth); + this.AddPolyline(features, result.forward.points, this.lineColor, '#cccccc', this.lineWidth); this.AddCenter(features, param); this.AddPoints(features, result.backward.points, 0.5, '#000000', '#ffffff'); @@ -384,7 +404,7 @@ var Map = function (parent) { var features = new L.FeatureGroup(); features.name = name; - this.AddPolyline(features, result, 'blue', '#000000'); + this.AddPolyline(features, result, 'blue', '#000000', 2); this.AddPoints(features, result, 1, 'blue', '#ffffff'); this.AddLabels(features, result, 'compare'); @@ -404,7 +424,7 @@ var Map = function (parent) { }.bind(this)); }; - this.AddPolyline = function (features, points, color, fillColor) { + this.AddPolyline = function (features, points, color, fillColor, weight) { var polyline = []; $(points).each(function (index, point) { polyline.push([point[1], point[0]]); @@ -412,7 +432,7 @@ var Map = function (parent) { L.polyline(polyline, { fillColor: fillColor, color: color, - weight: 2 + weight: weight }).addTo(features); }; @@ -698,6 +718,7 @@ var Map = function (parent) { this.LoadInfoPoint = function () { $.ajax({ type: "POST", + async: false, dataType: 'text', url: '/Point/Query', data: { diff --git a/04.系统编码/App/Content/scripts/menggu/map.js b/04.系统编码/App/Content/scripts/menggu/map.js index 4f95aa3..50b5e5c 100644 --- a/04.系统编码/App/Content/scripts/menggu/map.js +++ b/04.系统编码/App/Content/scripts/menggu/map.js @@ -26,6 +26,8 @@ var Map = function (parent) { this.isSwitch = false; this.isSelected = false; this.showTimeTags = true; + this.lineColor = null; + this.lineWidth = null; this.currentButton = { cursorSelected: true, markSelected: true, @@ -44,6 +46,7 @@ var Map = function (parent) { this.InitCapture(); this.LoadWindTemplate(); this.LoadInfoPoint(); + this.GetLineConfig(); this.InfoPoint.Startup(); this.SelectPoint.Startup(); this.LatLngSwitch.Startup(); @@ -92,7 +95,24 @@ var Map = function (parent) { value = value.substring(0) } return parseFloat(value).toFixed(6) - } + }; + + this.GetLineConfig = function () { + $.ajax({ + type: "POST", + dataType: 'json', + url: '/Config/All', + success: function (result) { + console.log() + this.lineColor = result.find(function (item) { + return item.Id === 'line-color'; + }).Value; + this.lineWidth = result.find(function (item) { + return item.Id === 'line-width'; + }).Value; + }.bind(this) + }); + }; this.OnParticleButtonClick = function () { // Toggle switch on/off @@ -266,8 +286,8 @@ var Map = function (parent) { this.AddData(features, result.backward.average); this.AddData(features, result.forward.average); - this.AddPolyline(features, result.backward.points); - this.AddPolyline(features, result.forward.points); + this.AddPolyline(features, result.backward.points, this.lineColor, this.lineWidth); + this.AddPolyline(features, result.forward.points, this.lineColor, this.lineWidth); this.AddCenter(features, param); this.AddPoints(features, result.backward.points); @@ -291,15 +311,15 @@ var Map = function (parent) { }.bind(this)); }; - this.AddPolyline = function (features, points) { + this.AddPolyline = function (features, points, color, weight) { var polyline = []; $(points).each(function (index, point) { polyline.push([point[1], point[0]]); }); L.polyline(polyline, { fillColor: '#1c9099', - color: 'white', - weight: 2 + color: color, + weight: weight }).addTo(features); };