private void LoadLayerInView(bool useTransitions, Rectangle2D drawBounds, Layer layer)
{
if (!Rectangle2D.IsNullOrEmpty(drawBounds) && layer.IsInitialized && (layer.Error == null)
&& (layer.MinVisibleResolution <= mapResolution) && (layer.MaxVisibleResolution >= mapResolution)
&& layer.IsVisible && Layers.Contains(layer) && CoordinateReferenceSystem.Equals(layer.CRS, CRS, true))
{
Rectangle2D last = (Rectangle2D)(layer.GetValue(LastLayerViewBoundsProperty));
if (Rectangle2D.IsNullOrEmpty(last) || !drawBounds.Equals(last))
{
layer.Draw(new DrawParameter()
{
UseTransitions = useTransitions,
Resoluitons = Resolutions,
Resolution = targetResolution,
ViewBounds = drawBounds,
ViewSize = currentSize,
LayerOrigin = layer.Container.Origin
});
layer.SetValue(LastLayerViewBoundsProperty, drawBounds);
}
}
}