请问Leaflet用GetFeatureBySQLParameters获取的结果怎么应用到GetFeatureByGeometryParameters()里面的geometry?谢谢!目的是想用SQL查出来的行政区划,与其他图层叠加相交,显示行政区划范围内的要素。
你好,我在前面获取的feature转换不成后面需要的geometry格式,这个图上是serviceResult.result.features.features[0].geometry获取到的,但是用到后面的getFeaturesByGeometry上面不行。
你好,因为这个是中国的行政边界,是multipolygon,我用L。polygon画出来图形不对,变形了,位置也跑偏了,数据是官网的数据,您能给看一下吗,谢谢!
var host = window.isLocal ? window.server : "https://iserver.supermap.io"; var map, resultLayer,polygon,resultLayer1, baseUrl = host + "/iserver/services/map-world/rest/maps/World", data_url = host + "/iserver/services/data-world/rest/data"; function query() { var sqlParam = new SuperMap.GetFeaturesBySQLParameters({ queryParameter: { name: "Countries@World", attributeFilter: "COUNTRY = '中华人民共和国' " }, datasetNames: ["World:Countries"] }); L.supermap.featureService(data_url).getFeaturesBySQL(sqlParam, function (serviceResult) { resultLayer = L.geoJSON(serviceResult.result.features,{ onEachFeature: function (feature, layer) { layer.bindPopup(feature.properties.COUNTRY+ ":" + feature.properties.CAPITAL_CH); var polygonList= new Array(); for(var i=0;i<feature.geometry.coordinates[0][0].length;i++){ polygonList.push(feature.geometry.coordinates[0][0][i]); } var polygon=L.polygon(polygonList, {color: 'red'}); polygon.addTo(map); } }).addTo(map).bindPopup('SMID = 247'); }); }