Dim latit As Double, longi As Double
Dim puntocober, puntocober2 As GeoPoint
Dim strpuntocober As String
PathOverlay1.Initialize(MapView1, Colors.Black)
MapView1.AddOverlay(PathOverlay1)
PathOverlay1.StrokeWidth=4
PathOverlay1.Alpha=128
For a = 0 To Main.listaGeoESP.Size - 1 'Main.listaGeoESP contains strings representing the coverage, corresponding to filenames in this format: "N45E022.zip"
'The idea is add a polygon for each file, covering all its area
strpuntocober = Main.listaGeoESP.Get(a)
latit = strpuntocober.SubString2(1,3) 'We take the latitude from the string
If strpuntocober.SubString2(0,1) = "S" Then
latit = -1 * latit 'If it was South, we convert it to negative
End If
longi = strpuntocober.SubString2(4,7) 'We do the same with the longitude
If strpuntocober.SubString2(3,4) = "W" Then
longi = -1 * longi
End If
puntocober.Initialize(latit, longi) 'Assign the values to the first point
puntocober2.Initialize(latit + 1, longi + 1) 'The second point is exactly 1 degree greater to the North and to the East
PathOverlay1.AddGreatCircle(puntocober, puntocober2, 100)
Next