SVG Google标记无法在Firefox中使用

5 firefox svg google-maps google-maps-api-3 google-maps-markers

随机SVG错误,我花了最后一个小时来弄清楚为什么我的SVG图标不能在Firefox中与Google Markers一起使用。

我正在使用以下代码段获取和调整SVG的大小。

任何和所有建议,将不胜感激,谢谢。

  url: 'svg/icon_inactive.svg',
  size: new google.maps.Size(30, 30),
  scaledSize: new google.maps.Size(30, 30),
  anchor: new google.maps.Point(30, 30)
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

小智 5

简单修复,我只需要向SVG添加高度和宽度-小学生错误。

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve" height="30px" width="30px">
<style type="text/css">
    .st0{opacity:0.9;fill:#ED1D7F;}
</style>
<g>
    <circle class="st0" cx="10" cy="10" r="10"/>
</g>
</svg>
Run Code Online (Sandbox Code Playgroud)