Class UrlIconProvider

  • All Implemented Interfaces:
    com.google.maps.android.data.renderer.IconProvider

    
    public class UrlIconProvider
     implements IconProvider
                        

    Implementation of IconProvider that loads icons from URLs. Uses an LruCache to cache loaded icons and handles "thundering herd" by deduplicating in-flight requests.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Bitmap loadIcon(String url) Loads an icon from the given URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UrlIconProvider

        UrlIconProvider(CoroutineDispatcher dispatcher, KmlUrlSanitizer urlSanitizer)
      • UrlIconProvider

        UrlIconProvider(CoroutineDispatcher dispatcher)
      • UrlIconProvider

        UrlIconProvider()
    • Method Detail

      • loadIcon

         Bitmap loadIcon(String url)

        Loads an icon from the given URL.

        Parameters:
        url - The URL of the icon to load.
        Returns:

        The loaded Bitmap, or null if loading failed.