error: PushpinInfo.Default

Jul 24, 2009 at 5:17 AM
Edited Jul 24, 2009 at 8:33 AM

PushpinInfo pushInfo = PushpinInfo.Default; 
pushInfo.Resource = "Resources/station.png";
pushInfo.Label = "";
m_GlobeControl.Host.Geometry.AddGeometry(new PushpinGeometry("SubStationLayer", "id", LatLonAlt.CreateUsingDegrees(subInfo.Latitude, subInfo.Longitude, subInfo.Altitude), pushInfo));  //when run here , throw an innerException

who can tell me why, or tell me another method to achieve. 

Jul 25, 2009 at 2:15 AM

I don't know, but you could search for other threads with about it:

Jul 27, 2009 at 1:38 PM

Not sure what aou are trying to acheive, but if it is placing an image on the map, you can try this:

        public void DrawImage(string layer, string id, System.Drawing.Bitmap image, LatLonAlt pt)
            PushpinInfo info = PushpinInfo.Default;
            info.Image = new SingleBitmapProvider(image);
            info.AltitudeMode = AltitudeMode.FromDatum;
            RollPitchYaw orientation = new RollPitchYaw(0, -90 * 2 * Math.PI / 360.0, 0);
            info.OrientationMode = PushpinOrientationMode.UseProvided;
            info.Orientation = new Microsoft.MapPoint.Geometry.VectorMath.Orientation(orientation);
            info.ImageWidth = image.Width;
            info.ImageHeight = image.Height;
            info.MaintainScreenSize = true;
            info.HitDetect = HitDetectMode.None;

            this.GlobeControl.Host.Geometry.AddGeometry(new PushpinGeometry(layer, id, pt, info));
If your latLonAlt point doesn't contain altitude, just set altitudeMode to AltitudeMode.FromGround (probably don't need to specify RollPitchYaw and Orientation params)