Torna al Thread
Private Sub btnHTML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHTML.Click
Dim txtLO As String = txtLON.Text
Dim txtLA As String = txtLAT.Text
txtLO = txtLO.Replace("°", "")
txtLA = txtLA.Replace("°", "")
txtLO = txtLO.Replace("'", "")
txtLA = txtLA.Replace("'", "")
txtLO = txtLO.Replace("""", "")
txtLA = txtLA.Replace("""", "")
Dim txtN() As String = txtLO.Split(" ")
Dim txtE() As String = txtLA.Split(" ")
Dim dec_lat As String = txtN(0) + (txtN(1) / 60) + (txtN(2) / 3600)
Dim dec_lon As String = txtE(0) + (txtE(1) / 60) + (txtE(2) / 3600)
WebBrowser1.DocumentText = _
"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">" & vbCrLf & _
"<html>" & vbCrLf & _
"<head>" & vbCrLf & _
"<title></title> " & vbCrLf & _
"<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">" & _
"<script type=""text/javascript"" src=""http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2""></script>" & _
"<script type=""text/javascript"" > " & vbCrLf & _
"var map = null;" & vbCrLf & _
"var pinid = 0; " & vbCrLf & _
"function GetMap() " & vbCrLf & _
"{ " & vbCrLf & _
"map = new VEMap('myMap'); " & vbCrLf & _
"map.LoadMap(); " & vbCrLf & _
"map.LoadMap(new VELatLong(" & dec_lat.Replace(",", ".") & "," & dec_lon.Replace(",", ".") & "), 15 ,'r' ,false); " & vbCrLf & _
"} " & vbCrLf & _
"function AddPushpin() " & vbCrLf & _
"{ " & vbCrLf & _
"var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter()); " & vbCrLf & _
"shape.SetTitle('My pushpin'); " & vbCrLf & _
"shape.SetDescription('This is shape number '+pinid); " & vbCrLf & _
"pinid++; " & vbCrLf & _
"map.AddShape(shape); " & vbCrLf & _
"} " & vbCrLf & _
"</script> " & vbCrLf & _
"</head> " & vbCrLf & _
"<body onload=""GetMap();AddPushpin();"" > " & vbCrLf & _
"<div id='myMap' style=""position:absolute; width:95%; height:95%;""></div> " & vbCrLf & _
"</body> " & vbCrLf & _
"</html> "
End Sub