How to Set background image of a custom google map marker?

孤街醉人 提交于 2019-12-12 11:21:45

问题


I have a custom image for Google Marker but another image i have to set on its background.

Is it possible to set background image of a map Marker?


回答1:


Yes ,You can

Try this so question How to create a custom-shaped bitmap marker with Android map API v2

Also read this




回答2:


From the answer of @Abx

You can add custom marker like that,

googleMap.addMarker(new MarkerOptions()
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_me))
            .anchor(0.5f, 1.0f) // Anchors the marker on the bottom left
            .position(new LatLng(latitude, longitude)));

Thanks to @Abx



来源:https://stackoverflow.com/questions/33819702/how-to-set-background-image-of-a-custom-google-map-marker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!