using System; using Core.Components.DotSpatial.Converter; using Core.Components.Gis.Data; using Core.Components.Gis.Features; using DotSpatial.Controls; namespace Core.Components.DotSpatial.Layer { /// /// A based on and updated according to the wrapped . /// public class MapPointDataLayer : MapPointLayer, IFeatureBasedMapDataLayer { private readonly MapPointData mapPointData; private readonly MapPointDataConverter converter = new MapPointDataConverter(); private MapFeature[] drawnFeatures; /// /// Creates a new instance of . /// /// The which the map point data layer is based upon. /// Thrown when is null. public MapPointDataLayer(MapPointData mapPointData) { if (mapPointData == null) { throw new ArgumentNullException("mapPointData"); } this.mapPointData = mapPointData; Update(); } public void Update() { if (!ReferenceEquals(mapPointData.Features, drawnFeatures)) { converter.ConvertLayerFeatures(mapPointData, this); DataSet.InitializeVertices(); DataSet.UpdateExtent(); AssignFastDrawnStates(); drawnFeatures = mapPointData.Features; } converter.ConvertLayerProperties(mapPointData, this); } } }