12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title data-i18n="resources.title_surfaceAnalystService"></title>
- <script type="text/javascript" src="../js/include-web.js"></script>
- </head>
- <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
- <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
- <script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
- <script type="text/javascript">
- var host = window.isLocal ? window.server : "https://iserver.supermap.io";
- var map, region, resultLayer, surfaceAnalystService, surfaceAnalystParameters,
- baseUrl = host + "/iserver/services/map-temperature/rest/maps/全国温度变化图",
- serviceUrl = host + "/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst";
- map = L.map('map', {
- crs: L.CRS.NonEarthCRS({
- bounds: L.bounds([-2640403.63, 1873792.1], [3247669.39, 5921501.4]),
- origin: L.point(-2640403.63, 5921501.4)
- }),
- center: [3580330, 531762],
- maxZoom: 18,
- zoom: 2
- });
- L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).once("load", function () {
- surfaceAnalystProcess();
- });
- function surfaceAnalystProcess() {
- region = L.polygon([
- [4010338, 0],
- [4010338, 1063524],
- [3150322, 1063524],
- [3150322, 0]
- ]);
- surfaceAnalystParameters = new SuperMap.DatasetSurfaceAnalystParameters({
- extractParameter: new SuperMap.SurfaceAnalystParametersSetting({
- datumValue: 0,
- interval: 2,
- resampleTolerance: 0,
- smoothMethod: SuperMap.SmoothMethod.BSPLINE,
- smoothness: 3,
- clipRegion: region
- }),
- dataset: "SamplesP@Interpolation",
- resolution: 9000,
- zValueFieldName: "AVG_TMP"
- });
- surfaceAnalystService = L.supermap.spatialAnalystService(serviceUrl);
- surfaceAnalystService.surfaceAnalysis(surfaceAnalystParameters, function (serviceResult) {
- var result = serviceResult.result;
- if (result && result.recordset && result.recordset.features) {
- resultLayer = L.geoJSON(result.recordset.features, {weight: 3}).addTo(map);
- } else {
- alert(serviceResult.error.errorMsg);
- }
- });
- }
- </script>
- </body>
- </html>
|