我正在通过Visual Studio运行ASP .NET应用程序。纬度和经度数据是从SQL Server数据库中检索的。通过Visual Studio本地主机运行时,该应用程序可以正常工作,但是当我将其部署到IIS时,显示的数据没有小数点。
数据库中的数据类型为浮点数。
TestTable模态类,用于从数据库中检索数据。
public class TestTable
{
public int ID { get; set; }
public string Product_Description { get; set; }
public int PolicyNo { get; set; }
public string Insured { get; set; }
public string TAB_Ratio { get; set; }
public string Broker_Name { get; set; }
public DateTime Policy_Inception_Date { get; set; }
public string Match { get; set; }
public string Detail_Address { get; set; }
public int Building_SI { get; set; }
public decimal Total_API_Outside { get; set; }
public decimal Rate { get; set; }
public decimal Total_Loss_Ratio { get; set; }
public decimal ThrdParty_Loss_ratio { get; set; }
public decimal ThrdParty_Attritional_Ratio { get; set; }
public double Lat { get; set; }
public double Long { get; set; }
}
Foreach从TestTable检索数据
@{ var mapCounter = 0;}
@foreach (var item in Model.TestTable) {
if(mapCounter < 200)
{
mapCounter++;
<text>
console.log(@item.Lat);
</text>
@:addMarker(@item.Lat,@item.Long,'@item.ID','@item.Product_Description','@item.Insured','@item.TAB_Ratio','@item.Broker_Name','@item.PolicyNo','@item.Match','@item.Detail_Address','@item.Building_SI','@item.Total_API_Outside','@item.Rate','@item.Total_Loss_Ratio','@item.ThrdParty_Loss_ratio','@item.ThrdParty_Attritional_Ratio');
}
}
基于数据库数据创建标记的功能
function addMarker(latitude,longitude,title,description,insured,tab_ratio,broker_name,policy_inception,match,detail_address,building_si,total_api_outside,rate,total_loss_ratio,thrdparty_loss_ratio,thrdparty_attritional_ratio)
{
var latLng = new google.maps.LatLng(latitude,longitude);
var marker = new google.maps.Marker({
position: latLng,title: title,map: map,icon: icon,draggable: false
});
allMarkers.push(marker);
}
请参阅控制台以获取输出。
Visual Studio的顶部图像。 IIS服务器的底部图像。
谢谢。