====== ThinkGeo Cloud .NET SDK Quick Start Guide ======
The ThinkGeo Cloud .NET SDK Quickstart Guide will guide you through the process of creating a sample application and will help you become familiar with ThinkGeo Cloud .NET SDK.
The purpose of this guide is to help you quickly get started building your own spatially aware applications with ThinkGeo Cloud. Like any new software, there is some learning to be done along the way. How do we start to learn how to take advantage of the power of ThinkGeo Cloud? The best way is to make a sample application with it. \\ ===== Download the Sample ===== {{https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWpf|Download Sample Code From GitHub}} \\ \\ ===== Setting up the Environment ===== Let's start with a new WPF project in Microsoft Visual Studio (2015 or newer) and call it QuickstartSample (see Figure 1). We can create the project with .NET Framework 4.0 or 4.5. {{mapsuite10:wpf:Map_Suite_Wpf_QSG_NewProject.png}} \\ //Figure 1. Creating a new project in the Visual Studio IDE.// \\ \\ The project QuickstartSample is created in a new solution called QuickstartSample. The wizard creates a single WPF Application. Next we need to install MapSuiteDesktopForWpf-Standard from nugget package server (see Figure 2-5). {{mapsuite10:wpf:Map_Suite_Wpf_QSG_NuGetManager.png}} \\ //Figure 2. Refer to Manage NuGet Packages.// {{mapsuite10:wpf:Map_Suite_Wpf_QSG_InstallWpfPackage.png}} \\ //Figure 3. Refer to MapSuiteDesktopForWpf - Standard.// Now the package is installing into the project. Click “OK” if the message box like Figure 4 pops up. \\ {{mapsuite10:wpf:Map_Suite_Wpf_QSG_ReferenceRreview.png}} \\ //Figure 4. Review package references.// \\ \\ The “NetTopologySuite” is the third part assembly, so the license acceptance is required. You can click “I Accept” to agree the license.(See Figure 5) \\ {{mapsuite10:wpf:Map_Suite_Wpf_QSG_PackageLicenseAcceptance.png}} \\ //Figure 5. NuGet installation success.// ===== Adding the Map Control ===== Open ".../QuickstartSample/packages/MapSuiteDesktopForWpf-Standard.10.0.0/designtime" package folder and drag "ThinkGeo.MapSuite.Wpf.dll" assembly to the Toolbox of Visual Studio. {{mapsuite10:Wpf:Map_Suite_Wpf_QSG_ControlDesigntime.png}} Draw the Map control on the MainWindow by clicking on the WpfMap Control object in the Toolbox and then dragging(using the left mouse button) it to the MainWindow. You can resize the map if you desire. You can leave the name of the Map control as Map1. Our map will display in this object. {{mapsuite10:Wpf:Map_Suite_Wpf_QSG_AddMapControl.png}} The second way. You can open your .xaml file and add reference code to refer Wpf map to your application (See Figure 6) {{mapsuite10:Wpf:Map_Suite_Wpf_QSG_MapXmlCode.png}} \\ //Figure 6. Add Map Control to your application.// If you have not set up a developer license, ​the Map Suite Product Center will pop up when you debug the app. You need to generate your developer license. For more details, please refer to http://wiki.thinkgeo.com/wiki/map_suite_developer_license_guide. \\ Once the developer license is ready, run the application. Your map should look like the one below: (see Figure 7). {{mapsuite10:wpf:Map_Suite_Wpf_QSG_MapRender.png}} //Figure 7. The normal map is rendered after the developer license file has been got.// Now you can see the ThinkGeo.Cloud.Client had been installed also. Copy the code as below and paste it into Map_Loaded function, it can works. map.MapUnit = GeographyUnit.Meter; map.ZoomLevelSet = ThinkGeoCloudMapsOverlay.GetZoomLevelSet(); thinkGeoCloudMapsOverlay = new ThinkGeoCloudMapsOverlay(); //thinkGeoCloudMapsOverlay = new ThinkGeoCloudMapsOverlay(clientId, clientSecret); // Tiles will be cached in the TEMP folder (%USERPROFILE%\AppData\Local\Temp\MapSuite\PersistentCaches) by default if the TileCache property is not set. //thinkGeoCloudMapsOverlay.TileCache = new XyzFileBitmapTileCache("ThinkGeoCloudMapsTileCache"); map.Overlays.Add(thinkGeoCloudMapsOverlay); map.CurrentExtent = new ThinkGeo.MapSuite.Shapes.RectangleShape(-13086298.60, 7339062.72, -8111177.75, 2853137.62); map.Refresh();