Ejemplo n.º 1
0
        private void AddMultiGeometry(bool sky, KmlPlacemark placemark, float width, Color polyColor, Color lineColor, KmlMultiGeometry geo)
        {
            foreach (KmlGeometry childGeo in geo.Children)
            {
                if (childGeo is KmlPoint)
                {
                    KmlPoint point = (KmlPoint)childGeo;

                    placemark.Point = (KmlPoint)childGeo;
                    AddPlacemark(placemark);
                }
                else if (childGeo is KmlLineList)
                {
                    AddLines(sky, childGeo as KmlLineList, width, lineColor, lineColor, false);

                }
                else if (childGeo is KmlPolygon)
                {
                    KmlPolygon child = (KmlPolygon)childGeo;
                    if (child.OuterBoundary != null)
                    {
                        AddLines(sky, child.OuterBoundary as KmlLineList, width, polyColor, lineColor, child.extrude);
                        // to do 3d work and subtract inner rings
                    }
                }
                else if (childGeo is KmlMultiGeometry)
                {
                    AddMultiGeometry(sky, placemark, width, polyColor, lineColor, childGeo as KmlMultiGeometry);
                }
            }
        }
        public override void LoadDetails(XmlNode node, KmlRoot owner)
        {
            base.LoadDetails(node, owner);

            foreach (XmlNode child in node.ChildNodes)
            {
                KmlFeature newChild = null;
                switch (child.Name)
                {
                    case "NetworkLink":
                        newChild = new KmlNetworkLink();
                        break;
                    case "Placemark":
                        newChild = new KmlPlacemark();
                        break;
                    case "PhotoOverlay":
                        newChild = new KmlPhotoOverlay();
                        break;
                    case "ScreenOverlay":
                        newChild = new KmlScreenOverlay();
                        break;
                    case "GroundOverlay":
                        newChild = new KmlGroundOverlay();
                        break;
                    case "Folder":
                        newChild = new KmlFolder();
                        break;
                    case "Document":
                        newChild = new KmlDocument();
                        break;
                }

                if (newChild != null)
                {
                    newChild.sky = this.sky;
                    newChild.LoadDetails(child, owner);
                    if (children == null)
                    {
                        children = new List<KmlFeature>();
                    }
                    children.Add(newChild);
                }
            }
        }
Ejemplo n.º 3
0
 public void AddPlacemark(KmlPlacemark placemark)
 {
     Placemarks.Add(placemark);
 }
        public void LoadDetails(XmlNode node)
        {
            foreach (XmlNode child in node.ChildNodes)
            {
                KmlFeature newChild = null;
                switch (child.Name)
                {
                    case "NetworkLink":
                        newChild = new KmlNetworkLink();
                        break;
                    case "Placemark":
                        newChild = new KmlPlacemark();
                        break;
                    case "PhotoOverlay":
                        newChild = new KmlPhotoOverlay();
                        break;
                    case "ScreenOverlay":
                        newChild = new KmlScreenOverlay();
                        break;
                    case "GroundOverlay":
                        newChild = new KmlGroundOverlay();
                        break;
                    case "Folder":
                        newChild = new KmlFolder();
                        break;
                    case "Document":
                        newChild = Document = new KmlDocument();
                        break;
                }

                if (newChild != null)
                {
                    newChild.sky = this.sky;
                    newChild.LoadDetails(child, this);

                    children.Add(newChild);
                }
            }

            lastUpdate = DateTime.Now;
        }