private void btnSetBase_Click(object sender, EventArgs e) { if (!waypointmode) { if (!setbasemode) { ClearTracksAndMarkers(); setbasemode = true; ToggleDynamicDragging(); } else { BaseStationSet = true; BaseStation = GetCoords(); setbasemode = false; ToggleDynamicDragging(); SetMarkerAtCurrentLoc(); } } }
public LatLong[] GetWayPointCoords() { ArrayList latlongArray = new ArrayList(); string[] LATLONGS = webBrowser1.Document.GetElementById("message3").InnerHtml.Split(new string[] { "\"" }, StringSplitOptions.RemoveEmptyEntries); if (LATLONGS.Length > 2) { for (int i = 1; i < LATLONGS.Length - 1; i += 2) { latlongArray.Add(LATLONGS[i]); } LatLong[] latlong = new LatLong[latlongArray.Count/2]; int arrayCount = 0; for (int i = 0; i < latlongArray.Count; i++) { latlong[arrayCount].latitude = Convert.ToDouble(latlongArray[i]); latlong[arrayCount].longitude = Convert.ToDouble(latlongArray[++i]); arrayCount++; } return latlong; } return null; }