谷歌地图带有动画的SVG标记

5
无法将此SVG动画作为Google地图上的标记进行展示。

<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <g fill="none" fill-rule="evenodd" stroke-width="1" stroke="black" stroke-opacity="0.3">
    <circle cx="50" cy="50" r="50">
      <animate attributeName="r" begin="0s" dur="3s" values="0;50" keyTimes="0;1" keySplines="0.1,0.2,0.3,1" calcMode="spline" repeatCount="indefinite"></animate>
      <animate attributeName="stroke-opacity" begin="0s" dur="3s" values="0;.3;.3;0" repeatCount="indefinite"></animate>
    </circle>
    <circle cx="50" cy="50" r="30">
      <animate attributeName="r" begin="-1s" dur="3s" values="0;50" keyTimes="0;1" keySplines="0.1,0.2,0.3,1" calcMode="spline" repeatCount="indefinite"></animate>
      <animate attributeName="stroke-opacity" begin="-1s" dur="3s" values="0;.3;.3;0" repeatCount="indefinite"></animate>
    </circle>
  </g>
</svg>


你能为此创建一个fiddle吗? - Adam Azad
4
将标记的“optimized”选项设置为“false”。 - Dr.Molle
@Dr.Molle,您能将其添加为答案,这样我就可以接受它了吗? - Kirk Strobeck
1个回答

3

如评论中所提到的,可以在标记选项中设置optimized: false

文档中得知:

禁用优化渲染动画GIF或PNG,或者每个标记必须作为单独的DOM元素进行渲染(仅限高级用法)。


呵呵,我欣赏这个恶作剧。 - Kirk Strobeck

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接