using DevExpress.Data; using DevExpress.XtraMap; using Ips.Library.Basic; using Ips.Library.DxpLib; using Ips.Sps.Store; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ips.Sps.TskResults.Poses { public class PosMapItemFactory : DefaultMapItemFactory { protected override void InitializeItem(MapItem item, object obj) { base.InitializeItem(item, obj); var mapDot = item as MapDot; var posObj = obj as RealTimeProxyForObject; if (mapDot != null && posObj != null) { var posId = posObj.GetRowCellValue(nameof(Pos.Id)); var posLon = posObj.GetRowCellValue(nameof(Pos.PosLon)); mapDot.Tag = posId; if (GeoUtil.IsValidLon(posLon)) { mapDot.Fill = Color.Red; if (posId == PosStore.Default.GridSelectPosId) { mapDot.Size = 8; mapDot.StrokeWidth = 3; mapDot.Stroke = Color.Black; } else { mapDot.Size = 6; mapDot.StrokeWidth = 2; mapDot.Stroke = Color.White; } } else { mapDot.Size = 0; } } } protected override MapItem CreateItemInstance(MapItemType type, object obj) { return base.CreateItemInstance(type, obj); } } }