Browse Source

commit

master
hhx 3 years ago
parent
commit
4e92aaed1b
  1. 31
      04.系统编码/App/Content/scripts/beijing/map.js
  2. 32
      04.系统编码/App/Content/scripts/menggu/map.js

31
04.系统编码/App/Content/scripts/beijing/map.js

@ -58,6 +58,8 @@ var Map = function (parent) {
this.isSwitch = false; this.isSwitch = false;
this.isSelected = false; this.isSelected = false;
this.showTimeTags = true; this.showTimeTags = true;
this.lineColor = null;
this.lineWidth = null;
this.currentButton = { this.currentButton = {
cursorSelected: true, cursorSelected: true,
markSelected: true, markSelected: true,
@ -86,6 +88,7 @@ var Map = function (parent) {
this.InitCapture(); this.InitCapture();
this.LoadWindTemplate(); this.LoadWindTemplate();
this.LoadInfoPoint(); this.LoadInfoPoint();
this.GetLineConfig();
this.InfoPoint.Startup(); this.InfoPoint.Startup();
this.SelectPoint.Startup(); this.SelectPoint.Startup();
this.LatLngSwitch.Startup(); this.LatLngSwitch.Startup();
@ -141,6 +144,23 @@ var Map = function (parent) {
return parseFloat(value).toFixed(6) 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 () { this.OnParticleButtonClick = function () {
// Toggle switch on/off // Toggle switch on/off
var parent = $(event.target).parent(); var parent = $(event.target).parent();
@ -368,8 +388,8 @@ var Map = function (parent) {
this.AddData(features, result.backward.average); this.AddData(features, result.backward.average);
this.AddData(features, result.forward.average); this.AddData(features, result.forward.average);
this.AddPolyline(features, result.backward.points, '#ffffff', '#cccccc'); this.AddPolyline(features, result.backward.points, this.lineColor, '#cccccc', this.lineWidth);
this.AddPolyline(features, result.forward.points, '#ffffff', '#cccccc'); this.AddPolyline(features, result.forward.points, this.lineColor, '#cccccc', this.lineWidth);
this.AddCenter(features, param); this.AddCenter(features, param);
this.AddPoints(features, result.backward.points, 0.5, '#000000', '#ffffff'); this.AddPoints(features, result.backward.points, 0.5, '#000000', '#ffffff');
@ -384,7 +404,7 @@ var Map = function (parent) {
var features = new L.FeatureGroup(); var features = new L.FeatureGroup();
features.name = name; features.name = name;
this.AddPolyline(features, result, 'blue', '#000000'); this.AddPolyline(features, result, 'blue', '#000000', 2);
this.AddPoints(features, result, 1, 'blue', '#ffffff'); this.AddPoints(features, result, 1, 'blue', '#ffffff');
this.AddLabels(features, result, 'compare'); this.AddLabels(features, result, 'compare');
@ -404,7 +424,7 @@ var Map = function (parent) {
}.bind(this)); }.bind(this));
}; };
this.AddPolyline = function (features, points, color, fillColor) { this.AddPolyline = function (features, points, color, fillColor, weight) {
var polyline = []; var polyline = [];
$(points).each(function (index, point) { $(points).each(function (index, point) {
polyline.push([point[1], point[0]]); polyline.push([point[1], point[0]]);
@ -412,7 +432,7 @@ var Map = function (parent) {
L.polyline(polyline, { L.polyline(polyline, {
fillColor: fillColor, fillColor: fillColor,
color: color, color: color,
weight: 2 weight: weight
}).addTo(features); }).addTo(features);
}; };
@ -698,6 +718,7 @@ var Map = function (parent) {
this.LoadInfoPoint = function () { this.LoadInfoPoint = function () {
$.ajax({ $.ajax({
type: "POST", type: "POST",
async: false,
dataType: 'text', dataType: 'text',
url: '/Point/Query', url: '/Point/Query',
data: { data: {

32
04.系统编码/App/Content/scripts/menggu/map.js

@ -26,6 +26,8 @@ var Map = function (parent) {
this.isSwitch = false; this.isSwitch = false;
this.isSelected = false; this.isSelected = false;
this.showTimeTags = true; this.showTimeTags = true;
this.lineColor = null;
this.lineWidth = null;
this.currentButton = { this.currentButton = {
cursorSelected: true, cursorSelected: true,
markSelected: true, markSelected: true,
@ -44,6 +46,7 @@ var Map = function (parent) {
this.InitCapture(); this.InitCapture();
this.LoadWindTemplate(); this.LoadWindTemplate();
this.LoadInfoPoint(); this.LoadInfoPoint();
this.GetLineConfig();
this.InfoPoint.Startup(); this.InfoPoint.Startup();
this.SelectPoint.Startup(); this.SelectPoint.Startup();
this.LatLngSwitch.Startup(); this.LatLngSwitch.Startup();
@ -92,7 +95,24 @@ var Map = function (parent) {
value = value.substring(0) value = value.substring(0)
} }
return parseFloat(value).toFixed(6) 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 () { this.OnParticleButtonClick = function () {
// Toggle switch on/off // Toggle switch on/off
@ -266,8 +286,8 @@ var Map = function (parent) {
this.AddData(features, result.backward.average); this.AddData(features, result.backward.average);
this.AddData(features, result.forward.average); this.AddData(features, result.forward.average);
this.AddPolyline(features, result.backward.points); this.AddPolyline(features, result.backward.points, this.lineColor, this.lineWidth);
this.AddPolyline(features, result.forward.points); this.AddPolyline(features, result.forward.points, this.lineColor, this.lineWidth);
this.AddCenter(features, param); this.AddCenter(features, param);
this.AddPoints(features, result.backward.points); this.AddPoints(features, result.backward.points);
@ -291,15 +311,15 @@ var Map = function (parent) {
}.bind(this)); }.bind(this));
}; };
this.AddPolyline = function (features, points) { this.AddPolyline = function (features, points, color, weight) {
var polyline = []; var polyline = [];
$(points).each(function (index, point) { $(points).each(function (index, point) {
polyline.push([point[1], point[0]]); polyline.push([point[1], point[0]]);
}); });
L.polyline(polyline, { L.polyline(polyline, {
fillColor: '#1c9099', fillColor: '#1c9099',
color: 'white', color: color,
weight: 2 weight: weight
}).addTo(features); }).addTo(features);
}; };

Loading…
Cancel
Save