简体   繁体   English

将 Mapael 版本从 0.7.1 更新到 2.2.0

[英]Update Mapael version from 0.7.1 to 2.2.0

There are a lot new/modified functions in jquery.mapael.js V2.2.0 and now I have some troubles. jquery.mapael.js V2.2.0 有很多新的/修改的函数,现在我遇到了一些麻烦。

desired process: ( + = got it, - = help needed)所需的过程: (+ = 得到它,- = 需要帮助)

  • display the US-map and some buttons, eg 10/2019 (in the sample it is only a link) +显示美国地图和一些按钮,例如 10/2019(在示例中它只是一个链接) +

  • a button 'mouseover' shows: “鼠标悬停”按钮显示:

    • visited states in a different color +以不同颜色访问的状态 +
    • the state abbr, eg CA, NV, AZ, ... -州缩写,例如 CA、NV、AZ、... -
    • PNG graphic with the route (in the sample: a free PNG with snowfall) +带有路线的 PNG 图形(示例中:带有降雪的免费 PNG)+
  • a mouseout shows: mouseout 显示:

    • the US-map +美国地图 +
    • original color +原色 +
    • no state abbr -没有状态缩写 -
    • no graphic +没有图形 +
  • a 'mouseclick' on the button opens link (in the sample: is #) +按钮上的“鼠标单击”打开链接(在示例中:是 #)+

see also: jsfiddle.net/ygpbzsce/另见: jsfiddle.net/ygpbzsce/

used versions:使用版本:

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

got it - my solutions:明白了 - 我的解决方案:

1) if animation is not required, open the custom script and set every animDuration to 0 (zero) 1) 如果不需要动画,打开自定义脚本并将每个animDuration设置为 0(零)

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

2) if animation is required, set animDuration , open jquery.mapael.js and search for _nonAnimatedAttrs and add "text" to the array 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"
    ],

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM