void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { String result = e.Result; if (result.Equals("")) { MessageBox.Show("Could not find location"); } else { String[] lonLat = result.Split(','); if (lonLat.Length == 2) { if (!streetBox.Text.Equals("")) { gui.mapControl.Viewport.Resolution = 0.597164283; } else if (!cityBox.Text.Equals("")) { gui.mapControl.Viewport.Resolution = 9.554628534; } else if (!countryBox.Equals("")) { gui.mapControl.Viewport.Resolution = 611.496226172; } Mapsui.Geometries.Point sphericalLocation = SphericalMercator.FromLonLat(Double.Parse(lonLat[1], CultureInfo.InvariantCulture), Double.Parse(lonLat[0], CultureInfo.InvariantCulture)); gui.mapControl.Viewport.Center = sphericalLocation; //Toresolution has to be set somehow gui.mapControl.OnViewChanged(true); HideGoTo.Begin(); } else { MessageBox.Show("Can not use the returned values"); } } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { HideGoTo.Begin(); }