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

PolygonLayer有时候会显示出跟数据无关的乱线条 #2342

Open
flyours opened this issue Mar 11, 2024 · 9 comments
Open

PolygonLayer有时候会显示出跟数据无关的乱线条 #2342

flyours opened this issue Mar 11, 2024 · 9 comments
Assignees
Labels
bug 这个是一个 bug good first issue Good for newcomers 🌟 star

Comments

@flyours
Copy link

flyours commented Mar 11, 2024

问题描述

const mydata={
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "01",
"properties": {
"name": "Alabama",
"density": 94.65
},
"geometry": {"type":"Polygon","coordinates":[[[121.438197843854,31.2618062190434],[121.438234702671,31.2618000670963],[121.438241928073,31.2617702668736],[121.438278786903,31.2617641149022],[121.438286012306,31.2617343146507],[121.438256378878,31.2617106663743],[121.438263604279,31.2616808660976],[121.438233970862,31.2616572178044],[121.438197112056,31.2616633697926],[121.438167478662,31.2616397214873],[121.438174704061,31.2616099211892],[121.438145070678,31.2615862728672],[121.438108211908,31.2615924248478],[121.438078578547,31.2615687765136],[121.438041719802,31.2615749284782],[121.438012086465,31.2615512801319],[121.437975227745,31.2615574320806],[121.437945594431,31.2615337837221],[121.437908735735,31.2615399356549],[121.437879102445,31.2615162872843],[121.437842243774,31.2615224392011],[121.43783501838,31.2615522394802],[121.437798159722,31.2615583913728],[121.437790934329,31.261588191623],[121.437790934329,31.261588191623],[121.437790934329,31.261588191623],[121.437798159722,31.2615583913728],[121.437768526468,31.2615347429946],[121.437775167368,31.2615073533863],[121.43777575186,31.2615049427193],[121.43777575186,31.2615049427193],[121.43777575186,31.2615049427193],[121.437770467931,31.2615007259536],[121.437746118617,31.2614812943243],[121.437753344008,31.2614514940239],[121.437723710775,31.2614278456122],[121.437730936165,31.2613980452867],[121.437701302942,31.2613743968582],[121.437708528331,31.2613445965076],[121.43767889512,31.2613209480624],[121.437642036532,31.2613270999725],[121.437612403344,31.2613034515152],[121.43761962873,31.2612736511432],[121.437589995552,31.2612500026692],[121.437553137001,31.2612561545717],[121.437523503847,31.2612325060855],[121.43748664532,31.2612386579722],[121.437457012189,31.2612150094738],[121.437464237572,31.2611852090843],[121.437434604452,31.2611615605692],[121.437397745961,31.2611677124482],[121.437368112864,31.261144063921],[121.437331254398,31.2611502157842],[121.437301621325,31.2611265672448],[121.437308846704,31.2610967668377],[121.437279213641,31.2610731182815],[121.437242355211,31.2610792701372],[121.437212722172,31.2610556215689],[121.437175863767,31.2610617734085],[121.43714623075,31.2610381248281],[121.437153456126,31.2610083244034],[121.43712382312,31.2609846758063],[121.437086964751,31.2609908276384],[121.437057331769,31.2609671790291],[121.437020473425,31.2609733308453],[121.436990840466,31.2609496822238],[121.436998065838,31.2609198817816],[121.436968432889,31.2608962331434],[121.436931574582,31.260902384952],[121.436901941656,31.2608787363017],[121.436865083373,31.2608848880944],[121.436835450471,31.2608612394319],[121.43684267584,31.2608314389721],[121.436813042949,31.2608077902929],[121.436776184702,31.260813942078],[121.436746551834,31.2607902933866],[121.4367537772,31.2607604929056],[121.436724144343,31.2607368441975],[121.436687286132,31.260742995975],[121.436657653298,31.2607193472548],[121.436620795112,31.2607254990164],[121.436591162301,31.260701850284],[121.436598387664,31.2606720497854],[121.436568754864,31.2606484010362],[121.436531896714,31.2606545527903],[121.436502263937,31.260630904029],[121.436465405812,31.2606370557672],[121.436435773059,31.2606134069937],[121.436398914958,31.2606195587159],[121.436391689599,31.2606493592032],[121.436354831512,31.2606555109011],[121.436347606153,31.2606853113595],[121.436377238881,31.2607089601238],[121.436370013521,31.260738760557],[121.436333155435,31.2607449122222],[121.436325930076,31.2607747126266],[121.436289072003,31.2607808642674],[121.436281846644,31.2608106646429],[121.436244988584,31.2608168162595],[121.436237763224,31.260846616606],[121.436200905178,31.2608527681983],[121.436193679819,31.2608825685159],[121.436223312505,31.260906217245],[121.436260170564,31.2609000656612],[121.436289803274,31.2609237143781],[121.436326661357,31.2609175627783],[121.436356294091,31.2609412114832],[121.436349068728,31.2609710117832],[121.436378701472,31.2609946604713],[121.436415559592,31.260988508864],[121.436445192359,31.2610121575399],[121.436482050503,31.2610060059166],[121.436511683294,31.2610296545804],[121.436504457928,31.2610594548629],[121.436534090729,31.26108310351],[121.436570948909,31.2610769518791],[121.436600581734,31.2611006005141],[121.436637439939,31.2610944488673],[121.436667072787,31.26111809749],[121.436703931016,31.2611119458273],[121.436733563888,31.2611355944379],[121.436726338517,31.2611653947067],[121.436755971399,31.2611890433006],[121.436748746027,31.2612188435442],[121.43677837892,31.2612424921214],[121.436815237197,31.2612363404595],[121.436844870113,31.2612599890245],[121.436881728415,31.2612538373466],[121.436911361354,31.2612774858995],[121.436904135979,31.2613072861256],[121.436933768928,31.2613309346617],[121.436970627267,31.2613247829763],[121.43700026024,31.2613484315003],[121.437037118603,31.2613422797989],[121.437066751599,31.2613659283108],[121.43705952622,31.2613957285193],[121.437089159227,31.2614193770144],[121.437126017626,31.2614132253055],[121.437155650657,31.2614368737884],[121.43719250908,31.2614307220636],[121.437222142134,31.2614543705344],[121.437214916752,31.2614841707254],[121.437244549816,31.2615078191794],[121.437281408276,31.261501667447],[121.437311041364,31.2615253158889],[121.437347899848,31.2615191641406],[121.437377532959,31.2615428125704],[121.437370307573,31.2615726127438],[121.437399940695,31.2615962611568],[121.437436799216,31.261590109401],[121.437466432361,31.2616137578018],[121.437503290906,31.26160760603],[121.437504718863,31.2616087455934],[121.437532924075,31.2616312544187],[121.437525698685,31.2616610545746],[121.437555331864,31.2616847029466],[121.437548106473,31.2617145030774],[121.437577739662,31.2617381514326],[121.437614598255,31.2617319996616],[121.437644231468,31.2617556480047],[121.437681090086,31.2617494962178],[121.437710723322,31.2617731445487],[121.437747581965,31.2617669927459],[121.437777215225,31.2617906410647],[121.437769989829,31.2618204411817],[121.437799623099,31.2618440894837],[121.437836481778,31.2618379376733],[121.437866115071,31.2618615859632],[121.437902973775,31.2618554341369],[121.437932607092,31.2618790824147],[121.437925381692,31.2619088825141],[121.43795501502,31.2619325307751],[121.437991873759,31.2619263789412],[121.43802150711,31.2619500271901],[121.438058365875,31.2619438753403],[121.438065591276,31.2619140752332],[121.438102450054,31.2619079233591],[121.438132083441,31.2619315716004],[121.438168942243,31.2619254197103],[121.438176167646,31.2618956195706],[121.438146534246,31.2618719713247],[121.438153759648,31.2618421711599],[121.438190618452,31.2618360192371],[121.438197843854,31.2618062190434]],[[121.43775480736,31.2617371926037],[121.43775480736,31.2617371926038],[121.437748743785,31.2617622009797],[121.43775480736,31.2617371926038],[121.43775480736,31.2617371926037]]]}
}
]
}
const layer = new PolygonLayer({})
.source(mydata)
.color('#2ca02c')
.shape('fill')
.size(1)
.style({
opacity: 0.5,
})
.active(true);
const layer2 = new LineLayer({
zIndex: 2
})
.source(mydata)
.color('#2ca02c')
.active(true)
.size(1)
.style({
opacity: 1, // 设置线的透明度
})
scene.addLayer(layer);
scene.addLayer(layer2);
layer.fitBounds()

