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

polygon显示变形严重 #2657

Open
flyours opened this issue Jan 7, 2025 · 0 comments
Open

polygon显示变形严重 #2657

flyours opened this issue Jan 7, 2025 · 0 comments
Assignees

Comments

@flyours
Copy link

flyours commented Jan 7, 2025

问题描述

方型的polgon显示成了梯形
image

重现链接

https://codesandbox.io/p/sandbox/l7-demo-forked-fntqmt?workspaceId=ws_SquWjKnX9ZtaqtASempSjf

重现步骤

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: [
          [
            [116.47835134, 40.00333684],
            [116.47835333, 40.00330714],
            [116.4783333, 40.00330639],
            [116.47833131, 40.0033359],
            [116.47835134, 40.00333684],
          ],
        ],
      },
    },
  ],
};
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();

预期行为

应该是方型
image

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

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

No branches or pull requests

2 participants