antv-l7/demos/raster/basic/demo/image.js

26 lines
464 B
JavaScript
Raw Normal View History

2019-11-21 17:52:18 +08:00
import { Scene, ImageLayer } from '@antv/l7';
2019-11-18 16:13:15 +08:00
const scene = new Scene({
id: 'map',
pitch: 0,
type: 'amap',
style: 'light',
2020-01-15 15:52:31 +08:00
center: [ 121.2680, 30.3628 ],
zoom: 13
2019-11-18 16:13:15 +08:00
});
const layer = new ImageLayer({});
layer.source(
'https://gw.alipayobjects.com/zos/rmsportal/FnHFeFklTzKDdUESRNDv.jpg',
{
parser: {
type: 'image',
2020-01-15 15:52:31 +08:00
extent: [ 121.168, 30.2828, 121.384, 30.4219 ]
}
}
2019-11-18 16:13:15 +08:00
);
2020-01-15 15:52:31 +08:00
scene.on('loaded', () => {
2019-11-18 16:13:15 +08:00
scene.addLayer(layer);
2020-01-15 15:52:31 +08:00
});
2019-11-18 16:13:15 +08:00