diff --git a/Gettingstarted.png b/Gettingstarted.png new file mode 100644 index 0000000..3f3bc10 Binary files /dev/null and b/Gettingstarted.png differ diff --git a/MapsGettingStarted/.vs/MapsGettingStarted/project-colors.json b/MapsGettingStarted/.vs/MapsGettingStarted/project-colors.json deleted file mode 100644 index 0a79aea..0000000 --- a/MapsGettingStarted/.vs/MapsGettingStarted/project-colors.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Version": 1, - "ProjectMap": { - "32ccc00e-1712-4bb3-9b4c-70cb72eb034a": { - "ProjectGuid": "32ccc00e-1712-4bb3-9b4c-70cb72eb034a", - "DisplayName": "MapsGettingStarted", - "ColorIndex": 0 - } - }, - "NextColorIndex": 1 -} \ No newline at end of file diff --git a/MapsGettingStarted/App.config b/MapsGettingStarted/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/MapsGettingStarted/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MapsGettingStarted/MapsGettingStarted.csproj b/MapsGettingStarted/MapsGettingStarted.csproj index 895c039..99a6b8d 100644 --- a/MapsGettingStarted/MapsGettingStarted.csproj +++ b/MapsGettingStarted/MapsGettingStarted.csproj @@ -1,100 +1,23 @@ - - - + + - Debug - AnyCPU - {32CCC00E-1712-4BB3-9B4C-70CB72EB034A} WinExe - MapsGettingStarted - MapsGettingStarted - v4.7.2 - 512 - true - true + net10.0-windows + enable + true + enable - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - packages\Syncfusion.Licensing.19.4.0.48\lib\net46\Syncfusion.Licensing.dll - - - packages\Syncfusion.Maps.Windows.19.4.0.48\lib\net46\Syncfusion.Maps.Windows.dll - - - packages\Syncfusion.Shared.Base.19.4.0.48\lib\net46\Syncfusion.Shared.Base.dll - - - packages\Syncfusion.Shared.Windows.19.4.0.48\lib\net46\Syncfusion.Shared.Windows.dll - - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - Always - - - Always - - - - - - - + + + + + + + + Always + + + Always + + \ No newline at end of file diff --git a/MapsGettingStarted/MapsGettingStarted.sln b/MapsGettingStarted/MapsGettingStarted.sln deleted file mode 100644 index e05e90f..0000000 --- a/MapsGettingStarted/MapsGettingStarted.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31919.166 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapsGettingStarted", "MapsGettingStarted.csproj", "{32CCC00E-1712-4BB3-9B4C-70CB72EB034A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {32CCC00E-1712-4BB3-9B4C-70CB72EB034A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32CCC00E-1712-4BB3-9B4C-70CB72EB034A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32CCC00E-1712-4BB3-9B4C-70CB72EB034A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32CCC00E-1712-4BB3-9B4C-70CB72EB034A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C3F4F89E-8258-4D41-889A-733E7BE97828} - EndGlobalSection -EndGlobal diff --git a/MapsGettingStarted/MapsGettingStarted.slnx b/MapsGettingStarted/MapsGettingStarted.slnx new file mode 100644 index 0000000..14807e6 --- /dev/null +++ b/MapsGettingStarted/MapsGettingStarted.slnx @@ -0,0 +1,3 @@ + + + diff --git a/MapsGettingStarted/Properties/AssemblyInfo.cs b/MapsGettingStarted/Properties/AssemblyInfo.cs deleted file mode 100644 index 1449a34..0000000 --- a/MapsGettingStarted/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MapsGettingStarted")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MapsGettingStarted")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("32ccc00e-1712-4bb3-9b4c-70cb72eb034a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MapsGettingStarted/Properties/Resources.Designer.cs b/MapsGettingStarted/Properties/Resources.Designer.cs deleted file mode 100644 index 384f35d..0000000 --- a/MapsGettingStarted/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MapsGettingStarted.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MapsGettingStarted.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/MapsGettingStarted/Properties/Resources.resx b/MapsGettingStarted/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/MapsGettingStarted/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MapsGettingStarted/Properties/Settings.Designer.cs b/MapsGettingStarted/Properties/Settings.Designer.cs deleted file mode 100644 index f128605..0000000 --- a/MapsGettingStarted/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MapsGettingStarted.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/MapsGettingStarted/Properties/Settings.settings b/MapsGettingStarted/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/MapsGettingStarted/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/MapsGettingStarted/packages.config b/MapsGettingStarted/packages.config deleted file mode 100644 index 88bc47c..0000000 --- a/MapsGettingStarted/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 9926c51..b4693da 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,96 @@ -# WinForms maps getting started +# Getting Started with Windows Forms Map -This repository contains sample to getting started with the [Syncfusion WinForms Maps](https://help.syncfusion.com/windowsforms/map/getting-started) control. WinForms Maps is a graphical representation of geographical data. This is used to represent the statistical data of a particular geographical area on the earth. Using pan and zoom features, maps can be navigated. +This sample demonstrates how to create and customize a Syncfusion® WinForms Maps control. -## Syncfusion controls +## Prerequisites -This project used the following Syncfusion control(s): -* [Maps](https://www.syncfusion.com/winforms-ui-controls/map) +- Visual Studio 2022 or later +- .NET Framework 4.7.2 or later +- Syncfusion `Syncfusion.Maps.Windows` NuGet package -## Requirements to run the sample +## Assembly Deployment -* [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) 2008 or higher. -* .NET 2.0 or higher. +To use the Maps control, add the following NuGet packages to your project: -Refer to the following link for more details: [System Requirements](https://help.syncfusion.com/windowsforms/system-requirements) +Open the **Package Manager Console** and run: -## How to run the sample +``` +Install-Package Syncfusion.Maps.Windows +Install-Package Syncfusion.Shared.Base +Install-Package Syncfusion.Shared.Windows +Install-Package Syncfusion.Licensing +``` -1. Clone the sample and open it in Visual Studio. +Or, add the references directly in your `.csproj` file: - *Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.* +```xml + + + + + + +``` -2. Register your license key in static void main method before calling Application.Run() method in C#, as demonstrated in the following code. +## Adding Maps to the Form - static void Main() - { - //Register Syncfusion license - Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - - Refer to this [link](https://help.syncfusion.com/windowsforms/licensing/overview) for more details. - -3. Clean and build the application. +### Step 1: Create a Windows Forms Application -4. Run the application. +Open Visual Studio, create a new **Windows Forms App** project targeting **.NET Framework 4.7.2** or higher. -## License +### Step 2: Add the Maps Control -Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. +In the `Form1.Designer.cs` (or code-behind), initialize and add the `Maps` control: + +```csharp +using Syncfusion.Windows.Forms.Maps; + +// Initialize the Maps control +this.mapsControl1 = new Syncfusion.Windows.Forms.Maps.Maps(); + +// Set properties +this.mapsControl1.Name = "mapsControl1"; +this.mapsControl1.Size = new System.Drawing.Size(880, 585); + +// Add to the form +this.Controls.Add(this.mapsControl1); +``` + +### Step 3: Add a Shape File Layer + +In the `Form1.cs` file, add a ShapeFileLayer to display map data: + +```csharp +using Syncfusion.Windows.Forms.Maps; +using System; +using System.Windows.Forms; + +public partial class Form1 : Form +{ + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + ShapeFileLayer shapeLayer = new ShapeFileLayer(); + shapeLayer.Uri = "world1.shp"; + this.mapsControl1.Layers.Add(shapeLayer); + } +} +``` + +## Running the Sample + +1. Clone or download this repository. +2. Open `MapsGettingStarted.sln` in Visual Studio. +3. Restore NuGet packages. +4. Build and run the project (`F5`). + +![Windows Forms Maps Sample](Gettingstarted.png) + +## References + +- [Syncfusion WinForms Maps Documentation](https://help.syncfusion.com/windowsforms/map/getting-started) +- [Syncfusion WinForms Maps API Reference](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Maps.html) \ No newline at end of file