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

前端 未结 6 1390
醉话见心
醉话见心 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:51

    I also had issues to show the icon image, ahocevar answer helped me to solve my problem but I had also to search for the php header, for SVG In case you are or others who see this answer are using php to generate the SVG you have to use header function to identify the content-type

    header('Content-type: image/svg+xml'); /* this line will do the magic */
    echo '
    
    
    ';
    

提交回复
热议问题