Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load icon from url as cluster icon using glide #512

Closed
Nininea-zz opened this issue Apr 24, 2019 · 4 comments
Closed

Load icon from url as cluster icon using glide #512

Nininea-zz opened this issue Apr 24, 2019 · 4 comments
Labels
Milestone

Comments

@Nininea-zz
Copy link

Nininea-zz commented Apr 24, 2019

I use dynamic icon for each cluster item , so I have special icon url and load marker icon from url . I user following code :

override fun onBeforeClusterItemRendered(item: T, markerOptions: MarkerOptions?) {
    super.onBeforeClusterItemRendered(item, markerOptions)

     try {
     var url = URL("https://cdn3.iconfinder.com/data/icons/places/100/map_pin_big_1-128.png") 
     //I use static url, to ensure that url is not null, it should be (item as MyItem).iconURL. got same result anyway
         Glide.with(context)
             .asBitmap()
             .load(url)
             .into(object : CustomTarget<Bitmap>() {
                 override fun onLoadCleared(placeholder: Drawable?) {
                 }

                 override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
                     markerOptions?.icon(BitmapDescriptorFactory.fromBitmap(resource))
                 }

             })

     } catch (ex: Exception) {
         Log.e("map", ex.toString())
     }
 }

some icons still default in my case, after zoom in zoom out icon changes sometimes. The problem is that this code is not works for every cluster item , after zoom changed cluster icon is changed too, it may render my custom icon and may use default.
Screenshot_20190424-114305
Screenshot_20190424-114326

@teknolojia
Copy link

@nininea I have the same issue! Have you found solution?

@tanujsareen
Copy link

@nininea , I have the same issue also... Any1 one find the solution for that ??

@donghae0414
Copy link

@arriolac arriolac added the triage me I really want to be triaged. label Jan 29, 2020
@arriolac
Copy link
Contributor

Thank you for reporting. This is a known unresolved issue. You can see #90 and #417 for some possible workarounds.

@arriolac arriolac added status: duplicate Duplicate. and removed triage me I really want to be triaged. labels Jan 29, 2020
@arriolac arriolac added this to the 1.0 milestone Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants