how to display location message in chat window same like whatsapp in android programmatically?

后端 未结 3 648
有刺的猬
有刺的猬 2021-02-03 14:48

I am developing a chat application. Where user can send location same like whatsapp. (I am not talking about share live location functionality). For th

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-03 15:16

    You can make use of static maps for that.

    http://maps.googleapis.com/maps/api/staticmap?center=9.9252,78.1198&zoom=14&markers=color:blue|label:A|9.9252,78.1198&size=500x400&sensor=false

    You can replace the dynamic co-ordinates programmatically like below:

    String location = "http://maps.googleapis.com/maps/api/staticmap?center="
                                    + Utils.CUR_LATTITUDE
                                    + ","
                                    + Utils.CUR_LONGITUDE
                                    + "&zoom=14&markers=color:blue|label:A|"
                                    + Utils.CUR_LATTITUDE
                                    + ","
                                    + Utils.CUR_LONGITUDE
                                    + "&size=500x400&sensor=false"
    

提交回复
热议问题