在页面绘制了一个圆和一个正方形,并转化成geojson对象进行叠加分析报错
var layers= L.layerGroup().addTo(map)
map.on(L.Draw.Event.CREATED, function (e) {
var type = e.layerType, layer = e.layer;
layers.addLayer(layer);
})
$("#btn").on("click",function () {
var collection= layers.toGeoJSON()
var GeometryOverlayAnalystParameters= new SuperMap.GeometryOverlayAnalystParameters({
operateGeometry:collection[0],
sourceGeometry:collection[1],
operation: L.supermap.OverlayOperationType.UNION
})
L.supermap.spatialAnalystService("http://localhost:8090/iserver/services/spatialAnalysis-ChengDuShengXian/restjsr/spatialanalyst").overlayAnalysis(GeometryOverlayAnalystParameters, function (res) {
console.log(res)
})
})