====== ThinkGeo Quick Start Guide For Blazor ======
dotnet new blazorserver -o QuickStart
- Open the //QuickStart// folder in Visual Studio Code.
- For a Blazor Server project, the Visual Studio Code requests that you add assets to build and debug the project. Select **Yes**.
Now, you have successfully created a server-side Blazor boilerplate project. Next, we'll be adding the ThinkGeo UI map control to the web page. If you have encountered any issues getting to this point, please refer to the Microsoft documentation on [[https://docs.microsoft.com/en-us/aspnet/core/blazor/get-started?view=aspnetcore-3.0&tabs=visual-studio-code|getting started with ASP.NET Core Blazor]].
===== Installing ThinkGeo UI Web for Blazor NuGet packages =====
To build this sample, you need to reference the "ThinkGeo.UI.Blazor" package from NuGet Package Manager. NuGet brings us a flexible way and pleasant experience to manage our references.
- Open NuGet Package Manager
- Install the "ThinkGeo.UI.Blazor" package by typing "ThinkGeo.UI.Blazor".
===== Add the Map Component =====
Now, we have all the references set. let's start by writing code step by step to display a world map.
==== Display a world map ====
- Open ~/Imports.razor and add 2 using directives to reference the Map components.
@using ThinkGeo.Core
@using ThinkGeo.UI.Blazor
- Open the ~/Pages/_Host.cshtml and add the stylesheet and javascript references of ThinkGeo Web For Blazor from CDN:
...
...
- Open ~/Pages/Index.razor file and add a ThinkGeo.UI.Blazor.Map component as following:
@page "/"
It requires an APIKey of ThinkGeo Cloud, and you can get the API Key from the registration email. If you don't have an account of ThinkGeo Cloud yet, please refer to [[thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys]] to get your ThinkGeo Cloud account.
Run the app by pressing F5. If you have not set up a developer license, the Map Suite Product Center will pop up. You will need to activate your developer license, either by starting a free evaluation of ThinkGeo UI Web for Blazor, or by purchasing the full edition of the product. For more details, please refer to our [[map_suite_developer_license_guide|developer license guide]].
Once your developer license is ready, run the application. Your map should look like the one below:
{{thinkgeo12:screenshots:blazor:quickstartguide:blazor_quick_start_sample.jpg}}
===== Summary =====
You now know the basics of using ThinkGeo Web for Blazor and are able to start adding this functionality into your own applications. Let's recap what we have learned about the object relationships and how the pieces of ThinkGeo work together:
-It is of the utmost importance that the unit of measurement (feet, meters, decimal degrees, etc.) be set properly for the map, based on the requirements of your data.
-A Map is the basic class that contains all of the other objects that are used to define how the map will be rendered.