Commit adc06604 authored by Curtis Adam's avatar Curtis Adam

Get the poi icon from the category object instead from the poi object itself

parent 55c66499
Pipeline #30076 passed with stage
in 8 minutes and 50 seconds
......@@ -98,9 +98,6 @@ export class MapRendererService {
});
(this.map as any).zoomControl.setPosition('bottomleft');
this.drawPois();
this.drawBuildings();
}
setCenterView(): void {
......@@ -141,6 +138,8 @@ export class MapRendererService {
this.poiCategories.push(category);
});
this.filteredCategories = [];
this.drawPois();
this.drawBuildings();
} catch (err) {
this.error = err.message;
}
......@@ -301,10 +300,15 @@ export class MapRendererService {
private addPoiToMap(poi: PoiModel) {
let marker: L.Marker;
let icon: string = '';
const category: CategoryModel = this.poiCategories.find((obj) => obj.id === poi.category.id);
if (category) {
icon = category.icon;
}
marker = L.marker([poi.latitude, poi.longitude],
{
title: poi.name,
icon: categoryIcon(poi.category.icon, poi.category.icon),
icon: categoryIcon(icon, icon),
});
marker.on('click', () => {
this.editPoi(poi.getID());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment