Fix icon
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
6ff3c0ec96
commit
b52bfd4f57
@ -112,17 +112,18 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
|||||||
this.host.instance.setSource(this.instance);
|
this.host.instance.setSource(this.instance);
|
||||||
|
|
||||||
this.host.instance.setStyle((feature) => {
|
this.host.instance.setStyle((feature) => {
|
||||||
var key = feature.get('itemType') + (this.selectedItem?"_I":"");
|
var itemType = feature.get('itemType');
|
||||||
|
var key = itemType + (this.selectedItem?"_I":"");
|
||||||
if (!this.stylesCache[key]) {
|
if (!this.stylesCache[key]) {
|
||||||
if (this.itemTypeService.itemTypes[key]) {
|
if (this.itemTypeService.itemTypes[itemType]) {
|
||||||
let itemType = this.itemTypeService.itemTypes[key];
|
let itemTypeEntry = this.itemTypeService.itemTypes[itemType];
|
||||||
let fillColor = color.asArray(itemType.iconColor);
|
let fillColor = color.asArray(itemType.iconColor);
|
||||||
fillColor[3] = 0;
|
fillColor[3] = 0;
|
||||||
this.stylesCache[key] = new style.Style({
|
this.stylesCache[key] = new style.Style({
|
||||||
image: itemType.icon ? new style.Icon({
|
image: itemTypeEntry.icon ? new style.Icon({
|
||||||
anchor: [0.5, 1],
|
anchor: [0.5, 1],
|
||||||
scale: 0.05,
|
scale: 0.05,
|
||||||
src: this.featureIconService$.getIconImageDataUrl(itemType.icon)
|
src: this.featureIconService$.getIconImageDataUrl(itemTypeEntry.icon)
|
||||||
}):null,
|
}):null,
|
||||||
stroke: new style.Stroke({
|
stroke: new style.Stroke({
|
||||||
color: 'red',
|
color: 'red',
|
||||||
|
Loading…
Reference in New Issue
Block a user