Пример #1
0
        //public static Func<MapPresenter, FeatureTableCommand> CreateZoomToExtentCommandFunc = (presenter) => CreateZoomToExtentCommand(presenter);
        public static FeatureTableCommand CreateZoomToExtentCommand(MapPresenter map)
        {
            var result = new FeatureTableCommand()
            {
                PathMarkup = IRI.Jab.Common.Assets.ShapeStrings.Appbar.appbarMagnify,
                //Layer = layer.AssociatedLayer,
                ToolTip = "محدودهٔ عوارض"
            };

            result.Command = new RelayCommand((param) =>
            {
                var layer = param as ISelectedLayer;

                if (layer == null || map == null)
                {
                    return;
                }

                var features = layer.GetHighlightedFeatures();

                var extent = BoundingBox.GetMergedBoundingBox(features.Select(f => f.TheSqlGeometry.GetBoundingBox()));

                map.ZoomToExtent(extent, false, () => { TryFlashPoint(map, features); });
            });

            return(result);
        }
Пример #2
0
        public static LegendCommand CreateZoomToExtentCommand(MapPresenter map, ILayer layer)
        {
            var result = new LegendCommand()
            {
                PathMarkup = IRI.Jab.Common.Assets.ShapeStrings.Appbar.appbarMagnify,
                Layer      = layer,
                ToolTip    = "محدودهٔ لایه"
            };

            result.Command = new RelayCommand((param) =>
            {
                if (layer == null || map == null)
                {
                    return;
                }

                map.ZoomToExtent(result.Layer.Extent, false);
            });

            return(result);
        }