如何通过点做缓冲区分析

0 投票
iclient for javascript如何通过点做缓冲区分析呢?示例代码中只有线缓冲,查了好几天也没弄明白[心塞],点缓冲具体代码应该怎么写呢
6月 26, 2017 分类:  1493次浏览 | 用户: Aleigus (4 分)
重新分类 6月 26, 2017 用户:李晓

1个回答

0 投票
 
已采纳
您好!点缓冲区分析和线缓冲区分析差不多,唯一的区别就是点缓冲区分析只需要设置地物的左侧缓冲距离即可,并且缓冲区端点类型只能为圆头缓冲。
6月 26, 2017 用户: 李晓 学富五车 (633 分)
采纳于 6月 26, 2017 用户:Aleigus
function bufferAnalystProcess() {
                if (nodeArray.length ==0) {
                    alert("请选择位置点!");
                    return;
                }
                var bufferServiceByGeometry = new SuperMap.REST.BufferAnalystService(url2),
                        bufferDistance = new SuperMap.REST.BufferDistance({
                            value: 500
                        }),
                        bufferSetting = new SuperMap.REST.BufferSetting({
                            endType: SuperMap.REST.BufferEndType.ROUND,
                            leftDistance: bufferDistance
                        }),
                        geoBufferAnalystParam = new SuperMap.REST.GeometryBufferAnalystParameters({
                            geometry: nodeArray,
                            bufferSetting: bufferSetting
                        });

                bufferServiceByGeometry.events.on(
                        {
                            "processCompleted": bufferAnalystCompleted
                        });
                bufferServiceByGeometry.processAsync(geoBufferAnalystParam);
            }
            function bufferAnalystCompleted(BufferAnalystEventArgs) {
                var feature = new SuperMap.Feature.Vector();
                bufferResultGeometry = BufferAnalystEventArgs.result.resultGeometry;
                feature.geometry = bufferResultGeometry;
                feature.style = styleRegion;
                resultLayer.addFeatures(feature);
            }

所以这么写是没问题的,不能实现是别的地方出错了是吗
单看你这段代码看不出什么问题,你实现的时候是不出结果还是怎么回事儿,具体的你可以看一下报错;其次你把这些参数拿到服务端去分析一下,看看能不能分析成功!
...