| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a03a6b3 commit 4bb3043
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | top: 0; | |
| 28 | 28 | right: 0; | |
| 29 | 29 | height: 100vh; | |
| 30 | - width: 500px; | ||
| 30 | + width: 400px; | ||
| 31 | 31 | padding: 20px; | |
| 32 | 32 | background: #fff; | |
| 33 | 33 | font-family: Avenir, Helvetica, Arial, sans-serif; | |
@@ -216,9 +216,8 @@ <h4 class="panel-title"> | |||
| 216 | 216 | map = L.map('map', { | |
| 217 | 217 | preferCanvas: true, | |
| 218 | 218 | crs: L.CRS.EPSG4326, | |
| 219 | - center: { lon: 30, lat: 0 }, | ||
| 220 | - maxZoom: 18, | ||
| 221 | - zoom: 2 | ||
| 219 | + center: { lon: 120, lat: 28 }, | ||
| 220 | + zoom: 5 | ||
| 222 | 221 | }); | |
| 223 | 222 | ||
| 224 | 223 | new L.supermap.TiledMapLayer(baseUrl, { noWrap: true }).addTo(map); | |
@@ -269,10 +268,31 @@ <h4 class="panel-title"> | |||
| 269 | 268 | appendTable(res); | |
| 270 | 269 | }) | |
| 271 | 270 | } | |
| 271 | + function getValuesCount(res) { | ||
| 272 | + var count = 0; | ||
| 273 | + if (!res.object.bounds) { | ||
| 274 | + count += 1; | ||
| 275 | + } else if (res.object.bounds && !Array.isArray(res.object.bounds)) { | ||
| 276 | + count += res.result.valuesCount; | ||
| 277 | + } else { | ||
| 278 | + var customResult = res.result.customResult; | ||
| 279 | + for(var i = 0 ; i < customResult.length ; i ++) { | ||
| 280 | + if (customResult[i].values) { | ||
| 281 | + count += customResult[i].valuesCount; | ||
| 282 | + } else { | ||
| 283 | + count += 1; | ||
| 284 | + } | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + return count; | ||
| 288 | + } | ||
| 272 | 289 | function appendTable(res) { | |
| 273 | 290 | if (!res) { | |
| 274 | 291 | return; | |
| 275 | 292 | } | |
| 293 | + if ((res.error && res.error.code === 400) || getValuesCount(res) > 5000) { | ||
| 294 | + return widgets.alert.showAlert(resources.msg_outOfQueryRange, false); | ||
| 295 | + } | ||
| 276 | 296 | // 展开table | |
| 277 | 297 | collapseTable(); | |
| 278 | 298 | if (!res.object.bounds) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1877,6 +1877,7 @@ window.examplesResources = { | |||
| 1877 | 1877 | "msg_deleteFeatureFailed": 'Delete feature failed', | |
| 1878 | 1878 | "msg_geographicPosition": "geographical position error! ", | |
| 1879 | 1879 | "msg_gridQueryNote": "Note: Click the map at any position, the instance will start to grid query at this location, and the bottom left corner of the map will show the query results after the query is completed.", | |
| 1880 | + "msg_outOfQueryRange": "Please narrow down the search scope。", | ||
| 1880 | 1881 | "msg_drawQueryBounds": "Please draw the query range!", | |
| 1881 | 1882 | "msg_drawClipBounds": "Please draw the clip range!", | |
| 1882 | 1883 | "msg_chooseColor": "Please choose color value", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1829,6 +1829,7 @@ window.examplesResources = { | |||
| 1829 | 1829 | "msg_deleteFeatureFailed": '删除地物失败', | |
| 1830 | 1830 | "msg_geographicPosition": "地理位置错误!", | |
| 1831 | 1831 | "msg_gridQueryNote": "注:点击地图任意位置,案例以该位置进行栅格查询,查询完成后地图左下角会显示查询结果。", | |
| 1832 | + "msg_outOfQueryRange": "请缩小查询范围。", | ||
| 1832 | 1833 | "msg_drawQueryBounds": "请绘制查询范围!", | |
| 1833 | 1834 | "msg_drawClipBounds": "请绘制裁剪范围!", | |
| 1834 | 1835 | "msg_chooseColor": "请选颜色值", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | top: 0; | |
| 28 | 28 | right: 0; | |
| 29 | 29 | height: 100vh; | |
| 30 | - width: 500px; | ||
| 30 | + width: 400px; | ||
| 31 | 31 | padding: 20px; | |
| 32 | 32 | background: #fff; | |
| 33 | 33 | font-family: Avenir, Helvetica, Arial, sans-serif; | |
@@ -236,8 +236,8 @@ <h4 class="panel-title"> | |||
| 236 | 236 | "source": "raster-tiles", | |
| 237 | 237 | }] | |
| 238 | 238 | }, | |
| 239 | - center: [30, 0], | ||
| 240 | - zoom: 2 | ||
| 239 | + center: [116, 32], | ||
| 240 | + zoom: 4 | ||
| 241 | 241 | }); | |
| 242 | 242 | ||
| 243 | 243 | map.addControl(new mapboxgl.supermap.LogoControl({ link: "https://iclient.supermap.io" }), 'bottom-right'); | |
@@ -252,7 +252,6 @@ <h4 class="panel-title"> | |||
| 252 | 252 | trash: true, | |
| 253 | 253 | } | |
| 254 | 254 | }); | |
| 255 | - console.log($($('.mapboxgl-ctrl').get(1))); | ||
| 256 | 255 | $($('.mapboxgl-ctrl').get(1)).hide(); | |
| 257 | 256 | map.addControl(Draw, 'top-left') | |
| 258 | 257 | function queryResult() { | |
@@ -300,10 +299,31 @@ <h4 class="panel-title"> | |||
| 300 | 299 | }) | |
| 301 | 300 | } | |
| 302 | 301 | }) | |
| 302 | + function getValuesCount(res) { | ||
| 303 | + var count = 0; | ||
| 304 | + if (!res.object.bounds) { | ||
| 305 | + count += 1; | ||
| 306 | + } else if (res.object.bounds && !Array.isArray(res.object.bounds)) { | ||
| 307 | + count += res.result.valuesCount; | ||
| 308 | + } else { | ||
| 309 | + var customResult = res.result.customResult; | ||
| 310 | + for (var i = 0; i < customResult.length; i++) { | ||
| 311 | + if (customResult[i].values) { | ||
| 312 | + count += customResult[i].valuesCount; | ||
| 313 | + } else { | ||
| 314 | + count += 1; | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | + return count; | ||
| 319 | + } | ||
| 303 | 320 | function appendTable(res) { | |
| 304 | 321 | if (!res) { | |
| 305 | 322 | return; | |
| 306 | 323 | } | |
| 324 | + if ((res.error && res.error.code === 400) || getValuesCount(res) > 5000) { | ||
| 325 | + return widgets.alert.showAlert(resources.msg_outOfQueryRange, false); | ||
| 326 | + } | ||
| 307 | 327 | // 展开table | |
| 308 | 328 | collapseTable(); | |
| 309 | 329 | if (!res.object.bounds) { | |
@@ -373,7 +393,7 @@ <h4 class="panel-title"> | |||
| 373 | 393 | table.appendChild(thead); | |
| 374 | 394 | table.appendChild(tbody); | |
| 375 | 395 | ||
| 376 | - var theadInfo = '<tr><th>'+ resources.text_index +'</th><th>'+ resources.text_row_index +'</th><th>'+ resources.text_column_index +'</th><th>'+ resources.text_color_number +'</th><th>'+ resources.text_color_rgba +'</th></tr>'; | ||
| 396 | + var theadInfo = '<tr><th>' + resources.text_index + '</th><th>' + resources.text_row_index + '</th><th>' + resources.text_column_index + '</th><th>' + resources.text_color_number + '</th><th>' + resources.text_color_rgba + '</th></tr>'; | ||
| 377 | 397 | thead.append(theadInfo); | |
| 378 | 398 | thead.innerHTML = theadInfo; | |
| 379 | 399 | tbody.innerHTML = tbodyHtml; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ | |||
| 53 | 53 | top: 0; | |
| 54 | 54 | right: 0; | |
| 55 | 55 | height: 100vh; | |
| 56 | - width: 500px; | ||
| 56 | + width: 400px; | ||
| 57 | 57 | padding: 20px; | |
| 58 | 58 | background: #fff; | |
| 59 | 59 | font-family: Avenir, Helvetica, Arial, sans-serif; | |
@@ -262,8 +262,8 @@ <h4 class="panel-title"> | |||
| 262 | 262 | "source": "raster-tiles", | |
| 263 | 263 | }] | |
| 264 | 264 | }, | |
| 265 | - center: [30, 0], | ||
| 266 | - zoom: 2 | ||
| 265 | + center: [116, 32], | ||
| 266 | + zoom: 4 | ||
| 267 | 267 | }); | |
| 268 | 268 | //mapbox 绘制要素图形控件 | |
| 269 | 269 | var Draw = new MapboxDraw({ | |
@@ -323,10 +323,31 @@ <h4 class="panel-title"> | |||
| 323 | 323 | }) | |
| 324 | 324 | } | |
| 325 | 325 | }); | |
| 326 | + function getValuesCount(res) { | ||
| 327 | + var count = 0; | ||
| 328 | + if (!res.object.bounds) { | ||
| 329 | + count += 1; | ||
| 330 | + } else if (res.object.bounds && !Array.isArray(res.object.bounds)) { | ||
| 331 | + count += res.result.valuesCount; | ||
| 332 | + } else { | ||
| 333 | + var customResult = res.result.customResult; | ||
| 334 | + for(var i = 0 ; i < customResult.length ; i ++) { | ||
| 335 | + if (customResult[i].values) { | ||
| 336 | + count += customResult[i].valuesCount; | ||
| 337 | + } else { | ||
| 338 | + count += 1; | ||
| 339 | + } | ||
| 340 | + } | ||
| 341 | + } | ||
| 342 | + return count; | ||
| 343 | + } | ||
| 326 | 344 | function appendTable(res) { | |
| 327 | 345 | if (!res) { | |
| 328 | 346 | return; | |
| 329 | 347 | } | |
| 348 | + if ((res.error && res.error.code === 400) || getValuesCount(res) > 5000) { | ||
| 349 | + return widgets.alert.showAlert(resources.msg_outOfQueryRange, false); | ||
| 350 | + } | ||
| 330 | 351 | // 展开table | |
| 331 | 352 | collapseTable(); | |
| 332 | 353 | if (!res.object.bounds) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ | |||
| 29 | 29 | top: 0; | |
| 30 | 30 | right: 0; | |
| 31 | 31 | height: 100vh; | |
| 32 | - width: 500px; | ||
| 32 | + width: 400px; | ||
| 33 | 33 | padding: 20px; | |
| 34 | 34 | background: #fff; | |
| 35 | 35 | font-family: Avenir, Helvetica, Arial, sans-serif; | |
@@ -221,7 +221,8 @@ <h4 class="panel-title"> | |||
| 221 | 221 | </div> | |
| 222 | 222 | <script type="text/javascript" include="bootstrap,jquery,widgets" src="../js/include-web.js"></script> | |
| 223 | 223 | <script type="text/javascript"> | |
| 224 | - var map, baseUrl = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/map-world/rest/maps/世界地图_Day", | ||
| 224 | + var map, | ||
| 225 | + baseUrl = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/map-world/rest/maps/世界地图_Day", | ||
| 225 | 226 | url = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/data-world/rest/data", | |
| 226 | 227 | draw, | |
| 227 | 228 | querylist = [], | |
@@ -230,8 +231,8 @@ <h4 class="panel-title"> | |||
| 230 | 231 | target: 'map', | |
| 231 | 232 | controls: ol.control.defaults({ attributionOptions: { collapsed: false } }).extend([new ol.supermap.control.Logo({ link: "https://iclient.supermap.io" })]), | |
| 232 | 233 | view: new ol.View({ | |
| 233 | - center: [30, 0], | ||
| 234 | - zoom: 3, | ||
| 234 | + center: [120, 28], | ||
| 235 | + zoom: 6, | ||
| 235 | 236 | projection: 'EPSG:4326', | |
| 236 | 237 | multiWorld: true, | |
| 237 | 238 | }) | |
@@ -274,10 +275,31 @@ <h4 class="panel-title"> | |||
| 274 | 275 | appendTable(res); | |
| 275 | 276 | }) | |
| 276 | 277 | } | |
| 278 | + function getValuesCount(res) { | ||
| 279 | + var count = 0; | ||
| 280 | + if (!res.object.bounds) { | ||
| 281 | + count += 1; | ||
| 282 | + } else if (res.object.bounds && !Array.isArray(res.object.bounds)) { | ||
| 283 | + count += res.result.valuesCount; | ||
| 284 | + } else { | ||
| 285 | + var customResult = res.result.customResult; | ||
| 286 | + for (var i = 0; i < customResult.length; i++) { | ||
| 287 | + if (customResult[i].values) { | ||
| 288 | + count += customResult[i].valuesCount; | ||
| 289 | + } else { | ||
| 290 | + count += 1; | ||
| 291 | + } | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | + return count; | ||
| 295 | + } | ||
| 277 | 296 | function appendTable(res) { | |
| 278 | - if (!res || res.error) { | ||
| 297 | + if (!res) { | ||
| 279 | 298 | return; | |
| 280 | 299 | } | |
| 300 | + if ((res.error && res.error.code === 400) || getValuesCount(res) > 5000) { | ||
| 301 | + return widgets.alert.showAlert(resources.msg_outOfQueryRange, false); | ||
| 302 | + } | ||
| 281 | 303 | // 展开table | |
| 282 | 304 | collapseTable(); | |
| 283 | 305 | if (!res.object.bounds) { | |
@@ -347,7 +369,7 @@ <h4 class="panel-title"> | |||
| 347 | 369 | table.appendChild(thead); | |
| 348 | 370 | table.appendChild(tbody); | |
| 349 | 371 | ||
| 350 | - var theadInfo = '<tr><th>'+ resources.text_index +'</th><th>'+ resources.text_row_index +'</th><th>'+ resources.text_column_index +'</th><th>'+ resources.text_color_number +'</th><th>'+ resources.text_color_rgba +'</th></tr>'; | ||
| 372 | + var theadInfo = '<tr><th>' + resources.text_index + '</th><th>' + resources.text_row_index + '</th><th>' + resources.text_column_index + '</th><th>' + resources.text_color_number + '</th><th>' + resources.text_color_rgba + '</th></tr>'; | ||
| 351 | 373 | thead.append(theadInfo); | |
| 352 | 374 | thead.innerHTML = theadInfo; | |
| 353 | 375 | tbody.innerHTML = tbodyHtml; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments