How can I use an SVG image as a map marker in OpenLayers-3?

前端 未结 6 1385
醉话见心
醉话见心 2020-12-31 13:57

I am trying to create map \"pin-drops\" (ie. map markers) in OpenLayers-3 (OL3) using SVG images.

Currently, I am using PNG images as the pindrops that reference the

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 14:39

    I had the same issue, but not even serving the image with the proper mime type helped.

    It boiled down to the SVG not defining width and height properly.

    I added the width and height attributes to the tag, like:

    
    

    After that I was able to use my svg just like any other image.

提交回复
热议问题