Adding Google Maps to a RecyclerView

后端 未结 3 1493
失恋的感觉
失恋的感觉 2020-12-30 16:35

I have added the map view inside the RecyclerView alongside other types of list items but now ... how and where do I initialize the map, where do I listen for o

3条回答
  •  不知归路
    2020-12-30 17:16

    For example you can use Glide and load map preview, not map fragment Like this:

        GlideApp
            .with(context)
            .load("http://maps.google.com/maps/api/staticmap?center=" + 
                   lat + 
                   "," + 
                   lng + 
                   "&zoom=15&size=200x200&sensor=false" +
                   "&markers=color:red%7Clabel:C%" + 
                   markerLat + 
                   "," + 
                   markerLlng)
            .centerCrop()
            .into(myImageView);
    

    Or using lib - static-maps-api

提交回复
热议问题