public void TestCalculateLookAtFolder()
        {
            var location = new Location
            {
                Latitude  = 0,
                Longitude = 0
            };

            var model = new Model
            {
                Location = location
            };

            var placemark = new Placemark
            {
                Geometry = model
            };

            var folder = new Folder();

            folder.AddFeature(placemark);

            LookAt lookat = folder.CalculateLookAt();

            Assert.That(lookat.Latitude, Is.EqualTo(0.0));
            Assert.That(lookat.Longitude, Is.EqualTo(0.0));
            Assert.That(lookat.Range, Is.EqualTo(1000.0));

            var point = new Point
            {
                Coordinate = new Vector(10, 10)
            };

            var overlay = new PhotoOverlay
            {
                Location = point
            };

            folder.AddFeature(overlay);
            lookat = folder.CalculateLookAt();
            Assert.That(lookat.Latitude, Is.EqualTo(5.0));
            Assert.That(lookat.Longitude, Is.EqualTo(5.0));
            Assert.That(lookat.Range, Is.EqualTo(1494183.4444).Within(0.0001));
        }
예제 #2
0
        public void TestCalculateLookAtFolder()
        {
            Location location = new Location();

            location.Latitude  = 0;
            location.Longitude = 0;

            Model model = new Model();

            model.Location = location;

            Placemark placemark = new Placemark();

            placemark.Geometry = model;

            Folder folder = new Folder();

            folder.AddFeature(placemark);

            var lookat = folder.CalculateLookAt();

            Assert.That(lookat.Latitude, Is.EqualTo(0.0));
            Assert.That(lookat.Longitude, Is.EqualTo(0.0));
            Assert.That(lookat.Range, Is.EqualTo(1000.0));

            Point point = new Point();

            point.Coordinate = new Vector(10, 10);

            PhotoOverlay overlay = new PhotoOverlay();

            overlay.Location = point;

            folder.AddFeature(overlay);
            lookat = folder.CalculateLookAt();
            Assert.That(lookat.Latitude, Is.EqualTo(5.0));
            Assert.That(lookat.Longitude, Is.EqualTo(5.0));
            Assert.That(lookat.Range, Is.EqualTo(1494183.4444).Within(0.0001));
        }