2019-12-10 20:11:26 +08:00
|
|
|
---
|
|
|
|
title: Image
|
|
|
|
order: 4
|
|
|
|
---
|
2020-11-16 15:19:41 +08:00
|
|
|
`markdown:docs/common/style.md`
|
2019-12-10 20:11:26 +08:00
|
|
|
|
2019-12-15 14:37:43 +08:00
|
|
|
Image 数据主要用于在地图根据经纬度范围添加图图片,比如一幅纸制地图扫描版你要放在地图显示。
|
2019-12-10 20:11:26 +08:00
|
|
|
|
|
|
|
## parser
|
|
|
|
|
|
|
|
- type: image
|
|
|
|
- extent: 图像的经纬度范围 [minlng, minlat,maxLng, maxLat]
|
|
|
|
|
|
|
|
根据图片的经纬度范围,将图片添加到地图上。
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
layer.source(
|
|
|
|
'https://gw.alipayobjects.com/zos/rmsportal/FnHFeFklTzKDdUESRNDv.jpg',
|
|
|
|
{
|
|
|
|
parser: {
|
|
|
|
type: 'image',
|
|
|
|
extent: [121.168, 30.2828, 121.384, 30.4219],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
```
|