1

I wonder if there is a away to show a circular version of a square image that is passed in as an icon image to a google map marker (api v3)?

Use case would be to show a round version of a gravatar as a marker.

Kara
  • 6,115
  • 16
  • 50
  • 57
Val Neekman
  • 17,692
  • 14
  • 63
  • 66

3 Answers3

0

According to the docs, you can specify the anchor, image and size of your marker icon, but you can't crop a circular version of it. I think you would want to store the gravatars as .png files and then crop them with transparency on the backend.

Cianan Sims
  • 3,419
  • 1
  • 21
  • 30
0

If you can't edit the image when delivered from the server, maybe you can put a mask on it by adding another icon over the top of that same location with a transparent circular area in the center.

Although this may look a bit weird.

Rafe
  • 793
  • 6
  • 15
0

You can create an HTML marker, give it border-radius:50%

and put an image in it. You have a perfectly round image for marker.

Jabran Saeed
  • 5,760
  • 3
  • 21
  • 37