mirror of https://gitee.com/antv-l7/antv-l7
39 lines
727 B
TypeScript
39 lines
727 B
TypeScript
// @ts-ignore
|
|||
import { Scene, LineLayer } from '@antv/l7';
|
|||
// @ts-ignore
|
|||
import { GaodeMap } from '@antv/l7-maps';
|
|||
|
|||
const scene = new Scene({
|
|||
id: 'map',
|
|||
|
|||
map: new GaodeMap({
|
|||
style:"light",
|
|||
center: [112, 30],
|
|||
zoom: 6,
|
|||
}),
|
|||
});
|
|||
|
|||
const layer = new LineLayer({
|
|||
featureId: 'COLOR',
|
|||
sourceLayer: 'ecoregions2', // woods hillshade contour ecoregions ecoregions2 city
|
|||
});
|
|||
layer
|
|||
.source(
|
|||
'http://ganos.oss-cn-hangzhou.aliyuncs.com/m2/rs_l7/{z}/{x}/{y}.pbf',
|
|||
{
|
|||
parser: {
|
|||
type: 'mvt',
|
|||
tileSize: 256,
|
|||
zoomOffset: 0,
|
|||
maxZoom: 9,
|
|||
},
|
|||
},
|
|||
)
|
|||
.shape('simple')
|
|||
.color('COLOR')
|
|||
.size(1)
|
|||
.select(true);
|
|||
scene.on('loaded', () => {
|
|||
scene.addLayer(layer);
|
|||
});
|