Código vb:
Ver originalPublic Sub GetPositionForApi(ByVal Valor As String, ByVal y As String, ByVal x As String)
Dim strWeb As String = "<!DOCTYPE html>" & _
"<html>" & _
"<head>" & _
"<script src=""http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"">" & _
"</script>" & _
"<script>" & _
"var myCenter=new google.maps.LatLng(" + y + "," + x + ");" & _
"function initialize()" & _
"{" & _
"var mapProp = {" & _
"center:myCenter," & _
"zoom:8," & _
"mapTypeId:google.maps.MapTypeId.HYBRID" & _
"};" & _
"var map=new google.maps.Map(document.getElementById(""googleMap""),mapProp);" & _
"var marker=new google.maps.Marker({" & _
"position:myCenter" & _
"});" & _
"marker.setMap(map);" & _
"var infowindow = new google.maps.InfoWindow({" & _
"content:""" + Valor + """ " & _
"});" & _
"infowindow.open(map,marker);" & _
"}" & _
"google.maps.event.addDomListener(window, 'load', initialize);" & _
"</script>" & _
"</head>" & _
"<body>" & _
"<div id=""googleMap"" style=""width:1200px;height:360px;"" align=""center""><center></center></div>" & _
"</body>" & _
"</html>"
Try
Dim FILE_NAME As String = "C:\x.html"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(strWeb)
objWriter.Close()
wb.Navigate("C:\x.html")
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "Error al generar posición", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Por si esto puede resolverle a alguien así lo resolví, cargo este string en un WebBrowse a manera de que con un Timer cargo posiciones con los parámetros X y Y, y el parámetro Valor sirve para generar el punto con un dialog y un comentario.
saludos!