55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using Mapsui.Layers;
|
|
using Mapsui.Nts;
|
|
|
|
namespace OperationControl.Mapas.Rendering
|
|
{
|
|
/// <summary>
|
|
/// Resultado da construção visual de um MapaDocumento.
|
|
///
|
|
/// Não contém a fonte de verdade do mapa.
|
|
/// As GeometryFeatures existem apenas como representação
|
|
/// para o Mapsui.
|
|
/// </summary>
|
|
public sealed class MapaRenderResult
|
|
{
|
|
public Layer Layer { get; }
|
|
|
|
public IReadOnlyDictionary<string, GeometryFeature>
|
|
FeaturesPorRuaId
|
|
{ get; }
|
|
|
|
|
|
public int QuantidadeFeatures =>
|
|
FeaturesPorRuaId.Count;
|
|
|
|
|
|
public MapaRenderResult(
|
|
Layer layer,
|
|
Dictionary<string, GeometryFeature> featuresPorRuaId)
|
|
{
|
|
Layer =
|
|
layer
|
|
?? throw new ArgumentNullException(nameof(layer));
|
|
|
|
FeaturesPorRuaId =
|
|
featuresPorRuaId
|
|
?? throw new ArgumentNullException(nameof(featuresPorRuaId));
|
|
}
|
|
|
|
|
|
public GeometryFeature? ObterFeature(
|
|
string ruaId)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(ruaId))
|
|
return null;
|
|
|
|
|
|
return FeaturesPorRuaId.TryGetValue(
|
|
ruaId.Trim(),
|
|
out GeometryFeature? feature
|
|
)
|
|
? feature
|
|
: null;
|
|
}
|
|
}
|
|
} |