/// <summary> /// Expand cluster from cluster graphic /// </summary> /// <param name="clusterGraphic">Cluster graphic to expand</param> private void _ExpandCluster(ClusterGraphicObject clusterGraphic) { if (_mapctrl.IsInEditedMode || _MaxGraphicsToExpandExceeded(clusterGraphic)) return; if (!_mapctrl.IsInEditedMode) _mapctrl.SetOpacityToLayers(MapControl.HalfOpacity); _expandedClusterGraphic = clusterGraphic; _clusteringLayer.Visible = true; int count = (int)clusterGraphic.Attributes[ALClusterer.COUNT_PROPERTY_NAME]; Debug.Assert(count > 0); for (int index = 0; index < count; index++) { string attrKey = ALClusterer.GRAPHIC_PROPERTY_NAME + index.ToString(); DataGraphicObject grObj = (DataGraphicObject)clusterGraphic.Attributes[attrKey]; _clusteringLayerColl.Add(grObj.Data); // support already selected items if (_mapctrl.SelectedItems.Contains(grObj.Data)) _clusteringLayer.SelectedItems.Add(grObj.Data); } _clusterCenter = _mapctrl.map.MapToScreen((MapPoint)clusterGraphic.Geometry); if (_clusteringLayer.MapLayer.Graphics.Count > MAXIMUM_GRAPHICS_IN_CIRCLE_EXPANDED) _SetSpiraledPositionsToExpandedClusterGraphics(); else _SetCircledPositionsToExpandedClusterGraphics(); _CreateLeaderLines(); _expandedClusterGraphic.SetZIndex(ObjectLayer.FRONTZINDEX); }