Skip to content

Commit

Permalink
fix(regex): missing regexes for geoservice
Browse files Browse the repository at this point in the history
  • Loading branch information
pelord committed Jun 5, 2023
1 parent b79c7a0 commit 4bda3ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions packages/geo/src/lib/feature/shared/strategies/geo-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ export class GeoPropertiesStrategy extends EntityStoreStrategy {
const [key, values] = entry;
values.map(value => {
const geoService = this.propertyTypeDetectorService.getGeoService(value, allKeys);
const propertiesForLayerName = allKeys.filter(p => geoService.propertiesForLayerName.includes(p));
// providing the the first matching regex;
const propertyForLayerName = propertiesForLayerName.length ? propertiesForLayerName[0] : undefined;
if (propertyForLayerName) {
geoServiceAssociations.push({ url: value, urlProperty: key, layerNameProperty: propertyForLayerName, geoService });

if (geoService) {
const propertiesForLayerName = allKeys.filter(p => geoService.propertiesForLayerName.includes(p));
// providing the the first matching regex;
const propertyForLayerName = propertiesForLayerName.length ? propertiesForLayerName[0] : undefined;
if (propertyForLayerName) {
geoServiceAssociations.push({ url: value, urlProperty: key, layerNameProperty: propertyForLayerName, geoService });
}
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GeoServiceDefinition } from './propertyTypeDetector.interface';
})
export class PropertyTypeDetectorService {

public geoServiceRegexes: GeoServiceDefinition[];
public geoServiceRegexes: GeoServiceDefinition[] = [];

constructor(
private regexService: RegexService
Expand Down

0 comments on commit 4bda3ce

Please sign in to comment.