Skip to content

Commit ae64168

Browse files
committed
classsic下逐步增加iclient8示例 reviewby zhurc
1 parent c9ed823 commit ae64168

16 files changed

+312
-0
lines changed

examples/classic/3857Map.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>墨卡托投影系地图</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" exclude="iclient-classic" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer,
12+
host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
13+
url = host + "/iserver/services/map-world/rest/maps/World";
14+
//初始化地图
15+
map = new SuperMap.Map("map", {
16+
controls: [
17+
new SuperMap.Control.Navigation(),
18+
new SuperMap.Control.Zoom()
19+
]
20+
});
21+
map.addControl(new SuperMap.Control.MousePosition());
22+
//初始化图层
23+
layer = new SuperMap.Layer.TiledDynamicRESTLayer("China", url, null, {maxResolution: "auto"});
24+
//监听图层信息加载完成事件
25+
layer.events.on({"layerInitialized": addLayer});
26+
27+
function addLayer() {
28+
map.addLayer(layer);
29+
//显示地图范围
30+
map.setCenter(new SuperMap.LonLat(0, 0), 1);
31+
}
32+
33+
</script>
34+
</body>
35+
</html>

examples/classic/4326Map.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>经纬度地图</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" exclude="iclient-classic" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer,
12+
host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090",
13+
url = host + "/iserver/services/map-world/rest/maps/World";
14+
//初始化地图
15+
map = new SuperMap.Map("map", {
16+
controls: [
17+
new SuperMap.Control.Navigation(),
18+
new SuperMap.Control.Zoom()]
19+
});
20+
map.addControl(new SuperMap.Control.MousePosition());
21+
//初始化图层
22+
layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, null, {maxResolution: "auto"});
23+
//监听图层信息加载完成事件
24+
layer.events.on({"layerInitialized": addLayer});
25+
function addLayer() {
26+
map.addLayer(layer);
27+
//显示地图范围
28+
map.setCenter(new SuperMap.LonLat(0, 0), 0);
29+
}
30+
</script>
31+
</body>
32+
</html>

examples/classic/changchunMap.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5+
<title>平面坐标系图层</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" exclude="iclient-classic" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer, host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
12+
url = host + "/iserver/services/map-changchun/rest/maps/长春市区图";
13+
map = new SuperMap.Map("map", {
14+
controls: [
15+
new SuperMap.Control.Navigation(),
16+
new SuperMap.Control.Zoom()]
17+
});
18+
map.addControl(new SuperMap.Control.MousePosition());
19+
layer = new SuperMap.Layer.TiledDynamicRESTLayer("China", url, null, {maxResolution: "auto"});
20+
layer.events.on({"layerInitialized": addLayer});
21+
22+
function addLayer() {
23+
map.addLayer(layer);
24+
map.setCenter(new SuperMap.LonLat(5105, -3375), 0);
25+
}
26+
</script>
27+
</body>
28+
</html>

examples/classic/cloudLayer.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5+
<title>CloudLayer</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" exclude="iclient-classic" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer;
12+
map = new SuperMap.Map("map", {
13+
controls: [
14+
new SuperMap.Control.ScaleLine(),
15+
new SuperMap.Control.LayerSwitcher(),
16+
new SuperMap.Control.Zoom(),
17+
new SuperMap.Control.Navigation({
18+
dragPanOptions: {
19+
enableKinetic: true
20+
}
21+
})]
22+
});
23+
24+
layer = new SuperMap.Layer.CloudLayer();
25+
map.addLayers([layer]);
26+
map.setCenter(new SuperMap.LonLat(11339634.286396, 4588716.5813769), 4);
27+
</script>
28+
</body>
29+
</html>

examples/classic/config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,41 @@ var exampleConfig = {
99
"iServer": {
1010
name: "iServer",
1111
content: {
12+
"map": {
13+
name: "地图",
14+
content: [{
15+
name: "4326底图",
16+
thumbnail: "4326Map.png",
17+
fileName: "4326Map"
18+
}, {
19+
name: "3857底图",
20+
thumbnail: "3857Map.png",
21+
fileName: "3857Map"
22+
}, {
23+
name: "平面坐标系图层",
24+
thumbnail: "changchunMap.png",
25+
fileName: "changchunMap"
26+
27+
}, {
28+
name: "SuperMap 云图层",
29+
thumbnail: "cloudLayer.png",
30+
fileName: "cloudLayer"
31+
}, {
32+
name: "Image图层",
33+
thumbnail: "image.png",
34+
fileName: "image"
35+
}, {
36+
name: "图层叠加",
37+
thumbnail: "overlayLayer.png",
38+
fileName: "overlayLayer"
39+
40+
}, {
41+
name: "动态图层",
42+
thumbnail: "dynamiclayers.png",
43+
fileName: "dynamiclayers"
44+
45+
}]
46+
},
1247
"processingService": {
1348
name: "分布式分析",
1449
content: [{
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5+
<title>动态图层操作</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer, host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
12+
url = host + "/iserver/services/map-world/rest/maps/World";
13+
var bounds = new SuperMap.Bounds(-120, -60, 120, 60);
14+
map = new SuperMap.Map("map", {
15+
controls: [
16+
new SuperMap.Control.Navigation(),
17+
new SuperMap.Control.Zoom()]
18+
});
19+
layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
20+
transparent: true,
21+
cacheEnabled: true
22+
}, {
23+
dpi: 95.99999999999939,
24+
maxExtent: bounds,
25+
resolutions: [
26+
0.34615384615384615, 0.17307692307692307,
27+
0.08653846153846154, 0.04326923076923077,
28+
0.021634615384615384, 0.010817307692307692,
29+
0.005408653846153846, 0.002704326923076923,
30+
0.0013521634615384615, 0.0006760817307692308,
31+
0.0003380408653846154, 0.0001690204326923077,
32+
0.00008451021634615384, 0.00004225510817307692,
33+
0.00002112755408653846, 0.00001056377704326923
34+
]
35+
});
36+
map.addLayer(layer);
37+
map.setCenter(new SuperMap.LonLat(0, 0), 1.5);
38+
</script>
39+
</body>
40+
</html>

examples/classic/image.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5+
<title>Image图层</title>
6+
</head>
7+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
8+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
9+
<script type="text/javascript" exclude="iclient-classic" src="../../dist/include-classic.js"></script>
10+
<script type="text/javascript">
11+
var map, layer;
12+
map = new SuperMap.Map("map", {
13+
controls: [
14+
new SuperMap.Control.ScaleLine(),
15+
new SuperMap.Control.Zoom(),
16+
new SuperMap.Control.LayerSwitcher(),
17+
new SuperMap.Control.Navigation()]
18+
});
19+
var options = {numZoomLevels: 12, useCanvas: false};
20+
var bounds = new SuperMap.Bounds(-180, -90, 180, 90);
21+
layer = new SuperMap.Layer.Image(
22+
'World_Day',
23+
'images/Day.jpg',
24+
bounds,
25+
options
26+
);
27+
map.addLayer(layer);
28+
map.zoomToMaxExtent();
29+
</script>
30+
</body>
31+
</html>

examples/classic/images/Day.jpg

193 KB
Loading

examples/classic/img/3857Map.png

21.7 KB
Loading

examples/classic/img/4326Map.png

23.8 KB
Loading

0 commit comments

Comments
 (0)