void MyMap_ExtentChanging(object sender, ESRI.ArcGIS.Client.ExtentEventArgs e)
        {
            Envelope ext = e.NewExtent;

            XMinText.Text = String.Format("MinX: {0}", Math.Round(ext.XMin, 3));
            YMinText.Text = String.Format("MinY: {0}", Math.Round(ext.YMin, 3));
            XMaxText.Text = String.Format("MaxX: {0}", Math.Round(ext.XMax, 3));
            YMaxText.Text = String.Format("MaxY: {0}", Math.Round(ext.YMax, 3));
        }
Beispiel #2
0
        private void MyMap_ExtentChanged(object sender, ESRI.ArcGIS.Client.ExtentEventArgs e)
        {
            Envelope newExtent = null;

            if (MyMap.WrapAroundIsActive)
            {
                Geometry normalizedExtent = Geometry.NormalizeCentralMeridian(e.NewExtent);
                if (normalizedExtent is Polygon)
                {
                    newExtent = new Envelope();

                    foreach (MapPoint p in (normalizedExtent as Polygon).Rings[0])
                    {
                        if (p.X < newExtent.XMin || double.IsNaN(newExtent.XMin))
                        {
                            newExtent.XMin = p.X;
                        }
                        if (p.Y < newExtent.YMin || double.IsNaN(newExtent.YMin))
                        {
                            newExtent.YMin = p.Y;
                        }
                    }

                    foreach (MapPoint p in (normalizedExtent as Polygon).Rings[1])
                    {
                        if (p.X > newExtent.XMax || double.IsNaN(newExtent.XMax))
                        {
                            newExtent.XMax = p.X;
                        }
                        if (p.Y > newExtent.YMax || double.IsNaN(newExtent.YMax))
                        {
                            newExtent.YMax = p.Y;
                        }
                    }
                }
                else if (normalizedExtent is Envelope)
                {
                    newExtent = normalizedExtent as Envelope;
                }
            }
            else
            {
                newExtent = e.NewExtent;
            }

            MinXNormalized.Text = newExtent.XMin.ToString("0.000");
            MinYNormalized.Text = newExtent.YMin.ToString("0.000");
            MaxXNormalized.Text = newExtent.XMax.ToString("0.000");
            MaxYNormalized.Text = newExtent.YMax.ToString("0.000");
        }
Beispiel #3
0
        /// <summary>
        ///  Internal handler for setting orientation of globe when map extent changes
        /// </summary>
        private void Map_ExtentChanged(object sender, ESRI.ArcGIS.Client.ExtentEventArgs args)
        {
            MapPoint center = Map.Extent.GetCenter();

            if (center.Y < -90)
            {
                center.Y = -90;
            }
            else if (center.Y > 90)
            {
                center.Y = 90;
            }
            SetViewCenter(new GeoPosition(center.Y, center.X));
        }
Beispiel #4
0
 /// <summary>
 /// React on extent changing.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Ignored.</param>
 private void _ExtentChanging(object sender, ESRI.ArcGIS.Client.ExtentEventArgs e)
 {
     _HideAddressPopups();
 }
 /// <summary>
 /// Overload of UpdateOVMap - ExtentEventHandler version
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateOVMap(object sender, ESRI.ArcGIS.Client.ExtentEventArgs e)
 {
     UpdateOVMap();
 }
Beispiel #6
0
 void MyMap_ExtentChange(object sender, ESRI.ArcGIS.Client.ExtentEventArgs args)
 {
     setExtentText(args.NewExtent);
 }