0
我需要传递数据库中存储的经纬度值,通过GetLocation方法传递给javascript,我该怎么做?将数据库传递给Javascript
数据库表中的位置
LocationId
Latitude
Longitude
Name
BUSSINES类方法
public List<Location> GetLocation() { return Bd.Location.ToList(); }
JAVASCRIPT
function initMap() {
var mapCanvas = document.getElementById("map");
var mapOptions = {
center: new google.maps.LatLng(**Latitude** , **Longitude**), <--
zoom: 15
};
var map = new google.maps.Map(mapCanvas, mapOptions);
}
什么将它们存储数据 - 在DOM中的属性? –
你使用的是AngularJS这样的框架,还是这个javascript? –
没有框架,只是javascript – DedalusNine