Skip to content

Commit bf6d9a1

Browse files
[fix] common+leaflet callback promise doc 以及示例 promise修改 review by luox
1 parent 129c0a8 commit bf6d9a1

File tree

177 files changed

+495
-541
lines changed

Some content is hidden

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

177 files changed

+495
-541
lines changed

examples/leaflet/01_mapQueryBySQL_FGB.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
});
3535
new L.supermap
3636
.QueryService(url)
37-
.queryBySQL(param, null, 'FGB').then(function (serviceResult) {
37+
.queryBySQL(param, 'FGB').then(function (serviceResult) {
3838
new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
3939
strategy: 'all'
4040
}).addTo(map);

examples/leaflet/02_getFeatureBySQL_FGB.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
datasetNames: ['World:world']
3636
});
37-
new L.supermap.FeatureService(url).getFeaturesBySQL(sqlParam, null, 'FGB').then(function (serviceResult) {
37+
new L.supermap.FeatureService(url).getFeaturesBySQL(sqlParam, 'FGB').then(function (serviceResult) {
3838
new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
3939
strategy: 'all'
4040
}).addTo(map);

examples/leaflet/04_bufferAnalystService_FGB.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
})
5252
});
5353

54-
dsBufferAnalystService.bufferAnalysis(dsBufferAnalystParameters, null, 'FGB').then(function (serviceResult) {
54+
dsBufferAnalystService.bufferAnalysis(dsBufferAnalystParameters, 'FGB').then(function (serviceResult) {
5555
new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
5656
style: {
5757
color: 'red'

examples/leaflet/04_bufferAnalystService_geometry_FGB.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383
})
8484
});
8585

86-
bufferAnalystService.bufferAnalysis(geoBufferAnalystParams, function (serviceResult) {
86+
bufferAnalystService.bufferAnalysis(geoBufferAnalystParams, 'FGB').then(function (serviceResult) {
8787
var resultLayer = new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
8888
strategy: 'all'
8989
}).addTo(map);
90-
}, 'FGB');
90+
});
9191

