Skip to content

Commit 2f36183

Browse files
committed
迁移iclient8动态标绘示例;新增mapboxgl两个空间分析相关示例;fix alert对话框。review by songyumeng, caoxink.
1 parent e528b22 commit 2f36183

File tree

116 files changed

+9099
-140
lines changed

Some content is hidden

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

116 files changed

+9099
-140
lines changed

dist/include-classic.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
if (inArray(includes, 'heatmapColorCSS')) {
5656
inputCSS("http://iclient.supermap.io/libs/iclient8c/examples/css/heatmap.css");
5757
}
58-
if (inArray(includes, 'responsive')) {
59-
inputCSS("http://iclient.supermap.io/libs/iclient8c/examples/css/bootstrap-responsive.min.css");
60-
}
6158
if (!inArray(excludes, 'iclient-classic')) {
6259
inputScript("../../dist/iclient-classic.min.js");
6360
}
@@ -119,7 +116,15 @@
119116
if (inArray(includes, 'LargeFormatPrints')) {
120117
inputScript("http://iclient.supermap.io/libs/iclient8c/examples/js/LargeFormatPrints.js");
121118
}
122-
119+
if (inArray(includes, 'PlottingPanel')) {
120+
inputScript("http://iclient.supermap.io/web/libs/iclient8c/examples/js/plottingPanel/PlottingPanel.Include.js");
121+
}
122+
if (inArray(includes, 'bevInclude')) {
123+
inputScript("http://iclient.supermap.io/web/libs/iclient8c/examples/js/bevInclude.js");
124+
}
125+
if (inArray(includes, 'DefaultStyleConfiguration')) {
126+
inputScript("http://iclient.supermap.io/web/libs/iclient8c/resource/Plugins/Plotting/DefaultStyleConfiguration.js");
127+
}
123128
}
124129

125130
load();

examples/classic/SM_OSMBuildings_DrawBuildings.html

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h5 class='panel-title text-center'>WebGL Globe</h5>
4242

4343
//检测浏览器是否支持canves,Buildings 需要Canvas绘制
4444
if (!document.createElement('canvas').getContext) {
45-
alert("您的浏览器不支持Canvas,请先升级!");
45+
showAlert("您的浏览器不支持Canvas,请先升级!");
4646
}
4747

4848
//新建矢量面图层 保存绘制的要素
@@ -69,7 +69,7 @@ <h5 class='panel-title text-center'>WebGL Globe</h5>
6969

7070
//异步加载图层
7171
function addLayer() {
72-
alert('请输入自定义参数后绘制');
72+
showAlert('请输入自定义参数后绘制');
7373
map.addLayers([layer, polygonLayer]);
7474
map.setCenter(new SuperMap.LonLat(12957186.36784, 4852711.53595), 12);
7575
//激活多边形绘制
@@ -130,11 +130,37 @@ <h5 class='panel-title text-center'>WebGL Globe</h5>
130130
osm.set(Draw_geojson);
131131
osm.click(function (e) {
132132
//Buildings 单击事件 返回当前Building的ID 和 经纬度
133-
alert("FeatureID:" + e.feature);
133+
showAlert("FeatureID:" + e.feature);
134134
});
135135
}
136136
}
137137
}
138+
139+
//显示提示框
140+
var alertDiv;
141+
function showAlert(msg) {
142+
var className = "alert-success";
143+
closeAlert();
144+
if (!$('#msg_container')[0]) {
145+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
146+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
147+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
148+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
149+
$('body').append(alertDiv)
150+
}
151+
$('.close').on('click', function () {
152+
$(alertDiv).remove();
153+
});
154+
$('#msg_container').addClass(className);
155+
$('#msg_container').slideDown(300);
156+
$('#msg').html(msg);
157+
}
158+
159+
function closeAlert() {
160+
if (alertDiv) {
161+
$(alertDiv).remove();
162+
}
163+
}
138164
</script>
139165
</body>
140166
</html>

