I have gone through numerous samples and suggestions, but unfortunately, none of them seem to work effectively in my case.
When using winForms webControl, I am attempting to send an array of addresses to the Google Maps API for stops along the way.
Everything functions perfectly without the stops array. Below are snippets of the code:
JavaScript:
function calcRoute(origin,destination, way )
{
var waypts = [];
for (var i = 0; i < way.length; i++) {
waypts.push({
location:way[i],
stopover:true});}
.....
VB.net
Private Sub GetDirections_Click(sender As Object, e As EventArgs)
Dim origin As String = "1 Main St"
Dim destination As String = "200 Main St"
Dim wayP = New System.Web.Script.Serialization.JavaScriptSerializer().Serialize({"123Main St.", "189 Main St"})
InvokeScript("calcRoute", origin, destination, wayP)
End Sub
Private Function InvokeScript(name As String, ParamArray args As Object()) As Object
Return WebBrowser1.Document.InvokeScript(name, args)
End Function
EDIT: In JavaScript, the desired output should be:
[{
location:"10201"
},
{
location:"10202"
}]