├── .gitattributes ├── .gitignore ├── PcArcBruTile ├── .nuget │ ├── NuGet.Config │ ├── NuGet.exe │ └── NuGet.targets ├── ArcBruTile2010.sln ├── ArcBruTile2013.sln ├── ArcBruTileSetup │ └── ArcBruTileSetup.vdproj ├── app │ ├── App.config │ ├── ArcBruTile.csproj │ ├── ArcBruTileInstaller.Designer.cs │ ├── ArcBruTileInstaller.cs │ ├── MenuDefs │ │ ├── BingMenuDef.cs │ │ ├── BruTileMenuDef.cs │ │ ├── CloudMadeMenuDef.cs │ │ ├── DutchMenu.cs │ │ ├── GaodeMenuDef.cs │ │ ├── GoogleMenuDef.cs │ │ ├── MapBoxMenuDef.cs │ │ ├── MapQuestMenuDef.cs │ │ ├── Osm2MenuDef.cs │ │ ├── OsmMenuDef.cs │ │ ├── PCMenuDef.cs │ │ ├── PdokMenuDef.cs │ │ ├── StamenMenuDef.cs │ │ └── TDTMenuDef.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Resources │ │ ├── Google.png │ │ ├── QQ截图20150419154852.jpg │ │ ├── TDT.png │ │ ├── WMS_icon.png │ │ ├── bing.PNG │ │ ├── brutilelogobig.png │ │ ├── download.png │ │ ├── gaode.bmp │ │ ├── google.ico │ │ ├── osm_logo.png │ │ └── tms.jpg │ ├── Toolbars │ │ ├── ArcBruTileToolbar.cs │ │ ├── DutchToolbar.cs │ │ └── PCLayerToolbar.cs │ ├── brutile │ │ └── 0.8.6 │ │ │ ├── BruTile.Desktop.dll │ │ │ ├── BruTile.dll │ │ │ └── log4net.dll │ ├── commands │ │ ├── AboutBruTileCommand.cs │ │ ├── AboutMeCommand.cs │ │ ├── AboutPdokCommand.cs │ │ ├── AddBingLayerCommand.cs │ │ ├── AddBruTileLayerCommandBase.cs │ │ ├── AddCloudMadeLayerCommand.cs │ │ ├── AddGaodeLayerCommand.cs │ │ ├── AddGoogleLayerCommand.cs │ │ ├── AddMapBoxLayerCommand.cs │ │ ├── AddMapQuestLayerCommand.cs │ │ ├── AddOsmLayerCommand.cs │ │ ├── AddPdokLayerCommand.cs │ │ ├── AddServicesCommand.cs │ │ ├── AddStamenLayerCommand.cs │ │ ├── AddTmsLayerCommandBase.cs │ │ └── AddWmsCLayerCommand.cs │ ├── forms │ │ ├── AboutMe.Designer.cs │ │ ├── AboutMe.cs │ │ ├── AboutMe.resx │ │ ├── AddProviderForm.Designer.cs │ │ ├── AddProviderForm.cs │ │ ├── AddProviderForm.resx │ │ ├── AddServicesForm.Designer.cs │ │ ├── AddServicesForm.cs │ │ ├── AddServicesForm.resx │ │ ├── AddWmsCForm.Designer.cs │ │ ├── AddWmsCForm.cs │ │ ├── AddWmsCForm.resx │ │ ├── BruTileAboutBox.Designer.cs │ │ ├── BruTileAboutBox.cs │ │ ├── BruTileAboutBox.resx │ │ ├── FormPreCache.Designer.cs │ │ ├── FormPreCacheStatus.Designer.cs │ │ ├── TileCache.Designer.cs │ │ ├── TileCache.cs │ │ └── TileCache.resx │ ├── lib │ │ ├── ArcMapWindow.cs │ │ ├── BruTileCustomLayer.cs │ │ ├── BruTileHelper.cs │ │ ├── BruTileLayer.cs │ │ ├── CacheDirectory.cs │ │ ├── CacheSettings.cs │ │ ├── ChinaConfig.cs │ │ ├── ConfigBing.cs │ │ ├── ConfigBingHybrid.cs │ │ ├── ConfigHelper.cs │ │ ├── ConfigInvertedTMS.cs │ │ ├── ConfigOsm.cs │ │ ├── ConfigTms.cs │ │ ├── ConfigWmsC.cs │ │ ├── ConfigurationHelper.cs │ │ ├── EnumBruTileLayer.cs │ │ ├── EnvelopeExtensionMethods.cs │ │ ├── FetchStrategy.cs │ │ ├── FileCacheExtensionMethods.cs │ │ ├── FileFetcher.cs │ │ ├── IConfig.cs │ │ ├── MultipleThreadResetEvent.cs │ │ ├── OsmMapType.cs │ │ ├── Projector.cs │ │ ├── Requester.cs │ │ ├── SimpleFileFetcher.cs │ │ ├── SmartThreadPool.dll │ │ ├── SpatialReferences.cs │ │ ├── SqlServer │ │ │ └── Microsoft.ExceptionMessageBox.dll │ │ ├── Tile.cs │ │ ├── TileMap.cs │ │ ├── TmsTileMapServiceParser.cs │ │ ├── Transform.cs │ │ └── WorldFileWriter.cs │ ├── packages.config │ └── services │ │ └── arcbrutile_sample_services.xml └── packages │ ├── SmartThreadPool.dll.2.2.3 │ ├── SmartThreadPool.dll.2.2.3.nupkg │ └── lib │ │ └── SmartThreadPool.dll │ └── log4net.1.2.10 │ ├── lib │ ├── 1.0 │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── 1.1 │ │ ├── log4net.dll │ │ └── log4net.xml │ └── 2.0 │ │ ├── log4net.dll │ │ └── log4net.xml │ └── log4net.1.2.10.nupkg ├── README.md ├── README2.md └── Soft ├── 1.png ├── 2.png ├── ArcBruTileSetup.msi ├── ArcBruTileSetup_336.msi ├── setup.exe └── 截图.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /PcArcBruTile/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PcArcBruTile/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/.nuget/NuGet.exe -------------------------------------------------------------------------------- /PcArcBruTile/.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 31 | $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) 32 | 33 | 34 | 35 | 36 | $(SolutionDir).nuget 37 | packages.config 38 | 39 | 40 | 41 | 42 | $(NuGetToolsPath)\NuGet.exe 43 | @(PackageSource) 44 | 45 | "$(NuGetExePath)" 46 | mono --runtime=v4.0.30319 $(NuGetExePath) 47 | 48 | $(TargetDir.Trim('\\')) 49 | 50 | -RequireConsent 51 | -NonInteractive 52 | 53 | "$(SolutionDir) " 54 | "$(SolutionDir)" 55 | 56 | 57 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) 58 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols 59 | 60 | 61 | 62 | RestorePackages; 63 | $(BuildDependsOn); 64 | 65 | 66 | 67 | 68 | $(BuildDependsOn); 69 | BuildPackage; 70 | 71 | 72 | 73 | 74 | 75 | 76 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | 98 | 100 | 101 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /PcArcBruTile/ArcBruTile2010.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcBruTile", "app\ArcBruTile.csproj", "{501036A0-A949-4E35-A8BF-B375CD6D20C3}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D485BEEE-002B-40AA-BAAB-6F0EE3EB4C7B}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "ArcBruTileSetup", "ArcBruTileSetup\ArcBruTileSetup.vdproj", "{50369D65-844D-434F-AA41-85AAC9D5923A}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Debug|Mixed Platforms = Debug|Mixed Platforms 19 | Debug|x86 = Debug|x86 20 | Release|Any CPU = Release|Any CPU 21 | Release|Mixed Platforms = Release|Mixed Platforms 22 | Release|x86 = Release|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 28 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 29 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|x86.ActiveCfg = Debug|Any CPU 30 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 33 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU 34 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|x86.ActiveCfg = Release|Any CPU 35 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|Any CPU.ActiveCfg = Debug 36 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|Any CPU.Build.0 = Debug 37 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|Mixed Platforms.ActiveCfg = Debug 38 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|Mixed Platforms.Build.0 = Debug 39 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|x86.ActiveCfg = Debug 40 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Debug|x86.Build.0 = Debug 41 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|Any CPU.ActiveCfg = Release 42 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|Any CPU.Build.0 = Release 43 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|Mixed Platforms.ActiveCfg = Release 44 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|Mixed Platforms.Build.0 = Release 45 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|x86.ActiveCfg = Release 46 | {50369D65-844D-434F-AA41-85AAC9D5923A}.Release|x86.Build.0 = Release 47 | EndGlobalSection 48 | GlobalSection(SolutionProperties) = preSolution 49 | HideSolutionNode = FALSE 50 | EndGlobalSection 51 | GlobalSection(SubversionScc) = preSolution 52 | Svn-Managed = True 53 | Manager = AnkhSVN - Subversion Support for Visual Studio 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /PcArcBruTile/ArcBruTile2013.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21126.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcBruTile", "app\ArcBruTile.csproj", "{501036A0-A949-4E35-A8BF-B375CD6D20C3}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcBruTile.Tests", "ArcBruTile.Tests\ArcBruTile.Tests.csproj", "{327F29F1-D587-4804-9C7E-E48B419ADE6B}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BruTile", "..\..\..\..\..\aaa\brutile-0.8.4\brutile_0.8.4\BruTile\BruTile.csproj", "{9FB60E2D-C682-4A01-9584-8B495B8DA85A}" 11 | EndProject 12 | Global 13 | GlobalSection(SubversionScc) = preSolution 14 | Svn-Managed = True 15 | Manager = AnkhSVN - Subversion Support for Visual Studio 16 | EndGlobalSection 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug Portable|Any CPU = Debug Portable|Any CPU 19 | Debug|Any CPU = Debug|Any CPU 20 | Release Portable|Any CPU = Release Portable|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU 25 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU 26 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release Portable|Any CPU.ActiveCfg = Release|Any CPU 29 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release Portable|Any CPU.Build.0 = Release|Any CPU 30 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {501036A0-A949-4E35-A8BF-B375CD6D20C3}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU 33 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU 34 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Release Portable|Any CPU.ActiveCfg = Release|Any CPU 37 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Release Portable|Any CPU.Build.0 = Release|Any CPU 38 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {327F29F1-D587-4804-9C7E-E48B419ADE6B}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Debug Portable|Any CPU.ActiveCfg = Debug Portable|Any CPU 41 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Debug Portable|Any CPU.Build.0 = Debug Portable|Any CPU 42 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Release Portable|Any CPU.ActiveCfg = Release Portable|Any CPU 45 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Release Portable|Any CPU.Build.0 = Release Portable|Any CPU 46 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {9FB60E2D-C682-4A01-9584-8B495B8DA85A}.Release|Any CPU.Build.0 = Release|Any CPU 48 | EndGlobalSection 49 | GlobalSection(SolutionProperties) = preSolution 50 | HideSolutionNode = FALSE 51 | EndGlobalSection 52 | EndGlobal 53 | -------------------------------------------------------------------------------- /PcArcBruTile/app/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /PcArcBruTile/app/ArcBruTileInstaller.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BruTileArcGIS 2 | { 3 | partial class ArcBruTileInstaller 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | } 33 | 34 | #endregion 35 | } 36 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/ArcBruTileInstaller.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Configuration.Install; 3 | using System; 4 | using BrutileArcGIS.Lib; 5 | using log4net; 6 | using log4net.Config; 7 | using System.IO; 8 | using System.Diagnostics; 9 | 10 | 11 | namespace BruTileArcGIS 12 | { 13 | [RunInstaller(true)] 14 | public partial class ArcBruTileInstaller : Installer 15 | { 16 | private static readonly ILog Logger = LogManager.GetLogger("ArcBruTileSystemLogger"); 17 | 18 | public ArcBruTileInstaller() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | public override void Install(System.Collections.IDictionary stateSaver) 24 | { 25 | base.OnAfterInstall(stateSaver); 26 | 27 | var esriRegAsmFilename = Path.Combine( 28 | Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), 29 | "ArcGIS\\bin\\ESRIRegAsm.exe"); 30 | var esriRegAsm = new Process {StartInfo = {FileName = esriRegAsmFilename}}; 31 | var cmd = string.Format("\"{0}\" /p:Desktop", GetType().Assembly.Location); 32 | esriRegAsm.StartInfo.Arguments = cmd; 33 | Logger.Debug("Register for ArcGIS 10: " + cmd); 34 | 35 | esriRegAsm.Start(); 36 | Logger.Debug("Register for ArcGIS 10 finished."); 37 | 38 | } 39 | 40 | public override void Uninstall(System.Collections.IDictionary savedState) 41 | { 42 | base.OnBeforeUninstall(savedState); 43 | XmlConfigurator.Configure(new FileInfo(GetType().Assembly.Location + ".config")); 44 | Logger.Debug("Uninstall ArcBruTile"); 45 | // Try to clean up stuff 46 | try 47 | { 48 | var cacheFolder = CacheSettings.GetCacheFolder(); 49 | Logger.Debug("Trying to delete tile folder: " + cacheFolder); 50 | Directory.Delete(cacheFolder, true); 51 | Logger.Debug("Tile directory is deleted"); 52 | } 53 | catch (Exception ex) 54 | { 55 | Logger.Debug("Delete folder failed, error: " + ex); 56 | } 57 | 58 | var esriRegAsmFilename = Path.Combine( 59 | Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), 60 | "ArcGIS\\bin\\ESRIRegAsm.exe"); 61 | var esriRegAsm = new Process {StartInfo = {FileName = esriRegAsmFilename}}; 62 | var cmd=string.Format("\"{0}\" /p:Desktop /u", GetType().Assembly.Location); 63 | esriRegAsm.StartInfo.Arguments = cmd; 64 | Logger.Debug("Unregister for ArcGIS 10: " + cmd); 65 | esriRegAsm.Start(); 66 | Logger.Debug("Unregister for ArcGIS 10 finished."); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/BingMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class BingMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&Bing"; } 10 | } 11 | public void GetItemInfo(int pos, IItemDef itemDef) 12 | { 13 | switch (pos) 14 | { 15 | case 0: 16 | itemDef.ID = "AddBingRoadLayerCommand"; 17 | itemDef.Group = false; 18 | break; 19 | case 1: 20 | itemDef.ID = "AddBingAerialLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | case 2: 24 | itemDef.ID = "AddBingHybridLayerCommand"; 25 | itemDef.Group = false; 26 | break; 27 | 28 | } 29 | } 30 | 31 | public int ItemCount 32 | { 33 | get { return 3; } 34 | } 35 | 36 | public string Name 37 | { 38 | get { return "BruTile"; } 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/BruTileMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class BruTileMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&ArcBruTile - Global"; } 10 | } 11 | 12 | public void GetItemInfo(int pos, IItemDef itemDef) 13 | { 14 | switch (pos) 15 | { 16 | case 0: 17 | itemDef.ID = "AddServicesCommand"; 18 | itemDef.Group = false; 19 | break; 20 | //case 1: 21 | // itemDef.ID = "AddWmscCommand"; 22 | // itemDef.Group = false; 23 | // break; 24 | case 1: 25 | itemDef.ID = "AboutBruTileCommand"; 26 | itemDef.Group = true; 27 | break; 28 | } 29 | } 30 | 31 | public int ItemCount 32 | { 33 | get { return 2; } 34 | } 35 | 36 | public string Name 37 | { 38 | get { return "BruTile"; } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/CloudMadeMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class CloudMadeMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&CloudMade"; } 10 | } 11 | public void GetItemInfo(int pos, IItemDef itemDef) 12 | { 13 | switch (pos) 14 | { 15 | case 0: 16 | itemDef.ID = "AddCloudMadeFreshLayerCommand"; 17 | itemDef.Group = false; 18 | break; 19 | case 1: 20 | itemDef.ID = "AddCloudMadeMidnightCommanderLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | case 2: 24 | itemDef.ID = "AddCloudMadePaleDawnLayerCommand"; 25 | itemDef.Group = false; 26 | break; 27 | } 28 | } 29 | 30 | public int ItemCount 31 | { 32 | get { return 3; } 33 | } 34 | 35 | public string Name 36 | { 37 | get { return "BruTile"; } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/DutchMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using BrutileArcGIS.commands; 6 | using ESRI.ArcGIS.ADF.BaseClasses; 7 | 8 | namespace BrutileArcGIS.MenuDefs 9 | { 10 | public class DutchMenuDef:BaseMenu 11 | { 12 | public DutchMenuDef() 13 | { 14 | m_barCaption = "ArcBruTile - &Dutch"; 15 | AddItem(typeof (AboutBruTileCommand)); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/GaodeMenuDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ESRI.ArcGIS.SystemUI; 6 | 7 | namespace BrutileArcGIS.MenuDefs 8 | { 9 | public class GaodeMenuDef: IMenuDef 10 | { 11 | public string Caption 12 | { 13 | get { return "&高德地图"; } 14 | } 15 | public void GetItemInfo(int pos, IItemDef itemDef) 16 | { 17 | switch (pos) 18 | { 19 | case 0: 20 | itemDef.ID = "AddGaodeRoadLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | case 1: 24 | itemDef.ID = "AddGaodeArialCommand"; 25 | itemDef.Group = false; 26 | break; 27 | case 2: 28 | itemDef.ID = "AddGaodeHybridCommand"; 29 | itemDef.Group = false; 30 | break; 31 | } 32 | } 33 | 34 | public int ItemCount 35 | { 36 | get { return 3; } 37 | } 38 | 39 | public string Name 40 | { 41 | get { return "BruTile"; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/GoogleMenuDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ESRI.ArcGIS.SystemUI; 6 | 7 | namespace BrutileArcGIS.MenuDefs 8 | { 9 | public class GoogleMenuDef:IMenuDef 10 | { 11 | public string Caption 12 | { 13 | get { return "&谷歌地图"; } 14 | } 15 | public void GetItemInfo(int pos, IItemDef itemDef) 16 | { 17 | switch (pos) 18 | { 19 | case 0: 20 | itemDef.ID = "AddGoogleRoadLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | case 1: 24 | itemDef.ID = "AddGoogleArialCommand"; 25 | itemDef.Group = false; 26 | break; 27 | 28 | } 29 | } 30 | 31 | public int ItemCount 32 | { 33 | get { return 2; } 34 | } 35 | 36 | public string Name 37 | { 38 | get { return "BruTile"; } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/MapBoxMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class MapBoxMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&MapBox"; } 10 | } 11 | public void GetItemInfo(int pos, IItemDef itemDef) 12 | { 13 | switch (pos) 14 | { 15 | case 0: 16 | itemDef.ID = "AddMapBoxSatelliteLayerCommand"; 17 | itemDef.Group = false; 18 | break; 19 | case 1: 20 | itemDef.ID = "AddMapBoxStreetsLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | case 2: 24 | itemDef.ID = "AddMapBoxTerrainLayerCommand"; 25 | itemDef.Group = false; 26 | break; 27 | 28 | } 29 | } 30 | 31 | public int ItemCount 32 | { 33 | get { return 3; } 34 | } 35 | 36 | public string Name 37 | { 38 | get { return "BruTile"; } 39 | } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/MapQuestMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class MapQuestMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&MapQuest"; } 10 | } 11 | public void GetItemInfo(int pos, IItemDef itemDef) 12 | { 13 | switch (pos) 14 | { 15 | case 0: 16 | itemDef.ID = "AddMapQuestOpenAerialMapLayerCommand"; 17 | itemDef.Group = false; 18 | break; 19 | case 1: 20 | itemDef.ID = "AddMapQuestOSMLayerCommand"; 21 | itemDef.Group = false; 22 | break; 23 | } 24 | } 25 | 26 | public int ItemCount 27 | { 28 | get { return 2; } 29 | } 30 | 31 | public string Name 32 | { 33 | get { return "BruTile"; } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/Osm2MenuDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ESRI.ArcGIS.SystemUI; 6 | 7 | namespace BrutileArcGIS.MenuDefs 8 | { 9 | 10 | public class Osm2MenuDef : IMenuDef 11 | { 12 | public string Caption 13 | { 14 | get { return "&OSM地图"; } 15 | } 16 | public void GetItemInfo(int pos, IItemDef itemDef) 17 | { 18 | switch (pos) 19 | { 20 | case 0: 21 | itemDef.ID = "AddOSMRoadCommand"; 22 | itemDef.Group = false; 23 | break; 24 | case 1: 25 | itemDef.ID = "AddOSMBikeCommand"; 26 | itemDef.Group = false; 27 | break; 28 | case 2: 29 | itemDef.ID = "AddOSMTrafficCommand"; 30 | itemDef.Group = false; 31 | break; 32 | } 33 | } 34 | 35 | public int ItemCount 36 | { 37 | get { return 3; } 38 | } 39 | 40 | public string Name 41 | { 42 | get { return "BruTile"; } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/OsmMenuDef.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.SystemUI; 2 | 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class OsmMenuDef : IMenuDef 6 | { 7 | public string Caption 8 | { 9 | get { return "&OpenStreetMap"; } 10 | } 11 | 12 | public void GetItemInfo(int pos, IItemDef itemDef) 13 | { 14 | switch (pos) 15 | { 16 | case 0: 17 | itemDef.ID = "AddOsmLayerCommand1"; 18 | itemDef.Group = false; 19 | break; 20 | } 21 | } 22 | 23 | public int ItemCount 24 | { 25 | get { return 1; } 26 | } 27 | 28 | public string Name 29 | { 30 | get { return "BruTile"; } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/PCMenuDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ESRI.ArcGIS.SystemUI; 6 | 7 | namespace BrutileArcGIS.MenuDefs 8 | { 9 | public class PCMenuDef:IMenuDef 10 | { 11 | public string Caption 12 | { 13 | get { return "&关于"; } 14 | } 15 | 16 | public void GetItemInfo(int pos, IItemDef itemDef) 17 | { 18 | switch (pos) 19 | { 20 | case 0: 21 | itemDef.ID = "TileCacheCommand"; 22 | itemDef.Group = false; 23 | break; 24 | case 1: 25 | itemDef.ID = "AboutMeCommand"; 26 | itemDef.Group = false; 27 | break; 28 | 29 | } 30 | } 31 | 32 | public int ItemCount 33 | { 34 | get { return 2; } 35 | } 36 | 37 | public string Name 38 | { 39 | get { return "BruTile"; } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/PdokMenuDef.cs: -------------------------------------------------------------------------------- 1 | using BrutileArcGIS.commands; 2 | using ESRI.ArcGIS.ADF.BaseClasses; 3 | namespace BrutileArcGIS.MenuDefs 4 | { 5 | public class PdokMenuDef:BaseMenu 6 | { 7 | public PdokMenuDef() 8 | { 9 | m_barCaption = "&PDOK"; 10 | AddItem(typeof(AddPdokBrtAchtergrondLayerCommand)); 11 | AddItem(typeof(AddPdokBrpGewaspercelenLayerCommand)); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/StamenMenuDef.cs: -------------------------------------------------------------------------------- 1 | using BrutileArcGIS.commands; 2 | using ESRI.ArcGIS.ADF.BaseClasses; 3 | 4 | namespace BrutileArcGIS.MenuDefs 5 | { 6 | public class StamenMenuDef : BaseMenu 7 | { 8 | public StamenMenuDef() 9 | { 10 | m_barCaption = "&Stamen"; 11 | AddItem(typeof(AddStamenWaterColorLayerCommand)); 12 | AddItem(typeof(AddStamenTerrainLayerCommand)); 13 | AddItem(typeof(AddStamenTonerLayerCommand)); 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /PcArcBruTile/app/MenuDefs/TDTMenuDef.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ESRI.ArcGIS.SystemUI; 6 | 7 | namespace BrutileArcGIS.MenuDefs 8 | { 9 | public class TDTMenuDef:IMenuDef 10 | { 11 | public string Caption 12 | { 13 | get { return "&天地图地图"; } 14 | } 15 | public void GetItemInfo(int pos, IItemDef itemDef) 16 | { 17 | switch (pos) 18 | { 19 | //case 0: 20 | // itemDef.ID = "AddTDTRoadCommand"; 21 | // itemDef.Group = false; 22 | // break; 23 | case 0: 24 | itemDef.ID = "AddTDTArialCommand"; 25 | itemDef.Group = false; 26 | break; 27 | case 1: 28 | itemDef.ID = "AddTDTLabelCommand"; 29 | itemDef.Group = false; 30 | break; 31 | } 32 | } 33 | 34 | public int ItemCount 35 | { 36 | get { return 2; } 37 | } 38 | 39 | public string Name 40 | { 41 | get { return "BruTile"; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PcArcBruTile/app/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PcArcBruTile")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ArcBruTile")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(true)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9775f479-36fb-47ad-a320-be374b50ad7b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0")] 36 | [assembly: AssemblyFileVersion("1.0")] 37 | -------------------------------------------------------------------------------- /PcArcBruTile/app/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.0 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace BrutileArcGIS.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BrutileArcGIS.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap bing { 67 | get { 68 | object obj = ResourceManager.GetObject("bing", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap brutilelogobig { 77 | get { 78 | object obj = ResourceManager.GetObject("brutilelogobig", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap download { 87 | get { 88 | object obj = ResourceManager.GetObject("download", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap gaode { 97 | get { 98 | object obj = ResourceManager.GetObject("gaode", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap google { 107 | get { 108 | object obj = ResourceManager.GetObject("google", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap osm_logo { 117 | get { 118 | object obj = ResourceManager.GetObject("osm_logo", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap TDT { 127 | get { 128 | object obj = ResourceManager.GetObject("TDT", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap tms { 137 | get { 138 | object obj = ResourceManager.GetObject("tms", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Drawing.Bitmap. 145 | /// 146 | internal static System.Drawing.Bitmap WMS_icon { 147 | get { 148 | object obj = ResourceManager.GetObject("WMS_icon", resourceCulture); 149 | return ((System.Drawing.Bitmap)(obj)); 150 | } 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/Google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/Google.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/QQ截图20150419154852.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/QQ截图20150419154852.jpg -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/TDT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/TDT.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/WMS_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/WMS_icon.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/bing.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/bing.PNG -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/brutilelogobig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/brutilelogobig.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/download.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/gaode.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/gaode.bmp -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/google.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/google.ico -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/osm_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/osm_logo.png -------------------------------------------------------------------------------- /PcArcBruTile/app/Resources/tms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/Resources/tms.jpg -------------------------------------------------------------------------------- /PcArcBruTile/app/Toolbars/ArcBruTileToolbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | using BrutileArcGIS.Lib; 6 | using BrutileArcGIS.MenuDefs; 7 | using ESRI.ArcGIS.ADF.BaseClasses; 8 | using ESRI.ArcGIS.ADF.CATIDs; 9 | using log4net; 10 | using log4net.Config; 11 | 12 | namespace BrutileArcGIS.Toolbars 13 | { 14 | [Guid("E74018F6-E70C-44B6-8227-1BCDEF152839")] 15 | [ClassInterface(ClassInterfaceType.None)] 16 | [ProgId("BrutileArcGIS.Toolbars.ArcBruTiletoolbar")] 17 | public sealed class ArcBruTileToolbar : BaseToolbar 18 | { 19 | private static readonly ILog Logger = LogManager.GetLogger("ArcBruTileSystemLogger"); 20 | 21 | public ArcBruTileToolbar() 22 | { 23 | XmlConfigurator.Configure(new FileInfo(Assembly.GetExecutingAssembly().Location + ".config")); 24 | 25 | try 26 | { 27 | Logger.Info("Startup ArcBruTile"); 28 | AddItem(typeof(BruTileMenuDef)); 29 | var config = ConfigurationHelper.GetConfig(); 30 | 31 | //Status sectie 32 | BeginGroup(); 33 | 34 | BeginGroup(); 35 | if (Convert.ToBoolean(config.AppSettings.Settings["useOSM"].Value)) 36 | { 37 | AddItem(typeof(OsmMenuDef)); 38 | } 39 | if (Convert.ToBoolean(config.AppSettings.Settings["useBing"].Value)) 40 | { 41 | AddItem(typeof(BingMenuDef)); 42 | } 43 | if (Convert.ToBoolean(config.AppSettings.Settings["useStamen"].Value)) 44 | { 45 | AddItem(typeof(StamenMenuDef)); 46 | } 47 | if (Convert.ToBoolean(config.AppSettings.Settings["useMapBox"].Value)) 48 | { 49 | AddItem(typeof(MapBoxMenuDef)); 50 | } 51 | if (Convert.ToBoolean(config.AppSettings.Settings["useCloudMade"].Value)) 52 | { 53 | AddItem(typeof(CloudMadeMenuDef)); 54 | } 55 | if (Convert.ToBoolean(config.AppSettings.Settings["useMapQuest"].Value)) 56 | { 57 | AddItem(typeof(MapQuestMenuDef)); 58 | } 59 | 60 | } 61 | catch (Exception ex) 62 | { 63 | Logger.Error(ex.ToString()); 64 | } 65 | } 66 | 67 | public override string Caption 68 | { 69 | get 70 | { 71 | return "ArcBruTile"; 72 | } 73 | } 74 | 75 | public override string Name 76 | { 77 | get 78 | { 79 | return "ArcBruTile toolbar"; 80 | } 81 | } 82 | 83 | #region COM Registration Function(s) 84 | [ComRegisterFunction()] 85 | [ComVisible(false)] 86 | static void RegisterFunction(Type registerType) 87 | { 88 | // Required for ArcGIS Component Category Registrar support 89 | ArcGISCategoryRegistration(registerType); 90 | 91 | // 92 | // TODO: Add any COM registration code here 93 | // 94 | } 95 | 96 | [ComUnregisterFunction()] 97 | [ComVisible(false)] 98 | static void UnregisterFunction(Type registerType) 99 | { 100 | // Required for ArcGIS Component Category Registrar support 101 | ArcGISCategoryUnregistration(registerType); 102 | 103 | // 104 | // TODO: Add any COM unregistration code here 105 | // 106 | } 107 | 108 | #region ArcGIS Component Category Registrar generated code 109 | /// 110 | /// Required method for ArcGIS Component Category registration - 111 | /// Do not modify the contents of this method with the code editor. 112 | /// 113 | private static void ArcGISCategoryRegistration(Type registerType) 114 | { 115 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 116 | MxCommandBars.Register(regKey); 117 | } 118 | /// 119 | /// Required method for ArcGIS Component Category unregistration - 120 | /// Do not modify the contents of this method with the code editor. 121 | /// 122 | private static void ArcGISCategoryUnregistration(Type registerType) 123 | { 124 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 125 | MxCommandBars.Unregister(regKey); 126 | } 127 | 128 | #endregion 129 | #endregion 130 | 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /PcArcBruTile/app/Toolbars/DutchToolbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | using BrutileArcGIS.MenuDefs; 6 | using ESRI.ArcGIS.ADF.BaseClasses; 7 | using ESRI.ArcGIS.ADF.CATIDs; 8 | using log4net; 9 | using log4net.Config; 10 | 11 | namespace BrutileArcGIS.Toolbars 12 | { 13 | [Guid("E7A9F7CC-9705-4104-8237-99D2D8C7C291")] 14 | [ClassInterface(ClassInterfaceType.None)] 15 | [ProgId("BrutileArcGIS.Toolbars.Dutchtoolbar")] 16 | public sealed class DutchToolbar:BaseToolbar 17 | { 18 | private static readonly ILog Logger = LogManager.GetLogger("ArcBruTileSystemLogger"); 19 | 20 | public DutchToolbar() 21 | { 22 | XmlConfigurator.Configure(new FileInfo(Assembly.GetExecutingAssembly().Location + ".config")); 23 | 24 | try 25 | { 26 | AddItem(typeof(DutchMenuDef)); 27 | AddItem(typeof(PdokMenuDef)); 28 | //var config = ConfigurationHelper.GetConfig(); 29 | 30 | 31 | } 32 | catch (Exception ex) 33 | { 34 | Logger.Error(ex.ToString()); 35 | } 36 | } 37 | 38 | public override string Caption 39 | { 40 | get 41 | { 42 | return "ArcBruTile - PDOK"; 43 | } 44 | } 45 | 46 | public override string Name 47 | { 48 | get 49 | { 50 | return "PDOK toolbar"; 51 | } 52 | } 53 | 54 | #region COM Registration Function(s) 55 | [ComRegisterFunction()] 56 | [ComVisible(false)] 57 | static void RegisterFunction(Type registerType) 58 | { 59 | // Required for ArcGIS Component Category Registrar support 60 | ArcGISCategoryRegistration(registerType); 61 | 62 | // 63 | // TODO: Add any COM registration code here 64 | // 65 | } 66 | 67 | [ComUnregisterFunction()] 68 | [ComVisible(false)] 69 | static void UnregisterFunction(Type registerType) 70 | { 71 | // Required for ArcGIS Component Category Registrar support 72 | ArcGISCategoryUnregistration(registerType); 73 | 74 | // 75 | // TODO: Add any COM unregistration code here 76 | // 77 | } 78 | 79 | #region ArcGIS Component Category Registrar generated code 80 | /// 81 | /// Required method for ArcGIS Component Category registration - 82 | /// Do not modify the contents of this method with the code editor. 83 | /// 84 | private static void ArcGISCategoryRegistration(Type registerType) 85 | { 86 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 87 | MxCommandBars.Register(regKey); 88 | } 89 | /// 90 | /// Required method for ArcGIS Component Category unregistration - 91 | /// Do not modify the contents of this method with the code editor. 92 | /// 93 | private static void ArcGISCategoryUnregistration(Type registerType) 94 | { 95 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 96 | MxCommandBars.Unregister(regKey); 97 | } 98 | 99 | #endregion 100 | #endregion 101 | 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /PcArcBruTile/app/Toolbars/PCLayerToolbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | using BrutileArcGIS.MenuDefs; 6 | using ESRI.ArcGIS.ADF.BaseClasses; 7 | using ESRI.ArcGIS.ADF.CATIDs; 8 | using log4net; 9 | using log4net.Config; 10 | using log4net.Repository.Hierarchy; 11 | 12 | namespace BrutileArcGIS.Toolbars 13 | { 14 | [ProgId("BrutileArcGIS.Toolbars.PCLayerToolbar")] 15 | public sealed class PCLayerToolbar : BaseToolbar 16 | { 17 | private static readonly ILog Logger = LogManager.GetLogger("ArcBruTileSystemLogger"); 18 | public PCLayerToolbar() 19 | { 20 | XmlConfigurator.Configure(new FileInfo(Assembly.GetExecutingAssembly().Location + ".config")); 21 | 22 | try 23 | { 24 | AddItem(typeof(GaodeMenuDef)); 25 | AddItem(typeof(TDTMenuDef)); 26 | AddItem(typeof(Osm2MenuDef)); 27 | AddItem(typeof(GoogleMenuDef)); 28 | AddItem(typeof(PCMenuDef)); 29 | 30 | } 31 | catch (Exception ex) 32 | { 33 | Logger.Error(ex.ToString()); 34 | } 35 | } 36 | 37 | public override string Caption 38 | { 39 | get 40 | { 41 | return "ChinaMap"; 42 | } 43 | } 44 | 45 | public override string Name 46 | { 47 | get 48 | { 49 | return "ChinaMap toolbar"; 50 | } 51 | } 52 | 53 | #region COM Registration Function(s) 54 | [ComRegisterFunction()] 55 | [ComVisible(false)] 56 | static void RegisterFunction(Type registerType) 57 | { 58 | // Required for ArcGIS Component Category Registrar support 59 | ArcGISCategoryRegistration(registerType); 60 | 61 | // 62 | // TODO: Add any COM registration code here 63 | // 64 | } 65 | 66 | [ComUnregisterFunction()] 67 | [ComVisible(false)] 68 | static void UnregisterFunction(Type registerType) 69 | { 70 | // Required for ArcGIS Component Category Registrar support 71 | ArcGISCategoryUnregistration(registerType); 72 | 73 | // 74 | // TODO: Add any COM unregistration code here 75 | // 76 | } 77 | 78 | #region ArcGIS Component Category Registrar generated code 79 | /// 80 | /// Required method for ArcGIS Component Category registration - 81 | /// Do not modify the contents of this method with the code editor. 82 | /// 83 | private static void ArcGISCategoryRegistration(Type registerType) 84 | { 85 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 86 | MxCommandBars.Register(regKey); 87 | } 88 | /// 89 | /// Required method for ArcGIS Component Category unregistration - 90 | /// Do not modify the contents of this method with the code editor. 91 | /// 92 | private static void ArcGISCategoryUnregistration(Type registerType) 93 | { 94 | string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); 95 | MxCommandBars.Unregister(regKey); 96 | } 97 | 98 | #endregion 99 | #endregion 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /PcArcBruTile/app/brutile/0.8.6/BruTile.Desktop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/brutile/0.8.6/BruTile.Desktop.dll -------------------------------------------------------------------------------- /PcArcBruTile/app/brutile/0.8.6/BruTile.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/brutile/0.8.6/BruTile.dll -------------------------------------------------------------------------------- /PcArcBruTile/app/brutile/0.8.6/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/brutile/0.8.6/log4net.dll -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AboutBruTileCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BruTile.Cache; 3 | using BruTile.Web; 4 | using BrutileArcGIS.forms; 5 | using BrutileArcGIS.lib; 6 | using BrutileArcGIS.Lib; 7 | using ESRI.ArcGIS.ADF.BaseClasses; 8 | using ESRI.ArcGIS.ArcMapUI; 9 | using ESRI.ArcGIS.Framework; 10 | 11 | namespace BrutileArcGIS.commands 12 | { 13 | [ProgId("AboutBruTileCommand")] 14 | public sealed class AboutBruTileCommand : BaseCommand 15 | { 16 | private IApplication _application; 17 | 18 | public AboutBruTileCommand() 19 | { 20 | m_category = "BruTile"; 21 | m_caption = "&About ArcBruTile..."; 22 | m_message = "About BruTile..."; 23 | m_toolTip = m_caption; 24 | m_name = "AboutBruTileCommand"; 25 | } 26 | 27 | public override void OnCreate(object hook) 28 | { 29 | if (hook == null) 30 | return; 31 | 32 | _application = hook as IApplication; 33 | 34 | //Disable if it is not ArcMap 35 | if (hook is IMxApplication) 36 | m_enabled = true; 37 | else 38 | m_enabled = false; 39 | } 40 | 41 | public override void OnClick() 42 | { 43 | var bruTileAboutBox = new BruTileAboutBox(); 44 | bruTileAboutBox.ShowDialog(new ArcMapWindow(_application)); 45 | 46 | //var fileCache = new FileCache(@"c:\aaa\tiles", "png"); 47 | //var osmTileSource = new OsmTileSource(); 48 | //var mxdoc = (IMxDocument)_application.Document; 49 | //var map = mxdoc.FocusMap; 50 | //var brutileCustomLayer = new BruTileCustomLayer(_application, osmTileSource,fileCache) {Name = "testlayer"}; 51 | //map.AddLayer(brutileCustomLayer); 52 | 53 | 54 | } 55 | } 56 | } 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AboutMeCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using BrutileArcGIS.Lib; 7 | using BrutileArcGIS.forms; 8 | using ESRI.ArcGIS.ADF.BaseClasses; 9 | using ESRI.ArcGIS.ArcMapUI; 10 | using ESRI.ArcGIS.Carto; 11 | using ESRI.ArcGIS.Framework; 12 | 13 | namespace BrutileArcGIS.commands 14 | { 15 | [ProgId("TileCacheCommand")] 16 | public sealed class TileCacheCommand : BaseCommand 17 | { 18 | private IApplication _application; 19 | 20 | public TileCacheCommand() 21 | { 22 | m_category = "BruTile"; 23 | m_caption = "&下载切片"; 24 | m_message = "下载切片"; 25 | m_toolTip = m_caption; 26 | m_name = "TileCacheCommand"; 27 | } 28 | 29 | public override void OnCreate(object hook) 30 | { 31 | if (hook == null) 32 | return; 33 | 34 | _application = hook as IApplication; 35 | 36 | //Disable if it is not ArcMap 37 | if (hook is IMxApplication) 38 | m_enabled = true; 39 | else 40 | m_enabled = false; 41 | } 42 | 43 | public override void OnClick() 44 | { 45 | var mxdoc = (IMxDocument)_application.Document; 46 | IActiveView view = mxdoc.ActiveView; 47 | var tilecache = new TileCache(view); 48 | tilecache.ShowDialog(new ArcMapWindow(_application)); 49 | } 50 | } 51 | 52 | [ProgId("AboutMeCommand")] 53 | public sealed class AboutMeCommand : BaseCommand 54 | { 55 | private IApplication _application; 56 | 57 | public AboutMeCommand() 58 | { 59 | m_category = "BruTile"; 60 | m_caption = "&关于"; 61 | m_message = "关于"; 62 | m_toolTip = m_caption; 63 | m_name = "AboutMeCommand"; 64 | } 65 | 66 | public override void OnCreate(object hook) 67 | { 68 | if (hook == null) 69 | return; 70 | 71 | _application = hook as IApplication; 72 | 73 | //Disable if it is not ArcMap 74 | if (hook is IMxApplication) 75 | m_enabled = true; 76 | else 77 | m_enabled = false; 78 | } 79 | 80 | public override void OnClick() 81 | { 82 | var bruTileAboutBox = new AboutMe(); 83 | bruTileAboutBox.ShowDialog(new ArcMapWindow(_application)); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AboutPdokCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.forms; 3 | using BrutileArcGIS.Lib; 4 | using ESRI.ArcGIS.ADF.BaseClasses; 5 | using ESRI.ArcGIS.ArcMapUI; 6 | using ESRI.ArcGIS.Framework; 7 | 8 | namespace BrutileArcGIS.commands 9 | { 10 | [ProgId("AboutPdokCommand")] 11 | public sealed class AboutPdokCommand : BaseCommand 12 | { 13 | private IApplication _application; 14 | 15 | public AboutPdokCommand() 16 | { 17 | m_category = "BruTile"; 18 | m_caption = "&About Pdok..."; 19 | m_message = "About Pdok..."; 20 | m_toolTip = m_caption; 21 | m_name = "AboutPdokCommand"; 22 | } 23 | 24 | public override void OnCreate(object hook) 25 | { 26 | if (hook == null) 27 | return; 28 | 29 | _application = hook as IApplication; 30 | 31 | //Disable if it is not ArcMap 32 | if (hook is IMxApplication) 33 | m_enabled = true; 34 | else 35 | m_enabled = false; 36 | } 37 | 38 | public override void OnClick() 39 | { 40 | var bruTileAboutBox = new BruTileAboutBox(); 41 | bruTileAboutBox.ShowDialog(new ArcMapWindow(_application)); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddBingLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddBingAerialLayerCommand")] 8 | public sealed class AddBingAerialLayerCommand : AddBruTileLayerCommandBase 9 | { 10 | public AddBingAerialLayerCommand() 11 | : base("BruTile", "&Aerial", "Add Bing Aerial Layer", "Bing Aerial", Resources.bing, EnumBruTileLayer.BingAerial) 12 | { 13 | } 14 | } 15 | 16 | [ProgId("AddBingHybridLayerCommand")] 17 | public sealed class AddBingHybridLayerCommand : AddBruTileLayerCommandBase 18 | { 19 | public AddBingHybridLayerCommand() 20 | : base("BruTile", "&Hybrid", "Add Bing Hybrid Layer", "Bing Hybrid", Resources.bing, EnumBruTileLayer.BingHybrid) 21 | { 22 | } 23 | } 24 | 25 | [ProgId("AddBingRoadLayerCommand")] 26 | public sealed class AddBingRoadLayerCommand : AddBruTileLayerCommandBase 27 | { 28 | public AddBingRoadLayerCommand() 29 | : base("BruTile", "&Roads", "Add Bing Road Layer", "Bing Road", Resources.bing, EnumBruTileLayer.BingRoad) 30 | { 31 | } 32 | } 33 | 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddBruTileLayerCommandBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using BrutileArcGIS.Lib; 5 | using ESRI.ArcGIS.ADF.BaseClasses; 6 | using ESRI.ArcGIS.ArcMapUI; 7 | using ESRI.ArcGIS.Framework; 8 | 9 | namespace BrutileArcGIS.commands 10 | { 11 | public class AddBruTileLayerCommandBase : BaseCommand 12 | { 13 | private IApplication _application; 14 | private readonly EnumBruTileLayer _enumBruTileLayer; 15 | 16 | public AddBruTileLayerCommandBase(string category, string caption, string message, string name, Bitmap bitmap, EnumBruTileLayer enumBruTileLayer) 17 | { 18 | m_category = category; 19 | m_caption = caption; 20 | m_message = message; 21 | m_toolTip = message; 22 | m_name = name; 23 | m_bitmap = bitmap; 24 | _enumBruTileLayer = enumBruTileLayer; 25 | } 26 | 27 | public override bool Enabled 28 | { 29 | get 30 | { 31 | return true; 32 | } 33 | } 34 | 35 | public override void OnCreate(object hook) 36 | { 37 | if (hook == null) 38 | return; 39 | 40 | _application = hook as IApplication; 41 | 42 | //Disable if it is not ArcMap 43 | if (hook is IMxApplication) 44 | m_enabled = true; 45 | else 46 | m_enabled = false; 47 | } 48 | 49 | public override void OnClick() 50 | { 51 | try 52 | { 53 | var mxdoc = (IMxDocument)_application.Document; 54 | var map = mxdoc.FocusMap; 55 | var brutileLayer = new BruTileLayer(_application, _enumBruTileLayer) 56 | { 57 | Name = m_name, 58 | Visible = true 59 | }; 60 | 61 | map.AddLayer(brutileLayer); 62 | } 63 | catch (Exception ex) 64 | { 65 | MessageBox.Show(ex.ToString()); 66 | } 67 | } 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddCloudMadeLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddCloudMadeFreshLayerCommand")] 8 | public sealed class AddCloudMadeFreshLayerCommand : AddTmsLayerCommandBase 9 | { 10 | public AddCloudMadeFreshLayerCommand() 11 | : base("BruTile", "&Fresh", "Add Fresh Layer", "CloudMade Fresh", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/CloudMade/Fresh.xml", EnumBruTileLayer.InvertedTMS) 12 | { 13 | } 14 | } 15 | 16 | [ProgId("AddCloudMadeMidnightCommanderLayerCommand")] 17 | public sealed class AddCloudMadeMidnightCommanderLayerCommand : AddTmsLayerCommandBase 18 | { 19 | public AddCloudMadeMidnightCommanderLayerCommand() 20 | : base("BruTile", "&Midnight Commander", "Add Midnight Commander Layer", "CloudMade Midnight Commander", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/CloudMade/Midnight Commander.xml", EnumBruTileLayer.InvertedTMS) 21 | { 22 | } 23 | } 24 | 25 | [ProgId("AddCloudMadePaleDawnLayerCommand")] 26 | public sealed class AddCloudMadePaleDawnLayerCommand : AddTmsLayerCommandBase 27 | { 28 | public AddCloudMadePaleDawnLayerCommand() 29 | : base("BruTile", "&Pale Dawn", "Add Pale Dawn Layer", "CloudMade Pale Dawn", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/CloudMade/Pale Dawn.xml", EnumBruTileLayer.InvertedTMS) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddGaodeLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using BrutileArcGIS.Lib; 7 | using BrutileArcGIS.Properties; 8 | 9 | namespace BrutileArcGIS.commands 10 | { 11 | #region 高德地图 12 | [ProgId("AddGaodeRoadLayerCommand")] 13 | public sealed class AddGaodeRoadLayerCommand : AddBruTileLayerCommandBase 14 | { 15 | public AddGaodeRoadLayerCommand() 16 | : base("BruTile", "&道路地图", "添加高德道路地图", "GaodeRoad", Resources.gaode, EnumBruTileLayer.GaodeRoad) 17 | { 18 | } 19 | } 20 | 21 | [ProgId("AddGaodeArialCommand")] 22 | public sealed class AddGaodeArialCommand : AddBruTileLayerCommandBase 23 | { 24 | public AddGaodeArialCommand() 25 | : base("BruTile", "&影像地图", "添加高德影像地图", "GaodeArial", Resources.gaode, EnumBruTileLayer.GaodeArial) 26 | { 27 | } 28 | } 29 | 30 | [ProgId("AddGaodeHybridCommand")] 31 | public sealed class AddGaodeHybridCommand : AddBruTileLayerCommandBase 32 | { 33 | public AddGaodeHybridCommand() 34 | : base("BruTile", "&路网地图", "添加高德路网地图", "GaodeHybrid", Resources.gaode, EnumBruTileLayer.GaodeHybrid) 35 | { 36 | } 37 | } 38 | 39 | [ProgId("AddGaodeTrafficCommand")] 40 | public sealed class AddGaodeTrafficCommand : AddBruTileLayerCommandBase 41 | { 42 | public AddGaodeTrafficCommand() 43 | : base("BruTile", "&交通流量地图", "添加高德交通流量地图", "GaodeTraffic", Resources.gaode, EnumBruTileLayer.GaodeTraffic) 44 | { 45 | } 46 | } 47 | #endregion 48 | 49 | #region 天地图 50 | [ProgId("AddTDTRoadCommand")] 51 | public sealed class AddTDTRoadCommand : AddBruTileLayerCommandBase 52 | { 53 | public AddTDTRoadCommand() 54 | : base("BruTile", "&道路地图", "添加天地图地图", "TDTRoad", Resources.TDT, EnumBruTileLayer.TDTRoad) 55 | { 56 | } 57 | } 58 | 59 | 60 | [ProgId("AddTDTArialCommand")] 61 | public sealed class AddTDTArialCommand : AddBruTileLayerCommandBase 62 | { 63 | public AddTDTArialCommand() 64 | : base("BruTile", "&影像地图", "添加天地图影像地图", "TDTArial", Resources.TDT, EnumBruTileLayer.TDTArial) 65 | { 66 | } 67 | } 68 | 69 | [ProgId("AddTDTLabelCommand")] 70 | public sealed class AddTDTLabelCommand : AddBruTileLayerCommandBase 71 | { 72 | public AddTDTLabelCommand() 73 | : base("BruTile", "&注记地图", "添加天地图注记地图", "TDTLabel", Resources.TDT, EnumBruTileLayer.TDTLabel) 74 | { 75 | } 76 | } 77 | 78 | #endregion 79 | 80 | #region OSM地图 81 | [ProgId("AddOSMRoadCommand")] 82 | public sealed class AddOSMRoadCommand : AddBruTileLayerCommandBase 83 | { 84 | public AddOSMRoadCommand() 85 | : base("BruTile", "&道路地图", "添加OSM道路地图", "OSMRoad", Resources.osm_logo, EnumBruTileLayer.OSMRoad) 86 | { 87 | } 88 | } 89 | 90 | [ProgId("AddOSMBikeCommand")] 91 | public sealed class AddOSMBikeCommand : AddBruTileLayerCommandBase 92 | { 93 | public AddOSMBikeCommand() 94 | : base("BruTile", "&自行车地图", "添加OSM自行车地图", "OSMBike", Resources.osm_logo, EnumBruTileLayer.OSMBike) 95 | { 96 | } 97 | } 98 | 99 | [ProgId("AddOSMTrafficCommand")] 100 | public sealed class AddOSMTrafficCommand : AddBruTileLayerCommandBase 101 | { 102 | public AddOSMTrafficCommand() 103 | : base("BruTile", "&交通地图", "添加OSM交通流量地图", "OSMTraffic", Resources.osm_logo, EnumBruTileLayer.OsmTraffic) 104 | { 105 | } 106 | } 107 | #endregion 108 | } 109 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddGoogleLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using BrutileArcGIS.Lib; 7 | using BrutileArcGIS.Properties; 8 | 9 | namespace BrutileArcGIS.commands 10 | { 11 | [ProgId("AddGoogleRoadLayerCommand")] 12 | public sealed class AddGoogleRoadLayerCommand : AddBruTileLayerCommandBase 13 | { 14 | public AddGoogleRoadLayerCommand() 15 | : base("BruTile", "&道路地图", "添加谷歌道路地图", "GoogleRoad", Resources.google, EnumBruTileLayer.GoogleMap) 16 | { 17 | } 18 | } 19 | 20 | [ProgId("AddGoogleArialCommand")] 21 | public sealed class AddGoogleArialCommand : AddBruTileLayerCommandBase 22 | { 23 | public AddGoogleArialCommand() 24 | : base("BruTile", "&影像地图", "添加谷歌影像地图", "GoogleArial", Resources.google, EnumBruTileLayer.GoogleHybrid) 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddMapBoxLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddMapBoxSatelliteLayerCommand")] 8 | public sealed class AddMapBoxSatelliteLayerCommand : AddTmsLayerCommandBase 9 | { 10 | public AddMapBoxSatelliteLayerCommand() 11 | : base("BruTile", "&Satellite", "Add Satellite Layer", "MapBox Satellite", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/MapBox/Satellite.xml", EnumBruTileLayer.InvertedTMS) 12 | { 13 | } 14 | } 15 | 16 | [ProgId("AddMapBoxStreetsLayerCommand")] 17 | public sealed class AddMapBoxStreetsLayerCommand : AddTmsLayerCommandBase 18 | { 19 | public AddMapBoxStreetsLayerCommand() 20 | : base("BruTile", "&Streets", "Add Streets Layer", "MapBox Streets", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/MapBox/Streets.xml", EnumBruTileLayer.InvertedTMS) 21 | { 22 | } 23 | } 24 | 25 | [ProgId("AddMapBoxTerrainLayerCommand")] 26 | public sealed class AddMapBoxTerrainLayerCommand : AddTmsLayerCommandBase 27 | { 28 | public AddMapBoxTerrainLayerCommand() 29 | : base("BruTile", "&Terrain", "Add Terrain Layer", "MapBox Terrain", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/MapBox/terrain.xml", EnumBruTileLayer.InvertedTMS) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddMapQuestLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddMapQuestOpenAerialMapLayerCommand")] 8 | public sealed class AddMapQuestOpenAerialMapLayerCommand : AddTmsLayerCommandBase 9 | { 10 | public AddMapQuestOpenAerialMapLayerCommand() 11 | : base("BruTile", "&OpenAerialMap", "Add OpenAerialMap Layer", "MapQuest OpenAerialMap", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/MapQuest/OpenAerialMap.xml", EnumBruTileLayer.InvertedTMS) 12 | { 13 | } 14 | } 15 | 16 | [ProgId("AddMapQuestOSMLayerCommand")] 17 | public sealed class AddMapQuestOSMLayerCommand : AddTmsLayerCommandBase 18 | { 19 | public AddMapQuestOSMLayerCommand() 20 | : base("BruTile", "&OSM", "Add OSM Layer", "MapQuest OSM", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/MapQuest/OSM.xml", EnumBruTileLayer.InvertedTMS) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddOsmLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddOsmLayerCommand1")] 8 | public sealed class AddOsmLayerCommand : AddBruTileLayerCommandBase 9 | { 10 | public AddOsmLayerCommand() 11 | : base("BruTile", "&Mapnik", "Add OpenStreetMap Layer", "OpenStreetMap Mapnik", Resources.osm_logo, EnumBruTileLayer.OSM) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddPdokLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddPdokBrtAchtergrondLayerCommand")] 8 | public sealed class AddPdokBrtAchtergrondLayerCommand : AddTmsLayerCommandBase 9 | { 10 | public AddPdokBrtAchtergrondLayerCommand() 11 | : base("Pdok", "&Brt achtergrond", "Add Brt Layer", "Pdok Brt", Resources.download, "http://acceptatie.geodata.nationaalgeoregister.nl/tiles/service/tms/1.0.0/brtachtergrondkaart@EPSG%3A25831%3ARWS@png8", EnumBruTileLayer.TMS) 12 | { 13 | } 14 | } 15 | 16 | 17 | [ProgId("AddPdokBrpGewaspercelenLayerCommand")] 18 | public sealed class AddPdokBrpGewaspercelenLayerCommand : AddTmsLayerCommandBase 19 | { 20 | public AddPdokBrpGewaspercelenLayerCommand() 21 | : base("Pdok", "&Brp gewaspercelen", "Add Brp gewaspercelen", "Pdok Brp", Resources.download, "http://acceptatie.geodata.nationaalgeoregister.nl/tiles/service/tms/1.0.0/brpgewaspercelen@EPSG%3A28992@png8", EnumBruTileLayer.TMS) 22 | { 23 | } 24 | } 25 | } 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddServicesCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | using BrutileArcGIS.forms; 5 | using BrutileArcGIS.Lib; 6 | using ESRI.ArcGIS.ADF.BaseClasses; 7 | using ESRI.ArcGIS.ArcMapUI; 8 | using ESRI.ArcGIS.Framework; 9 | 10 | namespace BrutileArcGIS.commands 11 | { 12 | [ProgId("AddServicesCommand")] 13 | public sealed class AddServicesCommand : BaseCommand 14 | { 15 | private IApplication _application; 16 | 17 | public AddServicesCommand() 18 | { 19 | m_category = "BruTile"; 20 | m_caption = "&Add TMS service..."; 21 | m_message = "Add TMS service..."; 22 | m_toolTip = m_caption; 23 | m_name = "ServicesCommand"; 24 | } 25 | 26 | public override void OnCreate(object hook) 27 | { 28 | if (hook == null) 29 | return; 30 | 31 | _application = hook as IApplication; 32 | 33 | //Disable if it is not ArcMap 34 | if (hook is IMxApplication) 35 | m_enabled = true; 36 | else 37 | m_enabled = false; 38 | 39 | } 40 | 41 | public override void OnClick() 42 | { 43 | try 44 | { 45 | var mxdoc = (IMxDocument)_application.Document; 46 | var map = mxdoc.FocusMap; 47 | 48 | var addServicesForm = new AddServicesForm(); 49 | 50 | var result = addServicesForm.ShowDialog(new ArcMapWindow(_application)); 51 | if (result == DialogResult.OK) 52 | { 53 | var selectedService = addServicesForm.SelectedService; 54 | 55 | // Fix the service labs.metacarta.com bug: it doubles the version :-( 56 | selectedService.Href = selectedService.Href.Replace(@"1.0.0/1.0.0", @"1.0.0").Trim(); 57 | 58 | 59 | var layerType=EnumBruTileLayer.TMS; 60 | 61 | // If the type is inverted TMS we have to do something special 62 | if (selectedService.Type != null) 63 | { 64 | if (selectedService.Type == "InvertedTMS") 65 | { 66 | layerType = EnumBruTileLayer.InvertedTMS; 67 | } 68 | } 69 | 70 | var brutileLayer = new BruTileLayer(_application, layerType, selectedService.Href, selectedService.OverwriteUrls) 71 | { 72 | Name = selectedService.Title, 73 | Visible = true 74 | }; 75 | map.AddLayer(brutileLayer); 76 | } 77 | } 78 | catch (Exception ex) 79 | { 80 | MessageBox.Show(ex.ToString()); 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddStamenLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using BrutileArcGIS.Lib; 3 | using BrutileArcGIS.Properties; 4 | 5 | namespace BrutileArcGIS.commands 6 | { 7 | [ProgId("AddStamenWaterColorLayerCommand")] 8 | public sealed class AddStamenWaterColorLayerCommand : AddTmsLayerCommandBase 9 | { 10 | public AddStamenWaterColorLayerCommand() 11 | : base("BruTile", "&Watercolor", "Add Watercolor Layer", "Stamen WaterColor", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/Stamen/watercolor.xml",EnumBruTileLayer.InvertedTMS) 12 | { 13 | } 14 | } 15 | 16 | [ProgId("AddStamenTonerLayerCommand")] 17 | public sealed class AddStamenTonerLayerCommand : AddTmsLayerCommandBase 18 | { 19 | public AddStamenTonerLayerCommand() 20 | : base("BruTile", "&Toner", "Add Toner Layer", "Stamen Toner", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/Stamen/toner.xml", EnumBruTileLayer.InvertedTMS) 21 | { 22 | } 23 | } 24 | 25 | [ProgId("AddStamenTerrainLayerCommand")] 26 | public sealed class AddStamenTerrainLayerCommand : AddTmsLayerCommandBase 27 | { 28 | public AddStamenTerrainLayerCommand() 29 | : base("BruTile", "&Terrain", "Add Terrain Layer", "Stamen Terrain", Resources.download, "http://dl.dropbox.com/u/9984329/ArcBruTile/Services/Stamen/terrain.xml", EnumBruTileLayer.InvertedTMS) 30 | { 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddTmsLayerCommandBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using BrutileArcGIS.Lib; 5 | using ESRI.ArcGIS.ADF.BaseClasses; 6 | using ESRI.ArcGIS.ArcMapUI; 7 | using ESRI.ArcGIS.Framework; 8 | 9 | namespace BrutileArcGIS.commands 10 | { 11 | public class AddTmsLayerCommandBase : BaseCommand 12 | { 13 | private IApplication _application; 14 | private readonly string _url; 15 | private readonly EnumBruTileLayer _enumBruTileLayer; 16 | 17 | public AddTmsLayerCommandBase(string category, string caption, string message, string name, Bitmap bitmap, string url, EnumBruTileLayer enumBruTileLayer) 18 | { 19 | m_category = category; 20 | m_caption = caption; 21 | m_message = message; 22 | m_toolTip = message; 23 | m_name = name; 24 | m_bitmap = bitmap; 25 | _url = url; 26 | _enumBruTileLayer = enumBruTileLayer; 27 | } 28 | 29 | public override bool Enabled 30 | { 31 | get 32 | { 33 | return true; 34 | } 35 | } 36 | 37 | public override void OnCreate(object hook) 38 | { 39 | if (hook == null) 40 | return; 41 | 42 | _application = hook as IApplication; 43 | 44 | //Disable if it is not ArcMap 45 | if (hook is IMxApplication) 46 | m_enabled = true; 47 | else 48 | m_enabled = false; 49 | } 50 | 51 | public override void OnClick() 52 | { 53 | try 54 | { 55 | var mxdoc = (IMxDocument)_application.Document; 56 | var map = mxdoc.FocusMap; 57 | var view = mxdoc.ActiveView; 58 | var brutileLayer = new BruTileLayer(_application, _enumBruTileLayer, _url, true) 59 | { 60 | Name = m_name, 61 | Visible = true 62 | }; 63 | 64 | map.AddLayer(brutileLayer); 65 | } 66 | catch (Exception ex) 67 | { 68 | MessageBox.Show(ex.ToString()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /PcArcBruTile/app/commands/AddWmsCLayerCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | using BrutileArcGIS.forms; 5 | using BrutileArcGIS.Lib; 6 | using BrutileArcGIS.Properties; 7 | using ESRI.ArcGIS.ADF.BaseClasses; 8 | using ESRI.ArcGIS.ArcMapUI; 9 | using ESRI.ArcGIS.Carto; 10 | using ESRI.ArcGIS.Framework; 11 | 12 | namespace BrutileArcGIS.commands 13 | { 14 | [ProgId("AddWmscCommand")] 15 | public sealed class AddWmsCLayerCommand : BaseCommand 16 | { 17 | private IMap _map; 18 | private IApplication _application; 19 | 20 | public AddWmsCLayerCommand() 21 | { 22 | m_category = "BruTile"; 23 | m_caption = "Add &WMS-C service..."; 24 | m_message = "Add WMS-C Layer"; 25 | m_toolTip = m_message; 26 | m_name = "AddWmsCLayer"; 27 | m_bitmap = Resources.WMS_icon; 28 | } 29 | 30 | public override void OnCreate(object hook) 31 | { 32 | if (hook == null) 33 | return; 34 | 35 | _application = hook as IApplication; 36 | 37 | //Disable if it is not ArcMap 38 | if (hook is IMxApplication) 39 | m_enabled = true; 40 | else 41 | m_enabled = false; 42 | 43 | } 44 | 45 | public override bool Enabled 46 | { 47 | get 48 | { 49 | return true; 50 | } 51 | } 52 | 53 | public override void OnClick() 54 | { 55 | try 56 | { 57 | var mxdoc = (IMxDocument)_application.Document; 58 | 59 | _map = mxdoc.FocusMap; 60 | 61 | var addWmsCForm = new AddWmsCForm(); 62 | var result = addWmsCForm.ShowDialog(new ArcMapWindow(_application)); 63 | 64 | if (result == DialogResult.OK) 65 | { 66 | var tileSource = addWmsCForm.SelectedTileSource; 67 | 68 | IConfig configWmsC = new ConfigWmsC(tileSource); 69 | var brutileLayer = new BruTileLayer(_application,configWmsC) 70 | { 71 | Name = configWmsC.CreateTileSource().Schema.Name, 72 | Visible = true 73 | }; 74 | _map.AddLayer(brutileLayer); 75 | } 76 | } 77 | catch (Exception ex) 78 | { 79 | MessageBox.Show(ex.ToString()); 80 | } 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AboutMe.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BrutileArcGIS.forms 2 | { 3 | partial class AboutMe 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 34 | this.label3 = new System.Windows.Forms.Label(); 35 | this.label4 = new System.Windows.Forms.Label(); 36 | this.button1 = new System.Windows.Forms.Button(); 37 | this.label5 = new System.Windows.Forms.Label(); 38 | this.label6 = new System.Windows.Forms.Label(); 39 | this.label7 = new System.Windows.Forms.Label(); 40 | this.label8 = new System.Windows.Forms.Label(); 41 | this.SuspendLayout(); 42 | // 43 | // label1 44 | // 45 | this.label1.AutoSize = true; 46 | this.label1.Location = new System.Drawing.Point(13, 13); 47 | this.label1.Name = "label1"; 48 | this.label1.Size = new System.Drawing.Size(65, 12); 49 | this.label1.TabIndex = 0; 50 | this.label1.Text = "作者:彭晨"; 51 | // 52 | // label2 53 | // 54 | this.label2.AutoSize = true; 55 | this.label2.Location = new System.Drawing.Point(13, 38); 56 | this.label2.Name = "label2"; 57 | this.label2.Size = new System.Drawing.Size(41, 12); 58 | this.label2.TabIndex = 1; 59 | this.label2.Text = "邮箱:"; 60 | // 61 | // linkLabel1 62 | // 63 | this.linkLabel1.AutoSize = true; 64 | this.linkLabel1.Location = new System.Drawing.Point(51, 38); 65 | this.linkLabel1.Name = "linkLabel1"; 66 | this.linkLabel1.Size = new System.Drawing.Size(101, 12); 67 | this.linkLabel1.TabIndex = 2; 68 | this.linkLabel1.TabStop = true; 69 | this.linkLabel1.Text = "646645129@qq.com"; 70 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 71 | // 72 | // label3 73 | // 74 | this.label3.AutoSize = true; 75 | this.label3.Location = new System.Drawing.Point(13, 88); 76 | this.label3.Name = "label3"; 77 | this.label3.Size = new System.Drawing.Size(41, 12); 78 | this.label3.TabIndex = 3; 79 | this.label3.Text = "简介:"; 80 | // 81 | // label4 82 | // 83 | this.label4.AutoSize = true; 84 | this.label4.Location = new System.Drawing.Point(51, 88); 85 | this.label4.MaximumSize = new System.Drawing.Size(150, 0); 86 | this.label4.Name = "label4"; 87 | this.label4.Size = new System.Drawing.Size(149, 36); 88 | this.label4.TabIndex = 4; 89 | this.label4.Text = "在原程序上添加了新的电子地图,并且加快了显示速度,祝好!"; 90 | // 91 | // button1 92 | // 93 | this.button1.Location = new System.Drawing.Point(12, 162); 94 | this.button1.Name = "button1"; 95 | this.button1.Size = new System.Drawing.Size(75, 23); 96 | this.button1.TabIndex = 5; 97 | this.button1.Text = "打开缓存目录"; 98 | this.button1.UseVisualStyleBackColor = true; 99 | this.button1.Click += new System.EventHandler(this.button1_Click); 100 | // 101 | // label5 102 | // 103 | this.label5.AutoSize = true; 104 | this.label5.Location = new System.Drawing.Point(13, 142); 105 | this.label5.Name = "label5"; 106 | this.label5.Size = new System.Drawing.Size(149, 12); 107 | this.label5.TabIndex = 6; 108 | this.label5.Text = "如果缓存占用空间过大,就"; 109 | // 110 | // label6 111 | // 112 | this.label6.AutoSize = true; 113 | this.label6.Location = new System.Drawing.Point(97, 167); 114 | this.label6.MaximumSize = new System.Drawing.Size(150, 0); 115 | this.label6.Name = "label6"; 116 | this.label6.Size = new System.Drawing.Size(65, 12); 117 | this.label6.TabIndex = 7; 118 | this.label6.Text = "删掉就好了"; 119 | // 120 | // label7 121 | // 122 | this.label7.AutoSize = true; 123 | this.label7.Location = new System.Drawing.Point(13, 63); 124 | this.label7.Name = "label7"; 125 | this.label7.Size = new System.Drawing.Size(41, 12); 126 | this.label7.TabIndex = 8; 127 | this.label7.Text = "单位:"; 128 | // 129 | // label8 130 | // 131 | this.label8.AutoSize = true; 132 | this.label8.Location = new System.Drawing.Point(51, 63); 133 | this.label8.MaximumSize = new System.Drawing.Size(150, 0); 134 | this.label8.Name = "label8"; 135 | this.label8.Size = new System.Drawing.Size(125, 12); 136 | this.label8.TabIndex = 9; 137 | this.label8.Text = "华东师范大学地理学院"; 138 | // 139 | // AboutMe 140 | // 141 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 142 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 143 | this.ClientSize = new System.Drawing.Size(199, 218); 144 | this.Controls.Add(this.label8); 145 | this.Controls.Add(this.label7); 146 | this.Controls.Add(this.label6); 147 | this.Controls.Add(this.label5); 148 | this.Controls.Add(this.button1); 149 | this.Controls.Add(this.label4); 150 | this.Controls.Add(this.label3); 151 | this.Controls.Add(this.linkLabel1); 152 | this.Controls.Add(this.label2); 153 | this.Controls.Add(this.label1); 154 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; 155 | this.Name = "AboutMe"; 156 | this.Text = "AboutMe"; 157 | this.ResumeLayout(false); 158 | this.PerformLayout(); 159 | 160 | } 161 | 162 | #endregion 163 | 164 | private System.Windows.Forms.Label label1; 165 | private System.Windows.Forms.Label label2; 166 | private System.Windows.Forms.LinkLabel linkLabel1; 167 | private System.Windows.Forms.Label label3; 168 | private System.Windows.Forms.Label label4; 169 | private System.Windows.Forms.Button button1; 170 | private System.Windows.Forms.Label label5; 171 | private System.Windows.Forms.Label label6; 172 | private System.Windows.Forms.Label label7; 173 | private System.Windows.Forms.Label label8; 174 | } 175 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AboutMe.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Windows.Forms; 10 | using BrutileArcGIS.Lib; 11 | 12 | namespace BrutileArcGIS.forms 13 | { 14 | public partial class AboutMe : Form 15 | { 16 | public AboutMe() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 22 | { 23 | Process.Start("mailto:"+linkLabel1.Text); 24 | } 25 | 26 | private void button1_Click(object sender, EventArgs e) 27 | { 28 | string _cacheDir = CacheSettings.GetCacheFolder(); 29 | Process.Start(_cacheDir); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AboutMe.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddProviderForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Net; 7 | using System.Windows.Forms; 8 | using System.Xml; 9 | using BrutileArcGIS.Lib; 10 | 11 | namespace BrutileArcGIS.forms 12 | { 13 | public partial class AddProviderForm : Form 14 | { 15 | private string _providedServiceUrl = string.Empty; 16 | private EnumBruTileLayer _enumBruTileLayer = EnumBruTileLayer.TMS; 17 | 18 | public string ProviderName { get; set; } 19 | 20 | public string ProvidedServiceUrl 21 | { 22 | get { return _providedServiceUrl; } 23 | set { _providedServiceUrl = value; } 24 | } 25 | 26 | public EnumBruTileLayer EnumBruTileLayer 27 | { 28 | get { return _enumBruTileLayer; } 29 | set { _enumBruTileLayer = value; } 30 | } 31 | 32 | public AddProviderForm() 33 | { 34 | InitializeComponent(); 35 | 36 | InitForm(); 37 | } 38 | 39 | private void InitForm() 40 | { 41 | var config = ConfigurationHelper.GetConfig(); 42 | var sampleProviders = config.AppSettings.Settings["sampleProviders"].Value; 43 | var providers = GetList(sampleProviders); 44 | lbProviders.DataSource = providers; 45 | lbProviders.DisplayMember = "Title"; 46 | } 47 | 48 | protected List GetList(string url) 49 | { 50 | var providers = new List(); 51 | 52 | var request = (HttpWebRequest)WebRequest.Create(url); 53 | request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"; 54 | var proxy = WebRequest.GetSystemWebProxy(); 55 | proxy.Credentials = CredentialCache.DefaultCredentials; 56 | request.Proxy = proxy; 57 | 58 | var response = (HttpWebResponse)request.GetResponse(); 59 | var stream = response.GetResponseStream(); 60 | if (stream != null) 61 | { 62 | var reader = new StreamReader(stream); 63 | 64 | while (!reader.EndOfStream) 65 | { 66 | var line = reader.ReadLine(); 67 | 68 | var tileMapService = new TileMapService(); 69 | if (line != null) 70 | { 71 | tileMapService.Title = line.Split(',')[0]; 72 | tileMapService.Href = line.Split(',')[1]; 73 | tileMapService.Version = line.Split(',')[2]; 74 | } 75 | providers.Add(tileMapService); 76 | } 77 | } 78 | 79 | return providers; 80 | } 81 | 82 | private bool CheckUrl(string url) 83 | { 84 | var result = false; 85 | if (!UrlIsValid(url)) return false; 86 | try 87 | { 88 | TmsTileMapServiceParser.GetTileMaps(url); 89 | result = true; 90 | } 91 | catch (WebException) 92 | { 93 | errorProvider1.SetError(tbTmsUrl, "Could not download document. Please specify valid url"); 94 | } 95 | catch (XmlException) 96 | { 97 | errorProvider1.SetError(tbTmsUrl, "Could not download XML document. Please specify valid url"); 98 | } 99 | return result; 100 | 101 | } 102 | 103 | 104 | private void btnOk_Click(object sender, EventArgs e) 105 | { 106 | if (!CheckUrl(tbTmsUrl.Text)) return; 107 | ProviderName = tbName.Text; 108 | ProvidedServiceUrl = tbTmsUrl.Text; 109 | DialogResult = DialogResult.OK; 110 | Close(); 111 | } 112 | 113 | private void tbName_Validating(object sender, CancelEventArgs e) 114 | { 115 | if (tbName.Text == String.Empty) 116 | { 117 | errorProvider1.SetError(tbName, "Please give name"); 118 | e.Cancel = true; 119 | } 120 | else 121 | { 122 | errorProvider1.SetError(tbName, ""); 123 | } 124 | 125 | } 126 | 127 | private void tbTmsUrl_Validating(object sender, CancelEventArgs e) 128 | { 129 | if (tbTmsUrl.Text == String.Empty) 130 | { 131 | errorProvider1.SetError(tbTmsUrl, "Please give url"); 132 | e.Cancel = true; 133 | } 134 | else 135 | { 136 | errorProvider1.SetError(tbTmsUrl, ""); 137 | } 138 | 139 | } 140 | 141 | private void btnCancel_Click(object sender, EventArgs e) 142 | { 143 | Close(); 144 | } 145 | 146 | 147 | protected bool UrlIsValid(string url) 148 | { 149 | Uri result; 150 | return (Uri.TryCreate(url, UriKind.Absolute, out result)); 151 | } 152 | 153 | 154 | private void lbProviders_SelectedIndexChanged(object sender, EventArgs e) 155 | { 156 | var tileMapService=(TileMapService)lbProviders.SelectedItem; 157 | tbName.Text = tileMapService.Title; 158 | tbTmsUrl.Text = tileMapService.Href; 159 | } 160 | 161 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 162 | { 163 | var psi=new ProcessStartInfo {UseShellExecute = true, FileName = "http://arcbrutile.codeplex.com"}; 164 | Process.Start(psi); 165 | } 166 | 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddProviderForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddServicesForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | using System.Xml.Linq; 6 | using BruTileArcGIS; 7 | using BrutileArcGIS.Lib; 8 | 9 | namespace BrutileArcGIS.forms 10 | { 11 | public partial class AddServicesForm : Form 12 | { 13 | private string _servicesDir; 14 | private bool _init=true; 15 | private string _file; 16 | 17 | public AddServicesForm() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | public TileMap SelectedService { get; set; } 23 | public TileMapService SelectedTileMapService { get; set; } 24 | 25 | private void AddPredefinedServicesForm_Load(object sender, EventArgs e) 26 | { 27 | InitForm(); 28 | } 29 | 30 | private void InitForm() 31 | { 32 | // Read the files in de services directory 33 | _servicesDir = CacheSettings.GetServicesConfigDir(); 34 | var di = new DirectoryInfo(_servicesDir); 35 | var files= di.GetFiles("*.xml").Select(f => Path.GetFileNameWithoutExtension(f.FullName)).ToList(); 36 | 37 | lbProvider.DataSource = files; 38 | 39 | if (files.Count==0) 40 | { 41 | dgvServices.DataSource = null; 42 | } 43 | } 44 | 45 | private void btnOk_Click(object sender, EventArgs e) 46 | { 47 | DialogResult = DialogResult.OK; 48 | Close(); 49 | } 50 | 51 | private void lbProvider_SelectedIndexChanged(object sender, EventArgs e) 52 | { 53 | _init = true; 54 | _file = (String)lbProvider.SelectedItem; 55 | var res = _servicesDir + Path.DirectorySeparatorChar + _file + ".xml"; 56 | 57 | var xdoc=XDocument.Load(res); 58 | var el=xdoc.Element("Services"); 59 | if (el != null) 60 | { 61 | var el1 = el.Element("TileMapService"); 62 | if (el1 != null) 63 | SelectedTileMapService = new TileMapService 64 | { 65 | Title = el1.Attribute("title").Value, 66 | Version = el1.Attribute("version").Value, 67 | Href = el1.Attribute("href").Value }; 68 | } 69 | 70 | btnRemoveProvider.Enabled = true; 71 | 72 | var tilemaps=TmsTileMapServiceParser.GetTileMaps(SelectedTileMapService.Href); 73 | tilemaps.Sort(TileMap.Compare); 74 | 75 | dgvServices.DataSource = tilemaps; 76 | dgvServices.Columns.Remove("Href"); 77 | dgvServices.Columns.Remove("Profile"); 78 | dgvServices.Columns.Remove("Srs"); 79 | dgvServices.Columns.Remove("Type"); 80 | dgvServices.Columns.Remove("OverwriteUrls"); 81 | 82 | //resize columns 83 | dgvServices.Columns[0].Width=120; 84 | dgvServices.ClearSelection(); 85 | _init = false; 86 | if (tilemaps.Count > 0) 87 | { 88 | btnOk.Enabled = false; 89 | } 90 | } 91 | 92 | private void dgvServices_SelectionChanged(object sender, EventArgs e) 93 | { 94 | if (!_init) 95 | { 96 | btnOk.Enabled = true; 97 | if (dgvServices.CurrentRow != null) SelectedService = (TileMap)dgvServices.CurrentRow.DataBoundItem; 98 | //SelectedService. 99 | } 100 | } 101 | 102 | private void btnAddProvider_Click(object sender, EventArgs e) 103 | { 104 | var addProviderForm = new AddProviderForm(); 105 | var dr=addProviderForm.ShowDialog(this); 106 | if (dr == DialogResult.OK) 107 | { 108 | var name = addProviderForm.ProviderName; 109 | var url=addProviderForm.ProvidedServiceUrl; 110 | var enumBruTileLayer = addProviderForm.EnumBruTileLayer; 111 | 112 | // Now write an XML file to the services... 113 | WriteProviderXml(name,url,enumBruTileLayer); 114 | 115 | // now refresh... 116 | InitForm(); 117 | } 118 | } 119 | 120 | private void WriteProviderXml(string name, string url, EnumBruTileLayer enumBruTileLayer) 121 | { 122 | var xml=@""; 123 | xml+=String.Format(@"",name,url,enumBruTileLayer); 124 | xml += ""; 125 | 126 | var xmlfile = _servicesDir + Path.DirectorySeparatorChar + name + ".xml"; 127 | if (!File.Exists(xmlfile)) 128 | { 129 | var tw = new StreamWriter(xmlfile); 130 | tw.WriteLine(xml); 131 | tw.Close(); 132 | } 133 | else 134 | { 135 | MessageBox.Show(string.Format("Provider {0} does already exist.", name)); 136 | } 137 | } 138 | 139 | private void btnRemoveProvider_Click(object sender, EventArgs e) 140 | { 141 | var selectedFile = (String)lbProvider.SelectedItem; 142 | var res = _servicesDir + Path.DirectorySeparatorChar + selectedFile + ".xml"; 143 | 144 | if(File.Exists(res)) 145 | { 146 | File.Delete(res); 147 | InitForm(); 148 | } 149 | else 150 | { 151 | MessageBox.Show(string.Format("File {0} does not exist. Cannot remove provider.", selectedFile), @"Error"); 152 | } 153 | } 154 | 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddServicesForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddWmsCForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | using BruTile; 6 | using BruTile.Wmsc; 7 | 8 | namespace BrutileArcGIS.forms 9 | { 10 | public partial class AddWmsCForm : Form 11 | { 12 | private IList _tileSources; 13 | 14 | public ITileSource SelectedTileSource; 15 | 16 | public AddWmsCForm() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void btnOk_Click(object sender, EventArgs e) 22 | { 23 | DialogResult = DialogResult.OK; 24 | } 25 | 26 | private void btnRetrieve_Click(object sender, EventArgs e) 27 | { 28 | // Complete sample urrel: 29 | // http://labs.metacarta.com/wms-c/tilecache.py?version=1.1.1&request=GetCapabilities&service=wms-c 30 | // Does not work yet: http://public-wms.kaartenbalie.nl/wms/nederland 31 | //string url = String.Format("{0}?version={1}&request=GetCapabilities&service=wms-c", tbWmsCUrl.Text, cbbVersion.SelectedItem); 32 | var url = tbWmsCUrl.Text; 33 | 34 | try 35 | { 36 | _tileSources = WmscTileSource.CreateFromWmscCapabilties(new Uri(url)).ToList(); 37 | 38 | var names = _tileSources.Select(t => t.Schema.Name).ToList(); 39 | 40 | lbServices.DataSource = names; 41 | } 42 | catch (Exception ex) 43 | { 44 | MessageBox.Show(ex.Message); 45 | } 46 | 47 | } 48 | 49 | private void lbServices_SelectedIndexChanged(object sender, EventArgs e) 50 | { 51 | if (lbServices.SelectedItem != null) 52 | { 53 | var name = (String)lbServices.SelectedItem; 54 | foreach (var tileSource in _tileSources.Where(t => t.Schema.Name == name)) 55 | { 56 | SelectedTileSource = tileSource; 57 | } 58 | btnOk.Enabled = true; 59 | } 60 | } 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/AddWmsCForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/BruTileAboutBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | using System.Windows.Forms; 5 | 6 | namespace BrutileArcGIS.forms 7 | { 8 | partial class BruTileAboutBox : Form 9 | { 10 | public BruTileAboutBox() 11 | { 12 | InitializeComponent(); 13 | Text = String.Format("About {0}", AssemblyTitle); 14 | labelProductName.Text = AssemblyProduct; 15 | labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 16 | } 17 | 18 | public string AssemblyTitle 19 | { 20 | get 21 | { 22 | var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 23 | if (attributes.Length > 0) 24 | { 25 | var titleAttribute = (AssemblyTitleAttribute)attributes[0]; 26 | if (titleAttribute.Title != "") 27 | { 28 | return titleAttribute.Title; 29 | } 30 | } 31 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 32 | } 33 | } 34 | 35 | public string AssemblyVersion 36 | { 37 | get 38 | { 39 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 40 | } 41 | } 42 | 43 | public string AssemblyDescription 44 | { 45 | get 46 | { 47 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 48 | if (attributes.Length == 0) 49 | { 50 | return "Produced by Bert Temme (2009)"; 51 | } 52 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 53 | } 54 | } 55 | 56 | public string AssemblyProduct 57 | { 58 | get 59 | { 60 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 61 | if (attributes.Length == 0) 62 | { 63 | return ""; 64 | } 65 | return ((AssemblyProductAttribute)attributes[0]).Product; 66 | } 67 | } 68 | 69 | public string AssemblyCopyright 70 | { 71 | get 72 | { 73 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 74 | if (attributes.Length == 0) 75 | { 76 | return ""; 77 | } 78 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 79 | } 80 | } 81 | 82 | public string AssemblyCompany 83 | { 84 | get 85 | { 86 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 87 | if (attributes.Length == 0) 88 | { 89 | return ""; 90 | } 91 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 92 | } 93 | } 94 | 95 | private void pictureBox1_Click(object sender, EventArgs e) 96 | { 97 | Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=P4TKQNQKS4JKS"); 98 | } 99 | 100 | private void okButton_Click(object sender, EventArgs e) 101 | { 102 | 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/BruTileAboutBox.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/FormPreCache.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BruTileArcGIS 2 | { 3 | partial class FormPreCache 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.TextBoxPreCacheAreaName = new System.Windows.Forms.TextBox(); 33 | this.ButtonStart = new System.Windows.Forms.Button(); 34 | this.ButtonCancel = new System.Windows.Forms.Button(); 35 | this.SuspendLayout(); 36 | // 37 | // label1 38 | // 39 | this.label1.AutoSize = true; 40 | this.label1.Location = new System.Drawing.Point(12, 9); 41 | this.label1.Name = "label1"; 42 | this.label1.Size = new System.Drawing.Size(150, 13); 43 | this.label1.TabIndex = 0; 44 | this.label1.Text = "Enter name of PreCache area:"; 45 | // 46 | // TextBoxPreCacheAreaName 47 | // 48 | this.TextBoxPreCacheAreaName.Location = new System.Drawing.Point(15, 25); 49 | this.TextBoxPreCacheAreaName.Name = "TextBoxPreCacheAreaName"; 50 | this.TextBoxPreCacheAreaName.Size = new System.Drawing.Size(265, 20); 51 | this.TextBoxPreCacheAreaName.TabIndex = 1; 52 | // 53 | // ButtonStart 54 | // 55 | this.ButtonStart.Location = new System.Drawing.Point(60, 125); 56 | this.ButtonStart.Name = "ButtonStart"; 57 | this.ButtonStart.Size = new System.Drawing.Size(75, 23); 58 | this.ButtonStart.TabIndex = 3; 59 | this.ButtonStart.Text = "Start"; 60 | this.ButtonStart.UseVisualStyleBackColor = true; 61 | this.ButtonStart.Click += new System.EventHandler(this.ButtonStart_Click); 62 | // 63 | // ButtonCancel 64 | // 65 | this.ButtonCancel.Location = new System.Drawing.Point(141, 125); 66 | this.ButtonCancel.Name = "ButtonCancel"; 67 | this.ButtonCancel.Size = new System.Drawing.Size(75, 23); 68 | this.ButtonCancel.TabIndex = 4; 69 | this.ButtonCancel.Text = "Cancel"; 70 | this.ButtonCancel.UseVisualStyleBackColor = true; 71 | this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); 72 | // 73 | // FormPreCache 74 | // 75 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 76 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 77 | this.ClientSize = new System.Drawing.Size(292, 160); 78 | this.Controls.Add(this.ButtonCancel); 79 | this.Controls.Add(this.ButtonStart); 80 | this.Controls.Add(this.TextBoxPreCacheAreaName); 81 | this.Controls.Add(this.label1); 82 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 83 | this.Name = "FormPreCache"; 84 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 85 | this.Text = "PreCache"; 86 | this.ResumeLayout(false); 87 | this.PerformLayout(); 88 | 89 | } 90 | 91 | #endregion 92 | 93 | private System.Windows.Forms.Label label1; 94 | private System.Windows.Forms.TextBox TextBoxPreCacheAreaName; 95 | private System.Windows.Forms.Button ButtonStart; 96 | private System.Windows.Forms.Button ButtonCancel; 97 | } 98 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/FormPreCacheStatus.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BruTileArcGIS 2 | { 3 | partial class FormPreCacheStatus 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.LabelStatus = new System.Windows.Forms.Label(); 32 | this.SuspendLayout(); 33 | // 34 | // LabelStatus 35 | // 36 | this.LabelStatus.AutoSize = true; 37 | this.LabelStatus.Location = new System.Drawing.Point(12, 9); 38 | this.LabelStatus.Name = "LabelStatus"; 39 | this.LabelStatus.Size = new System.Drawing.Size(93, 13); 40 | this.LabelStatus.TabIndex = 0; 41 | this.LabelStatus.Text = "PreCache Status: "; 42 | // 43 | // FormPreCacheStatus 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(270, 33); 48 | this.Controls.Add(this.LabelStatus); 49 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 50 | this.Name = "FormPreCacheStatus"; 51 | this.ShowInTaskbar = false; 52 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 53 | this.Text = "PreCache Status"; 54 | this.ResumeLayout(false); 55 | this.PerformLayout(); 56 | 57 | } 58 | 59 | #endregion 60 | 61 | private System.Windows.Forms.Label LabelStatus; 62 | } 63 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/forms/TileCache.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ArcMapWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ESRI.ArcGIS.Framework; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public class ArcMapWindow : System.Windows.Forms.IWin32Window 7 | { 8 | private readonly IApplication _app; 9 | 10 | public ArcMapWindow(IApplication application) 11 | { 12 | _app = application; 13 | } 14 | 15 | public IntPtr Handle 16 | { 17 | get { return new IntPtr(_app.hWnd); } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/CacheDirectory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BruTile.Cache; 3 | using BrutileArcGIS.Lib; 4 | 5 | namespace BrutileArcGIS.lib 6 | { 7 | public class CacheDirectory 8 | { 9 | public static FileCache GetFileCache(string baseCacheDir, IConfig config,EnumBruTileLayer enumBruTileLayer) 10 | { 11 | var schema = config.CreateTileSource().Schema; 12 | 13 | var cacheDirType = GetCacheDirectory(config, enumBruTileLayer, baseCacheDir); 14 | 15 | var format = schema.Format; 16 | 17 | if (format.Contains(@"image/")) 18 | { 19 | format = format.Substring(6, schema.Format.Length - 6); 20 | } 21 | if (format.Contains("png8")) 22 | { 23 | format = format.Replace("png8", "png"); 24 | } 25 | var fileCache = new FileCache(cacheDirType, format); 26 | 27 | return fileCache; 28 | 29 | } 30 | 31 | private static string GetCacheDirectory(IConfig config, EnumBruTileLayer layerType, string baseCacheDir) 32 | { 33 | string cacheDirectory = String.Format("{0}{1}{2}", baseCacheDir, System.IO.Path.DirectorySeparatorChar, layerType); 34 | 35 | if (layerType == EnumBruTileLayer.TMS || layerType == EnumBruTileLayer.InvertedTMS) 36 | { 37 | string url = (layerType == EnumBruTileLayer.TMS ? ((ConfigTms)config).Url : ((ConfigInvertedTMS)config).Url); 38 | 39 | string service = url.Substring(7, url.Length - 7); 40 | service = service.Replace(@"/", "-"); 41 | service = service.Replace(":", "-"); 42 | 43 | if (service.EndsWith("-")) 44 | { 45 | service = service.Substring(0, service.Length - 1); 46 | } 47 | cacheDirectory = String.Format("{0}{1}{2}{3}{4}", baseCacheDir, System.IO.Path.DirectorySeparatorChar, layerType, System.IO.Path.DirectorySeparatorChar, service); 48 | } 49 | 50 | return cacheDirectory; 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/CacheSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public static class CacheSettings 7 | { 8 | public static string GetServicesConfigDir() 9 | { 10 | var config = ConfigurationHelper.GetConfig(); 11 | var servicesConfigDir = config.AppSettings.Settings["servicesConfigDir"].Value; 12 | if (servicesConfigDir.Contains("%")) 13 | { 14 | servicesConfigDir = ReplaceEnvironmentVar(servicesConfigDir); 15 | } 16 | 17 | if (!Directory.Exists(servicesConfigDir)) 18 | { 19 | Directory.CreateDirectory(servicesConfigDir); 20 | } 21 | 22 | return servicesConfigDir; 23 | } 24 | 25 | public static string GetCacheFolder() 26 | { 27 | var config=ConfigurationHelper.GetConfig(); 28 | var tileDir = config.AppSettings.Settings["tileDir"].Value; 29 | if(tileDir.Contains("%")) 30 | { 31 | tileDir = ReplaceEnvironmentVar(tileDir); 32 | } 33 | 34 | return tileDir; 35 | } 36 | 37 | private static string ReplaceEnvironmentVar(string path) 38 | { 39 | var firstIndex = path.IndexOf("%", StringComparison.Ordinal); 40 | var lastIndex = path.LastIndexOf("%", StringComparison.Ordinal); 41 | var envVar = path.Substring(firstIndex+1, lastIndex - firstIndex-1); 42 | var environmentVariable = Environment.GetEnvironmentVariable(envVar); 43 | path = path.Replace("%"+envVar+"%", environmentVariable); 44 | return path; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ChinaConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using BruTile; 6 | using BruTile.Predefined; 7 | using BruTile.Web; 8 | using BrutileArcGIS.Lib; 9 | 10 | namespace BrutileArcGIS.lib 11 | { 12 | public class ChinaConfig : IConfig 13 | { 14 | 15 | private readonly EnumBruTileLayer _mapType = EnumBruTileLayer.GaodeRoad; 16 | 17 | public ChinaConfig(EnumBruTileLayer mapType) 18 | { 19 | _mapType = mapType; 20 | } 21 | 22 | public ITileSource CreateTileSource() 23 | { 24 | if (_mapType == EnumBruTileLayer.GaodeRoad) 25 | { 26 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 27 | "http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}", 28 | new[] {"1", "2", "3","4"}, name: _mapType.ToString()); 29 | } 30 | else if (_mapType==EnumBruTileLayer.GaodeArial) 31 | { 32 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 33 | "http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", 34 | new[] { "1", "2", "3","4" }, name: _mapType.ToString()); 35 | } 36 | else if (_mapType == EnumBruTileLayer.GaodeHybrid) 37 | { 38 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 39 | "http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}", 40 | new[] { "1", "2", "3","4" }, name: _mapType.ToString()); 41 | } 42 | else if (_mapType == EnumBruTileLayer.GaodeTraffic) 43 | { 44 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 45 | "http://123.57.79.15/Service/Traffic.ashx?zoom={z}&x={x}&y={y}", 46 | new[] { "1", "2", "3", "4" }, name: _mapType.ToString()); 47 | } 48 | else if (_mapType == EnumBruTileLayer.TDTRoad) 49 | { 50 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 51 | "http://t{s}.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}", 52 | new[] { "0", "1", "2", "3", "4", "5", "6", "7" }, name: _mapType.ToString()); 53 | } 54 | else if (_mapType == EnumBruTileLayer.TDTArial) 55 | { 56 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 57 | "http://t{s}.tianditu.cn/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}", 58 | new[] { "0", "1", "2", "3", "4", "5", "6", "7" }, name: _mapType.ToString()); 59 | } 60 | else if (_mapType == EnumBruTileLayer.TDTLabel) 61 | { 62 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 63 | "http://t{s}.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}", 64 | new[] { "0","1", "2", "3", "4", "5", "6", "7" }, name: _mapType.ToString()); 65 | } 66 | else if (_mapType == EnumBruTileLayer.OSMRoad) 67 | { 68 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 69 | "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", 70 | new[] { "a", "b", "c" }, name: _mapType.ToString()); 71 | } 72 | else if (_mapType == EnumBruTileLayer.OSMBike) 73 | { 74 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 75 | "http://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png", 76 | new[] { "a", "b", "c" }, name: _mapType.ToString()); 77 | } 78 | else if (_mapType == EnumBruTileLayer.OsmTraffic) 79 | { 80 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 81 | "http://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png", 82 | new[] { "a", "b", "c" }, name: _mapType.ToString()); 83 | } 84 | else if (_mapType == EnumBruTileLayer.GoogleHybrid) 85 | { 86 | return new HttpTileSource(new GlobalSphericalMercator(0, 20), 87 | "http://khm{s}.googleapis.com/kh?v=190&hl=zh-CN&x={x}&y={y}&z={z}", 88 | new[] { "0","1", "2", "3"}, name: _mapType.ToString()); 89 | } 90 | else if (_mapType == EnumBruTileLayer.GoogleMap) 91 | { 92 | return new HttpTileSource(new GlobalSphericalMercator(0, 21), 93 | "http://maps.googleapis.com/maps/vt?hl=zh-CN&x={x}&y={y}&z={z}", 94 | new[] { "1", "2", "3" }, name: _mapType.ToString()); 95 | } 96 | return new OsmTileSource(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigBing.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | using BruTile.Web; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public class ConfigBing : IConfig 7 | { 8 | private readonly BingMapType _mapType = BingMapType.Roads; 9 | 10 | public ConfigBing(BingMapType mapType) 11 | { 12 | _mapType = mapType; 13 | } 14 | 15 | public ITileSource CreateTileSource() 16 | { 17 | var config = ConfigurationHelper.GetConfig(); 18 | 19 | var bingToken=config.AppSettings.Settings["BingToken"].Value; 20 | var bingUrl = config.AppSettings.Settings["BingUrl"].Value; 21 | 22 | return new BingTileSource( 23 | bingUrl,bingToken,_mapType); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigBingHybrid.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | using BruTile.Web; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public class ConfigBingHybrid : IConfig 7 | { 8 | public ITileSource CreateTileSource() 9 | { 10 | var config = ConfigurationHelper.GetConfig(); 11 | 12 | var bingToken = config.AppSettings.Settings["BingToken"].Value; 13 | var bingUrl = config.AppSettings.Settings["BingUrl"].Value; 14 | const BingMapType mapType = BingMapType.Hybrid; 15 | 16 | return new BingTileSource( 17 | bingUrl, bingToken, mapType); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using BruTile.Web; 2 | using BrutileArcGIS.lib; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public class ConfigHelper 7 | { 8 | public static IConfig GetTmsConfig(string url, bool overwriteUrls) 9 | { 10 | return new ConfigTms(url, overwriteUrls); 11 | } 12 | 13 | public static IConfig GetConfig(EnumBruTileLayer enumBruTileLayer, string url, bool overwriteUrls) 14 | { 15 | IConfig result; 16 | 17 | if (enumBruTileLayer == EnumBruTileLayer.TMS) 18 | { 19 | result = new ConfigTms(url, overwriteUrls); 20 | } 21 | else if (enumBruTileLayer == EnumBruTileLayer.InvertedTMS) 22 | { 23 | result = new ConfigInvertedTMS(url); 24 | } 25 | else 26 | { 27 | result = new ConfigOsm(OsmMapType.Default); 28 | } 29 | 30 | return result; 31 | } 32 | 33 | public static IConfig GetConfig(EnumBruTileLayer enumBruTileLayer) 34 | { 35 | IConfig result = new ConfigOsm(OsmMapType.Default); 36 | 37 | if (enumBruTileLayer == EnumBruTileLayer.OSM) 38 | { 39 | result = new ConfigOsm(OsmMapType.Default); 40 | } 41 | else if (enumBruTileLayer == EnumBruTileLayer.BingRoad) 42 | { 43 | result = new ConfigBing(BingMapType.Roads); 44 | } 45 | else if (enumBruTileLayer == EnumBruTileLayer.BingHybrid) 46 | { 47 | result = new ConfigBing(BingMapType.Hybrid); 48 | } 49 | else if (enumBruTileLayer == EnumBruTileLayer.BingAerial) 50 | { 51 | result = new ConfigBing(BingMapType.Aerial); 52 | } 53 | else 54 | { 55 | result = new ChinaConfig(enumBruTileLayer); 56 | } 57 | return result; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigInvertedTMS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using BruTile; 4 | using BruTile.Predefined; 5 | using BruTile.Tms; 6 | 7 | namespace BrutileArcGIS.Lib 8 | { 9 | public class ConfigInvertedTMS : IConfig 10 | { 11 | private string _url; 12 | 13 | public ConfigInvertedTMS(string url) 14 | { 15 | if (url == null) throw new ArgumentNullException("url"); 16 | _url = url; 17 | } 18 | 19 | public ITileSource CreateTileSource() 20 | { 21 | var request = (HttpWebRequest)WebRequest.Create(_url); 22 | request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"; 23 | var response = (HttpWebResponse)request.GetResponse(); 24 | var stream = response.GetResponseStream(); 25 | var tileSource = TileMapParser.CreateTileSource(stream); 26 | return new TileSource(tileSource.Provider, new SphericalMercatorInvertedWorldSchema()); 27 | } 28 | 29 | public string Url 30 | { 31 | get { return _url; } 32 | set { _url = value; } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigOsm.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | using BruTile.Predefined; 3 | using BruTile.Web; 4 | 5 | namespace BrutileArcGIS.Lib 6 | { 7 | public class ConfigOsm : IConfig 8 | { 9 | private readonly OsmMapType _osmMapType; 10 | 11 | public ConfigOsm(OsmMapType maptype) 12 | { 13 | _osmMapType = maptype; 14 | 15 | } 16 | 17 | public ITileSource CreateTileSource() 18 | { 19 | ITileSource result = null; 20 | 21 | if (_osmMapType == OsmMapType.Default) 22 | { 23 | result = KnownTileSources.Create(KnownTileSource.OpenStreetMap); 24 | } 25 | 26 | return result; 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigTms.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using BruTile; 4 | using BruTile.Tms; 5 | 6 | namespace BrutileArcGIS.Lib 7 | { 8 | public class ConfigTms: IConfig 9 | { 10 | private readonly bool _overwriteUrls; 11 | 12 | public ConfigTms(String url, bool overwriteUrls) 13 | { 14 | Url = url; 15 | _overwriteUrls = overwriteUrls; 16 | } 17 | 18 | public ITileSource CreateTileSource() 19 | { 20 | var request = (HttpWebRequest)WebRequest.Create(Url); 21 | request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"; 22 | var response = (HttpWebResponse)request.GetResponse(); 23 | var stream= response.GetResponseStream(); 24 | var tileSource = _overwriteUrls ? TileMapParser.CreateTileSource(stream, Url) : TileMapParser.CreateTileSource(stream); 25 | return tileSource; 26 | } 27 | 28 | public string Url { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigWmsC.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | 3 | namespace BrutileArcGIS.Lib 4 | { 5 | public class ConfigWmsC: IConfig 6 | { 7 | private readonly ITileSource _tileSource; 8 | 9 | public ConfigWmsC(ITileSource tileSource) 10 | { 11 | _tileSource = tileSource; 12 | } 13 | 14 | public ITileSource CreateTileSource() 15 | { 16 | return _tileSource; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/ConfigurationHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Reflection; 4 | 5 | namespace BrutileArcGIS.Lib 6 | { 7 | public class ConfigurationHelper 8 | { 9 | public static int GetTileTimeOut() 10 | { 11 | var config = GetConfig(); 12 | var tileTimeOut = Int32.Parse(config.AppSettings.Settings["tileTimeout"].Value); 13 | return tileTimeOut; 14 | } 15 | 16 | public static Configuration GetConfig() 17 | { 18 | Configuration config; 19 | 20 | var configFileName = Assembly.GetExecutingAssembly().Location + ".config"; 21 | var fileMap = new ExeConfigurationFileMap(); 22 | try 23 | { 24 | // You may want to map to your own exe.config file here. 25 | fileMap.ExeConfigFilename = configFileName; 26 | config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); 27 | } 28 | catch 29 | { 30 | var msg = String.Format("Can not find ({0})", configFileName); 31 | throw new ApplicationException(msg); 32 | } 33 | 34 | return config; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/EnumBruTileLayer.cs: -------------------------------------------------------------------------------- 1 | namespace BrutileArcGIS.Lib 2 | { 3 | public enum EnumBruTileLayer 4 | { 5 | OSM, 6 | BingRoad, BingAerial, BingHybrid, 7 | TMS, 8 | WMSC, 9 | InvertedTMS, 10 | GaodeRoad,GaodeArial,GaodeHybrid,GaodeTraffic, 11 | TDTRoad, TDTArial, TDTLabel, 12 | OSMRoad,OSMBike,OsmTraffic, 13 | GoogleMap,GoogleHybrid 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/EnvelopeExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using ESRI.ArcGIS.Geometry; 4 | 5 | namespace BrutileArcGIS.lib 6 | { 7 | public static class EnvelopeExtensionMethods 8 | { 9 | public static float GetMapResolution(this IEnvelope env, int mapWidth) 10 | { 11 | var dx = env.XMax - env.XMin; 12 | var res = Convert.ToSingle(dx / mapWidth); 13 | return res; 14 | } 15 | 16 | 17 | public static PointF GetCenterPoint(this IEnvelope env) 18 | { 19 | var p = new PointF 20 | { 21 | X = Convert.ToSingle(env.XMin + (env.XMax - env.XMin) / 2), 22 | Y = Convert.ToSingle(env.YMin + (env.YMax - env.YMin) / 2) 23 | }; 24 | return p; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/FetchStrategy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using BruTile; 5 | 6 | namespace BrutileArcGIS.Lib 7 | { 8 | interface IFetchStrategy 9 | { 10 | IList GetTilesWanted(ITileSchema schema, Extent extent, string levelId); 11 | } 12 | 13 | public class FetchStrategy : IFetchStrategy 14 | { 15 | public static HashSet GetPreFetchLevels(int min, int max) 16 | { 17 | var preFetchLayers = new HashSet(); 18 | var level = min; 19 | var step = 1; 20 | while (level <= max) 21 | { 22 | preFetchLayers.Add(level); 23 | level += step; 24 | step++; 25 | } 26 | return preFetchLayers; 27 | } 28 | 29 | public IList GetTilesWanted(ITileSchema schema, Extent extent, string levelId) 30 | { 31 | IList infos = new List(); 32 | // Iterating through all levels from current to zero. If lower levels are 33 | // not availeble the renderer can fall back on higher level tiles. 34 | var resolution = schema.Resolutions[levelId].UnitsPerPixel; 35 | var levels = schema.Resolutions.Where(k => resolution <= k.Value.UnitsPerPixel).OrderByDescending(x => x.Value.UnitsPerPixel); 36 | 37 | //var levelCount = levels.Count(); 38 | foreach (var level in levels) 39 | { 40 | var tileInfos = schema.GetTilesInView(extent, level.Key); 41 | tileInfos = SortByPriority(tileInfos, extent.CenterX, extent.CenterY); 42 | 43 | //var count = infosOfLevel.Count(); 44 | foreach (var info in tileInfos) 45 | { 46 | if ((info.Index.Row >= 0) && (info.Index.Col >= 0)) infos.Add(info); 47 | } 48 | } 49 | 50 | return infos; 51 | } 52 | 53 | private static IEnumerable SortByPriority(IEnumerable tiles, double centerX, double centerY) 54 | { 55 | return tiles.OrderBy(t => Distance(centerX, centerY, t.Extent.CenterX, t.Extent.CenterY)); 56 | } 57 | 58 | public static double Distance(double x1, double y1, double x2, double y2) 59 | { 60 | return Math.Sqrt(Math.Pow(x1 - x2, 2.0) + Math.Pow(y1 - y2, 2.0)); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/FileCacheExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.IO; 4 | using BruTile; 5 | using BruTile.Cache; 6 | 7 | namespace BrutileArcGIS.lib 8 | { 9 | public static class ExtensionMethods 10 | { 11 | public static void AddWorldFile(this FileCache fileCache, TileInfo tileInfo, int width, int height, string format) 12 | { 13 | var fileName = fileCache.GetFileName(tileInfo.Index); 14 | var fi = new FileInfo(fileName); 15 | 16 | var tfwFile = fileName.Replace(fi.Extension, "." + GetWorldFile(format)); 17 | 18 | var extent = tileInfo.Extent; 19 | 20 | using (var sw = new StreamWriter(tfwFile)) 21 | { 22 | var resX = (extent.MaxX - extent.MinX) / width; 23 | var resY = (extent.MaxY - extent.MinY) / height; 24 | sw.WriteLine(resX.ToString(CultureInfo.InvariantCulture)); 25 | sw.WriteLine("0"); 26 | sw.WriteLine("0"); 27 | sw.WriteLine((resY * -1).ToString(CultureInfo.InvariantCulture)); 28 | sw.WriteLine(extent.MinX.ToString(CultureInfo.InvariantCulture)); 29 | sw.WriteLine(extent.MaxY.ToString(CultureInfo.InvariantCulture)); 30 | sw.Close(); 31 | } 32 | 33 | } 34 | 35 | private static string GetWorldFile(string format) 36 | { 37 | var res = String.Empty; 38 | 39 | format = (format.Contains(@"image/") ? format.Substring(6, format.Length - 6) : format); 40 | 41 | if (format == "jpg") 42 | { 43 | res = "jgw"; 44 | } 45 | if (format == "jpeg") 46 | { 47 | res = "jgw"; 48 | } 49 | else if (format == "png") 50 | { 51 | res = "pgw"; 52 | } 53 | else if (format == "png8") 54 | { 55 | res = "pgw"; 56 | } 57 | 58 | else if (format == "tif") 59 | { 60 | res = "tfw"; 61 | } 62 | 63 | return res; 64 | 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/FileFetcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading; 5 | using BruTile; 6 | using BruTile.Cache; 7 | using BrutileArcGIS.lib; 8 | 9 | namespace BrutileArcGIS.Lib 10 | { 11 | public class FileFetcher 12 | { 13 | private readonly ITileSource _tileSource; 14 | private readonly FileCache _fileCache; 15 | private readonly IList _tilesInProgress = new List(); 16 | private const int MaxThreads = 4; 17 | private readonly AutoResetEvent _waitHandle = new AutoResetEvent(false); 18 | private volatile bool _isAborted; 19 | private volatile bool _isViewChanged; 20 | //private readonly IFetchStrategy _strategy = new FetchStrategy(); 21 | private double _resolution; 22 | //private readonly Retries _retries = new Retries(); 23 | private Extent _extent; 24 | 25 | 26 | public event DataChangedEventHandler DataChanged; 27 | 28 | public FileFetcher(ITileSource tileSource, FileCache filecache) 29 | { 30 | _tileSource = tileSource; 31 | _fileCache = filecache; 32 | 33 | StartFetchLoop(); 34 | 35 | } 36 | 37 | public void ViewChanged(Extent newExtent, double newResolution) 38 | { 39 | _extent = newExtent; 40 | _resolution = newResolution; 41 | _isViewChanged = true; 42 | _waitHandle.Set(); 43 | } 44 | 45 | private void StartFetchLoop() 46 | { 47 | ThreadPool.QueueUserWorkItem(FetchLoop); 48 | } 49 | 50 | 51 | private void FetchLoop(object state) 52 | { 53 | IEnumerable tilesWanted = null; 54 | 55 | while (!_isAborted) 56 | { 57 | _waitHandle.WaitOne(); 58 | 59 | if (_tileSource.Schema == null) 60 | { 61 | _waitHandle.Reset(); // set in wait mode 62 | continue; // and go to begin of loop to wait 63 | } 64 | 65 | if (_isViewChanged || tilesWanted == null) 66 | { 67 | var levelId = Utilities.GetNearestLevel(_tileSource.Schema.Resolutions, _resolution); 68 | tilesWanted = GetTilesWanted(_tileSource.Schema, _extent, levelId); 69 | _isViewChanged = false; 70 | } 71 | 72 | var tilesMissing = GetTilesMissing(tilesWanted, _fileCache); 73 | 74 | FetchTiles(tilesMissing); 75 | 76 | if (tilesMissing.Count == 0) 77 | { 78 | _waitHandle.Reset(); 79 | } 80 | 81 | if (_tilesInProgress.Count >= MaxThreads) { _waitHandle.Reset(); } 82 | } 83 | } 84 | 85 | private void FetchTiles(IEnumerable tilesMissing) 86 | { 87 | foreach (TileInfo info in tilesMissing) 88 | { 89 | if (_tilesInProgress.Count >= MaxThreads) return; 90 | FetchTile(info); 91 | } 92 | } 93 | 94 | 95 | 96 | public void FetchTiles(Extent currentExtent, string level) 97 | { 98 | var tilesMissing = GetTilesWanted(_tileSource.Schema, currentExtent, level); 99 | foreach (var info in tilesMissing) 100 | { 101 | if (_tilesInProgress.Count >= MaxThreads) return; 102 | FetchTile(info); 103 | } 104 | } 105 | 106 | private void FetchTile(TileInfo info) 107 | { 108 | // first some checks 109 | if (_tilesInProgress.Contains(info.Index)) return; 110 | 111 | // prepare for request 112 | lock (_tilesInProgress) { _tilesInProgress.Add(info.Index); } 113 | 114 | // now we can go for the request. 115 | FetchAsync(info); 116 | } 117 | 118 | public void AbortFetch() 119 | { 120 | _isAborted = true; 121 | _waitHandle.Set(); // active fetch loop so it can run out of the loop 122 | } 123 | 124 | 125 | private void FetchAsync(TileInfo tileInfo) 126 | { 127 | ThreadPool.QueueUserWorkItem( 128 | source => 129 | { 130 | Exception error = null; 131 | Tile tile = null; 132 | 133 | try 134 | { 135 | if (_tileSource != null) 136 | { 137 | byte[] data = _tileSource.Provider.GetTile(tileInfo); 138 | _fileCache.Add(tileInfo.Index, data); 139 | 140 | _fileCache.AddWorldFile(tileInfo, _tileSource.Schema.GetTileHeight("0"), _tileSource.Schema.GetTileHeight("0"), 141 | _tileSource.Schema.Format); 142 | tile = new Tile { Data = data, Info = tileInfo }; 143 | 144 | } 145 | } 146 | catch (Exception ex) //This may seem a bit weird. We catch the exception to pass it as an argument. This is because we are on a worker thread here, we cannot just let it fall through. 147 | { 148 | error = ex; 149 | } 150 | 151 | lock (_tilesInProgress) 152 | { 153 | if (_tilesInProgress.Contains(tileInfo.Index)) 154 | _tilesInProgress.Remove(tileInfo.Index); 155 | } 156 | 157 | _waitHandle.Set(); 158 | if (DataChanged != null && !_isAborted) 159 | DataChanged(this, new DataChangedEventArgs(error, false, tile)); 160 | 161 | }); 162 | } 163 | 164 | 165 | public IList GetTilesMissing(IEnumerable tilesWanted, FileCache fileCache) 166 | { 167 | return tilesWanted.Where( 168 | info => fileCache.Find(info.Index) == null).ToList(); 169 | } 170 | 171 | 172 | public IList GetTilesWanted(ITileSchema schema, Extent extent, string levelId) 173 | { 174 | return schema.GetTilesInView(extent, (levelId)).ToList(); 175 | } 176 | 177 | } 178 | 179 | 180 | public delegate void DataChangedEventHandler(object sender, DataChangedEventArgs e); 181 | 182 | public class DataChangedEventArgs 183 | { 184 | public DataChangedEventArgs(Exception error, bool cancelled, Tile tile) 185 | { 186 | Error = error; 187 | Cancelled = cancelled; 188 | Tile = tile; 189 | } 190 | 191 | public Exception Error { get; private set; } 192 | public bool Cancelled { get; private set; } 193 | public Tile Tile { get; private set; } 194 | } 195 | 196 | } 197 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/IConfig.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | 3 | namespace BrutileArcGIS.Lib 4 | { 5 | public interface IConfig 6 | { 7 | ITileSource CreateTileSource(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/MultipleThreadResetEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | 4 | namespace BrutileArcGIS.Lib 5 | { 6 | public class MultipleThreadResetEvent : IDisposable 7 | { 8 | private readonly ManualResetEvent _done; 9 | private readonly int _total; 10 | private long _current; 11 | 12 | /// 13 | /// 构造函数 14 | /// 15 | /// 需要等待执行的线程总数 16 | public MultipleThreadResetEvent(int total) 17 | { 18 | this._total = total; 19 | _current = total; 20 | _done = new ManualResetEvent(false); 21 | 22 | } 23 | /// 24 | /// 唤醒一个等待的线程 25 | /// 26 | public void SetOne() 27 | { 28 | // Interlocked 原子操作类 ,此处将计数器减1 29 | if (Interlocked.Decrement(ref _current) == 0) 30 | { 31 | //当所以等待线程执行完毕时,唤醒等待的线程 32 | _done.Set(); 33 | } 34 | } 35 | 36 | /// 37 | /// 等待所以线程执行完毕 38 | /// 39 | public void WaitAll() 40 | { 41 | _done.WaitOne(); 42 | } 43 | 44 | /// 45 | /// 释放对象占用的空间 46 | /// 47 | public void Dispose() 48 | { 49 | ((IDisposable)_done).Dispose(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/OsmMapType.cs: -------------------------------------------------------------------------------- 1 | namespace BrutileArcGIS.Lib 2 | { 3 | public enum OsmMapType 4 | { 5 | Default = 0 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/Projector.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.Geometry; 2 | 3 | namespace BrutileArcGIS.Lib 4 | { 5 | public class Projector 6 | { 7 | public static IEnvelope ProjectEnvelope(IEnvelope envelope, string srs) 8 | { 9 | var spatialReferences = new SpatialReferences(); 10 | var dataSpatialReference = spatialReferences.GetSpatialReference(srs); 11 | envelope.Project(dataSpatialReference); 12 | return envelope; 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/Requester.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Text; 3 | using System.Xml; 4 | 5 | namespace BrutileArcGIS.lib 6 | { 7 | public class Requester 8 | { 9 | public static XmlDocument GetXmlDocument(string url) 10 | { 11 | var client = new WebClient(); 12 | client.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"); 13 | 14 | var proxy = WebRequest.GetSystemWebProxy(); 15 | proxy.Credentials = CredentialCache.DefaultCredentials; 16 | client.Proxy = proxy; 17 | 18 | var theBytes = client.DownloadData(url); 19 | var test = Encoding.UTF8.GetString(theBytes); 20 | client.Dispose(); 21 | var doc = new XmlDocument(); 22 | doc.LoadXml(test); 23 | return doc; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/SimpleFileFetcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Amib.Threading; 5 | using BruTile; 6 | using BruTile.Cache; 7 | 8 | namespace BrutileArcGIS.lib 9 | { 10 | public class SimpleFileFetcher 11 | { 12 | private readonly ITileSource _tileSource; 13 | private readonly FileCache _fileCache; 14 | private const bool async = false; 15 | 16 | public SimpleFileFetcher(ITileSource tileSource, FileCache filecache) 17 | { 18 | if (tileSource == null) throw new ArgumentNullException("tileSource"); 19 | if (filecache == null) throw new ArgumentNullException("filecache"); 20 | _tileSource = tileSource; 21 | _fileCache = filecache; 22 | } 23 | 24 | public void Fetch(Extent newExtent, double newResolution) 25 | { 26 | var levelId = Utilities.GetNearestLevel(_tileSource.Schema.Resolutions, newResolution); 27 | var tilesWanted = GetTilesWanted(_tileSource.Schema, newExtent, levelId); 28 | var tilesMissing = GetTilesMissing(tilesWanted, _fileCache); 29 | var stp = new SmartThreadPool(1000, 5); 30 | 31 | foreach (var info in tilesMissing) 32 | { 33 | // for debugging 34 | if(!async) 35 | Fetch(info); 36 | else 37 | { 38 | stp.QueueWorkItem(GetTileOnThread, new object[] { info }); 39 | } 40 | } 41 | } 42 | 43 | private void GetTileOnThread(object parameter) 44 | { 45 | 46 | var @params = (object[])parameter; 47 | var tileInfo = (TileInfo)@params[0]; 48 | 49 | Fetch(tileInfo); 50 | } 51 | 52 | 53 | private void Fetch(TileInfo tileInfo) 54 | { 55 | try 56 | { 57 | var data = _tileSource.Provider.GetTile(tileInfo); 58 | _fileCache.Add(tileInfo.Index, data); 59 | 60 | _fileCache.AddWorldFile(tileInfo, _tileSource.Schema.GetTileHeight("0"), _tileSource.Schema.GetTileHeight("0"), 61 | _tileSource.Schema.Format); 62 | } 63 | catch (Exception) 64 | { 65 | } 66 | } 67 | 68 | 69 | public IList GetTilesWanted(ITileSchema schema, Extent extent, string levelId) 70 | { 71 | return schema.GetTilesInView(extent, (levelId)).ToList(); 72 | } 73 | 74 | public IList GetTilesMissing(IEnumerable tilesWanted, FileCache fileCache) 75 | { 76 | return tilesWanted.Where( 77 | info => fileCache.Find(info.Index) == null).ToList(); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/SmartThreadPool.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/lib/SmartThreadPool.dll -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/SpatialReferences.cs: -------------------------------------------------------------------------------- 1 | using ESRI.ArcGIS.Geometry; 2 | 3 | namespace BrutileArcGIS.Lib 4 | { 5 | public class SpatialReferences 6 | { 7 | public ISpatialReference GetSpatialReference(string epsgCode) 8 | { 9 | ISpatialReference res=null; 10 | 11 | // first get the code 12 | var start=epsgCode.IndexOf(":", System.StringComparison.Ordinal)+1; 13 | var end = epsgCode.Length; 14 | 15 | int code = int.Parse(epsgCode.Substring(start, end-start)); 16 | 17 | // Handle non official EPSG codes... 18 | if (code == 900913 | code==41001 ) code = 102113; 19 | 20 | if(IsProjectedSpatialReference(code)) 21 | { 22 | res = GetProjectedSpatialReference(code); 23 | } 24 | else if(IsGeographicSpatialReference(code)) 25 | { 26 | res = GetGeographicSpatialReference(code); 27 | } 28 | 29 | return res; 30 | } 31 | 32 | 33 | private static bool IsGeographicSpatialReference(int gcsType) 34 | { 35 | try 36 | { 37 | var pSrf = new SpatialReferenceEnvironmentClass(); 38 | var geographicCoordinateSystem = pSrf.CreateGeographicCoordinateSystem(gcsType); 39 | // ReSharper disable once UnusedVariable 40 | var spatialReference = (ISpatialReference)geographicCoordinateSystem; 41 | return true; 42 | } 43 | catch 44 | { 45 | return false; 46 | } 47 | } 48 | 49 | 50 | private static bool IsProjectedSpatialReference(int pcsType) 51 | { 52 | try 53 | { 54 | var pSrf = new SpatialReferenceEnvironmentClass(); 55 | var mProjectedCoordinateSystem = pSrf.CreateProjectedCoordinateSystem(pcsType); 56 | // ReSharper disable once UnusedVariable 57 | var spatialReference = (ISpatialReference)mProjectedCoordinateSystem; 58 | return true; 59 | } 60 | catch 61 | { 62 | return false; 63 | } 64 | } 65 | 66 | 67 | protected ISpatialReference GetGeographicSpatialReference(int gcsType) 68 | { 69 | var pSrf = new SpatialReferenceEnvironmentClass(); 70 | var geographicCoordinateSystem = pSrf.CreateGeographicCoordinateSystem(gcsType); 71 | var spatialReference = (ISpatialReference)geographicCoordinateSystem; 72 | return spatialReference; 73 | } 74 | 75 | 76 | protected ISpatialReference GetProjectedSpatialReference(int pcsType) 77 | { 78 | var pSrf = new SpatialReferenceEnvironmentClass(); 79 | var projectedCoordinateSystem = pSrf.CreateProjectedCoordinateSystem(pcsType); 80 | var spatialReference = (ISpatialReference)projectedCoordinateSystem; 81 | return spatialReference; 82 | } 83 | 84 | public static string GetWebMercator() 85 | { 86 | return "PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_1SP"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["latitude_of_origin",0.0],UNIT["Meter",1.0]]"; 87 | } 88 | 89 | public static string GetWGS84() 90 | { 91 | return "GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]"; 92 | } 93 | 94 | public static string GetRDNew() 95 | { 96 | return "PROJCS["RD_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",155000.0],PARAMETER["False_Northing",463000.0],PARAMETER["Central_Meridian",5.38763888888889],PARAMETER["Scale_Factor",0.9999079],PARAMETER["Latitude_Of_Origin",52.15616055555555],UNIT["Meter",1.0]]"; 97 | } 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/SqlServer/Microsoft.ExceptionMessageBox.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/app/lib/SqlServer/Microsoft.ExceptionMessageBox.dll -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/Tile.cs: -------------------------------------------------------------------------------- 1 | using BruTile; 2 | 3 | namespace BrutileArcGIS.lib 4 | { 5 | public class Tile 6 | { 7 | public TileInfo Info { get; set; } 8 | public T Image { get; set; } 9 | public long StartAnimation { get; set; } 10 | public byte[] Data { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/TileMap.cs: -------------------------------------------------------------------------------- 1 | namespace BrutileArcGIS.Lib 2 | { 3 | public class TileMap 4 | { 5 | public TileMap() 6 | { 7 | OverwriteUrls = true; 8 | } 9 | 10 | public string Href { get; set; } 11 | public string Srs { get; set; } 12 | public string Title { get; set; } 13 | public string Profile { get; set; } 14 | public string Type { get; set; } 15 | public bool OverwriteUrls { get; set; } 16 | 17 | static public int Compare(TileMap a, TileMap b) 18 | { 19 | return(System.String.Compare(a.Title, b.Title, System.StringComparison.Ordinal)); 20 | } 21 | } 22 | 23 | public class TileMapService 24 | { 25 | public string Title { get; set; } 26 | public string Version { get; set; } 27 | public string Href { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/TmsTileMapServiceParser.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Xml; 3 | using BrutileArcGIS.lib; 4 | 5 | namespace BrutileArcGIS.Lib 6 | { 7 | public class TmsTileMapServiceParser 8 | { 9 | public static List GetTileMaps(string url) 10 | { 11 | var doc = Requester.GetXmlDocument(url); 12 | var nodes=doc.GetElementsByTagName("TileMap"); 13 | 14 | var tilemaps=new List(); 15 | foreach (XmlNode node in nodes) 16 | { 17 | var tileMap=new TileMap(); 18 | if (node.Attributes != null) 19 | { 20 | tileMap.Href = node.Attributes["href"].Value; 21 | tileMap.Srs = node.Attributes["srs"].Value; 22 | tileMap.Profile = node.Attributes["profile"].Value; 23 | tileMap.Title= node.Attributes["title"].Value; 24 | tileMap.Title = node.Attributes["title"].Value; 25 | if (node.Attributes["type"] != null) 26 | { 27 | tileMap.Type = node.Attributes["type"].Value; 28 | } 29 | if (node.Attributes["overwriteurls"] != null) 30 | { 31 | tileMap.OverwriteUrls = bool.Parse(node.Attributes["overwriteurls"].Value); 32 | } 33 | } 34 | 35 | 36 | tilemaps.Add(tileMap); 37 | } 38 | 39 | return tilemaps; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/Transform.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace BrutileArcGIS.Lib 4 | { 5 | public class Transform 6 | { 7 | float _resolution; 8 | PointF _center; 9 | float _width; 10 | float _height; 11 | BruTile.Extent _extent; 12 | 13 | public Transform(PointF center, float resolution, float width, float height) 14 | { 15 | _center = center; 16 | _resolution = resolution; 17 | _width = width; 18 | _height = height; 19 | UpdateExtent(); 20 | } 21 | 22 | public float Resolution 23 | { 24 | set 25 | { 26 | _resolution = value; 27 | UpdateExtent(); 28 | } 29 | get 30 | { 31 | return _resolution; 32 | } 33 | } 34 | 35 | public PointF Center 36 | { 37 | set 38 | { 39 | _center = value; 40 | UpdateExtent(); 41 | } 42 | } 43 | 44 | public float Width 45 | { 46 | set 47 | { 48 | _width = value; 49 | UpdateExtent(); 50 | } 51 | } 52 | 53 | public float Height 54 | { 55 | set 56 | { 57 | _height = value; 58 | UpdateExtent(); 59 | } 60 | } 61 | 62 | public BruTile.Extent Extent 63 | { 64 | get { return _extent; } 65 | } 66 | 67 | public PointF WorldToMap(double x, double y) 68 | { 69 | return new PointF((float)(x - _extent.MinX) / _resolution, (float)(_extent.MaxY - y) / _resolution); 70 | } 71 | 72 | public PointF MapToWorld(double x, double y) 73 | { 74 | return new PointF((float)(_extent.MinX + x) * _resolution, (float)(_extent.MaxY - y) * _resolution); 75 | } 76 | 77 | public RectangleF WorldToMap(double x1, double y1, double x2, double y2) 78 | { 79 | var point1 = WorldToMap(x1, y1); 80 | var point2 = WorldToMap(x2, y2); 81 | return new RectangleF(point1.X, point2.Y, point2.X - point1.X, point1.Y - point2.Y); 82 | } 83 | 84 | private void UpdateExtent() 85 | { 86 | var spanX = _width * _resolution; 87 | var spanY = _height * _resolution; 88 | _extent = new BruTile.Extent(_center.X - spanX * 0.5f, _center.Y - spanY * 0.5f, 89 | _center.X + spanX * 0.5f, _center.Y + spanY * 0.5f); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /PcArcBruTile/app/lib/WorldFileWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.IO; 4 | using BruTile; 5 | 6 | namespace BrutileArcGIS.lib 7 | { 8 | public class WorldFileWriter 9 | { 10 | public static string GetWorldFile(string format) 11 | { 12 | var res = String.Empty; 13 | 14 | format = (format.Contains(@"image/") ? format.Substring(6, format.Length - 6) : format); 15 | 16 | if (format == "jpg") 17 | { 18 | res = "jgw"; 19 | } 20 | if (format == "jpeg") 21 | { 22 | res = "jgw"; 23 | } 24 | else if (format == "png") 25 | { 26 | res = "pgw"; 27 | } 28 | else if (format == "png8") 29 | { 30 | res = "pgw"; 31 | } 32 | 33 | else if (format == "tif") 34 | { 35 | res = "tfw"; 36 | } 37 | 38 | return res; 39 | 40 | } 41 | 42 | 43 | public static void WriteWorldFile(string f, Extent extent, ITileSchema schema) 44 | { 45 | using (var sw = new StreamWriter(f)) 46 | { 47 | var resX = (extent.MaxX - extent.MinX) / schema.GetTileWidth("0"); 48 | var resY = (extent.MaxY - extent.MinY) / schema.GetTileHeight("0"); 49 | sw.WriteLine(resX.ToString(CultureInfo.InvariantCulture)); 50 | sw.WriteLine("0"); 51 | sw.WriteLine("0"); 52 | sw.WriteLine((resY * -1).ToString(CultureInfo.InvariantCulture)); 53 | sw.WriteLine(extent.MinX.ToString(CultureInfo.InvariantCulture)); 54 | sw.WriteLine(extent.MaxY.ToString(CultureInfo.InvariantCulture)); 55 | sw.Close(); 56 | } 57 | } 58 | 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /PcArcBruTile/app/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PcArcBruTile/app/services/arcbrutile_sample_services.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /PcArcBruTile/packages/SmartThreadPool.dll.2.2.3/SmartThreadPool.dll.2.2.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/SmartThreadPool.dll.2.2.3/SmartThreadPool.dll.2.2.3.nupkg -------------------------------------------------------------------------------- /PcArcBruTile/packages/SmartThreadPool.dll.2.2.3/lib/SmartThreadPool.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/SmartThreadPool.dll.2.2.3/lib/SmartThreadPool.dll -------------------------------------------------------------------------------- /PcArcBruTile/packages/log4net.1.2.10/lib/1.0/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/log4net.1.2.10/lib/1.0/log4net.dll -------------------------------------------------------------------------------- /PcArcBruTile/packages/log4net.1.2.10/lib/1.1/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/log4net.1.2.10/lib/1.1/log4net.dll -------------------------------------------------------------------------------- /PcArcBruTile/packages/log4net.1.2.10/lib/2.0/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/log4net.1.2.10/lib/2.0/log4net.dll -------------------------------------------------------------------------------- /PcArcBruTile/packages/log4net.1.2.10/log4net.1.2.10.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/PcArcBruTile/packages/log4net.1.2.10/log4net.1.2.10.nupkg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PcArcBruTile 0.4.1 2 | 3 | # 注意!:此项目停止维护,如有需要请移至ArcBruTile官网 4 | 在ArcGIS中快速加载中国的网络地图(暂时不支持10.3的版本,10.3.1可以使用) 5 | 经过多天的测试,终于推出了PcArcBruTile 0.4.1版本,赶紧卸载原来的插件,安装新的吧!([336的小伙伴看这里~](#336特别版)) Thanks @hyx @tm 6 | 7 | 1. 修复谷歌地图加载Bug(谷歌服务时好时坏,遇到不能加载的情况就忍忍吧~) 8 | 2. 采用多线程和内存缓存较大地优化了地图的加载 9 | 10 | 本程序只是在[ArcBruTile](https://arcbrutile.codeplex.com/)上做了稍微修改,使其能够加载中国的网络地图。我们不生成代码,我们只是代码的搬运工... 11 |

