@@ -158,6 +158,7 @@ public static List<NearbyBaseMarker> loadAttractionsFromLocationToBaseMarkerOpti
158
158
placeList = placeList .subList (0 , Math .min (placeList .size (), MAX_RESULTS ));
159
159
160
160
VectorDrawableCompat vectorDrawable = null ;
161
+ VectorDrawableCompat vectorDrawableGreen = null ;
161
162
try {
162
163
vectorDrawable = VectorDrawableCompat .create (
163
164
context .getResources (), R .drawable .ic_custom_bookmark_marker , context .getTheme ()
@@ -191,13 +192,15 @@ public static List<NearbyBaseMarker> loadAttractionsFromLocationToBaseMarkerOpti
191
192
vectorDrawable = null ;
192
193
try {
193
194
vectorDrawable = VectorDrawableCompat .create (
194
- context .getResources (), R .drawable .ic_custom_map_marker , context .getTheme ()
195
- );
195
+ context .getResources (), R .drawable .ic_custom_map_marker , context .getTheme ());
196
+ vectorDrawableGreen = VectorDrawableCompat .create (
197
+ context .getResources (), R .drawable .ic_custom_map_marker_green , context .getTheme ());
196
198
} catch (Resources .NotFoundException e ) {
197
199
// ignore when running tests.
198
200
}
199
201
if (vectorDrawable != null ) {
200
202
Bitmap icon = UiUtils .getBitmap (vectorDrawable );
203
+ Bitmap iconGreen = UiUtils .getBitmap (vectorDrawableGreen );
201
204
202
205
for (Place place : placeList ) {
203
206
String distance = formatDistanceBetween (curLatLng , place .location );
@@ -210,8 +213,17 @@ public static List<NearbyBaseMarker> loadAttractionsFromLocationToBaseMarkerOpti
210
213
place .location .getLatitude (),
211
214
place .location .getLongitude ()));
212
215
nearbyBaseMarker .place (place );
213
- nearbyBaseMarker .icon (IconFactory .getInstance (context )
214
- .fromBitmap (icon ));
216
+ // Check if string is only spaces or empty, if so place doesn't have any picture
217
+ if (!place .pic .trim ().isEmpty ()) {
218
+
219
+ if (iconGreen != null ) {
220
+ nearbyBaseMarker .icon (IconFactory .getInstance (context )
221
+ .fromBitmap (iconGreen ));
222
+ }
223
+ } else {
224
+ nearbyBaseMarker .icon (IconFactory .getInstance (context )
225
+ .fromBitmap (icon ));
226
+ }
215
227
216
228
baseMarkerOptions .add (nearbyBaseMarker );
217
229
}
0 commit comments