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

参考dynamic-render-data实现动态加载VcCollectionBillboard,导致多个VcCollectionBillboard时候,第二个图层以后的图片出现缩放重影 #26

Open
flywin8 opened this issue May 17, 2024 · 1 comment

Comments

@flywin8
Copy link

flywin8 commented May 17, 2024

import { randomPoint } from '@turf/turf';
const createBillboards = (url, zIndex) =>
randomPoint(1000, { bbox: [95, 41, 118, 25] }).features.map(({ geometry }, i) => ({
id: 'billboards-' + zIndex + '-' + i,
name: '桥梁-' + i,
image: url,
width: 60,
height: 60,
verticalOrigin: 1,
heightReference: 2,
eyeOffset: { x: 0, y: 0, z: zIndex }, // 控制层级
disableDepthTestDistance: Number.POSITIVE_INFINITY,
scaleByDistance: new Cesium.NearFarScalar(4.0e2, 1, 2.0e6, 0.1),
position: { lng: geometry.coordinates[0], lat: geometry.coordinates[1] },
}));
const dataLayer = { id:'id1', page: 'page1', datasets: [] };
let billboards = createBillboards('./resource/images/a.png',0)
dataLayer.datasets.push({ component: 'VcCollectionBillboard', props: { billboards }});
mapStore.addDataLayer(dataLayer);

const dataLayer2 = { id:'id1', page: 'page1', datasets: [] };
billboards = createBillboards('./resource/images/b.png',100)
dataLayer2.datasets.push({ component: 'VcCollectionBillboard', props: { billboards }});
mapStore.addDataLayer(dataLayer2);

image

@flywin8
Copy link
Author

flywin8 commented May 17, 2024

const layers: any[] = [];
layers.push(createBillboards('./resource/images/a.svg', 0));
layers.push(createBillboards('./resource/images/b.svg', 100));
billboardLayers.value = layers;
使用这种方式渲染就没有缩放重影的问题

image

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

1 participant