import { PointLayer, Scene } from '@antv/l7'; import { Mapbox } from '@antv/l7-maps'; import * as React from 'react'; // @ts-ignore import data from '../data/data.json'; export default class Point3D extends React.Component { // @ts-ignore private scene: Scene; public componentWillUnmount() { this.scene.destroy(); } public componentDidMount() { const scene = new Scene({ id: 'map', map: new Mapbox({ center: [120.19382669582967, 30.258134], pitch: 0, style: 'mapbox://styles/mapbox/streets-v9', zoom: 1, }), }); const pointLayer = new PointLayer({ enablePicking: false, enableHighlight: false, enableTAA: false, onHover: (pickedFeature: any) => { // tslint:disable-next-line:no-console console.log('Scene4', pickedFeature.feature.name); }, }); pointLayer .source(data, { cluster: true, }) .color('red') .shape('cylinder') .size([15, 10]); scene.addLayer(pointLayer); scene.render(); this.scene = scene; } public render() { return (
); } }