private void UpdatePins() { var mapTile = Element; var map = Control; var pinItems = mapTile.PinList; ClusterManager.ClearItems(); map.Clear(); var clusterItems = pinItems.Select(i => new ClusterItem(i)).Cast <IGMUClusterItem>().ToArray(); ClusterManager.AddItems(clusterItems); ClusterManager.Cluster(); LocationMarker.Map = map; UpdateLocationPinPosition(); }
private void GenerateClusters(TripsClusterMapView mapView) { if (mapView == null) { return; } if (_clusterManager.Delegate == null) { _clusterManager.SetDelegate(new ClusterDelegate(mapView), new MapDelegate()); } _clusterManager.ClearItems(); var random = new Random(); mapView.Trips.ForEach(x => _clusterManager.AddItem(new ClusterMarker(x.Route.Average(y => y.Latitude), x.Route.Average(y => y.Longitude)) { Id = x.Id, Title = x.Name })); _clusterManager.Cluster(); }