Aw4751 eslint fixes
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:
@@ -30,7 +30,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
private _format: GeoJSON;
|
||||
private _select: Select;
|
||||
private _hoverSelect: Select;
|
||||
private _iconScale: number = 0.05;
|
||||
private _iconScale = 0.05;
|
||||
@Input() features: Array<Feature<Geometry>>;
|
||||
@Input() selectedFeature: Feature<Geometry>;
|
||||
@Input() selectedItem: IItem;
|
||||
@@ -45,10 +45,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
|
||||
geometry(feature: Feature<Geometry>) {
|
||||
let view = this.map.instance.getView();
|
||||
let resolution = view.getResolution();
|
||||
var geometry = feature.getGeometry();
|
||||
let e = geometry.getExtent();
|
||||
const view = this.map.instance.getView();
|
||||
const resolution = view.getResolution();
|
||||
let geometry = feature.getGeometry();
|
||||
const e = geometry.getExtent();
|
||||
//var size = Math.max((e[2] - e[0]) / resolution, (e[3] - e[1]) / resolution);
|
||||
if (resolution > 12) {
|
||||
geometry = new Point(extent.getCenter(e));
|
||||
@@ -57,9 +57,9 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
|
||||
getSelectedStyle(feature: Feature<Geometry>): style.Style {
|
||||
let key = feature.get('itemType') + "_selected";
|
||||
const key = feature.get('itemType') + "_selected";
|
||||
let evaluatedStyle: style.Style = undefined;
|
||||
var styleEntry = this.stylesCache[key];
|
||||
const styleEntry = this.stylesCache[key];
|
||||
if (styleEntry) {
|
||||
if (typeof styleEntry === 'function') {
|
||||
evaluatedStyle = styleEntry(feature);
|
||||
@@ -113,12 +113,12 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
this.host.instance.setSource(this.instance);
|
||||
|
||||
this.host.instance.setStyle((feature) => {
|
||||
var itemType = feature.get('itemType');
|
||||
var key = itemType + (this.selectedItem ? "_I" : "");
|
||||
const itemType = feature.get('itemType');
|
||||
let key = itemType + (this.selectedItem ? "_I" : "");
|
||||
if (!this.stylesCache[key]) {
|
||||
if (this.itemTypeService.itemTypes[itemType]) {
|
||||
let itemTypeEntry = this.itemTypeService.itemTypes[itemType];
|
||||
let fillColor = color.asArray(itemTypeEntry.iconColor);
|
||||
const itemTypeEntry = this.itemTypeService.itemTypes[itemType];
|
||||
const fillColor = color.asArray(itemTypeEntry.iconColor);
|
||||
fillColor[3] = 0;
|
||||
this.stylesCache[key] = new style.Style({
|
||||
image: itemTypeEntry.icon ? new style.Icon({
|
||||
@@ -140,7 +140,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
}
|
||||
let evaluatedStyle = null;
|
||||
var styleEntry = this.stylesCache[key];
|
||||
const styleEntry = this.stylesCache[key];
|
||||
if (typeof styleEntry === 'function') {
|
||||
evaluatedStyle = styleEntry(feature);
|
||||
} else {
|
||||
@@ -161,8 +161,8 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
|
||||
if (changes["selectedFeature"] && this.instance) {
|
||||
var features = this._hoverSelect.getFeatures();
|
||||
var feature = changes["selectedFeature"].currentValue
|
||||
const features = this._hoverSelect.getFeatures();
|
||||
const feature = changes["selectedFeature"].currentValue
|
||||
//this.instance.clear(false);
|
||||
//this.instance.addFeatures(features.getArray());
|
||||
features.clear();
|
||||
@@ -172,7 +172,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
}
|
||||
if (changes["selectedItem"] && this.instance) {
|
||||
var item = changes["selectedItem"].currentValue
|
||||
const item = changes["selectedItem"].currentValue
|
||||
if (item) {
|
||||
this.map.instance.removeInteraction(this._hoverSelect);
|
||||
} else {
|
||||
@@ -180,7 +180,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
}
|
||||
if (changes["styles"]) {
|
||||
let styles = changes["styles"].currentValue;
|
||||
const styles = changes["styles"].currentValue;
|
||||
for (const key in styles) {
|
||||
if (styles.hasOwnProperty(key)) {
|
||||
this.stylesCache[key] = styles[key];
|
||||
|
Reference in New Issue
Block a user