【发布时间】:2012-07-10 11:44:44
【问题描述】:
我已经使用 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)}]
谢谢
【问题讨论】:
-
您能否在您的问题中添加一个生成的 Json 示例?
标签: javascript vb.net json google-maps-api-3