javascript - 带动画的 Google map SVG 标记

标签 javascript google-maps svg google-maps-api-3 google-maps-markers

无法让此 SVG 动画化为 Google map 上的标记

<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>

最佳答案

如评论中所述,在标记选项中设置 optimized: false

来自docs :

Disable optimized rendering for animated GIFs or PNGs, or when each marker must be rendered as a separate DOM element (advanced usage only).

关于javascript - 带动画的 Google map SVG 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38404566/

相关文章:

javascript - 如何修复 JSX props 不应使用 .bind() 错误

javascript - 谷歌地点 ID 查找器

html - 将 SVG 高度和宽度设置为其内部 <text> 节点的高度和宽度

javascript - $.ajax json 下拉菜单项

javascript - 如何使用jquery将div从a,a,b,b重新排序为a,b,a,b?

javascript - 使用 Bootstrap 如何使用关闭按钮显示输入中的 div 列表中选定的 div

android - 具有位置的 Google Maps 7.0.0 的 Intent

javascript - JavaScript 中的层次聚类

css - 创建 Angular CSS3 分隔线 - 100%/自动高度

d3.js - 如何更改 d3 图例条目间距/对齐方式