com.supermap.data

Class DatasetImage.MapCacheService

  • java.lang.Object
    • com.supermap.data.DatasetImage.MapCacheService
  • Enclosing class:
    DatasetImage


    public class DatasetImage.MapCacheService
    extends java.lang.Object
    The map pre-cache service class is used to network map precache. Now it supports only iServerRest map, SuperMapCloud map, Google map, and WMTS map services. The cache data should open map first, then conduct the precache. Users open a network map (Rest) datasource. Specify a rectangle area for the network map dataset. Cache all scale images in the rectangle area to the mobile SD to browse offline.
    • Constructor Detail

      • MapCacheService

        public MapCacheService()
        Constructs a new MapCacheService object.
    • Method Detail

      • startDownload

        @Deprecated
        public boolean startDownload(Rectangle2D rcBounds)
        Deprecated. 
        Start downloading all scale images to local in the specified range.
        Parameters:
        rcBounds - the specified range
        Returns:
        Whether to start downloading
      • startDownload

        public boolean startDownload(double maxScale,
                                     double minScale,
                                     Rectangle2D rcBounds)
        Precache interface, according to the user set the maximum and minimum scale, find the appropriate cache level cache.

        If the total number of tiles calculated at a certain level is greater than 1 million, then exit directly.

        Parameters:
        maxScale - Maximum scale
        minScale - Minimum scale
        rcBounds - Out of the cache range
        Returns:
        Whether to start downloading
      • stopDownload

        public void stopDownload()
        Stop downloading.
      • setListener

        public void setListener(MapCacheListener listener)
        Sets the precache listener.
        Parameters:
        listener - Precache listener.
      • removeListener

        public void removeListener(MapCacheListener listener)
        Removes the precache listener.
        Parameters:
        listener - Precache listener.
      • removeCache

        public void removeCache()
        Delete all the local cache, in order to re-obtain data from the server, you can achieve real-time refresh service data. Also callLayer.removeCache()to clear the display cache.
      • removeCache

        public void removeCache(double scale,
                                Rectangle2D bounds)
        Delete the cache for the specified scale and range.
        Parameters:
        scale - Scale
        bounds - Need to clear the cached map area.