|
@@ -531,7 +531,7 @@ export default {
|
|
|
visibleLayerIds: {
|
|
|
immediate: true,
|
|
|
deep: true,
|
|
|
- handler() {
|
|
|
+ handler () {
|
|
|
this.visibleLayerId = this.visibleLayerIds[0];
|
|
|
},
|
|
|
},
|
|
@@ -553,7 +553,6 @@ export default {
|
|
|
let params = {};
|
|
|
if (layerIdx2 != null) {
|
|
|
params = {
|
|
|
- layers: `show:${layerIdx1},${layerIdx2}`,
|
|
|
layerDefs: {
|
|
|
[layerIdx1]: param,
|
|
|
[layerIdx2]: param,
|
|
@@ -561,7 +560,6 @@ export default {
|
|
|
};
|
|
|
} else {
|
|
|
params = {
|
|
|
- layers: `show:${layerIdx1}`,
|
|
|
layerDefs: {
|
|
|
[layerIdx1]: param,
|
|
|
},
|
|
@@ -1019,97 +1017,45 @@ export default {
|
|
|
console.error(`no layer id`);
|
|
|
return;
|
|
|
}
|
|
|
- if (layerId == "pewg_1") {
|
|
|
- if (bsm) {
|
|
|
- this.spinShow = true;
|
|
|
+ if (bsm) {
|
|
|
+ this.spinShow = true;
|
|
|
|
|
|
- if (!feature) {
|
|
|
- const where = `${this.layerFeatureKey} = '${bsm}'`;
|
|
|
+ if (!feature) {
|
|
|
+ const where = `${this.layerFeatureKey} = '${bsm}'`;
|
|
|
+
|
|
|
+ if (layerById.serverType === 'wms') {
|
|
|
+ await GeoServerQuery(`${layerById.queryUrl}`, {
|
|
|
+ typeName: layerById.params.layers,
|
|
|
+ cql_filter: where
|
|
|
+ }, true).then(({ features }) => {
|
|
|
+ feature = features[0]
|
|
|
+ })
|
|
|
+ } else {
|
|
|
await arcgisQuery(
|
|
|
`${layerById.url}/${this.layerIndex}/query`,
|
|
|
{
|
|
|
outSR: getSrid(this.map),
|
|
|
where,
|
|
|
},
|
|
|
- false
|
|
|
+ true
|
|
|
).then(({ features }) => {
|
|
|
- const geos = {
|
|
|
- type: "FeatureCollection",
|
|
|
- features: [
|
|
|
- {
|
|
|
- type: "Feature",
|
|
|
- geometry: {
|
|
|
- type: "MultiPolygon",
|
|
|
- coordinates: [],
|
|
|
- },
|
|
|
- properties: {},
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- let temp = [];
|
|
|
- features.forEach((it) => {
|
|
|
- temp = [...temp, ...it["geometry"]["rings"]];
|
|
|
- });
|
|
|
- geos["features"][0]["geometry"]["coordinates"] = [[...temp]];
|
|
|
- feature = new GeoJSON().readFeatures(geos)[0];
|
|
|
+ feature = features[0];
|
|
|
});
|
|
|
}
|
|
|
- if (row) {
|
|
|
- feature.setProperties({ ...row });
|
|
|
- }
|
|
|
- this.spinShow = false;
|
|
|
- }
|
|
|
- if (feature) {
|
|
|
- const geometry = feature.getGeometry();
|
|
|
- const wkt = WkxGeometry.parseGeoJSON(
|
|
|
- new GeoJSON().writeGeometryObject(geometry)
|
|
|
- ).toWkt();
|
|
|
-
|
|
|
- feature.set("wkt", wkt);
|
|
|
- this.feature = feature;
|
|
|
- this.$vm.$emit("getGeoData", feature); //初始化土地生命周期geo/feature参数
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (bsm) {
|
|
|
- this.spinShow = true;
|
|
|
-
|
|
|
- if (!feature) {
|
|
|
- const where = `${this.layerFeatureKey} = '${bsm}'`;
|
|
|
-
|
|
|
- if (layerById.serverType === 'wms') {
|
|
|
- await GeoServerQuery(`${layerById.queryUrl}`, {
|
|
|
- typeName: layerById.params.layers,
|
|
|
- cql_filter: where
|
|
|
- }, true).then(({ features }) => {
|
|
|
- feature = features[0]
|
|
|
- })
|
|
|
- } else {
|
|
|
- await arcgisQuery(
|
|
|
- `${layerById.url}/${this.layerIndex}/query`,
|
|
|
- {
|
|
|
- outSR: getSrid(this.map),
|
|
|
- where,
|
|
|
- },
|
|
|
- true
|
|
|
- ).then(({ features }) => {
|
|
|
- feature = features[0];
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- if (row) {
|
|
|
- feature.setProperties({ ...row });
|
|
|
- }
|
|
|
- this.spinShow = false;
|
|
|
}
|
|
|
- if (feature) {
|
|
|
- const geometry = feature.getGeometry();
|
|
|
- const wkt = WkxGeometry.parseGeoJSON(
|
|
|
- new GeoJSON().writeGeometryObject(geometry)
|
|
|
- ).toWkt();
|
|
|
- feature.set("wkt", wkt);
|
|
|
- this.feature = feature;
|
|
|
- this.$vm.$emit("getGeoData", feature); //初始化土地生命周期geo/feature参数
|
|
|
+ if (row) {
|
|
|
+ feature.setProperties({ ...row });
|
|
|
}
|
|
|
+ this.spinShow = false;
|
|
|
+ }
|
|
|
+ if (feature) {
|
|
|
+ const geometry = feature.getGeometry();
|
|
|
+ const wkt = WkxGeometry.parseGeoJSON(
|
|
|
+ new GeoJSON().writeGeometryObject(geometry)
|
|
|
+ ).toWkt();
|
|
|
+ feature.set("wkt", wkt);
|
|
|
+ this.feature = feature;
|
|
|
+ this.$vm.$emit("getGeoData", feature); //初始化土地生命周期geo/feature参数
|
|
|
}
|
|
|
},
|
|
|
async locationFeatureWhere(layerId, where, setting) {
|
|
@@ -1157,7 +1103,6 @@ export default {
|
|
|
}
|
|
|
if (bsm) {
|
|
|
this.spinShow = true;
|
|
|
-
|
|
|
if (!feature) {
|
|
|
const where = `${this.layerFeatureKey} = '${bsm}'`;
|
|
|
await arcgisQuery(
|
|
@@ -1194,19 +1139,33 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.spinShow = true;
|
|
|
- await arcgisQuery(
|
|
|
- `${layerById.url}/0/query`,
|
|
|
- {
|
|
|
- outSR: getSrid(this.map),
|
|
|
- where,
|
|
|
- },
|
|
|
- false
|
|
|
- ).then((resp) => {
|
|
|
- const { features } = resp;
|
|
|
- let json = { type: "FeatureCollection", features: [] };
|
|
|
- json.features.push(convertRingsToGeoJSON(features[0].geometry.rings));
|
|
|
- MapUtils.drawShade(this.map, json);
|
|
|
- });
|
|
|
+ if (layerById.serverType === 'wms') {
|
|
|
+ await GeoServerQuery(`${layerById.queryUrl}`, {
|
|
|
+ typeName: layerById.params.layers,
|
|
|
+ cql_filter: where
|
|
|
+ }, false).then((resp) => {
|
|
|
+ const { features } = resp;
|
|
|
+ let json = { type: "FeatureCollection", features: [] };
|
|
|
+ json.features.push(
|
|
|
+ features[0].geometry
|
|
|
+ );
|
|
|
+ MapUtils.drawShade(this.map, json);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ await arcgisQuery(
|
|
|
+ `${layerById.url}/0/query`,
|
|
|
+ {
|
|
|
+ outSR: getSrid(this.map),
|
|
|
+ where,
|
|
|
+ },
|
|
|
+ false
|
|
|
+ ).then((resp) => {
|
|
|
+ const { features } = resp;
|
|
|
+ let json = { type: "FeatureCollection", features: [] };
|
|
|
+ json.features.push(convertRingsToGeoJSON(features[0].geometry.rings));
|
|
|
+ MapUtils.drawShade(this.map, json);
|
|
|
+ });
|
|
|
+ }
|
|
|
this.spinShow = false;
|
|
|
},
|
|
|
mapLoaded(map) {
|
|
@@ -1812,6 +1771,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ alert(layerConfig.url)
|
|
|
arcgisQuery(
|
|
|
`${layerConfig.url}/${this.layerIndex}/query`,
|
|
|
param,
|
|
@@ -2036,7 +1996,7 @@ export default {
|
|
|
tzzxDetail(props) {
|
|
|
this.$vm.$emit("getTzzxDetail", props);
|
|
|
},
|
|
|
- statisticsLayer(layerId, setting) {
|
|
|
+ statisticsLayer (layerId, setting) {
|
|
|
const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
|
|
|
arcgisQuery(
|
|
|
`${layerById.url}/${this.layerIndex}/query`,
|