打印出来的feature是可以获取到的,选择鼠标不能点击,鼠标的小手是张开的,无法点击
//空间数据分析
queryMarker() {
let _this = this;
let cetext = "";
var sqlParam = new SuperMap.GetFeaturesBySQLParameters({
queryParameter: {
name: "陕西省_行政边界",
attributeFilter: cetext,
},
datasetNames: ["基础:陕西省_行政边界"],
toIndex: -1, //-1返回所有
});
//清除旧标注
_this.map.removeLayer(_this.resultLayerpop);
L.supermap
.featureService(_this.urlList.dataUrl)
.getFeaturesBySQL(sqlParam, function (serviceResult) {
var resultLayerpop = L.geoJSON(serviceResult.result.features, {
onEachFeature: function (feature, layer) {
console.log(feature, "feature");
layer.on("click", function (e) {
console.log(e.target.feature.properties, "layerE");
});
},
coordsToLatLng: function (coords) {
return L.CRS.EPSG3857.unproject(L.point(coords[0], coords[1]));
},
}).addTo(_this.map);
});
},