【问题标题】:Google Maps SVG marker with animation带有动画的 Google Maps SVG 标记
【发布时间】:2016-11-19 03:54:54
【问题描述】:

无法将此 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>

【问题讨论】:

  • 你能为此制作一个小提琴吗?
  • 将标记的optimized-选项设置为false
  • @Dr.Molle 你能把它添加为答案以便我接受吗?

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


【解决方案1】:

正如评论中提到的,在标记选项中设置optimized: false。

来自docs:

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

【讨论】:

  • 嘿,我很欣赏巨魔?
猜你喜欢
  • 1970-01-01
  • 2018-02-03
  • 2013-01-29
  • 2016-11-25
  • 2016-01-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-17
相关资源
最近更新 更多