internal static ArcGIS.Core.Geometry.Envelope ToEsriEnvelope(this Envelope envelope, ArcGIS.Core.Geometry.SpatialReference sr = null, bool hasZ = false, bool hasM = false) { var builder = new ArcGIS.Core.Geometry.EnvelopeBuilder(ArcGIS.Core.Geometry.EnvelopeBuilder.CreateEnvelope( envelope.MinX, envelope.MinY, envelope.MaxX, envelope.MaxY, sr)); //Assume 0 for Z if (hasZ) { builder.ZMin = 0; builder.ZMax = 0; } builder.HasZ = hasZ; builder.HasM = hasM; return(builder.ToGeometry()); }
/// MapView.PanToAsync(Geometry, TimeSpan?, bool) /// <example> /// <code title="Pan to Extent" description="Pan the active map view to an extent." region="Pan To Extent Asynchronous" source="..\..\ArcGIS\SharedArcGIS\SDK\Examples\ArcGIS.Desktop.Mapping\MapExploration\MapView_Examples.cs" lang="CS"/> /// </example> #region Pan To Extent Asynchronous public async Task <bool> PanToExtentAsync(double xMin, double yMin, double xMax, double yMax, ArcGIS.Core.Geometry.SpatialReference spatialReference) { //Get the active map view. var mapView = MapView.Active; if (mapView == null) { return(false); } //Create the envelope var envelope = await QueuedTask.Run(() => ArcGIS.Core.Geometry.EnvelopeBuilder.CreateEnvelope(xMin, yMin, xMax, yMax, spatialReference)); //Pan the view to a given extent. return(await mapView.PanToAsync(envelope, TimeSpan.FromSeconds(2))); }
/// MapView.PanTo(Geometry, TimeSpan?, bool) /// <example> /// <code title="Pan to Extent" description="Pan the active map view to an extent." region="Pan To Extent Synchronous" source="..\..\ArcGIS\SharedArcGIS\SDK\Examples\ArcGIS.Desktop.Mapping\MapExploration\MapView_Examples.cs" lang="CS"/> /// </example> #region Pan To Extent Synchronous public Task <bool> PanToExtentAsync(double xMin, double yMin, double xMax, double yMax, ArcGIS.Core.Geometry.SpatialReference spatialReference) { return(QueuedTask.Run(() => { //Get the active map view. var mapView = MapView.Active; if (mapView == null) { return false; } //Pan the view to a given extent. var envelope = ArcGIS.Core.Geometry.EnvelopeBuilder.CreateEnvelope(xMin, yMin, xMax, yMax, spatialReference); return mapView.PanTo(envelope); })); }
internal static ArcGIS.Core.Geometry.MapPoint ToMapPoint(this RBushCoord3D rbushCoord, ArcGIS.Core.Geometry.SpatialReference sr) { return(ArcGIS.Core.Geometry.MapPointBuilder.CreateMapPoint(rbushCoord.Coordinate3D, sr)); }