Example #1
0
        /// <summary>
        /// Begin an operation to precache a spherical area of the map. This allows that area to load faster in future.
        /// </summary>
        /// <param name="center">the center of the area to precache</param>
        /// <param name="radius">the radius (in meters) of the area to precache</param>
        /// <param name="completionCallback">the callback to call whenever the precache operation completes</param>
        /// <returns>an object with a Cancel() method to allow cancellation of the precache operation</returns>
        public PrecacheOperation Precache(LatLong center, double radius, PrecacheOperationCompletedCallback completionCallback)
        {
            if (radius < 0.0 || radius > MaximumPrecacheRadius)
            {
                throw new ArgumentOutOfRangeException("radius", string.Format("radius outside of valid (0, {0}] range.", MaximumPrecacheRadius));
            }

            int operationId = m_precacheApiInternal.BeginPrecacheOperation(center, radius);
            var operation   = new PrecacheOperation(m_precacheApiInternal, operationId, completionCallback);

            m_precacheOperations.Add(operationId, operation);

            return(operation);
        }
Example #2
0
 internal PrecacheOperation(PrecacheApiInternal internalApi, int operationId, PrecacheOperationCompletedCallback completionCallback)
 {
     m_internalApi        = internalApi;
     m_operationId        = operationId;
     m_completionCallback = completionCallback;
 }