examples/classic/SM_OSMBuildings_RestData.html

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
//检测浏览器是啥支持canves Buildings 需要Canvas绘制
1919
if (!document.createElement('canvas').getContext) {
20-
alert("您的浏览器不支持Canvas,请先升级!");
20+
showAlert("您的浏览器不支持Canvas,请先升级!");
2121
}
2222
//初始化地图
2323
map = new SuperMap.Map("map", {
@@ -82,7 +82,7 @@
8282

8383
//查询失败
8484
function processFailed(e) {
85-
alert(e.error.errorMsg);
85+
showAlert(e.error.errorMsg);
8686
}
8787

8888
var Draw_geoJSON = {
@@ -175,10 +175,36 @@
175175
osm.set(Draw_geoJSON);
176176
osm.click(function (e) {
177177
// 返回当前点击的feature ID 和 当前的经纬度
178-
alert("FeatureID:" + e.feature);
178+
showAlert("FeatureID:" + e.feature);
179179
});
180180
}
181181

182+
//显示提示框
183+
var alertDiv;
184+
function showAlert(msg) {
185+
var className = "alert-success";
186+
closeAlert();
187+
if (!$('#msg_container')[0]) {
188+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
189+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
190+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
191+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
192+
$('body').append(alertDiv)
193+
}
194+
$('.close').on('click', function () {
195+
$(alertDiv).remove();
196+
});
197+
$('#msg_container').addClass(className);
198+
$('#msg_container').slideDown(300);
199+
$('#msg').html(msg);
200+
}
201+
202+
function closeAlert() {
203+
if (alertDiv) {
204+
$(alertDiv).remove();
205+
}
206+
}
207+
182208
</script>
183209
</body>
184210
</html>

examples/classic/SM_OSMBuildings_addGeoJson.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
//检测浏览器是啥支持canves Buildings 需要Canvas绘制
1818
if (!document.createElement('canvas').getContext) {
19-
alert("您的浏览器不支持Canvas,请先升级!");
19+
showAlert("您的浏览器不支持Canvas,请先升级!");
2020
}
2121
//初始化地图
2222
map = new SuperMap.Map("map", {
@@ -72,9 +72,35 @@
7272
osm.click(function (e) {
7373
// 返回当前点击的feature ID 和 当前的经纬度
7474
//Buildings 单击事件 返回当前Building的ID 和 经纬度
75-
alert("FeatureID:" + e.feature);
75+
showAlert("FeatureID:" + e.feature);
7676
});
7777
}
78+
79+
//显示提示框
80+
var alertDiv;
81+
function showAlert(msg) {
82+
var className = "alert-success";
83+
closeAlert();
84+
if (!$('#msg_container')[0]) {
85+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
86+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
87+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
88+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
89+
$('body').append(alertDiv)
90+
}
91+
$('.close').on('click', function () {
92+
$(alertDiv).remove();
93+
});
94+
$('#msg_container').addClass(className);
95+
$('#msg_container').slideDown(300);
96+
$('#msg').html(msg);
97+
}
98+
99+
function closeAlert() {
100+
if (alertDiv) {
101+
$(alertDiv).remove();
102+
}
103+
}
78104
</script>
79105
</body>
80106
</html>

examples/classic/analysis_bufferAnalyst.html

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h5 class='panel-title text-center'>缓冲区分析一</h5></div>
4343
<div id="map"></div>
4444
<script>
4545
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
46-
var map, local, baseLayer, resultLayer, vectorLayer, spatialAnalystURL,
46+
var map, alertDiv, baseLayer, resultLayer, vectorLayer,
4747
points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
4848
new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
4949
new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
@@ -101,6 +101,7 @@ <h5 class='panel-title text-center'>缓冲区分析一</h5></div>
101101
}
102102

103103
function bufferAnalystProcess() {
104+
closeAlert();
104105
resultLayer.removeAllFeatures();
105106
var bufferServiceByDatasets = new SuperMap.REST.BufferAnalystService(url2),
106107
bufferDistance = new SuperMap.REST.BufferDistance({
@@ -132,12 +133,38 @@ <h5 class='panel-title text-center'>缓冲区分析一</h5></div>
132133
}
133134

134135
function bufferAnalystFailed(args) {
135-
alert(args.error.errorMsg);
136+
showAlert(args.error.errorMsg);
136137
}
137138

138139
function removeResult() {
140+
closeAlert();
139141
resultLayer.removeAllFeatures();
140142
}
143+
144+
//显示提示框
145+
function showAlert(msg) {
146+
var className = "alert-success";
147+
closeAlert();
148+
if (!$('#msg_container')[0]) {
149+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
150+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
151+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
152+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
153+
$('body').append(alertDiv)
154+
}
155+
$('.close').on('click', function () {
156+
$(alertDiv).remove();
157+
});
158+
$('#msg_container').addClass(className);
159+
$('#msg_container').slideDown(300);
160+
$('#msg').html(msg);
161+
}
162+
163+
function closeAlert() {
164+
if (alertDiv) {
165+
$(alertDiv).remove();
166+
}
167+
}
141168
</script>
142169

143170
</body>

examples/classic/analysis_bufferQuery.html

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h5 class='panel-title text-center'>缓冲区分析二</h5></div>
4545
<div id="map"></div>
4646
<script>
4747
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
48-
var spatialAnalystURL, local, map, layer, vectorLayer, resultLayer, markerLayer, gpsLine, bufferResultGeometry,
48+
var alertDiv, map, layer, vectorLayer, resultLayer, markerLayer, gpsLine, bufferResultGeometry,
4949
myPointsList = [new SuperMap.Geometry.Point(2823.940, -4690.000),
5050
new SuperMap.Geometry.Point(3448.940, -4690.301),
5151
new SuperMap.Geometry.Point(3816.561, -3810.125),
@@ -141,6 +141,7 @@ <h5 class='panel-title text-center'>缓冲区分析二</h5></div>
141141

142142
//将离散gps信号点生成线路
143143
function addPath() {
144+
closeAlert();
144145
var pathFeature = new SuperMap.Feature.Vector();
145146
gpsLine = new SuperMap.Geometry.LineString(myPointsList);
146147
pathFeature.geometry = gpsLine;
@@ -150,8 +151,9 @@ <h5 class='panel-title text-center'>缓冲区分析二</h5></div>
150151

151152
//对生成的线路进行缓冲区分析
152153
function bufferAnalystProcess() {
154+
closeAlert();
153155
if (!gpsLine) {
154-
alert("请生成路径,用于缓冲区分析");
156+
showAlert("请生成路径,用于缓冲区分析");
155157
return;
156158
}
157159
var bufferServiceByGeometry = new SuperMap.REST.BufferAnalystService(url2),
@@ -186,8 +188,9 @@ <h5 class='panel-title text-center'>缓冲区分析二</h5></div>
186188

187189
//查询出信号影响范围内的工厂
188190
function queryByGeometry() {
191+
closeAlert();
189192
if (!bufferResultGeometry) {
190-
alert("请先做缓冲区分析,以得到查询的范围");
193+
showAlert("请先做缓冲区分析,以得到查询的范围");
191194
return;
192195
}
193196
var queryParam, queryByGeometryParameters, queryService;
@@ -223,11 +226,37 @@ <h5 class='panel-title text-center'>缓冲区分析二</h5></div>
223226
}
224227

225228
function clearElements() {
229+
closeAlert();
226230
gpsLine = null;
227231
bufferResultGeometry = null;
228232
resultLayer.removeAllFeatures();
229233
markerLayer.clearMarkers();
230234
}
235+
236+
//显示提示框
237+
function showAlert(msg) {
238+
var className = "alert-success";
239+
closeAlert();
240+
if (!$('#msg_container')[0]) {
241+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
242+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
243+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
244+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
245+
$('body').append(alertDiv)
246+
}
247+
$('.close').on('click', function () {
248+
$(alertDiv).remove();
249+
});
250+
$('#msg_container').addClass(className);
251+
$('#msg_container').slideDown(300);
252+
$('#msg').html(msg);
253+
}
254+
255+
function closeAlert() {
256+
if (alertDiv) {
257+
$(alertDiv).remove();
258+
}
259+
}
231260
</script>
232261

233262
</body>

examples/classic/analysis_closestFacilities.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h5 class='panel-title text-center'>最近设施分析</h5></div>
6262
<div id="map"></div>
6363
<script>
6464
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
65-
var local, map, layer, vectorLayer, markerLayer1,
65+
var alertDiv, map, layer, vectorLayer, markerLayer1,
6666
markerLayer2, drawPoint, eventPoint, n = 0,
6767
facilityPoints = [
6868
new SuperMap.Geometry.Point(6000, -5500),
@@ -119,6 +119,7 @@ <h5 class='panel-title text-center'>最近设施分析</h5></div>
119119
}
120120

121121
function selectEventPoint() {
122+
closeAlert();
122123
clearElements();
123124
drawPoint.activate();
124125
}
@@ -137,9 +138,10 @@ <h5 class='panel-title text-center'>最近设施分析</h5></div>
137138
}
138139

139140
function findClosestFacilities() {
141+
closeAlert();
140142
drawPoint.deactivate();
141143
if (!eventPoint) {
142-
alert("请选择事件点!");
144+
showAlert("请选择事件点!");
143145
return;
144146
}
145147
var findClosestFacilitiesService, parameter, analystParameter, resultSetting;
@@ -191,11 +193,37 @@ <h5 class='panel-title text-center'>最近设施分析</h5></div>
191193
}
192194

193195
function clearElements() {
196+
closeAlert();
194197
eventPoint = null;
195198
n = 0;
196199
markerLayer2.clearMarkers();
197200
vectorLayer.removeAllFeatures();
198201
}
202+
203+
//显示提示框
204+
function showAlert(msg) {
205+
var className = "alert-success";
206+
closeAlert();
207+
if (!$('#msg_container')[0]) {
208+
alertDiv = $("<div class='alert alert-dismissible' id='msg_container' role='alert' " +
209+
"style='z-index:800;position: absolute;top: 20px;left: 40%;width:250px;display: none'>" +
210+
"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>" +
211+
"<strong><p id='msg' style='word-wrap: break-word'></p></strong></div>");
212+
$('body').append(alertDiv)
213+
}
214+
$('.close').on('click', function () {
215+
$(alertDiv).remove();
216+
});
217+
$('#msg_container').addClass(className);
218+
$('#msg_container').slideDown(300);
219+
$('#msg').html(msg);
220+
}
221+
222+
function closeAlert() {
223+
if (alertDiv) {
224+
$(alertDiv).remove();
225+
}
226+
}
199227
</script>
200228

201229
</body>

0 commit comments

Comments
 (0)