我已经使用 VB 创建了一个 JSON 标记对象。
Dim nearbyLocations = CType(sqldata.Select(DataSourceSelectArguments.Empty),
DataView)
For Each location As DataRowView In nearbyLocations
markers.Add(
String.Format(
"{{ title: ""AccName:{0}"", position: new google.maps.LatLng({1}, {2})}}",
location("accgrpname"),
location("Lat"),
location("Long")))
Next
Dim locationsJson = "[" & String.Join(",", markers.ToArray()) & "]"
我将如何在 javascript 中引用此对象以在地图上绘制?
最终的 JSON 如下:
[{ title: "AccName: Name", position: new google.maps.LatLng(51.0000, -0.1000)}]
谢谢