Al ejecutar el onMapReady llamo a una función llamada setUpReport(){} dentro de esa función hay un marker.tag que llama a una clase CustomInfoWindowGoogleMap. El problema es que no carga las imagenes de Glide.
El codigo de CostumInfoWindowGoogleMap es el siguiente:
class CustomInfoWindowGoogleMap(val context: Context) : GoogleMap.InfoWindowAdapter {
override fun getInfoContents(p0: Marker?): View {
val mInfoView = (context as Activity).layoutInflater.inflate(R.layout.reportvisor_maps, null)
val mInfoWindow: ReportPet? = p0?.tag as ReportPet?
mInfoView.title_window.text = mInfoWindow?.mTitleReport
mInfoView.date_ReportVisor.text = mInfoWindow?.mDate
mInfoView.description_ReportVisor.text = mInfoWindow?.mdescriptionReport
mInfoView.type_ReportVisor.text = mInfoWindow?.mTypeReport
val imageReportVisor = mInfoView.findViewById<ImageView>(R.id.image_ReportVisor)
Glide.with(this.context).load(mInfoWindow?.mImageReport).into(imageReportVisor) // image
Log.d("IMGREPORT","mImageReport: ${mInfoWindow?.mImageReport}")
return mInfoView
}
override fun getInfoWindow(p0: Marker?): View? {
return null
}
}
Lo invoco con:
private fun setUpReport(){
for (reportPet in listReport){
val markerOptions = MarkerOptions()
markerOptions
.position(LatLng(reportPet.mGeoPoint.latitude,reportPet.mGeoPoint.longitude))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.iconmapblue))
val customInfoWindow = CustomInfoWindowGoogleMap(this)
mMap.setInfoWindowAdapter(customInfoWindow)
val marker = mMap.addMarker(markerOptions)
marker.tag = reportPet
marker.showInfoWindow()
}
}
D/IMGREPORT: mImageReport: https://firebasestorage.googleapis.com/v0/b/mappet-be63d.appspot.com/o/report%2F80030zero%40gmail.com?alt=media&token=92eb95c4-0487-4636-8785-29c38f377cdb