百度地图infowindow
生活随笔
收集整理的這篇文章主要介紹了
百度地图infowindow
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
private void showInfoWindow(LatLng latLng, String address){ViewGroup infoView = (ViewGroup) LayoutInflater.from(getActivity()).inflate(R.layout.view_current_location,null);TextView locationTextView = (TextView) infoView.findViewById(R.id.view_current_location_info_textview);locationTextView.setText(address);Point p = baiduMap.getProjection().toScreenLocation(latLng);p.y -= 20;LatLng llInfo = baiduMap.getProjection().fromScreenLocation(p);infoWindow = new InfoWindow(infoView,llInfo,0);//第一個參數為infowindow顯示的view,第二個參數是顯示的位置,第三個參數為Y軸的偏移量baiduMap.showInfoWindow(infoWindow);}其中infowindow的view的布局只能是LinearLayout,如果用RelativeLayout會出現顯示不全,不知道是什么原因
轉載于:https://my.oschina.net/meetthebetteryour/blog/674206
總結
以上是生活随笔為你收集整理的百度地图infowindow的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: input image和img butt
- 下一篇: 关于系统重装的一件小事