92-
bufferAnalystService.bufferAnalysis(geoBufferAnalystParams, function (serviceResult) {
92+
bufferAnalystService.bufferAnalysis(geoBufferAnalystParams).then(function (serviceResult) {
9393
resultLayer = L.geoJSON(serviceResult.result.resultGeometry);
9494
//查询出缓冲区内信号影响范围内的工厂
9595
queryService = new L.supermap.QueryService(baseUrl);

examples/leaflet/04_minDistanceAnalysisService.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_minDistanceCalcula
7777
minDistance: minDistance,
7878
maxDistance: maxDistance
7979
});
80-
new L.supermap.SpatialAnalystService(serviceUrl).minDistanceAnalysis(minDistanceAnalystParameters, function (serviceResult) {
80+
new L.supermap.SpatialAnalystService(serviceUrl).minDistanceAnalysis(minDistanceAnalystParameters).then(function (serviceResult) {
8181
// 检查参数,给予错误信息提示
8282
if(serviceResult.error){
8383
return widgets.alert.showAlert(serviceResult.error.errorMsg,false);
@@ -127,7 +127,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_minDistanceCalcula
127127
attributeFilter: "SMID IN " + referenceIdsStr
128128
}
129129
});
130-
new L.supermap.QueryService(baseUrl).queryBySQL(sqlParam, function (serviceResult) {
130+
new L.supermap.QueryService(baseUrl).queryBySQL(sqlParam).then(function (serviceResult) {
131131
var resFrature = serviceResult.result.recordsets[0].features;
132132
var resFratureCoor = [resFrature.features[0].geometry.coordinates[1], resFrature.features[0].geometry.coordinates[0]]
133133
lineResultLayer = L.polyline([resFratureCoor, marker1.getLatLng()], {color: '#304DBE'}).addTo(map);

examples/leaflet/04_overlayAnalystService_FGB.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
operation: L.supermap.OverlayOperationType.UNION
3535
});
3636

37-
overlayAnalystService.overlayAnalysis(datasetOverlayAnalystParameters, null, 'FGB').then(function (serviceResult) {
37+
overlayAnalystService.overlayAnalysis(datasetOverlayAnalystParameters, 'FGB').then(function (serviceResult) {
3838
new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
3939
strategy: 'all'
4040
}).addTo(map);

examples/leaflet/04_surfaceAnalystService_FGB.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
zValueFieldName: "AVG_TMP"
5151
});
5252
surfaceAnalystService = new L.supermap.SpatialAnalystService(serviceUrl);
53-
surfaceAnalystService.surfaceAnalysis(surfaceAnalystParameters).then(function (serviceResult) {
54-
var result = serviceResult.result;
55-
if (result && result.recordset && result.recordset.features) {
56-
resultLayer = L.geoJSON(result.recordset.features, {weight: 3}).addTo(map);
57-
} else {
58-
alert(serviceResult.error.errorMsg);
59-
}
53+
surfaceAnalystService.surfaceAnalysis(surfaceAnalystParameters, 'FGB').then(function (serviceResult) {
54+
new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, {
55+
strategy: 'all',
56+
style: {
57+
weight: 3
58+
},
59+
}).addTo(map);
6060
});
6161
}
6262
</script>

examples/leaflet/04_terrainAspectCalculationService.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_terrainAspectCalcu
5555
deleteExistResultDataset:true
5656
}
5757
);
58-
new L.supermap.SpatialAnalystService(serviceUrl).terrainAspectCalculate(terrainAspectCalculationParameters, function (serviceResult) {
58+
new L.supermap.SpatialAnalystService(serviceUrl).terrainAspectCalculate(terrainAspectCalculationParameters).then(function (serviceResult) {
5959
terrainAspectCalculationResult = serviceResult.result;
6060
//用栅格专题图展示分析结果
6161
showAnalysisResult_ThemeGridRange();
@@ -140,7 +140,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_terrainAspectCalcu
140140
joinItems: null,
141141
themes: [themeGridRange]
142142
});
143-
new L.supermap.ThemeService(baseUrl).getThemeInfo(themeParameters, function (serviceResult1) {
143+
new L.supermap.ThemeService(baseUrl).getThemeInfo(themeParameters).then(function (serviceResult1) {
144144
var result = serviceResult1.result;
145145
if (result && result.newResourceID) {
146146
themeLayer = new L.supermap.TiledMapLayer(baseUrl, {

examples/leaflet/04_terrainCurvatureCalculationService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
deleteExistResultDataset: true
3939
});
4040
//向iServer发起地形曲率计算请求
41-
terrainCurvatureCalculationService.terrainCurvatureCalculate(terrainCurvatureCalculationParameters, function (serviceResult) {
41+
terrainCurvatureCalculationService.terrainCurvatureCalculate(terrainCurvatureCalculationParameters).then(function (serviceResult) {
4242
terrainCurvatureCalculationResult = serviceResult.result;
4343
//用栅格专题图展示分析结果
4444
showAnalysisResult_ThemeGridRange();

examples/leaflet/04_terrainCutFillCalculationService.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_terrainCutFillCalc
6464
deleteExistResultDataset:true
6565

6666
});
67-
new L.supermap.SpatialAnalystService(serviceUrl).terrainCutFillCalculate(terrainCutFillCalculationParameters, function (serviceResult) {
67+
new L.supermap.SpatialAnalystService(serviceUrl).terrainCutFillCalculate(terrainCutFillCalculationParameters).then(function (serviceResult) {
6868
terrainCutFillCalculationResult = serviceResult.result;
6969
//用栅格专题图展示分析结果
7070
showAnalysisResult_ThemeGridRange();
@@ -121,7 +121,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_terrainCutFillCalc
121121
themes: [themeGridRange]
122122
});
123123

124-
new L.supermap.ThemeService(baseUrl).getThemeInfo(themeParameters, function (serviceResult1) {
124+
new L.supermap.ThemeService(baseUrl).getThemeInfo(themeParameters).then(function (serviceResult1) {
125125
console.log(serviceResult1)
126126
var result = serviceResult1.result;
127127
if (result && result.newResourceID) {

0 commit comments

Comments
 (0)