Beispiel #1
0
        public void TestLongitude()
        {
            Coordinate source = new Coordinate( 0 ,0 );
            Assert.AreEqual(0, source.Longitude);

            source = new Coordinate(0, -100);
            Assert.AreEqual(-100, source.Longitude);

            source = new Coordinate(0, -190);
            Assert.AreEqual(170, source.Longitude);

            source = new Coordinate(0, -360);
            Assert.AreEqual(0, source.Longitude);

            source = new Coordinate(0, 190);
            Assert.AreEqual(-170, source.Longitude);

            source = new Coordinate(0, 10000);
            Assert.AreEqual(-80, source.Longitude);
        }
Beispiel #2
0
        public void TestLatitude()
        {
            Coordinate source = new Coordinate(0, 0);
            Assert.AreEqual(0, source.Latitude);

            source = new Coordinate(-100, 0);
            Assert.AreEqual(80, source.Latitude);

            source = new Coordinate(90, 0);
            Assert.AreEqual(90, source.Latitude);

            source = new Coordinate(-180, 0);
            Assert.AreEqual(0, source.Latitude);

            source = new Coordinate(-90, 0);
            Assert.AreEqual(-90, source.Latitude);

            source = new Coordinate(10000, 0);
            Assert.AreEqual(-80, source.Latitude);
        }
Beispiel #3
0
        protected Point CalculateScreenPos(Coordinate objectCoord)
        {
            Point drawAt = new Point();

            double tileColumnPartly = 0;
            double tileRowPartly = 0;

            Calculator.GetTilesDoubleValue(objectCoord, zoom, ref tileColumnPartly, ref tileRowPartly);

            drawAt.X = -startDrawingPoint.X +  (int)(((tileColumnPartly - centerCoordTileColumnPartly) * 256) + halfWindowWidth);
            drawAt.Y = -startDrawingPoint.Y +  (int)(((tileRowPartly - centerCoordTileRowPartly) * 256) + halfWindowHeight);

            return drawAt;
        }
Beispiel #4
0
 /// <summary>
 /// 
 /// </summary>e
 /// <param name="mouseCoord"></param>
 /// <returns></returns>
 public virtual object HitTest(Coordinate mouseCoord)
 {
     return null;
 }