private Locateable AsLocateable(Ham.SpatialBase.Point webMercatorPoint, Color color) { return(new Locateable(MapProjects.WebMercatorToGeodeticWgs84(webMercatorPoint)) { Element = new Circle(1, new SolidColorBrush(color)) }); }
public CoordinateMarker(double mercatorX, double mercatorY, bool changeToDms = false) { InitializeComponent(); this._current = coordinates.Geodetic; this.ChangeToDms = changeToDms; this.MercatorLocation = new IRI.Ham.SpatialBase.Point(mercatorX, mercatorY); //this.X = mercatorX; //this.Y = mercatorY; }
private Ham.SpatialBase.Point FromWebMercator(Ham.SpatialBase.Point webMercatorPoint) { var geodetic = IRI.Ham.CoordinateSystem.MapProjection.MapProjects.WebMercatorToGeodeticWgs84(webMercatorPoint); if (IsUTMEditingMode) { this.CurrentEditingZone = IRI.Ham.CoordinateSystem.MapProjection.MapProjects.FindZone(geodetic.X); return(IRI.Ham.CoordinateSystem.MapProjection.MapProjects.GeodeticToUTM(geodetic)); } else if (IsGeodeticWgs84EditingMode) { return(geodetic); } else { throw new NotImplementedException(); } }
private void Add(Locateable mainLocateable) { var index = _mainLocateables.IndexOf(mainLocateable); if (index == 0) { return; } var point = new Ham.SpatialBase.Point((mainLocateable.X + _mainLocateables[index - 1].X) / 2.0, (mainLocateable.Y + _mainLocateables[index - 1].Y) / 2.0); var newMainLocateable = AsLocateable(point, Colors.Green); newMainLocateable.OnPositionChanged += mainLocateable_OnPositionChanged; newMainLocateable.Element.MouseRightButtonDown += (sender, e) => { mainElement_MouseRightButtonDown(newMainLocateable, e); }; var newControl1 = AsLocateable(point, Colors.Gray); newControl1.OnPositionChanged += controlLocateable_OnPositionChanged; var newControl2 = AsLocateable(point, Colors.Gray); newControl2.OnPositionChanged += controlLocateable_OnPositionChanged; _mainLocateables.Insert(index, newMainLocateable); mercatorPolyline.Insert(index, point); _controlLocateables.Insert(2 * index - 1, newControl2); _controlLocateables.Insert(2 * index - 1, newControl1); Refresh(); }
public void ZoomToGoogleScale(int googleScale, Ham.SpatialBase.Point center) { this.RequestZoomToGoogleScale?.Invoke(center, googleScale); }
public void Zoom(double mapScale, Ham.SpatialBase.Point center) { this.RequestZoomToPoint?.Invoke(center, mapScale); }
public void ZoomToLevelAndCenter(int zoomLevel, Ham.SpatialBase.Point centerMapPoint, Action callback = null, bool withAnimation = true) { this.RequestZoomToLevelAndCenter?.Invoke(zoomLevel, centerMapPoint, callback, withAnimation); }
public void PanTo(Ham.SpatialBase.Point point, Action callback) { this.RequestPanTo?.Invoke(point, callback); }
public void FlashPoint(Ham.SpatialBase.Point point) { this.RequestFlashPoint?.Invoke(point); }
public void UpdateCurrentEditingPoint(Ham.SpatialBase.Point webMercatorPoint) { MapPanel.UpdateCurrentEditingPoint(webMercatorPoint); }