这个面图层会显示出乱线条, 在其他工具, 比如geojson.io是显示正常的

重现链接

https://codesandbox.io/s/thirsty-cdn-9n4tr9?file=/index.js

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

image

补充说明(可选)

No response

Copy link
Contributor

hi @flyours, welcome!

Copy link
Contributor

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

@github-actions github-actions bot added the good first issue Good for newcomers label Mar 11, 2024
@flyours
Copy link
Author

flyours commented Mar 11, 2024

import { Scene, LineLayer, PolygonLayer } from '@antv/l7';
import { TencentMap } from '@antv/l7-maps';

function initMap() {
const scene = new Scene({
id: 'map',
map: new TencentMap({
zoom: 10,
minZoom: 5,
maxZoom: 20
})
});
scene.on('loaded', () => {
const mydata={
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "01",
"properties": {
"name": "Alabama",
"density": 94.65
},
"geometry": {"type":"Polygon","coordinates":[[[121.438197843854,31.2618062190434],[121.438234702671,31.2618000670963],[121.438241928073,31.2617702668736],[121.438278786903,31.2617641149022],[121.438286012306,31.2617343146507],[121.438256378878,31.2617106663743],[121.438263604279,31.2616808660976],[121.438233970862,31.2616572178044],[121.438197112056,31.2616633697926],[121.438167478662,31.2616397214873],[121.438174704061,31.2616099211892],[121.438145070678,31.2615862728672],[121.438108211908,31.2615924248478],[121.438078578547,31.2615687765136],[121.438041719802,31.2615749284782],[121.438012086465,31.2615512801319],[121.437975227745,31.2615574320806],[121.437945594431,31.2615337837221],[121.437908735735,31.2615399356549],[121.437879102445,31.2615162872843],[121.437842243774,31.2615224392011],[121.43783501838,31.2615522394802],[121.437798159722,31.2615583913728],[121.437790934329,31.261588191623],[121.437790934329,31.261588191623],[121.437790934329,31.261588191623],[121.437798159722,31.2615583913728],[121.437768526468,31.2615347429946],[121.437775167368,31.2615073533863],[121.43777575186,31.2615049427193],[121.43777575186,31.2615049427193],[121.43777575186,31.2615049427193],[121.437770467931,31.2615007259536],[121.437746118617,31.2614812943243],[121.437753344008,31.2614514940239],[121.437723710775,31.2614278456122],[121.437730936165,31.2613980452867],[121.437701302942,31.2613743968582],[121.437708528331,31.2613445965076],[121.43767889512,31.2613209480624],[121.437642036532,31.2613270999725],[121.437612403344,31.2613034515152],[121.43761962873,31.2612736511432],[121.437589995552,31.2612500026692],[121.437553137001,31.2612561545717],[121.437523503847,31.2612325060855],[121.43748664532,31.2612386579722],[121.437457012189,31.2612150094738],[121.437464237572,31.2611852090843],[121.437434604452,31.2611615605692],[121.437397745961,31.2611677124482],[121.437368112864,31.261144063921],[121.437331254398,31.2611502157842],[121.437301621325,31.2611265672448],[121.437308846704,31.2610967668377],[121.437279213641,31.2610731182815],[121.437242355211,31.2610792701372],[121.437212722172,31.2610556215689],[121.437175863767,31.2610617734085],[121.43714623075,31.2610381248281],[121.437153456126,31.2610083244034],[121.43712382312,31.2609846758063],[121.437086964751,31.2609908276384],[121.437057331769,31.2609671790291],[121.437020473425,31.2609733308453],[121.436990840466,31.2609496822238],[121.436998065838,31.2609198817816],[121.436968432889,31.2608962331434],[121.436931574582,31.260902384952],[121.436901941656,31.2608787363017],[121.436865083373,31.2608848880944],[121.436835450471,31.2608612394319],[121.43684267584,31.2608314389721],[121.436813042949,31.2608077902929],[121.436776184702,31.260813942078],[121.436746551834,31.2607902933866],[121.4367537772,31.2607604929056],[121.436724144343,31.2607368441975],[121.436687286132,31.260742995975],[121.436657653298,31.2607193472548],[121.436620795112,31.2607254990164],[121.436591162301,31.260701850284],[121.436598387664,31.2606720497854],[121.436568754864,31.2606484010362],[121.436531896714,31.2606545527903],[121.436502263937,31.260630904029],[121.436465405812,31.2606370557672],[121.436435773059,31.2606134069937],[121.436398914958,31.2606195587159],[121.436391689599,31.2606493592032],[121.436354831512,31.2606555109011],[121.436347606153,31.2606853113595],[121.436377238881,31.2607089601238],[121.436370013521,31.260738760557],[121.436333155435,31.2607449122222],[121.436325930076,31.2607747126266],[121.436289072003,31.2607808642674],[121.436281846644,31.2608106646429],[121.436244988584,31.2608168162595],[121.436237763224,31.260846616606],[121.436200905178,31.2608527681983],[121.436193679819,31.2608825685159],[121.436223312505,31.260906217245],[121.436260170564,31.2609000656612],[121.436289803274,31.2609237143781],[121.436326661357,31.2609175627783],[121.436356294091,31.2609412114832],[121.436349068728,31.2609710117832],[121.436378701472,31.2609946604713],[121.436415559592,31.260988508864],[121.436445192359,31.2610121575399],[121.436482050503,31.2610060059166],[121.436511683294,31.2610296545804],[121.436504457928,31.2610594548629],[121.436534090729,31.26108310351],[121.436570948909,31.2610769518791],[121.436600581734,31.2611006005141],[121.436637439939,31.2610944488673],[121.436667072787,31.26111809749],[121.436703931016,31.2611119458273],[121.436733563888,31.2611355944379],[121.436726338517,31.2611653947067],[121.436755971399,31.2611890433006],[121.436748746027,31.2612188435442],[121.43677837892,31.2612424921214],[121.436815237197,31.2612363404595],[121.436844870113,31.2612599890245],[121.436881728415,31.2612538373466],[121.436911361354,31.2612774858995],[121.436904135979,31.2613072861256],[121.436933768928,31.2613309346617],[121.436970627267,31.2613247829763],[121.43700026024,31.2613484315003],[121.437037118603,31.2613422797989],[121.437066751599,31.2613659283108],[121.43705952622,31.2613957285193],[121.437089159227,31.2614193770144],[121.437126017626,31.2614132253055],[121.437155650657,31.2614368737884],[121.43719250908,31.2614307220636],[121.437222142134,31.2614543705344],[121.437214916752,31.2614841707254],[121.437244549816,31.2615078191794],[121.437281408276,31.261501667447],[121.437311041364,31.2615253158889],[121.437347899848,31.2615191641406],[121.437377532959,31.2615428125704],[121.437370307573,31.2615726127438],[121.437399940695,31.2615962611568],[121.437436799216,31.261590109401],[121.437466432361,31.2616137578018],[121.437503290906,31.26160760603],[121.437504718863,31.2616087455934],[121.437532924075,31.2616312544187],[121.437525698685,31.2616610545746],[121.437555331864,31.2616847029466],[121.437548106473,31.2617145030774],[121.437577739662,31.2617381514326],[121.437614598255,31.2617319996616],[121.437644231468,31.2617556480047],[121.437681090086,31.2617494962178],[121.437710723322,31.2617731445487],[121.437747581965,31.2617669927459],[121.437777215225,31.2617906410647],[121.437769989829,31.2618204411817],[121.437799623099,31.2618440894837],[121.437836481778,31.2618379376733],[121.437866115071,31.2618615859632],[121.437902973775,31.2618554341369],[121.437932607092,31.2618790824147],[121.437925381692,31.2619088825141],[121.43795501502,31.2619325307751],[121.437991873759,31.2619263789412],[121.43802150711,31.2619500271901],[121.438058365875,31.2619438753403],[121.438065591276,31.2619140752332],[121.438102450054,31.2619079233591],[121.438132083441,31.2619315716004],[121.438168942243,31.2619254197103],[121.438176167646,31.2618956195706],[121.438146534246,31.2618719713247],[121.438153759648,31.2618421711599],[121.438190618452,31.2618360192371],[121.438197843854,31.2618062190434]],[[121.43775480736,31.2617371926037],[121.43775480736,31.2617371926038],[121.437748743785,31.2617622009797],[121.43775480736,31.2617371926038],[121.43775480736,31.2617371926037]]]}
}
]
}
const layer = new PolygonLayer({})
.source(mydata)
.color('#2ca02c')
.shape('fill')
.size(1)
.style({
opacity: 0.5,
})
.active(true);
const layer2 = new LineLayer({
zIndex: 2
})
.source(mydata)
.color('#2ca02c')
.active(true)
.size(1)
.style({
opacity: 1, // 设置线的透明度
})
scene.addLayer(layer);
scene.addLayer(layer2);
layer.fitBounds()

});
}
initMap();

