
我有一个从Web服务检索纬度和经度的项目,并将它们添加到Google地图标记中.我想为网址中的标记添加自定义图标.
mMap.addMarker(new MarkerOptions() .position(new LatLng(dlat,Dlong)) .Title(m.group(9)) .draggable(false) .snippet(m.group(1)+" "+m.group(10)));如何从链接中添加带有自定义图标的.icon?
解决方法:
Use this method and use returned bitmap to display in mappublic Bitmap getBitmapFromURL(String imageUrl) { try { URL url = new URL(imageUrl); httpURLConnection connection = (httpURLConnection) url.openConnection(); connection.setDoinput(true); connection.connect(); inputStream input = connection.getinputStream(); Bitmap myBitmap = BitmapFactory.decodeStream(input); return myBitmap; } catch (IOException e) { e.printstacktrace(); return null; }} 总结 以上是内存溢出为你收集整理的谷歌地图api v2从URL android添加图标全部内容,希望文章能够帮你解决谷歌地图api v2从URL android添加图标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)