Metadata storage for each placemark, assigned by KML engine.
コード例 #1
0
 private static void GetRendererInfo(PlacemarkDescriptor feature, KMLStyle style, out string label, out string description)
 {
     label       = null;
     description = null;
     if (string.IsNullOrEmpty(style.StyleId))
     {
         //if the feature is not using a shared style -> create an entry by graphic with the name as ident
         if (feature.Attributes.ContainsKey("name"))
         {
             label = feature.Attributes["name"].ToString();
         }
         if (feature.Attributes.ContainsKey("description"))
         {
             description = feature.Attributes["description"].ToString();
         }
     }
     else
     {
         //if the feature is using a shared style -> create an entry for the style
         label = style.StyleId;
     }
 }
        /// <summary>
        /// Extracts a point from the input element and applies style information to the placemark descriptor.
        /// </summary>
        /// <param name="kmlStyle">KML Style information.</param>
        /// <param name="point">Point geometry information.</param>
		/// <returns>A PlacemarkDescriptor object representing the feature.</returns>
        private static PlacemarkDescriptor ExtractPoint(KMLStyle kmlStyle, XElement point)
        {
			XNamespace kmlNS = point.Name.Namespace;
			XElement coord = point.Element(kmlNS + "coordinates");
            if (coord != null)
            {
                // Extract geometry
                ESRI.ArcGIS.Client.Geometry.Geometry geom = ExtractCoordinate(coord.Value);
                if (geom != null)
                {
                    // Create symbol and use style information
                    PointSymbolDescriptor sym = new PointSymbolDescriptor();
                    sym.style = kmlStyle;

                    // Create feature descriptor from geometry and other information
                    PlacemarkDescriptor fd = new PlacemarkDescriptor()
                    {
                        Geometry = geom,
                        Symbol = sym
                    };

                    return fd;
                }
            }

            return null;
        }
コード例 #3
0
		private static void GetRendererInfo(PlacemarkDescriptor feature, KMLStyle style, out string label, out string description)
		{
			label = null;
			description = null;
			if (string.IsNullOrEmpty(style.StyleId))
			{
				//if the feature is not using a shared style -> create an entry by graphic with the name as ident
				if (feature.Attributes.ContainsKey("name"))
					label = feature.Attributes["name"].ToString();
				if (feature.Attributes.ContainsKey("description"))
					description = feature.Attributes["description"].ToString();
			}
			else
			{
				//if the feature is using a shared style -> create an entry for the style
				label = style.StyleId;
			}
		}
コード例 #4
0
 /// <summary>
 /// Adds a placemark descriptor to the list.
 /// </summary>
 /// <param name="fd">Placemark description.</param>
 public void AddPlacemark(PlacemarkDescriptor fd)
 {
     placemarks.Add(fd);
 }
コード例 #5
0
		private static void SetFeaturePlacemarkerDescriptor(DependencyObject graphic, PlacemarkDescriptor feature)
		{
			graphic.SetValue(FeaturePlacemarkerDescriptorProperty, feature);
		}
コード例 #6
0
 /// <summary>
 /// Adds a placemark descriptor to the list.
 /// </summary>
 /// <param name="fd">Placemark description.</param>
 public void AddPlacemark(PlacemarkDescriptor fd)
 {
     placemarks.Add(fd);
 }
コード例 #7
0
 private static void SetFeaturePlacemarkerDescriptor(DependencyObject graphic, PlacemarkDescriptor feature)
 {
     graphic.SetValue(FeaturePlacemarkerDescriptorProperty, feature);
 }