-
Notifications
You must be signed in to change notification settings - Fork 0
/
加载arcgis图层服务.html
51 lines (50 loc) · 1.69 KB
/
加载arcgis图层服务.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>加载arcgis图层服务</title>
<meta charset="utf-8" />
<style type="text/css">
html, body {
margin: 0px;
height: 100%;
width: 100%;
}
#map {
width: 100%;
height: 100%;
}
</style>
<link rel="stylesheet" href="css/mapbox-gl.css" type="text/css"/>
<script type="text/javascript" src="js/mapbox-gl.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var map = new mapboxgl.Map({
container: 'map', // container id
style: { // stylesheet location
"version": 8,
"sources": {},
"layers": []
},
center: [112.939,31.377], // starting position [lng, lat]
zoom: 4 // starting zoom
});
map.on("load",function(){
var arcgis_wmts ='http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ChinaOnlineCommunity&STYLE=default&TILEMATRIXSET=default028mm&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/png'
var arcgis_layer = {
"id": "arcgis_wmts",
"type": "raster",
"source": {
"type": "raster",
"tiles": [arcgis_wmts],
"zoomOffset": 0,//wmts Capabilities信息中TileMatrix第一个对应的实际多少级
"tileSize": 256
}
};
map.addLayer(arcgis_layer);
})
</script>
</body>
</html>