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 layer is based upon.
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);
drawnFeatures = mapPointData.Features;
}
converter.ConvertLayerProperties(mapPointData, this);
}
}
}