安装包地址:https://github.com/xiaoqqchen/PcArcBruTile/blob/master/Soft/ArcBruTileSetup.msi?raw=true

12 | 具体使用方法参考[我的博客](http://www.cnblogs.com/pengchen/p/4771288.html) 13 | 14 | ##使用步骤 15 | 1.下载安装包,双击直接安装,安装成功后显示“Registration succeeded”表示注册成功。 16 | 17 | 18 | 19 | 2.打开ArcMap,右键,勾选ChinaMap工具条 20 | 21 | 22 | 23 | 3.在ArcMap中显示工具条,点击菜单就可以在ArcMap中显示网络地图了。 24 | 25 | 26 | 27 | 4.OSM 和 谷歌地图最好使用VPN加速。 28 | ##示例图片 29 |

30 | 31 | ##336特别版 32 | 作为336的一员,肯定要为实验室单独开发一个版本。[下载地址](https://github.com/xiaoqqchen/PcArcBruTile/raw/master/Soft/ArcBruTileSetup_336.msi) 33 | 34 | 特别之处是我利用了实验室的面包机来共享和缓存切片... 35 | ######把homes这个文件夹设置为y盘,其他都一样。 36 | ![图片](Soft/截图.jpg) 37 | 38 | 39 | -------------------------------------------------------------------------------- /README2.md: -------------------------------------------------------------------------------- 1 | # PcArcBruTile 2 | 在ArcGIS中快速加载网络地图 3 | 4 | 此项目停止维护,如有需要请移至[ArcBruTile官网](https://arcbrutile.codeplex.com/) 5 | -------------------------------------------------------------------------------- /Soft/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/1.png -------------------------------------------------------------------------------- /Soft/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/2.png -------------------------------------------------------------------------------- /Soft/ArcBruTileSetup.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/ArcBruTileSetup.msi -------------------------------------------------------------------------------- /Soft/ArcBruTileSetup_336.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/ArcBruTileSetup_336.msi -------------------------------------------------------------------------------- /Soft/setup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/setup.exe -------------------------------------------------------------------------------- /Soft/截图.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoqqchen/PcArcBruTile/53ffaf1d35242b06008f7d0a54fcd7a6af445302/Soft/截图.jpg --------------------------------------------------------------------------------