示例#1
0
        public static ILegendCommand CreateExportAsGeoJson(MapPresenter map, VectorLayer layer)
        {
            var result = new LegendCommand()
            {
                PathMarkup = IRI.Jab.Common.Assets.ShapeStrings.Appbar.appbarDownload,
                Layer      = layer,
                ToolTip    = _exportAsGeoJsonToolTip,
            };

            result.Command = new RelayCommand(async param =>
            {
                try
                {
                    var fileName = await map.DialogService.ShowSaveFileDialogAsync("*.json|*.json", null, layer.LayerName);

                    if (string.IsNullOrWhiteSpace(fileName))
                    {
                        return;
                    }

                    // 1400.02.31
                    // به خاطر خروجی برنامه البرز نگار
                    // چون در سایت ژئوجی‌سان دات آی‌او
                    // بارگذاری می شه خروجی‌ها
                    layer.ExportAsGeoJson(fileName, true);
                }
                catch (Exception ex)
                {
                    await map.DialogService.ShowMessageAsync(null, ex.Message, null, null);
                }
            });

            return(result);
        }