private void UpdateLayers(ICollection <RhitLocation> locations) { LabeledLocations.Clear(); Outlines.Clear(); PolygonLayer.Children.Clear(); TextLayer.Children.Clear(); foreach (RhitLocation location in locations) { MapPolygon polygon = location.OutLine; if (polygon.Locations == null || polygon.Locations.Count <= 0) { continue; } PolygonLayer.Children.Add(polygon); if (!AreOutlinesVisible) { RhitLocation.HideOutline(polygon); } polygon.MouseLeftButtonUp += new MouseButtonEventHandler(Outline_Tap); Outlines[polygon] = location; LabeledLocations[location] = location.GetLabel(); if (ShouldShowLabel(location)) { TextLayer.Children.Add(LabeledLocations[location]); } } }
private void UpdatePolygons() { if (Outlines == null) { return; } if (AreOutlinesVisible) { foreach (MapPolygon polygon in Outlines.Keys) { RhitLocation.ShowOutline(polygon); } } else { foreach (MapPolygon polygon in Outlines.Keys) { RhitLocation.HideOutline(polygon); } } }
private void CurrentLocationChanged(object sender, LocationEventArgs e) { if (!AreOutlinesVisible) { if (e.NewLocation == null) { RhitLocation.HideOutline(e.OldLocation.OutLine); } else { if (e.OldLocation != null) { RhitLocation.HideOutline(e.OldLocation.OutLine); } RhitLocation.ShowOutline(e.NewLocation.OutLine); } } if (e.NewLocation != null) { MapControl.Center = e.NewLocation.Center; } }