public void UpdateHexagonsInView() { if (Current.Instance.MapControl.Viewport.Resolution > 50) { ClearGraphics(); return; } if (!Enabled) { return; } var topLeft = Current.Instance.MapControl.Viewport.Extent.TopLeft; var bottomLeft = Current.Instance.MapControl.Viewport.Extent.BottomLeft; var bottomRight = Current.Instance.MapControl.Viewport.Extent.BottomRight; var topRight = Current.Instance.MapControl.Viewport.Extent.TopRight; var llTopLeft = SphericalMercator.ToLonLat(topLeft.X, topLeft.Y); var llbottomLeft = SphericalMercator.ToLonLat(bottomLeft.X, bottomLeft.Y); var llbottonRight = SphericalMercator.ToLonLat(bottomRight.X, bottomRight.Y); var llTopRight = SphericalMercator.ToLonLat(topRight.X, topRight.Y); var wkt = String.Format(CultureInfo.InvariantCulture, "POLYGON(({0} {1},{2} {3},{4} {5},{6} {7},{0} {1}))", llTopLeft.x, llTopLeft.y, llbottomLeft.x, llbottomLeft.y, llbottonRight.x, llbottonRight.y, llTopRight.x, llTopRight.y); landRequest.GetLandByWkt(wkt); }
public void UpdateHexagonsInView() { /* * if (Current.Instance.MapControl.Viewport.Resolution > 50) * { * ClearGraphics(); * return; * } * */ if (!Enabled) { return; } var topLeft = Current.Instance.MapControl.Viewport.Extent.TopLeft; var bottomLeft = Current.Instance.MapControl.Viewport.Extent.BottomLeft; var bottomRight = Current.Instance.MapControl.Viewport.Extent.BottomRight; var topRight = Current.Instance.MapControl.Viewport.Extent.TopRight; var llTopLeft = SphericalMercator.ToLonLat(topLeft.X, topLeft.Y); var llbottomLeft = SphericalMercator.ToLonLat(bottomLeft.X, bottomLeft.Y); var llbottonRight = SphericalMercator.ToLonLat(bottomRight.X, bottomRight.Y); var llTopRight = SphericalMercator.ToLonLat(topRight.X, topRight.Y); var wkt = String.Format(CultureInfo.InvariantCulture, "POLYGON(({0} {1},{2} {3},{4} {5},{6} {7},{0} {1}))", llTopLeft.x, llTopLeft.y, llbottomLeft.x, llbottomLeft.y, llbottonRight.x, llbottonRight.y, llTopRight.x, llTopRight.y); //Esto se ejecuta al principio o cuando haces una actualizacion landRequest.GetLandByWkt(wkt, Current.Instance.Earthwatcher.Lands.First().Id); }
void landRequests_ConfirmationAdded(object sender, EventArgs e) { if ((ConfirmationSort)sender == ConfirmationSort.Confirm) { if (!string.IsNullOrEmpty(selectedLand.DeforestationConfirmers)) { selectedLand.DeforestationConfirmers += ","; } selectedLand.DeforestationConfirmers += Current.Instance.Earthwatcher.Id.ToString(); } else { if (!string.IsNullOrEmpty(selectedLand.DeforestationDeconfirmers)) { selectedLand.DeforestationDeconfirmers += ","; } selectedLand.DeforestationDeconfirmers += Current.Instance.Earthwatcher.Id.ToString(); } if (!Current.Instance.Scores.Any(x => x.Action.Equals("ConfirmationAdded") && x.Published > selectedLand.LastReset)) { Current.Instance.AddScore.Add("ConfirmationAdded", 500); } var topLeft = Current.Instance.MapControl.Viewport.Extent.TopLeft; var bottomLeft = Current.Instance.MapControl.Viewport.Extent.BottomLeft; var bottomRight = Current.Instance.MapControl.Viewport.Extent.BottomRight; var topRight = Current.Instance.MapControl.Viewport.Extent.TopRight; var llTopLeft = SphericalMercator.ToLonLat(topLeft.X, topLeft.Y); var llbottomLeft = SphericalMercator.ToLonLat(bottomLeft.X, bottomLeft.Y); var llbottonRight = SphericalMercator.ToLonLat(bottomRight.X, bottomRight.Y); var llTopRight = SphericalMercator.ToLonLat(topRight.X, topRight.Y); var wkt = String.Format(CultureInfo.InvariantCulture, "POLYGON(({0} {1},{2} {3},{4} {5},{6} {7},{0} {1}))", llTopLeft.x, llTopLeft.y, llbottomLeft.x, llbottomLeft.y, llbottonRight.x, llbottonRight.y, llTopRight.x, llTopRight.y); landRequests.LandInViewReceived += LivLandInViewReceived; landRequests.GetLandByWkt(wkt); }