|
@@ -162,12 +162,23 @@ export class olMap {
|
|
|
const extData = feature.get('extData');
|
|
|
if (!!feature) {
|
|
|
this.clickMarker = feature;
|
|
|
+ if (this.selectedFeature) {
|
|
|
+ const selectData = this.selectedFeature.get('extData');
|
|
|
+ this.selectedFeature.setStyle(
|
|
|
+ new Style({
|
|
|
+ image: new Icon({
|
|
|
+ src: selectData.image,
|
|
|
+ scale: selectData.scale,
|
|
|
+ anchor: [0.5, 0.5],
|
|
|
+ anchorXUnits: 'fraction',
|
|
|
+ anchorYUnits: 'fraction'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
if (['1', '2'].includes(extData.type)) {
|
|
|
// 多点位 单点
|
|
|
if (this.selectedFeature !== feature) {
|
|
|
- if (this.selectedFeature) {
|
|
|
- this.selectedFeature.set('icon', this.selectedFeature.get('image'));
|
|
|
- }
|
|
|
this.selectedFeature = feature;
|
|
|
feature.setStyle(
|
|
|
new Style({
|
|
@@ -187,7 +198,7 @@ export class olMap {
|
|
|
this.select.getFeatures().clear();
|
|
|
const currentZoom = this.map.getView().getZoom();
|
|
|
this.map.getView().setZoom(currentZoom + 1);
|
|
|
- this.map.getView().setCenter(feature.geometry.coordinates);
|
|
|
+ this.map.getView().setCenter([Number(extData.longitude), Number(extData.latitude)]);
|
|
|
event.selected = [];
|
|
|
}
|
|
|
}
|
|
@@ -688,7 +699,7 @@ export class olMap {
|
|
|
} else {
|
|
|
this.plotLayers['search'].getSource().clear();
|
|
|
}
|
|
|
- this.addMarker2({'search': item});
|
|
|
+ this.addMarker2({ 'search': item });
|
|
|
this.clickMarker = item;
|
|
|
this.options.onMarkerClick(item);
|
|
|
}
|
|
@@ -833,7 +844,7 @@ export class olMap {
|
|
|
});
|
|
|
if (hideInfoFlag) {
|
|
|
this.clickMarker = null;
|
|
|
- this.hideInfo();
|
|
|
+ this.hideInfo(true);
|
|
|
}
|
|
|
}
|
|
|
// 清除所有标加
|
|
@@ -852,8 +863,8 @@ export class olMap {
|
|
|
this.map.addLayer(this.plotLayers[name]);
|
|
|
} else {
|
|
|
this.plotLayers[name].getSource().clear();
|
|
|
- this.clickMarker = null;
|
|
|
- this.hideInfo();
|
|
|
+ // this.clickMarker = null;
|
|
|
+ // this.hideInfo();
|
|
|
}
|
|
|
}
|
|
|
// 设置灾害地点 单独图册
|
|
@@ -898,6 +909,20 @@ export class olMap {
|
|
|
this.infoWindow = null;
|
|
|
if (!!flag && this.select) {
|
|
|
this.select.getFeatures().clear();
|
|
|
+ if (this.selectedFeature) {
|
|
|
+ const selectData = this.selectedFeature.get('extData');
|
|
|
+ this.selectedFeature.setStyle(
|
|
|
+ new Style({
|
|
|
+ image: new Icon({
|
|
|
+ src: selectData.image,
|
|
|
+ scale: selectData.scale,
|
|
|
+ anchor: [0.5, 0.5],
|
|
|
+ anchorXUnits: 'fraction',
|
|
|
+ anchorYUnits: 'fraction'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/**
|