@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
import { ISearchParams , ISearchResult } from '../App' ;
3
3
import { Map , Marker , Popup , TileLayer } from 'react-leaflet' ;
4
4
import { IDistrictResultSlim } from '../Services/districtService' ;
5
+ import { MeinItems } from './SearchResults/MeinItem' ;
5
6
6
7
// for custom markers
7
8
import { divIcon , Point , GeoJSON } from 'leaflet' ;
@@ -104,24 +105,11 @@ class LunchMap extends React.Component<ILunchMapProps, any> {
104
105
*/
105
106
private getAllMarkers ( locations : Array < ISearchResult > ) {
106
107
107
- var iconDefault = this . getIcon ( 'paw' ) ;
108
-
109
- const categoryIcons = {
110
- 'kindergarden' : this . getIcon ( 'baby-buggy' , 'kindergarden' ) ,
111
- 'construction' : this . getIcon ( 'vlc' , 'construction' ) ,
112
- 'event' : this . getIcon ( 'calendar-text' , 'event' ) ,
113
- 'lunch' : this . getIcon ( 'food' , 'lunch' ) ,
114
- 'playground' : this . getIcon ( 'castle' , 'playground' ) ,
115
- 'pool' : this . getIcon ( 'pool' , 'pool' ) ,
116
- 'wc' : this . getIcon ( 'human-male-female' , 'wc' ) ,
117
- 'webcam' : this . getIcon ( 'camera' , 'webcam' ) ,
118
- 'wifi' : this . getIcon ( 'wifi' , 'wifji' )
119
- } ;
120
-
121
108
var rows = [ ] ;
122
109
for ( let location of locations ) {
110
+ const meinItem = MeinItems . getItem ( location . type ) ;
123
111
124
- const currentIcon = categoryIcons [ location . type ] ? categoryIcons [ location . type ] : iconDefault ;
112
+ const currentIcon = this . getIcon ( meinItem . icon , location . type ) ;
125
113
const locationPos = new LatLng ( location . lat , location . lon ) ;
126
114
127
115
const markerOpenPopup = ( ) => {
@@ -147,7 +135,7 @@ class LunchMap extends React.Component<ILunchMapProps, any> {
147
135
< Popup
148
136
closeButton = { false }
149
137
>
150
- < span > { location . name } </ span >
138
+ < span > { meinItem . name } : < br /> < b > { location . name } </ b > </ span >
151
139
</ Popup >
152
140
</ Marker >
153
141
) ;
@@ -159,7 +147,7 @@ class LunchMap extends React.Component<ILunchMapProps, any> {
159
147
return divIcon ( {
160
148
className : 'lu-icon ' + extraClass ,
161
149
iconSize : new Point ( 40 , 40 ) ,
162
- html : '<i class="mdi mdi- ' + name + ' is-info"></i>'
150
+ html : '<i class="mdi ' + name + ' is-info"></i>'
163
151
} ) ;
164
152
}
165
153
0 commit comments