//Here all Markers for the Exhibits in the Main Map are set //and some general stuff private void SetMainScreenMarkers(IReadOnlyList <Exhibit> set) { locationOverlay = new MyLocationOverlay(activity, mapView); var compassOverlay = new CompassOverlay(activity, mapView); compassOverlay.EnableCompass(); mapView.OverlayManager.Add(locationOverlay); mapView.OverlayManager.Add(compassOverlay); //Here all exhibit markers and bubbles are set if the Exhibit is not null if (set != null) { var markerInfoWindow = new ViaPointInfoWindow(Resource.Layout.navigation_info_window, mapView); var mapMarkerIcon = ContextCompat.GetDrawable(activity, Resource.Drawable.marker_blue); var setMarker = new SetMarker(mapView, markerInfoWindow); foreach (var e in set) { //One Marker Object var geoPoint = new GeoPoint(e.Location.Latitude, e.Location.Longitude); var marker = setMarker.AddMarker(null, e.Name, e.Description, geoPoint, mapMarkerIcon, e.Id); mapView.OverlayManager.Add(marker); } } mapView.Invalidate(); }
/// <summary> /// Draws the markers in navigation /// </summary> /// <param name="route">Route to process</param> private void NewElementOnDetailsRouteChanged(Route route) { //The direct polyline is only drawn if related bool is true if (route != null && route.Waypoints.Any()) { var markerInfoWindow = new ViaPointInfoWindow(Resource.Layout.navigation_info_window, mapView); var mapMarkerIcon = ContextCompat.GetDrawable(activity, Resource.Drawable.marker_blue); var setMarker = new SetMarker(mapView, markerInfoWindow); foreach (var waypoint in route.Waypoints) { //Bubbles var geoPoint = new GeoPoint(waypoint.Exhibit.Location.Latitude, waypoint.Exhibit.Location.Longitude); var bubble = setMarker.AddMarker(null, waypoint.Exhibit.Name, waypoint.Exhibit.Description, geoPoint, mapMarkerIcon, waypoint.Exhibit.Id); mapView.OverlayManager.Add(bubble); } mapView.Invalidate(); } }