Exemplo n.º 1
0
        /// <summary>
        /// 지정한 위 경도로 이동
        /// </summary>
        /// <param name="latitude"></param>
        /// <param name="longitude"></param>
        /// <param name="altitude"></param>
        /// <param name="speed"></param>
        public void MoveFlyTo(double latitude, double longitude, double altitude, double speed)
        {
            try
            {
                if (this.ge == null)
                {
                    FileLogManager.GetInstance().WriteLog("[GEController] MoveFlyTo( GEPlugin is null. )");

                    throw new Exception("External Exception : GEPlugin is null.");
                }

                //맵 이동------------------------------------------시작
                double prevFlyToSpeed = ge.getOptions().getFlyToSpeed();
                ge.getOptions().setFlyToSpeed(speed);
                IKmlCamera camera = ge.getView().copyAsCamera(ge.ALTITUDE_RELATIVE_TO_GROUND);
                camera.setAltitude(altitude);
                camera.setLatitude(latitude);
                camera.setLongitude(longitude);
                camera.setHeading(360);
                ge.getView().setAbstractView(camera);
                ge.getOptions().setFlyToSpeed(prevFlyToSpeed);
                //맵 이동--------------------------------------------끝
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("MoveFlyTo Exception : " + ex.ToString());
                FileLogManager.GetInstance().WriteLog("[GEController] MoveFlyTo( " + ex.ToString() + " )");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get the current pluin view as a point object
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <returns>Point set to the current view</returns>
 public static IKmlPoint GetCurrentViewAsPoint(IGEPlugin ge)
 {
     IKmlLookAt lookat = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
     IKmlPoint point = ge.createPoint(String.Empty);
     point.set(
         lookat.getLatitude(),
         lookat.getLongitude(),
         lookat.getAltitude(),
         ge.ALTITUDE_RELATIVE_TO_GROUND,
         0,
         0);
     return point;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Create look at mode
        /// </summary>
        public void CreateLookAt()
        {
            KmlLookAtCoClass lookAt = ge.createLookAt("");

            lookAt.set(Latitude, Longitude, Altitude, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, Range);
            ge.getView().setAbstractView(lookAt);

            ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, 1);


            //create a point
            KmlPointCoClass point = ge.createPoint("");

            point.setLatitude(lookAt.getLatitude());
            point.setLongitude(lookAt.getLongitude());

            //create a placemark
            KmlPlacemarkCoClass placemark = ge.createPlacemark("");

            placemark.setName("Start Position");
            placemark.setGeometry(point);

            ge.getFeatures().appendChild(placemark);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Look at the given coordinates
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <param name="latitude">latitude in decimal degrees</param>
 /// <param name="longitude">longitude in decimal degrees</param>
 public static void LookAt(IGEPlugin ge, double latitude, double longitude)
 {
     IKmlLookAt lookat = ge.createLookAt(String.Empty);
     lookat.set(
         latitude,
         longitude,
         100,
         ge.ALTITUDE_RELATIVE_TO_GROUND,
         0,
         0,
         1000);
     ge.getView().setAbstractView(lookat);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Look at the given feature
        /// </summary>
        /// <param name="ge">the plugin</param>
        /// <param name="feature">the feature to look at</param>
        public static void LookAt(IGEPlugin ge, IKmlFeature feature)
        {
            switch (feature.getType())
            {
                case "KmlFolder":
                case "KmlDocument":
                case "KmlNetworkLink":
                    if (feature.getAbstractView() != null)
                    {
                        ge.getView().setAbstractView(feature.getAbstractView());
                    }

                    break;
                case "KmlPlacemark":
                    if (feature.getAbstractView() != null)
                    {
                        ge.getView().setAbstractView(feature.getAbstractView());
                    }
                    else
                    {
                        IKmlPlacemark placemark = (IKmlPlacemark)feature;
                        LookAt(ge, placemark.getGeometry());
                    }

                    break;
                default:
                    break;
            }
        }