将 Mapael 版本从 0.7.1 更新到 2.2.0

Update Mapael version from 0.7.1 to 2.2.0

jquery.mapael.jsV2.2.0中有很多new/modified功能,现在遇到了一些麻烦

所需流程:(+ = 知道,- = 需要帮助)

另请参阅: jsfiddle。net/ygpbzsce/

使用的版本:

Raphael V2.3.0
Mapael  V2.2.0
jQuery  V3.1.1
Firefox V72.0.2

知道了 - 我的解决方案:

1) 如果不需要动画,打开自定义脚本并将每个 animDuration 设置为 0(零)

$(".mapcontainer").trigger('update', [{
  mapOptions: updatedOptions,
  newPlots: newPlots,
  deletePlotKeys: false,
  animDuration: 0     /* <---set to zero */
}]);

2)如果需要动画,设置animDuration,打开jquery.mapael.js,搜索 _nonAnimatedAttrs 并将 "text" 添加到数组

    _nonAnimatedAttrs: [
        "arrow-end", "arrow-start", "gradient",
        "class", "cursor", "text-anchor",
        "font", "font-family", "font-style", "font-weight", "letter-spacing",
        "src", "href", "target", "text", "title",
        "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit"
    ],