fix: fix website demo err

This commit is contained in:
shihui 2023-02-15 10:46:59 +08:00
parent 4db42a1814
commit cfb8e5d569
1 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import { PointLayer, Scale, Scene, Layers, Zoom } from '@antv/l7'; import { PointLayer, Scale, Scene, LayerSwitch, Zoom } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps'; import { GaodeMap } from '@antv/l7-maps';
const scene = new Scene({ const scene = new Scene({
id: 'map', id: 'map',
@ -31,24 +31,20 @@ scene.on('loaded', () => {
}); });
scene.addLayer(pointLayer); scene.addLayer(pointLayer);
const overlayers = {
气泡图: pointLayer
};
const layersControl = new Layers({
overlayers,
position: 'rightcenter'
});
scene.addControl(layersControl);
}); });
const zoomControl = new Zoom({ const layerSwitch = new LayerSwitch({
position: 'rightcenter' position: 'rightcenter'
}); })
scene.addControl(layerSwitch);
const scaleControl = new Scale({ const zoomControl = new Zoom({
position: 'bottomright' position: 'rightcenter'
}); });
scene.addControl(zoomControl);
scene.addControl(scaleControl); const scaleControl = new Scale({
position: 'bottomright'
});
scene.addControl(zoomControl);
scene.addControl(scaleControl);
}); });