Ejemplo n.º 1
0
 public KMLPoint(KMLLocation loc, bool isExtrude, bool isTessellate)
 {
     base.Extrude     = isExtrude;
     base.Tessellate  = isTessellate;
     base.coordinates = new List <KMLLocation>();
     base.coordinates.Add(loc);
 }
Ejemplo n.º 2
0
        private static KMLPlacemarkItem ReadPlacemarkItem(XmlReader reader)
        {
            bool isExtrude    = false;
            bool isTessallate = true;
            List <KMLLocation> coordinates = null;

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name.ToUpper())
                    {
                    case "EXTRUDE":
                    {
                        isExtrude = Convert.ToBoolean(TinyKML.ReadInt(reader));
                        break;
                    }

                    case "TESSALLATE":
                    {
                        isTessallate = Convert.ToBoolean(TinyKML.ReadInt(reader));
                        break;
                    }

                    case "COORDINATES":
                    {
                        coordinates = KMLLocation.Parse(TinyKML.ReadString(reader));

                        if (coordinates == null)
                        {
                            throw new FormatException();
                        }

                        if (coordinates.Count == 1)
                        {
                            return(new KMLPoint(coordinates[0], isExtrude, isTessallate));
                        }
                        else
                        {
                            return(new KMLLineString(isExtrude, isTessallate, coordinates.ToArray()));
                        }
                    }
                    }
                }
            }

            throw new FormatException();
        }
Ejemplo n.º 3
0
 public KMLPlacemark(string name, string description, bool extrude, bool tessellate, KMLLocation point)
 {
     Name          = name;
     Description   = description;
     PlacemarkItem = new KMLPoint(point, extrude, tessellate);
 }