0.0.5 • Published 3 years ago
oltool v0.0.5
openlayer工具
介绍
openlayers常用工具封装
使用
import olTool from 'olTool'
const OlTool = new olTool({
minZoom: 5,
maxZoom: 20,
initialZoom: 6,
minVisbleZoom: 5,
minVisibleScale: 10000000, // 分级时,显示尺度
minVisibleScale_: 10000000, // 未分级时,标注显示尺度(3000000)
origin: [-180.0, 90.0],
init_Center: [107.5, 30],
full_Extent: { xmin: 73.498436, ymin: 21.142454, xmax: 135.086655, ymax: 53.561573 },
init_Extent: { xmin: 90.51758618252902, ymin: 23.893409685015925, xmax: 121.95764914055758, ymax: 36.12653381334954 },
isClassify: false, // 是否分级显示
isTextVisble: true, // 是否显示站名
resolutions: [
0.7031250000029744,
0.35156250000000011,
0.17578125000000006,
0.087890625000000028,
0.043945312500000014,
0.021972656250000007,
0.010986328125000003,
0.0054931640625000017,
0.0027465820312500009,
0.0013732910156250004,
0.00068664550781250022,
0.00034332275390625011,
0.00017166137695312505,
8.5830688476562527E-5,
4.2915344238281264E-5,
2.1457672119140632E-5,
1.0728836059570316E-5,
5.3644180297851579E-6,
2.68220901489257E-6,
1.3411118121060625E-6
],
basemap_config: [{
map_url: [{
map_url: 'http://t0.tianditu.com/ter_c/wmts?tk=',
type: 'tdt',
name: '晕渲底图',
zIndex: 0,
id: 'ter_c'
}, {
map_url: 'http://t0.tianditu.com/cta_c/wmts?tk=',
type: 'tdt',
name: '标注图层',
zIndex: 99,
id: 'cta_c'
}],
url: 'images/yxt.png',
name: '影像',
visible: true,
id: 'tdtDemLayer'
}, {
map_url: [{
map_url: 'http://t0.tianditu.com/vec_c/wmts?tk=',
type: 'tdt',
name: '行政底图',
zIndex: 0,
id: 'vec_c'
}, {
map_url: 'http://t0.tianditu.com/cva_c/wmts?tk=',
type: 'tdt',
name: '标注图层',
zIndex: 99,
id: 'cva_c'
}],
url: 'images/xzt.png',
name: '行政',
visible: false,
id: 'tdtVectorLayer'
}, {
map_url: [{
map_url: 'http://t0.tianditu.com/img_c/wmts?tk=',
type: 'tdt',
name: '影像底图',
zIndex: 0,
id: 'img_c'
}, {
map_url: 'http://t0.tianditu.com/cia_c/wmts?tk=',
type: 'tdt',
name: '标注图层',
zIndex: 99,
id: 'cia_c'
}],
url: 'images/yxit.png',
name: '影像',
visible: false,
id: 'tdtImageLayer'
}]
})
OlTool.initMap( id )
...