Skip to content

Commit 9d9b692

Browse files
author
潘卓然Y7000P
committed
【站点】【新增】【添加Openlayer的GDBP矢量图层】
1 parent 90c3eca commit 9d9b692

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

website/public/static/demo/config/config-openlayers.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@
134134
"detail": "自定义比例尺",
135135
"icon": "definescale.png",
136136
"update": "最后更新时间:2019-11-07"
137+
},
138+
{
139+
"name": "GDBP矢量图层",
140+
"file": "gdbplayer",
141+
"diffcult": "4",
142+
"detail": "矢量图层",
143+
"icon": "gdbplayer.png",
144+
"update": "最后更新时间:2020-12-16"
137145
}
138146
]
139147
},
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>矢量图层显示</title>
5+
<!--引入当前页面样式表-->
6+
<link href="./style.css" rel="stylesheet" type="text/css"/>
7+
<script src="./static/libs/include-openlayers-local.js"></script>
8+
<script type="text/javascript">
9+
//定义地图文档图层和地图
10+
var VecLayer, map;
11+
12+
/** 初始化地图显示*/
13+
function init() {
14+
//地图范围
15+
var extent = [634883.45517486, 3423051.6221381, 643377, 3431937.8];
16+
//投影坐标系
17+
var projection = new ol.proj.Projection({ units: ol.proj.Units.METERS, extent: extent });
18+
//中心点
19+
var center = ol.extent.getCenter(extent);
20+
//图层显示名称
21+
var name = "MapGIS IGS VecLayer";
22+
//要显示的图层的gdbps地址
23+
var gdbps = ["gdbp://MapGisLocal/sample/ds/地图综合/sfcls/水系"];
24+
//创建一个图层
25+
VecLayer = new Zondy.Map.GdbpLayer(name, gdbps, {
26+
ip: "develop.smaryun.com",
27+
port: "6163", //访问IGServer的端口号,.net版为6163,Java版为8089,
28+
extent:extent,
29+
mapstyUri: 'mapstyUri',
30+
mapstyOption: 'mapstyOption'
31+
});
32+
console.log('VecLayer', VecLayer);
33+
//创建一个地图容器
34+
map = new ol.Map({
35+
//目标DIV
36+
target: 'mapCon',
37+
//添加图层到地图容器中
38+
layers: [VecLayer],
39+
view: new ol.View({
40+
center: center,
41+
projection: projection,
42+
zoom: 2
43+
})
44+
});
45+
}
46+
</script>
47+
</head>
48+
<body onload="init()">
49+
<div id="mapCon" style="width: 100%; height: 95%; position: absolute;">
50+
</div>
51+
</body>
52+
</html>
45.1 KB
Loading

0 commit comments

Comments
 (0)