有人真的可以帮助我吗?我一直在寻找为我的SVG运行脚本的方法.但我得到的所有东西都不匹配!并且它没有包含足够的信息,因为他使用了这组代码.例如,一个使用了event.target,另一个使用了event.getTarget(),另一个使用了event.target.firstchild.data.有人可以帮帮我吗?
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M150 0 L75 200 L225 200 Z" />
</svg>
Run Code Online (Sandbox Code Playgroud)
是svg路径的一个例子吗?我需要的是得到那些坐标,可能把它放在一个变量中,并用它作为另一个svg的坐标.那我该怎么做呢?另一件事是我如何通过在界面中输入数字来更改这些坐标.
所以我试图寻找答案,但就像我说的,我没有找到我需要的信息,或者我只是不知道它给我的信息.
我正在编写一个扩展折线功能的Leaflet插件.在我的插件中,我使用SVGPathSegList接口访问路径段.但根据Chrome DevTools,该界面将在Chrome 48中删除.我正在寻找另一种访问路径段的可能性.

这是我的小提琴.
(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)