mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
import {ElementRef, Injectable} from '@angular/core';
|
||||
import {
|
||||
SCBuilding,
|
||||
SCSearchFilter,
|
||||
SCSearchQuery,
|
||||
SCSearchResponse,
|
||||
@@ -24,6 +25,7 @@ import {Point, Polygon} from 'geojson';
|
||||
import {divIcon, geoJSON, icon, LatLng, Map, marker, Marker} from 'leaflet';
|
||||
import {DataProvider} from '../data/data.provider';
|
||||
import {MapPosition, PositionService} from './position.service';
|
||||
import {hasValidLocation} from '../data/types/place/place-types';
|
||||
|
||||
/**
|
||||
* Provides methods for presenting the map
|
||||
@@ -125,7 +127,8 @@ export class MapProvider {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide places (buildings and canteens)
|
||||
* Provide places (buildings and canteens) const result = await this.dataProvider.search(query);
|
||||
|
||||
*
|
||||
* @param contextFilter Additional contextual filter (e.g. from the context menu)
|
||||
* @param queryText Query (text) of the search query
|
||||
@@ -224,6 +227,12 @@ export class MapProvider {
|
||||
];
|
||||
}
|
||||
|
||||
return this.dataProvider.search(query);
|
||||
const result = await this.dataProvider.search(query);
|
||||
|
||||
result.data = result.data.filter(place =>
|
||||
hasValidLocation(place as SCBuilding),
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user