座標我試圖從一個MVC模式如何建立JavaScript數組的谷歌地圖使用MVC模式
var locations = [];
我通過Model努力構建循環使用數據數組,並建立數組像這樣:
@{var count = 0; }
@foreach (var item in Model.Locations)
{
locations[count] = new locations[@item.StreetAddress, @item.Latitude, @item.Longitude, count+1];
count++;
}
有關如何完成此任務的任何想法?
所以你想循環througheach在模型中的項目,並將該項目添加到數組? – code