在arcgis JavaScript中添加Turf后无法显示图形图层

时间:2017-07-17 08:01:13

标签: javascript geojson arcgis-js-api turfjs

我想通过线条弯曲,但代码没有用完。我使用Turf.js制作贝塞尔线。

var line = {
          "type": "Feature",
          "properties": {
            "stroke": "#f00"
          },
          "geometry": {
            "type": "LineString",
            "coordinates": [
              [-76.091308, 18.427501],
              [-76.695556, 18.729501],
              [-76.552734, 19.40443],
              [-74.61914, 19.134789],
              [-73.652343, 20.07657],
              [-73.157958, 20.210656]
            ]
          }
        };
        var curved = turf.bezier(line);
        var bg = new Graphic(curved, basicSymbol, {}, null);

        graphicsLayer.add(bg);

我做错了吗?