|
|
@ -130,19 +130,19 @@ var Map = function (parent) { |
|
|
|
}; |
|
|
|
|
|
|
|
this.OnMapMove = function (e) { |
|
|
|
$('.latlng').text('当前经纬度:{0}, {1}'.format(this.getLatLng(e.latlng.lng), this.getLatLng(e.latlng.lat))) |
|
|
|
$('.latlng').text('当前经纬度:{0}, {1}'.format(this.getLatLng(e.latlng.lng), this.getLatLng(e.latlng.lat))); |
|
|
|
}; |
|
|
|
|
|
|
|
this.getLatLng = function (value) { |
|
|
|
value = value.toString() |
|
|
|
let index = value.indexOf('.') |
|
|
|
value = value.toString(); |
|
|
|
let index = value.indexOf('.'); |
|
|
|
if (index !== -1) { |
|
|
|
value = value.substring(0, 6 + index + 1) |
|
|
|
value = value.substring(0, 6 + index + 1); |
|
|
|
} else { |
|
|
|
value = value.substring(0) |
|
|
|
} |
|
|
|
return parseFloat(value).toFixed(6) |
|
|
|
value = value.substring(0); |
|
|
|
} |
|
|
|
return parseFloat(value).toFixed(6); |
|
|
|
}; |
|
|
|
|
|
|
|
this.GetLineConfig = function () { |
|
|
|
$.ajax({ |
|
|
@ -150,7 +150,6 @@ var Map = function (parent) { |
|
|
|
dataType: 'json', |
|
|
|
url: '/Config/All', |
|
|
|
success: function (result) { |
|
|
|
console.log() |
|
|
|
this.lineColor = result.find(function (item) { |
|
|
|
return item.Id === 'line-color'; |
|
|
|
}).Value; |
|
|
@ -731,8 +730,8 @@ var Map = function (parent) { |
|
|
|
lat: item.Latitude, |
|
|
|
lng: item.Longitude |
|
|
|
}; |
|
|
|
this.AddInfoPoint(point, item.Title, item.Icon, item.Id) |
|
|
|
}.bind(this)) |
|
|
|
this.AddInfoPoint(point, item.Title, item.Icon, item.Id); |
|
|
|
}.bind(this)); |
|
|
|
}.bind(this) |
|
|
|
}); |
|
|
|
}; |
|
|
@ -766,7 +765,7 @@ var Map = function (parent) { |
|
|
|
this.InfoPoint.ShowDialog(e.latlng); |
|
|
|
else |
|
|
|
return; |
|
|
|
}.bind(this)) |
|
|
|
}.bind(this)); |
|
|
|
}; |
|
|
|
|
|
|
|
this.AddInfoPoint = function (point, title, icon, id) { |
|
|
@ -788,13 +787,13 @@ var Map = function (parent) { |
|
|
|
dataType: 'text', |
|
|
|
url: '/Point/Delete', |
|
|
|
data: { |
|
|
|
id: id, |
|
|
|
id: id |
|
|
|
}, |
|
|
|
success: function () { |
|
|
|
$('.info-point{0}'.format(id)).hide(); |
|
|
|
}.bind(this) |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
this.onSwitchClick = function () { |
|
|
|
this.isSwitch = true; |
|
|
|