Fix hover and select remove @Host()
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2021-01-26 09:12:37 +01:00
parent ac352473a0
commit d2b8de17d1
9 changed files with 22 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ export class GpsLocation implements OnInit,OnChanges{
initialized:boolean = false;
@ViewChild('location', { static: true }) locationElement: ElementRef;
constructor(@Host() private map: MapComponent) {
constructor(private map: MapComponent) {
}

View File

@@ -36,7 +36,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
private selectedFeatures = {};
private selectionLayer:Layer = null;
constructor(private itemService: ItemService, @Host() private map: MapComponent, public appConfig: AppConfig) {
constructor(private itemService: ItemService, private map: MapComponent, public appConfig: AppConfig) {
super(map);
this._apiEndPoint = appConfig.getConfig("apiEndPoint");
}

View File

@@ -38,7 +38,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
@Output() onFeatureHover: EventEmitter<Feature> = new EventEmitter<Feature>();
private stylesCache:IStyles = {};
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, @Host() private map: MapComponent, private itemTypeService: ItemTypeService,private featureIconService$:FeatureIconService) {
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService,private featureIconService$:FeatureIconService) {
super(layer);
this._format = new GeoJSON();
}
@@ -116,6 +116,8 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
if (!this.stylesCache[key]) {
if (this.itemTypeService.itemTypes[key]) {
let itemType = this.itemTypeService.itemTypes[key];
let fillColor = color.asArray(itemType.iconColor);
fillColor[3] = 0;
this.stylesCache[key] = new style.Style({
image: itemType.icon ? new style.Icon({
anchor: [0.5, 1],
@@ -126,6 +128,9 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
color: 'red',
width: 1
}),
fill: new style.Fill({
color: fillColor
}),
geometry:(feature) => this.geometry(feature)
});
} else {

View File

@@ -29,7 +29,7 @@ export class RotationResetComponent implements OnInit {
});
}
constructor( @Host() private map: MapComponent, private changeDetectorRef$: ChangeDetectorRef ) {
constructor( private map: MapComponent, private changeDetectorRef$: ChangeDetectorRef ) {
}
handleClick(event:Event) {

View File

@@ -64,6 +64,9 @@ export class MapEffects {
stroke: new style.Stroke({
color: 'red',
width: 1
}),
fill: new style.Fill({
color: 'rgba(0, 0, 0,0)'
})
})));
actions.push(new mapActions.SetStyle('selected',new style.Style({
@@ -75,6 +78,9 @@ export class MapEffects {
stroke: new style.Stroke({
color: 'red',
width: 3
}),
fill: new style.Fill({
color: 'rgba(0, 0, 0, 0)'
})
})));

View File

@@ -17,7 +17,7 @@ export class Switch2D3DComponent {
private synchronizers:any[];
constructor(@Host() private map: MapComponent) {
constructor(private map: MapComponent) {
}