We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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);
The text was updated successfully, but these errors were encountered:
const layers: any[] = []; layers.push(createBillboards('./resource/images/a.svg', 0)); layers.push(createBillboards('./resource/images/b.svg', 100)); billboardLayers.value = layers; 使用这种方式渲染就没有缩放重影的问题
Sorry, something went wrong.
No branches or pull requests
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);
The text was updated successfully, but these errors were encountered: