예제 #1
0
 /// <summary>
 /// Fires the zoom to layer event.
 /// </summary>
 protected virtual void OnZoomToLayer()
 {
     if (Extent != null && !Extent.IsEmpty())
     {
         // changed by jany_ (2015-07-17) zooming to an empty layer makes no sense
         ZoomToLayer?.Invoke(this, new EnvelopeArgs(Extent.ToEnvelope()));
     }
 }
예제 #2
0
        /// <summary>
        /// Fires the zoom to layer event.
        /// </summary>
        protected virtual void OnZoomToLayer()
        {
            var h = ZoomToLayer;

            if (h != null && !Extent.IsEmpty()) // changed by jany_ (2015-07-17) zooming to an empty layer makes no sense
            {
                h(this, new EnvelopeArgs(Extent.ToEnvelope()));
            }
        }
예제 #3
0
        public void ExtentIntersectionTest(double xmin1, double ymin1, double xmax1, double ymax1, double xmin2, double ymin2, double xmax2, double ymax2, double xmin3, double ymin3, double xmax3, double ymax3, bool empty)
        {
            Extent e1  = new(xmin1, ymin1, xmax1, ymax1);
            Extent e2  = new(xmin2, ymin2, xmax2, ymax2);
            Extent res = new(xmin3, ymin3, xmax3, ymax3);

            Extent intersection = e1.Intersection(e2);

            Assert.AreEqual(res, intersection, "ExtentIntersection");
            Assert.AreEqual(empty, intersection.IsEmpty(), "ExtentIntersection.IsEmpty");
        }
예제 #4
0
        public void ExtentIsEmptyTest(double xmin, double xmax, double ymin, double ymax, bool expectedResult)
        {
            var extent = new Extent(xmin, ymin, xmax, ymax);

            Assert.AreEqual(expectedResult, extent.IsEmpty());
        }