예제 #1
0
        /// <summary>
        /// Zooms map to extends if the added layer is the only layer with valid envelope.
        /// </summary>
        /// <param name="layer"></param>
        private void CheckMapExtends(ILayer layer)
        {
            var allVisibleLayersWereEmpty = Layers.Except(new[] { layer }).All(l => l.Envelope.IsNull || !l.IsVisible);

            if (allVisibleLayersWereEmpty && (layer.Envelope != null && !layer.Envelope.IsNull))
            {
                ZoomToExtents();
            }
        }
예제 #2
0
파일: Map.cs 프로젝트: Sony-NS/SharpMap
        /// <summary>
        /// Zooms map to extends if the added layer is the only layer with valid envelope.
        /// </summary>
        /// <param name="layer"></param>
        private void CheckMapExtends(ILayer layer)
        {
            //error....
            var allVisibleLayersWereEmpty = Layers.Except(new[] { layer }).All(l => l.Envelope.IsNull || !l.Visible);

            if (!allVisibleLayersWereEmpty)
            {
                return;
            }

            var layerEnvelope = layer.Envelope;

            if (layerEnvelope != null && !layerEnvelope.IsNull)
            {
                ZoomToExtents();
            }
        }