想请教一下我写的代码是哪里有问题吗,为什么生不成缓冲区啊,地图可以正常加载,在它的官网示例中写为我的代码后也是地图可以加载,但是缓冲区未生成,未显示。原图是3857,可以加载出来。
<script type="text/javascript">
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
var map, point, dsBufferAnalystService, dsBufferAnalystParameters, resultLayer,
baseUrl = host + "/iserver/services/map-EmergWS/rest/maps/EmergMap",
serviceUrl = host + "/iserver/services/spatialAnalysis-EmergWS/restjsr/spatialanalyst";
map = L.map('map', {
crs: L.CRS.EPSG3857,
center: {lng: 103.7, lat: 30.61},
maxZoom: 30,
minZoom:10,
zoom: 14,
zoomControl: false,
attributionControl: false
});
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map);
bufferAnalystProcess();
function bufferAnalystProcess() {
dsBufferAnalystService = L.supermap.spatialAnalystService(serviceUrl);
dsBufferAnalystParameters = new SuperMap.DatasetBufferAnalystParameters({
dataset: "Chemical_Factory_1@EmergDS",
filterQueryParameter: new SuperMap.FilterParameter({
attributeFilter: "NameE='铝业化工厂'"
}),
bufferSetting: new SuperMap.BufferSetting({
endType: SuperMap.BufferEndType.ROUND,
leftDistance: {value: 10},
semicircleLineSegment: 10
})
});
dsBufferAnalystService.bufferAnalysis(dsBufferAnalystParameters, function (serviceResult) {
var result = serviceResult.result;
resultLayer = L.geoJSON(result.recordset.features, {color: "red"}).addTo(map);
});
}