Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/425.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript SVG路径属性d,例如geoJSON_Javascript_Json_Svg_Openlayers_Geojson - Fatal编程技术网

Javascript SVG路径属性d,例如geoJSON

Javascript SVG路径属性d,例如geoJSON,javascript,json,svg,openlayers,geojson,Javascript,Json,Svg,Openlayers,Geojson,我在SVG中有很多几何图形。为了能够在Openlayers矢量层中编辑它们,我想将svg几何图形转换为geoJSON格式,以便轻松地将它们添加到Openlayers层 发件人: 致: 有一个js框架可以处理这个问题吗?也许你不需要使用OpenLayers。您可以使用来绘制地图。d3还有一个可以帮助你转换的 path xmlns="http://www.w3.org/2000/svg" id="G0W9Q7bC" d="M29.68 -30.10l-12.94 9.61 220.96 157.25

我在SVG中有很多几何图形。为了能够在Openlayers矢量层中编辑它们,我想将svg几何图形转换为geoJSON格式,以便轻松地将它们添加到Openlayers层

发件人:

致:


有一个js框架可以处理这个问题吗?

也许你不需要使用OpenLayers。您可以使用来绘制地图。d3还有一个可以帮助你转换的

path xmlns="http://www.w3.org/2000/svg" id="G0W9Q7bC" d="M29.68 -30.10l-12.94 9.61 220.96 157.25 67.98-166.86-276.00 .00"/>

path xmlns="http://www.w3.org/2000/svg" id="G0W9Q7bA" d="M1223.26 349.19l-167.71 93.84 265.54 117.80-70.46 71.27 145.87 .00 .00-53.18-173.24-229.73"/>

path xmlns="http://www.w3.org/2000/svg" id="G0W9Q7bz_0" d="M1281.16 265.33l .00-111.81 115.34 .00M1396.50 265.33l-115.34 .00"/>
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              568420.74334458,
              121173.52026851001
            ],
            [
              568420.74334458,
              135550.45067237
            ],
            [
              598372.6816859602,
              135550.45067237
            ],
            [
              598372.6816859602,
              121173.52026851001
            ],
            [
              568420.74334458,
              121173.52026851001
            ]
          ]
        ]
      }
    }
  ]
}