|
@@ -208,11 +208,15 @@ export default defineComponent({
|
|
|
const qyLayer = store.state.gis.map.getLayers().getArray().filter(v => v.get('layerName') === 'qy')?.[0]
|
|
|
if (qyLayer) {
|
|
|
const f = qyLayer.getSource().getFeatureById(item.id)
|
|
|
- f?.get('mockClick')()
|
|
|
- store.state.gis.map.getView().animate({
|
|
|
- center: f.getGeometry().getCoordinates(),
|
|
|
- zoom: store.state.gis.map.getView().getMaxZoom(),
|
|
|
- });
|
|
|
+ if (f) {
|
|
|
+ f.get('mockClick')()
|
|
|
+ store.state.gis.map.getView().animate({
|
|
|
+ center: f.getGeometry().getCoordinates(),
|
|
|
+ zoom: store.state.gis.map.getView().getMaxZoom(),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('未找到该企业位置!')
|
|
|
+ }
|
|
|
}
|
|
|
console.log(item)
|
|
|
}
|