Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为啥使用json 数据没法将线条描绘出来 #2201

Closed
qq9321 opened this issue Dec 21, 2023 · 4 comments
Closed

为啥使用json 数据没法将线条描绘出来 #2201

qq9321 opened this issue Dec 21, 2023 · 4 comments

Comments

@qq9321
Copy link

qq9321 commented Dec 21, 2023

https://codesandbox.io/p/sandbox/exciting-carson-fcsvf3?file=%2Findex.js%3A25%2C59
这是地址,麻烦看下,谢谢

Copy link
Contributor

Hi @qq9321, Please star this repo if you find it useful! Thanks ⭐!
你好 @qq9321。如果该仓库对你有用,可以 star 一下,感谢你的 ⭐!

@lzxue
Copy link
Contributor

lzxue commented Dec 21, 2023

Json 需要是数组格式,如果对你有帮助欢迎 star一下

let position = [
    {
      name: "path1",
      type: "LineString",
      path: [
        [58.00781249999999, 32.84267363195431],
        [85.78125, 25.16517336866393],
        [101.953125, 41.77131167976407],
        [114.9609375, 39.639537564366684],
        [117.42187500000001, 28.613459424004414],
      ],
    },
  ];
  const layer1 = new LineLayer({ zIndex: 1, autoFit: true })
    .source(position, {
      parser: {
        type: "json",
        coordinates: "path",
      },
    })
    .shape("line")
    .size(2)
    .color("#f00");
  scene.addLayer(layer1);

@lzxue lzxue closed this as completed Dec 21, 2023
@qq9321
Copy link
Author

qq9321 commented Dec 21, 2023

1703125598587
那你们看看文档这边会不会造成误解呢

@lzxue
Copy link
Contributor

lzxue commented Dec 22, 2023

抱歉造成了,误解文档按照单个元素写的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants