Skip to content

Commit e2990b8

Browse files
committed
去除示例中多余的js
1 parent 5726d53 commit e2990b8

File tree

68 files changed

+235
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+235
-371
lines changed

examples/css/editor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
height: 100%;
44
margin-left: 200px;
55
position: absolute;
6-
box-shadow: 3px 0px 6px #cccccc;
6+
box-shadow: 2px 0px 6px #cccccc;
77
}
88

99
.contentTool {

examples/css/sideBar.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#sidebar {
22
width: 200px;
3-
border-right: 1px solid #e9e9e9;
3+
border-right: 1px solid #e0e0e0;
44
overflow-y: auto;
55
float: left;
66
position: fixed;
@@ -24,6 +24,7 @@
2424
#sidebar ul.menu .title {
2525
height: 30px;
2626
line-height: 30px;
27+
font-size: 16px;
2728
}
2829

2930
#sidebar ul.menu a:hover,#sidebar ul.menu a.active{

examples/js/editor.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ function initPage() {
99
menu.append(createSideBarMenuItem(key, config[key], containExamples));
1010
}
1111
initSelect();
12-
dragCode();
1312
initEditor();
1413
screenResize();
14+
dragCode();
1515
}
1616

1717
function screenResize() {
@@ -32,7 +32,8 @@ function screenResize() {
3232
myWidth = document.documentElement.clientWidth;
3333
myHeight = document.documentElement.clientHeight;
3434
}
35-
}
35+
mapHeight();
36+
};
3637
}
3738
//初始化编辑器
3839
function initCodeEditor() {
@@ -45,6 +46,7 @@ function initCodeEditor() {
4546
}
4647
aceEditor.setValue($('#editor').val());
4748
aceEditor.clearSelection();
49+
aceEditor.moveCursorTo(0,0);
4850
}
4951

5052
//初始化编辑器以及预览内容
@@ -100,6 +102,10 @@ function loadPreview(content) {
100102
iFrame.document.open();
101103
iFrame.document.write(content);
102104
iFrame.document.close();
105+
iFrame.onload = function () {
106+
mapHeight();
107+
};
108+
103109
}
104110

105111
/**设置显示源码的拖拽效果**/
@@ -118,7 +124,7 @@ function dragCode() {
118124
}
119125
$("#codePane").width(bottomX);
120126
$("#editor").width(bottomX);
121-
$(".ace_content").width(bottomX * 0.8);
127+
aceEditor.resize();
122128
$("#preview").css({'left:': (myWidth - bottomX - 202) + "px"});
123129
$("#innerPage").width(myWidth - bottomX - 202);
124130
aceEditor.resize();
@@ -147,3 +153,7 @@ function initSelect() {
147153
selectMenu(id);
148154
}
149155

156+
function mapHeight() {
157+
$("#innerPage").contents().find("body").height($("#innerPage").height());
158+
}
159+

examples/js/resize.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

examples/leaflet/01_layerService.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
88
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
99
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
10-
<script type="text/javascript" src="../js/resize.js"></script>
1110
<script type="text/javascript">
1211
var map, infowin,
1312
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1413
function init() {
15-
mapHeight();
1614
map = L.map('map', {
1715
preferCanvas: true,
1816
crs: L.CRS.EPSG4326,
@@ -44,11 +42,11 @@
4442

4543
</script>
4644
</head>
47-
<body onload="init()" style="margin: 0;overflow: hidden;background: #fff;">
45+
<body onload="init()" style="margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
4846
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
4947
<input type="button" class="btn btn-default" value="获取图层信息" onclick="layerService()"/>
5048
<input type="button" class="btn btn-default" value="清除结果" onclick="closeInfoWin()"/>
5149
</div>
52-
<div id="map" style="margin:0 auto;"></div>
50+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5351
</body>
5452
</html>

examples/leaflet/01_mapQueryByBounds.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
77
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
88
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
9-
<script type="text/javascript" src="../js/resize.js"></script>
109
<script type="text/javascript">
1110
var map, polygon, resultLayer,
1211
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1312
function init() {
14-
mapHeight();
1513
map = L.map('map', {
1614
preferCanvas: true,
1715
crs: L.CRS.EPSG4326,
@@ -43,11 +41,11 @@
4341
}
4442
</script>
4543
</head>
46-
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;">
44+
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
4745
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
4846
<input type="button" class="btn btn-default" value="地图bounds查询" onclick="query()"/>
4947
<input type="button" class="btn btn-default" value="清除结果" onclick="clearLayer()"/>
5048
</div>
51-
<div id="map" style="margin:0 auto;"></div>
49+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5250
</body>
5351
</html>

examples/leaflet/01_mapQueryByDistance.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
77
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
88
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
9-
<script type="text/javascript" src="../js/resize.js"></script>
109
<script type="text/javascript">
1110
var map, circleMarker, resultLayer,
1211
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1312
function init() {
14-
mapHeight();
1513
map = L.map('map', {
1614
preferCanvas: true,
1715
crs: L.CRS.EPSG4326,
@@ -40,12 +38,12 @@
4038
}
4139
</script>
4240
</head>
43-
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;">
41+
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
4442
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
4543
<input type="button" class="btn btn-default" value="地图距离查询" onclick="query()"/>
4644
<input type="button" class="btn btn-default" value="清除结果" onclick="clearLayer()"/>
4745
<span class="alert alert-danger" role="alert" style="padding: 10px;">距离:distance = 30</span>
4846
</div>
49-
<div id="map" style="margin:0 auto;"></div>
47+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5048
</body>
5149
</html>

examples/leaflet/01_mapQueryByGeometry.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
77
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
88
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
9-
<script type="text/javascript" src="../js/resize.js"></script>
109
<script type="text/javascript">
1110
var map, polygon, resultLayer,
1211
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1312
function init() {
14-
mapHeight();
1513
map = L.map('map', {
1614
preferCanvas: true,
1715
crs: L.CRS.EPSG4326,
@@ -43,11 +41,11 @@
4341
}
4442
</script>
4543
</head>
46-
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;">
44+
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
4745
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
4846
<input type="button" class="btn btn-default" value="地图几何查询" onclick="query()"/>
4947
<input type="button" class="btn btn-default" value="清除结果" onclick="clearLayer()"/>
5048
</div>
51-
<div id="map" style="margin:0 auto;"></div>
49+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5250
</body>
5351
</html>

examples/leaflet/01_mapQueryBySQL.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
77
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
88
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
9-
<script type="text/javascript" src="../js/resize.js"></script>
109
<script type="text/javascript">
1110
var map, resultLayer,
1211
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1312
function init() {
14-
mapHeight();
1513
map = L.map('map', {
1614
preferCanvas: true,
1715
crs: L.CRS.EPSG4326,
@@ -40,12 +38,12 @@
4038
}
4139
</script>
4240
</head>
43-
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;">
41+
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
4442
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
4543
<input type="button" class="btn btn-default" value="地图SQL查询" onclick="query()"/>
4644
<input type="button" class="btn btn-default" value="清除结果" onclick="clearLayer()"/>
4745
<span class="alert alert-danger" role="alert" style="padding: 10px;">SQL:SMID < 10</span>
4846
</div>
49-
<div id="map" style="margin:0 auto;"></div>
47+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5048
</body>
5149
</html>

examples/leaflet/01_mapService.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
88
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
99
<script type="text/javascript" src="../../dist/iclient9-leaflet.js"></script>
10-
<script type="text/javascript" src="../js/resize.js"></script>
11-
<script type="text/javascript" src="../js/resize.js"></script>
1210
<script type="text/javascript">
1311
var map, infowin,
1412
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
1513
function init() {
16-
mapHeight();
1714
map = L.map('map', {
1815
preferCanvas: true,
1916
crs: L.CRS.EPSG4326,
@@ -48,11 +45,11 @@
4845

4946
</script>
5047
</head>
51-
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;">
48+
<body onload="init()" style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:600px;">
5249
<div id="toolbar" style="height:44px; padding-top: 6px; text-align: right ">
5350
<input type="button" class="btn btn-default" value="获取地图信息" onclick="mapService()"/>
5451
<input type="button" class="btn btn-default" value="清除结果" onclick="closeInfoWin()"/>
5552
</div>
56-
<div id="map" style="margin:0 auto;"></div>
53+
<div id="map" style="margin:0 auto;width: 100%;height: 100%;border: 1px solid #dddddd"></div>
5754
</body>
5855
</html>

0 commit comments

Comments
 (0)