Issue
I am developing an android app. I am using google map API v2. But I don't use default icon marker. How can I using marker like same foodspotting app. I must design marker in xxdpi, xdpi, hdpi or another other way?
I don't know how to do it. Please help.
Solution
Use below code:
BitmapDescriptor icon = BitmapDescriptorFactory
.fromResource(R.drawable.pin_red);
MarkerOptions markerOptions = new MarkerOptions();
LatLng latLng = new LatLng(78.55, 244.67);
// Setting the position for the marker
markerOptions.position(latLng);
// setting the icon
markerOptions.icon(icon);
where pin_red is your .png image
Answered By - jyomin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.