@flyours
Copy link
Author

flyours commented Mar 11, 2024

完整的测试如上

@lzxue
Copy link
Contributor

lzxue commented Mar 12, 2024

应该是 WebGL 数据精度的问题,切换成高德没有问题

@flyours
Copy link
Author

flyours commented Mar 12, 2024

高德tile也有问题: https://codesandbox.io/p/sandbox/strange-https-9n4tr9?file=%2Findex.js%3A12%2C6
也试过其他的百度、腾讯也是同样的问题
WebGL精度如何控制呢?
我把geojson改成8位精度,并且makevalid之后还是有问题
辛苦帮忙看看如何规避?多谢

@flyours
Copy link
Author

flyours commented Mar 12, 2024

image

@flyours
Copy link
Author

flyours commented Mar 12, 2024

import { Scene, LineLayer, RasterLayer, PolygonLayer } from "@antv/l7";
import { Map } from "@antv/l7-maps";

function initMap() {
const scene = new Scene({
id: "map",
map: new Map({
zoom: 10,
minZoom: 5,
maxZoom: 20,
}),
});
scene.on("loaded", () => {
const layer0 = new RasterLayer();
layer0.source(
"https://webrd0{1-3}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
{
parser: {
type: "rasterTile",
tileSize: 256,
minZoom: 2,
maxZoom: 18,
},
}
);
scene.addLayer(layer0);

const mydata = {
  type: "FeatureCollection",
  features: [
    {
      type: "Feature",
      id: "01",
      properties: {
        name: "Alabama",
        density: 94.65,
      },
      geometry: {
        type: "Polygon",
        coordinates: [
          [
            [121.43779816, 31.26155839],
            [121.43776853, 31.26153474],
            [121.43777517, 31.26150735],
            [121.43777575, 31.26150494],
            [121.43777047, 31.26150073],
            [121.43774612, 31.26148129],
            [121.43775334, 31.26145149],
            [121.43772371, 31.26142785],
            [121.43773094, 31.26139805],
            [121.4377013, 31.2613744],
            [121.43770853, 31.2613446],
            [121.4376789, 31.26132095],
            [121.43764204, 31.2613271],
            [121.4376124, 31.26130345],
            [121.43761963, 31.26127365],
            [121.43759, 31.26125],
            [121.43755314, 31.26125615],
            [121.4375235, 31.26123251],
            [121.43748665, 31.26123866],
            [121.43745701, 31.26121501],
            [121.43746424, 31.26118521],
            [121.4374346, 31.26116156],
            [121.43739775, 31.26116771],
            [121.43736811, 31.26114406],
            [121.43733125, 31.26115022],
            [121.43730162, 31.26112657],
            [121.43730885, 31.26109677],
            [121.43727921, 31.26107312],
            [121.43724236, 31.26107927],
            [121.43721272, 31.26105562],
            [121.43717586, 31.26106177],
            [121.43714623, 31.26103812],
            [121.43715346, 31.26100832],
            [121.43712382, 31.26098468],
            [121.43708696, 31.26099083],
            [121.43705733, 31.26096718],
            [121.43702047, 31.26097333],
            [121.43699084, 31.26094968],
            [121.43699807, 31.26091988],
            [121.43696843, 31.26089623],
            [121.43693157, 31.26090238],
            [121.43690194, 31.26087874],
            [121.43686508, 31.26088489],
            [121.43683545, 31.26086124],
            [121.43684268, 31.26083144],
            [121.43681304, 31.26080779],
            [121.43677618, 31.26081394],
            [121.43674655, 31.26079029],
            [121.43675378, 31.26076049],
            [121.43672414, 31.26073684],
            [121.43668729, 31.260743],
            [121.43665765, 31.26071935],
            [121.4366208, 31.2607255],
            [121.43659116, 31.26070185],
            [121.43659839, 31.26067205],
            [121.43656875, 31.2606484],
            [121.4365319, 31.26065455],
            [121.43650226, 31.2606309],
            [121.43646541, 31.26063706],
            [121.43643577, 31.26061341],
            [121.43639891, 31.26061956],
            [121.43639169, 31.26064936],
            [121.43635483, 31.26065551],
            [121.43634761, 31.26068531],
            [121.43637724, 31.26070896],
            [121.43637001, 31.26073876],
            [121.43633316, 31.26074491],
            [121.43632593, 31.26077471],
            [121.43628907, 31.26078086],
            [121.43628185, 31.26081066],
            [121.43624499, 31.26081682],
            [121.43623776, 31.26084662],
            [121.43620091, 31.26085277],
            [121.43619368, 31.26088257],
            [121.43622331, 31.26090622],
            [121.43626017, 31.26090007],
            [121.4362898, 31.26092371],
            [121.43632666, 31.26091756],
            [121.43635629, 31.26094121],
            [121.43634907, 31.26097101],
            [121.4363787, 31.26099466],
            [121.43641556, 31.26098851],
            [121.43644519, 31.26101216],
            [121.43648205, 31.26100601],
            [121.43651168, 31.26102965],
            [121.43650446, 31.26105945],
            [121.43653409, 31.2610831],
            [121.43657095, 31.26107695],
            [121.43660058, 31.2611006],
            [121.43663744, 31.26109445],
            [121.43666707, 31.2611181],
            [121.43670393, 31.26111195],
            [121.43673356, 31.26113559],
            [121.43672634, 31.26116539],
            [121.43675597, 31.26118904],
            [121.43674875, 31.26121884],
            [121.43677838, 31.26124249],
            [121.43681524, 31.26123634],
            [121.43684487, 31.26125999],
            [121.43688173, 31.26125384],
            [121.43691136, 31.26127749],
            [121.43690414, 31.26130729],
            [121.43693377, 31.26133093],
            [121.43697063, 31.26132478],
            [121.43700026, 31.26134843],
            [121.43703712, 31.26134228],
            [121.43706675, 31.26136593],
            [121.43705953, 31.26139573],
            [121.43708916, 31.26141938],
            [121.43712602, 31.26141323],
            [121.43715565, 31.26143687],
            [121.43719251, 31.26143072],
            [121.43722214, 31.26145437],
            [121.43721492, 31.26148417],
            [121.43724455, 31.26150782],
            [121.43728141, 31.26150167],
            [121.43731104, 31.26152532],
            [121.4373479, 31.26151916],
            [121.43737753, 31.26154281],
            [121.43737031, 31.26157261],
            [121.43739994, 31.26159626],
            [121.4374368, 31.26159011],
            [121.43746643, 31.26161376],
            [121.43750329, 31.26160761],
            [121.43750472, 31.26160875],
            [121.43753292, 31.26163125],
            [121.4375257, 31.26166105],
            [121.43755533, 31.2616847],
            [121.43754811, 31.2617145],
            [121.43757774, 31.26173815],
            [121.4376146, 31.261732],
            [121.43764423, 31.26175565],
            [121.43768109, 31.2617495],
            [121.43771072, 31.26177314],
            [121.43774758, 31.26176699],
            [121.43777722, 31.26179064],
            [121.43776999, 31.26182044],
            [121.43779962, 31.26184409],
            [121.43783648, 31.26183794],
            [121.43786612, 31.26186159],
            [121.43790297, 31.26185543],
            [121.43793261, 31.26187908],
            [121.43792538, 31.26190888],
            [121.43795502, 31.26193253],
            [121.43799187, 31.26192638],
            [121.43802151, 31.26195003],
            [121.43805837, 31.26194388],
            [121.43806559, 31.26191408],
            [121.43810245, 31.26190792],
            [121.43813208, 31.26193157],
            [121.43816894, 31.26192542],
            [121.43817617, 31.26189562],
            [121.43814653, 31.26187197],
            [121.43815376, 31.26184217],
            [121.43819062, 31.26183602],
            [121.43819784, 31.26180622],
            [121.4382347, 31.26180007],
            [121.43824193, 31.26177027],
            [121.43827879, 31.26176411],
            [121.43828601, 31.26173431],
            [121.43825638, 31.26171067],
            [121.4382636, 31.26168087],
            [121.43823397, 31.26165722],
            [121.43819711, 31.26166337],
            [121.43816748, 31.26163972],
            [121.4381747, 31.26160992],
            [121.43814507, 31.26158627],
            [121.43810821, 31.26159242],
            [121.43807858, 31.26156878],
            [121.43804172, 31.26157493],
            [121.43801209, 31.26155128],
            [121.43797523, 31.26155743],
            [121.43794559, 31.26153378],
            [121.43790874, 31.26153994],
            [121.4378791, 31.26151629],
            [121.43784224, 31.26152244],
            [121.43783502, 31.26155224],
            [121.43779816, 31.26155839],
          ],
        ],
      },
    },
  ],
};
const layer = new PolygonLayer({})
  .source(mydata)
  .color("#2ca02c")
  .shape("fill")
  .size(1)
  .style({
    opacity: 0.5,
  })
  .active(true);
const layer2 = new LineLayer({
  zIndex: 2,
})
  .source(mydata)
  .color("#2ca02c")
  .active(true)
  .size(1)
  .style({
    opacity: 1, // 设置线的透明度
  });
scene.addLayer(layer);
scene.addLayer(layer2);
layer.fitBounds();

});
}
initMap();

@lzxue
Copy link
Contributor

lzxue commented Mar 12, 2024

使用 GaodeMap

@lzxue lzxue added the bug 这个是一个 bug label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 这个是一个 bug good first issue Good for newcomers 🌟 star
Projects
None yet
Development

No branches or pull requests

2 participants