Is there a way to use vector graphics to be google maps marker? I know that google maps takes a bitmap for a marker, but I have a vector graphics (coming from server) and I am not sure how to display that as marker?
Thank you
Technically, if you are able to render your vector image as a Drawable, you can use it as a map marker. Vector drawables on Android are complicated but maybe you already solved that problem.
You need to programmatically create a writable Bitmap with the desired size (specify your constant size in dips to adjust it to the screen density), create a Canvas based on that Bitmap, set the bounds on your Drawable then draw it on the Canvas. Your Bitmap will then contain the rendering of your Drawable and you can create a Marker from it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With