小编CG_*_*_FD的帖子

不推荐使用的SVG pathSegList的替代方案

我正在编写一个扩展折线功能的Leaflet插件.在我的插件中,我使用SVGPathSegList接口访问路径段.但根据Chrome DevTools,该界面将在Chrome 48中删除.我正在寻找另一种访问路径段的可能性.

Chrome DevTools通知

这是我的小提琴.

(function () {
    var __onAdd = L.Polyline.prototype.onAdd,
        __onRemove = L.Polyline.prototype.onRemove,
        __updatePath = L.Polyline.prototype._updatePath,
        __bringToFront = L.Polyline.prototype.bringToFront;

    L.Polyline.include({
      onAdd: function (map) {
          __onAdd.call(this, map);
          this._textRedraw();
      },

      onRemove: function (map) {
          __onRemove.call(this, map);
      },

      bringToFront: function () {
          __bringToFront.call(this);
          this._textRedraw();
      },

      _textRedraw: function () {
            var textNodes = this._path.parentElement.getElementsByTagName('text'),
                tnIndex;

                    if (textNodes.length > 0) {
                for (tnIndex = textNodes.length - 1; tnIndex >= 0; tnIndex -= 1) {
                    textNodes[tnIndex].parentNode.removeChild(textNodes[tnIndex]);
              }
          }

          if (this.options.measurements) {
              this.setText();
          }
      }, …
Run Code Online (Sandbox Code Playgroud)

html javascript svg

23
推荐指数
1
解决办法
9737
查看次数

如何在localStorage中存储数组?

我必须将数组存储在window.localStorage. 我将如何window.localStorage使用控制台窗口存储数组?

EX:
cards: Array[0]
length: 0
Run Code Online (Sandbox Code Playgroud)

我必须存储这个。现在这里的键是卡片,长度是嵌套的。

javascript json

3
推荐指数
1
解决办法
4056
查看次数

标签 统计

javascript ×2

html ×1

json ×1

svg ×1