Commit 7296bbc1 authored by Varun Patil's avatar Varun Patil

Pass filtered name to map for initial marker

parent 56764b9f
...@@ -244,7 +244,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -244,7 +244,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
public void onClick(@NonNull View widget) { public void onClick(@NonNull View widget) {
MapFragment mapFragment = new MapFragment(); MapFragment mapFragment = new MapFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Constants.MAP_INITIAL_MARKER, venue.getVenueName()); bundle.putString(Constants.MAP_INITIAL_MARKER, MapFragment.getPassableName(venue.getVenueShortName()));
mapFragment.setArguments(bundle); mapFragment.setArguments(bundle);
((MainActivity) getActivity()).updateFragment(mapFragment); ((MainActivity) getActivity()).updateFragment(mapFragment);
} }
......
...@@ -1134,5 +1134,9 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -1134,5 +1134,9 @@ public class MapFragment extends Fragment implements TextWatcher,
super.onLocationAvailability(locationAvailability); super.onLocationAvailability(locationAvailability);
} }
} }
public static String getPassableName(String name) {
return name.toLowerCase().replace(" ", "-").replaceAll("[^A-Za-z0-9\\-]", "");
}
} }
...@@ -132,7 +132,7 @@ public class CampusMapView extends SubsamplingScaleImageView { ...@@ -132,7 +132,7 @@ public class CampusMapView extends SubsamplingScaleImageView {
// Iterate all markers // Iterate all markers
if (getInitialMarkerName() != null) { if (getInitialMarkerName() != null) {
for (Marker m : markerList) { for (Marker m : markerList) {
if (m.getName().equals(getInitialMarkerName())) { if (MapFragment.getPassableName(m.getShortName()).equals(getInitialMarkerName())) {
centerMarker = m; centerMarker = m;
break; break;
} }
......
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