Пример #1
0
 /// <summary>
 /// Writes a value for the <c>image</c> property as a <c>uri</c> value.  The <c>image</c> property specifies the image to display on the surface.
 /// </summary>
 /// <param name="uri">The URI of the data.</param>
 /// <param name="resourceBehavior">An enumeration describing how to include the URI in the document. For even more control, use the overload that takes a ICesiumUriResolver.</param>
 public void WriteImageProperty(string uri, CesiumResourceBehavior resourceBehavior)
 {
     using (var writer = OpenImageProperty())
     {
         writer.WriteUri(uri, resourceBehavior);
     }
 }
Пример #2
0
 /// <summary>
 /// Writes a value for the <c>uri</c> property as a <c>uri</c> value. The <c>uri</c> property specifies the URI of a 3D tiles tileset. For broadest client compatibility, the URI should be accessible via Cross-Origin Resource Sharing (CORS). This value must be specified in order for the client to display graphics.
 /// </summary>
 /// <param name="uri">The URI of the data.</param>
 /// <param name="resourceBehavior">An enumeration describing how to include the URI in the document. For even more control, use the overload that takes a ICesiumUriResolver.</param>
 public void WriteUriProperty(Uri uri, CesiumResourceBehavior resourceBehavior)
 {
     using (var writer = OpenUriProperty())
     {
         writer.WriteUri(uri, resourceBehavior);
     }
 }
Пример #3
0
        /// <summary>
        /// Returns a resolved url, using the given <see cref="CesiumResourceBehavior"/>.
        /// </summary>
        /// <param name="uri">The url of the resource.</param>
        /// <param name="resourceBehavior">A <see cref="CesiumResourceBehavior"/> specifying how include the resource into a CZML document.</param>
        /// <returns>The resolved url.</returns>
        public static Uri GetResourceUri(Uri uri, CesiumResourceBehavior resourceBehavior)
        {
            if (resourceBehavior == CesiumResourceBehavior.Embed)
            {
                return(CachingCesiumUriResolver.ThreadLocalInstance.ResolveUri(uri));
            }

            return(uri);
        }
Пример #4
0
        /// <summary>
        /// Returns a resolved url, using the given <see cref="CesiumResourceBehavior"/>.
        /// </summary>
        /// <param name="url">The url of the resource.</param>
        /// <param name="resourceBehavior">A <see cref="CesiumResourceBehavior"/> specifying how include the resource into a CZML document.</param>
        /// <returns>The resolved url.</returns>
        public static string GetResourceUrl(string url, CesiumResourceBehavior resourceBehavior)
        {
            if (resourceBehavior == CesiumResourceBehavior.Embed)
            {
                return(CachingCesiumUrlResolver.ThreadLocalInstance.ResolveUrl(url));
            }

            return(url);
        }
Пример #5
0
        /// <summary>
        /// Writes the <code>image</code> property.  The <code>image</code> property specifies the URL of the image.
        /// </summary>
        /// <param name="url">The URL of the image.</param>
        /// <param name="resourceBehavior">An enumeration describing how to include the image in the document. For even more control, use the overload that takes a ICesiumUrlResolver.</param>
        public void WriteImage(string url, CesiumResourceBehavior resourceBehavior)
        {
            const string PropertyName = ImagePropertyName;

            if (IsInterval)
            {
                Output.WritePropertyName(PropertyName);
            }
            Output.WriteValue(CesiumFormattingHelper.GetResourceUrl(url, resourceBehavior));
        }
Пример #6
0
        /// <summary>
        /// Writes the <code>uri</code> property.  The <code>uri</code> property specifies the URI value.
        /// </summary>
        /// <param name="uri">The URI of the data.</param>
        /// <param name="resourceBehavior">An enumeration describing how to include the URI in the document. For even more control, use the overload that takes a ICesiumUriResolver.</param>
        public void WriteUri(string uri, CesiumResourceBehavior resourceBehavior)
        {
            const string PropertyName = UriPropertyName;

            if (ForceInterval)
            {
                OpenIntervalIfNecessary();
            }
            if (IsInterval)
            {
                Output.WritePropertyName(PropertyName);
            }
            Output.WriteValue(CesiumFormattingHelper.GetResourceUri(uri, resourceBehavior));
        }
Пример #7
0
        public static string GetResourceUri([NotNull] string uri, CesiumResourceBehavior resourceBehavior)
        {
            if (uri == null)
            {
                throw new ArgumentNullException("uri");
            }

            if (resourceBehavior == CesiumResourceBehavior.Embed)
            {
                return(CachingCesiumUriResolver.ThreadLocalInstance.ResolveUri(uri));
            }

            return(uri);
        }
Пример #8
0
 /// <summary>
 /// Writes the <code>uri</code> property.  The <code>uri</code> property specifies the URI value.
 /// </summary>
 /// <param name="uri">The URI of the data.</param>
 /// <param name="resourceBehavior">An enumeration describing how to include the URI in the document. For even more control, use the overload that takes a ICesiumUriResolver.</param>
 public void WriteUri(Uri uri, CesiumResourceBehavior resourceBehavior)
 {
     WriteUri(uri.ToString(), resourceBehavior);
 }
Пример #9
0
        /// <summary>
        /// Returns a resolved url, using the given <see cref="CesiumResourceBehavior"/>.
        /// </summary>
        /// <param name="uri">The url of the resource.</param>
        /// <param name="resourceBehavior">A <see cref="CesiumResourceBehavior"/> specifying how include the resource into a CZML document.</param>
        /// <returns>The resolved url.</returns>
        public static string GetResourceUri(string uri, CesiumResourceBehavior resourceBehavior)
        {
            if (resourceBehavior == CesiumResourceBehavior.Embed)
                return CachingCesiumUriResolver.ThreadLocalInstance.ResolveUri(uri);

            return uri;
        }
Пример #10
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="url">The URL of the resource.</param>
 /// <param name="behavior">An enumeration describing how to include the resource in the document.</param>
 public CesiumResource(string url, CesiumResourceBehavior behavior)
 {
     m_url = url;
     m_behavior = behavior;
 }
Пример #11
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="uri">The URI of the resource.</param>
 /// <param name="behavior">The enumeration describing how the resource is to be included in the document.</param>
 public CesiumResource(string uri, CesiumResourceBehavior behavior)
 {
     m_url      = uri;
     m_behavior = behavior;
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="uri">The URI of the resource.</param>
 /// <param name="behavior">The enumeration describing how the resource is to be included in the document.</param>
 public CesiumResource(Uri uri, CesiumResourceBehavior behavior)
     : this(uri.ToString(), behavior)
 {
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="uri">The URI of the resource.</param>
 /// <param name="behavior">The enumeration describing how the resource is to be included in the document.</param>
 public CesiumResource(Uri uri, CesiumResourceBehavior behavior)
 {
     m_url = uri;
     m_behavior = behavior;
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="uri">The URI of the resource.</param>
 /// <param name="behavior">The enumeration describing how the resource is to be included in the document.</param>
 public CesiumResource(Uri uri, CesiumResourceBehavior behavior)
     : this(uri.ToString(), behavior)
 {
 }