Skip to content

Commit e089942

Browse files
author
潘卓然Y7000P
committed
【站点】【新增】【新增MapboxGL的OGC-WMTS教程】
1 parent b79ca72 commit e089942

14 files changed

Lines changed: 81 additions & 0 deletions

File tree

10.8 KB
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# 0. wmts - 教程
2+
3+
[标准的 WMTS 元数据](http://develop.smaryun.com:6163/igs/rest/ogc/beijing/WMTSServer)
4+
5+
![说明](./static/demo/mapboxgl/helper/ogc/wmts/gettile.png)
6+
7+
## 1. restful 调用 - 使用受限
8+
9+
> `restful调用`的核心是将所有的 级别 行列 图层 样式 的参数统一明码的标记在 url 请求中
10+
> 使用这种方式 级别 行列号 都一定是`数字型` 这里很关键 , 常见的金字塔模型里面的级别 都`一般是整数表示`
11+
12+
```js
13+
map.addLayer({
14+
id: 'wmts-layer',
15+
type: 'raster',
16+
source: {
17+
type: 'raster',
18+
tiles: [
19+
`${protocol}://${ip}:${port}/igs/rest/ogc/beijing/WMTSServer?` +
20+
'service=WMTS' +
21+
'&request=GetTile' +
22+
'&version=1.0.0' +
23+
'&style=default' +
24+
'&tilematrixSet=EPSG:4326_北京市_arcgis_GB' +
25+
'&format=image/png' +
26+
'&layer=beijing' +
27+
'&tilematrix={z}' +
28+
'&tilerow={y}' +
29+
'&tilecol={x}'
30+
],
31+
tileSize: 256,
32+
mapgisOffset: -1 // 请看下面的3. 错级瓦片
33+
},
34+
paint: {}
35+
});
36+
```
37+
38+
### 1.1 参数说明
39+
40+
| 参数 | 类型 | OGC-名称 | 图片说明 |
41+
| :------------ | :----- | :------------ | :------------------------------------------------------------------- |
42+
| layer | 字符串 | Layer | ![图层](./static/demo/mapboxgl/helper/ogc/wmts/layer.png) |
43+
| style | 字符串 | Style | ![样式](./static/demo/mapboxgl/helper/ogc/wmts/style-type.png) |
44+
| format | 字符串 | Format | ![样式](./static/demo/mapboxgl/helper/ogc/wmts/wmts-format.png) |
45+
| tilematrixSet | 字符串 | TileMatrixSet | ![总称](./static/demo/mapboxgl/helper/ogc/wmts/tilematrixset-name.png) |
46+
47+
![restful](./static/demo/mapboxgl/helper/ogc/wmts/restful.png)
48+
49+
> 这一种是最常见的 WMTS 加载方式, 但这种方式一般只能处理全球裁瓦片的方式: 如经纬度 EPSG:4326/4490/4610 或者墨卡托 EPSG:3857
50+
51+
## 2. kvp
52+
53+
> 目前 mapboxgl 不支持 kvp 方式调用,如有需求请提交 [Github-Issues](https://github.com/MapGIS/WebClient-JavaScript/issues/new)
54+
55+
## 3. 错级瓦片
56+
57+
> 虽然目前不提供 KVP 的传参方式,但是仍然有额外的方式处理 错级瓦片 如初始级为 0 / 1 / -1 等情况。
58+
59+
```javascript
60+
map.addLayer({
61+
id: 'wmts-layer',
62+
type: 'raster',
63+
source: {
64+
type: 'raster',
65+
tiles: [`${protocol}://${ip}:${port}/igs/rest/mrms/tile/EPSG_4326_WORLD_TILE/{z}/{y}/{x}`],
66+
tileSize: 256,
67+
mapgisOffset: -1 // 通过设置级别的偏移实现对应的偏移
68+
}
69+
});
70+
```
71+
72+
结果如下所示:
73+
[在线链接](/#/demo/mapboxgl/mapgis-igserver/map/mapgisoffset)
74+
75+
![offset](./static/demo/mapboxgl/helper/ogc/wmts/offset.png)
264 KB
Loading
149 KB
Loading
114 KB
Loading
144 KB
Loading
37.3 KB
Loading
514 KB
Loading
67 KB
Loading
63.3 KB
Loading

0 commit comments

Comments
 (0)