12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title data-i18n="resources.title_bufferAnalystService"></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, roadLine, dsBufferAnalystService, dsBufferAnalystParameters, resultLayer,
- baseUrl = host + "/iserver/services/map-changchun/rest/maps/长春市区图",
- serviceUrl = host + "/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst";
- map = L.map('map', {
- crs: L.CRS.NonEarthCRS({
- bounds: L.bounds([48.4, -7668.25], [8958.85, -55.58]),
- origin: L.point(48.4, -55.58)
- }),
- center: [-3375, 5105],
- maxZoom: 18,
- zoom: 6
- });
- L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).once("load", function () {
- bufferAnalystProcess();
- });
- function bufferAnalystProcess() {
- roadLine = L.polyline([
- [-3337.3849141502124, 4933.319287022352],
- [-3349.3316322355736, 4960.9674060199022],
- [-3358.8890067038628, 5006.0235999418364],
- [-3378.0037556404409, 5075.3145648369318],
- [-3376.9669111768926, 5305.19551436013]
- ]).addTo(map);
- dsBufferAnalystService = L.supermap.spatialAnalystService(serviceUrl);
- dsBufferAnalystParameters = new SuperMap.DatasetBufferAnalystParameters({
- dataset: "RoadLine2@Changchun",
- filterQueryParameter: new SuperMap.FilterParameter({
- attributeFilter: "NAME='团结路'"
- }),
- bufferSetting: new SuperMap.BufferSetting({
- endType: SuperMap.BufferEndType.ROUND,
- leftDistance: {value: 10},
- rightDistance: {value: 10},
- semicircleLineSegment: 10
- })
- });
- dsBufferAnalystService.bufferAnalysis(dsBufferAnalystParameters, function (serviceResult) {
- var result = serviceResult.result;
- resultLayer = L.geoJSON(result.recordset.features, {color: "red"}).addTo(map);
- });
- }
- </script>
- </body>
- </html>
|