Using icon marker that will be retrived from "URL" instead of saved icon on Google Maps
I'm trying to display marker on Google map. I can do this using a saved icon, for example: Drawable drawable = this.getResources().getDrawable(R.drawable开发者_高级运维.androidmarker);
however, the chanllange is, i need to use icon that will be retrived from URL. like "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
any idea how i can do this?
It's probably best to download the image from the URL, save it locally and then generate the drawable from that local resource.
Check out the BitmapFactory.decodeStream() ... passing in the URL.getImputStream() for the image you want to use during runtime.
Lots of examples of this on the net.
精彩评论