다음을 통해 공유


BillboardPlugin.cs

using System;

using System.Collections.Generic;

using System.Drawing;

using System.Text;

 

using Microsoft.MapPoint.PlugIns;

using Microsoft.MapPoint.Rendering3D;

using Microsoft.MapPoint.Rendering3D.Cameras;

 

namespace VirtualEarth3DSamplePlugins.Billboard

{

    public class BillboardPlugin : PlugIn

    {

        #region Constructor

        public BillboardPlugin(Host host)

            : base(host)

        {

 

        }

        #endregion

        #region Overrides

        public override void Activate(object activationObject)

        {

            base.Activate(activationObject);

 

            LatLonAlt position = LatLonAlt.CreateUsingDegrees(46.849743288383046, -121.7498016357422, 5000);

 

            // Add the actor at the specified position

            this.Host.Actors.Add(new BillboardActor(position));

 

            this.Host.Notifications.Display("Flying to view billboard");

            // Now move the camera to view the newly placed billboard

            this.Host.Navigation.FlyTo(position.LatitudeDegrees, position.LongitudeDegrees, position.Altitude, 0, 0, 8000);

        }

 

        public override string Name

        {

            get

            {

                return "BillboardPlugin";

            }

        }

        #endregion

    }

}