### Sample HTTP GET Request Source: https://docs.thinkgeo.com/products/cloud-maps/services/colors An example of a GET request to the color scheme API, requesting 5 analogous colors with the API key 'mykey'. ```http https://cloud.thinkgeo.com/api/v1/color/scheme/analogous/random/5?apiKey=mykey ``` -------------------------------- ### Install .NET SDK via NuGet Source: https://docs.thinkgeo.com/products/cloud-maps/services/time-zones Command to install the ThinkGeo Cloud Client NuGet package using the Package Manager console. ```PowerShell Install-Package ThinkGeo.Cloud.Client -Version VERSION_TO_BE_INSTALLED ``` -------------------------------- ### Install ThinkGeo.UI.Blazor via NuGet Source: https://docs.thinkgeo.com/products/web-maps/quickstart Command to install the ThinkGeo UI package using the .NET CLI. ```powershell Install-Package ThinkGeo.UI.Blazor ``` -------------------------------- ### Install ThinkGeo.UI.WebApi NuGet Package Source: https://docs.thinkgeo.com/products/web-maps/quickstart Install the ThinkGeo.UI.WebApi NuGet package using the dotnet CLI. This is required for your ASP.NET Core Web API project. ```bash Install-Package ThinkGeo.UI.WebApi ``` -------------------------------- ### Install World Streets Styles via NPM Source: https://docs.thinkgeo.com/products/mapping-data/style-json-guide Install the styles package using the npm package manager. ```bash npm i worldstreets-styles ``` -------------------------------- ### Example Raster Tile Request URL Source: https://docs.thinkgeo.com/products/cloud-maps/services/raster-map-tiles An example of a complete URL to fetch a raster tile. A valid API key is necessary to remove the default ThinkGeo logo watermark. ```URL https://cloud.thinkgeo.com/api/v1/maps/raster/light/x1/3857/512/0/0/0.png ``` -------------------------------- ### Correctly Apply Styles with ApplyUntilZoomLevel Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/zoom-level-set-guide Ensure styles are visible at multiple zoom levels by pairing style assignments with ApplyUntilZoomLevel. The WRONG example only shows the style at one specific scale, while the CORRECT example makes it visible at all scales up to Level20. ```csharp // WRONG — only visible at one specific scale layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimpleCircleStyle(GeoColors.Red, 8); // CORRECT — visible at all scales layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimpleCircleStyle(GeoColors.Red, 8); layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ``` -------------------------------- ### NavigationProxy Property Source: https://docs.thinkgeo.com/products/mobile-maps/ThinkGeo.UI.Maui/ThinkGeo.UI.Maui.ZoomMapTool Gets the navigation proxy instance. ```csharp public NavigationProxy NavigationProxy { get; } ``` -------------------------------- ### Basic InMemoryFeatureLayer Setup and Styling Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/in-memory-feature-layer-guide Demonstrates the construction of an InMemoryFeatureLayer, applying default styles for points, lines, and areas, and adding it to a SingleTile LayerOverlay. Ensure to use TileType.SingleTile for dynamic layers. ```csharp var featureLayer = new InMemoryFeatureLayer(); // Style for points, lines, and areas — all visible at every zoom level featureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimpleCircleStyle(GeoColors.Blue, 8, GeoColors.Black); featureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyle.CreateSimpleLineStyle(GeoColors.Blue, 4, true); featureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColors.Blue, GeoColors.Black); featureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; // Add to a SingleTile LayerOverlay and register it with the map var layerOverlay = new LayerOverlay(); layerOverlay.Layers.Add("featureLayer", featureLayer); MapView.Overlays.Add("layerOverlay", layerOverlay); ``` -------------------------------- ### GET /api/v1/route/optimization/{coordinates} Source: https://docs.thinkgeo.com/products/cloud-maps/services/routing Find the shortest route through a series of destinations, optionally returning to the starting point. ```APIDOC ## GET /api/v1/route/optimization/{coordinates} ### Description Find the shortest route through a series of destinations, optionally returning to the starting point. ### Method GET ### Endpoint https://cloud.thinkgeo.com/api/v1/route/optimization/{coordinates} ### Parameters #### Path Parameters - **coordinates** (string) - Required - A semicolon-separated list of {y},{x} coordinate pairs to visit along the route. You can specify between 2 and 25 coordinates. #### Query Parameters - **srid** (integer) - Optional - The SRID of the input and output feature's coordinate system. Defaults to 4326. - **proj4String** (string) - Optional - The Proj string of the input and output feature's coordinate system. - **roundtrip** (boolean) - Optional - Indicates whether the returned route is round-trip, meaning the route returns to the starting location (true) or not (false). Defaults to true. - **source** (string) - Optional - Identifies which coordinate should be used as the start point of the route. Acceptable values are 'first' or 'any'. Defaults to 'first'. - **destination** (string) - Optional - Identifies which coordinate should be used as the final destination of the route. Acceptable values are 'any' or 'last'. Defaults to 'any'. - **turnByTurn** (boolean) - Optional - Specifies whether to return turn-by-turn directions with your route. Defaults to false. - **coordinateSnapRadius** (number) - Optional - The maximum distance a coordinate can be snapped to the road network. Defaults to 5000. - **coordinateSnapRadiusUnit** (string) - Optional - The unit of the radius to snap the input coordinate to road network. Defaults to meters. - **distanceUnit** (string) - Optional - The unit of measure in which to express the length of the route. Defaults to meters. - **durationUnit** (string) - Optional - The unit of the time in which to express the duration of traveling the route. Defaults to minutes. ``` -------------------------------- ### Time Zone API Response Example Source: https://docs.thinkgeo.com/products/cloud-maps/services/time-zones A sample JSON response returned by the Get Time Zone for Point endpoint. ```JSON { "timezone": "Asia/Bangkok", "countryName": "Thailand", "countryCode": "TH", "comment": "", "currentLocalTime": "2019-03-31T23:16:26.1379980", "currentUtcTime": "2019-03-31T16:16:26.1379980Z", "offsetSeconds": 25200 } ``` -------------------------------- ### Sample Color Scheme Generation Request Source: https://docs.thinkgeo.com/products/cloud-maps/services/colors Example of how to request an analogous color scheme with 5 colors, using 'mykey' as the API key. ```http https://cloud.thinkgeo.com/api/v1/color/scheme/analogous/FF00FF/5?apiKey=mykey ``` -------------------------------- ### Configure MapView and Add Cloud Base Map Overlay Source: https://docs.thinkgeo.com/products/mobile-maps/quickstart Initialize the MapView, set its unit of measurement, add a ThinkGeo Cloud Maps background overlay with tile caching, configure rotation and map tools, and set the initial map extent and scale. This code runs once when the map is ready. ```csharp private bool _initialized; private async void MapView_OnSizeChanged(object sender, EventArgs e) { if (_initialized) return; _initialized = true; // Set the map's unit of measurement to meters(Spherical Mercator) MapView.MapUnit = GeographyUnit.Meter; // Add ThinkGeo Cloud Maps as the background var backgroundOverlay = new ThinkGeoVectorOverlay { ClientId = "9ap16imkD_V7fsvDW9I8r8ULxgAB50BX_BnafMEBcKg~", ClientSecret = "vtVao9zAcOj00UlGcK7U-efLANfeJKzlPuDB9nw7Bp4K4UxU_PdRDg~~", MapType = ThinkGeoCloudVectorMapsMapType.Light, TileCache = new FileRasterTileCache(FileSystem.Current.CacheDirectory, "ThinkGeoVectorLight_RasterCache") }; MapView.Overlays.Add(backgroundOverlay); // set up the map rotation and map tools MapView.IsRotationEnabled = true; MapView.MapTools.Add(new ZoomMapTool()); // set up the map extent and refresh MapView.CenterPoint = new PointShape(450061, 1074668); MapView.MapScale = 74000000; await MapView.RefreshAsync(); } ``` -------------------------------- ### Define Contiguous Scale Bands Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/zoom-level-set-guide Ensure scale bands tile contiguously to avoid gaps where layers become invisible. Each band should end where the next begins, for example, Band 1 ending at Level13 and Band 2 starting at Level14. ```csharp // Band 1: levels 12-13 layer.ZoomLevelSet.ZoomLevel12.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level13; // Band 2: levels 14-15 (starts immediately where band 1 ends) layer.ZoomLevelSet.ZoomLevel14.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level15; // Band 3: levels 16-20 (starts immediately where band 2 ends) layer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ``` -------------------------------- ### Create Semi-Transparent and Two-Pen Line Styles Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/line-style-guide Demonstrates creating LineStyles with semi-transparent GeoPens and multi-pen configurations using GeoColor.FromArgb. ```csharp // Semi-transparent orange stroke — used in ValueStyle output layers new LineStyle(new GeoPen(GeoColor.FromArgb(180, 255, 155, 13), 5)) ``` ```csharp // Two-pen with ARGB colors new LineStyle( new GeoPen(GeoColor.FromArgb(200, 146, 203, 252), 5f), new GeoPen(GeoColors.Black, 6f)) ``` -------------------------------- ### Initialize tg.ColorClient Source: https://docs.thinkgeo.com/products/cloud-maps/JavaScript%20API/ColorClient Instantiate the color client using a valid ThinkGeo Cloud API key. ```javascript var colorClient = new tg.ColorClient('Your-Cloud-Service-Api-Key'); ``` -------------------------------- ### Get Custom Zoom Levels Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale This property gets the custom zoom levels from the zoomLevelSet. It returns a collection of ZoomLevel objects. ```csharp public Collection CustomZoomLevels { get; } ``` -------------------------------- ### Initialize Map and Feature Layer Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/Desktop-Classes/desktop-edit-overlay-guide Sets up the map unit and configures an InMemoryFeatureLayer with default styles for points, lines, and areas. ```csharp // ---- Setup (WPF: MapView_Loaded / WinForms: Form_Load) ---- MapView.MapUnit = GeographyUnit.Meter; var featureLayer = new InMemoryFeatureLayer(); featureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimpleCircleStyle(GeoColors.Blue, 8, GeoColors.Black); featureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyle.CreateSimpleLineStyle(GeoColors.Blue, 4, true); featureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColors.Blue, GeoColors.Black); featureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; var layerOverlay = new LayerOverlay(); layerOverlay.Layers.Add("featureLayer", featureLayer); MapView.Overlays.Add("layerOverlay", layerOverlay); ``` -------------------------------- ### Get Overlay Canvas (Obsolete) Source: https://docs.thinkgeo.com/products/desktop-maps/ThinkGeo.UI.WinForms%26Wpf/ThinkGeo.UI.Wpf.WmtsTiledOverlay Gets the canvas that hosts the overlay visuals. This property is obsolete; interact with the overlay itself instead. ```csharp public Canvas OverlayCanvas { get; } ``` -------------------------------- ### Open Method Source: https://docs.thinkgeo.com/products/mobile-maps/ThinkGeo.UI.Maui/ThinkGeo.UI.Maui.ZoomMapTool Opens the map tool and attaches it to the specified MapView. ```csharp public void Open(MapView mapView) ``` -------------------------------- ### Example Geocode Batch Request Body Source: https://docs.thinkgeo.com/products/cloud-maps/services/geocoding The JSON payload for the example batch geocode request, containing three distinct search items. ```json { "searchText": "200 Epcot Center Drive, Bay Lake, FL" }, { "searchText": "1313 South Harbor Blvd, Anaheim, CA" }, { "searchText": "Cedar Point" } ``` -------------------------------- ### Initialize ProjectionConverter with various coordinate systems Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/projection-converter-guide Demonstrates different constructor overloads using EPSG codes and Proj strings to define internal and external projections. ```csharp // Constructor 1: Two EPSG codes (most common) // internalEpsg = the projection the data is stored in (the shapefile, database, etc.) // externalEpsg = the projection the map is rendered in (typically 3857) var projectionConverter = new ProjectionConverter(2276, 3857); // Constructor 2: One EPSG + one Proj string // Use when the target projection is not in the EPSG registry var projectionConverter = new ProjectionConverter(4326, "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +datum=NAD83 +units=m +no_defs"); // Constructor 3: Two Proj strings // Use when both projections need full parameter control var projectionConverter = new ProjectionConverter( "+proj=longlat +datum=WGS84 +no_defs", "+proj=sterea +lat_0=52.15 +lon_0=5.38 +k=0.9999079 +x_0=155000 +y_0=463000 +datum=RD83 +units=m +no_defs"); ``` -------------------------------- ### Get Zoom Level 19 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 19. Access the configuration details for zoom level 19. ```csharp public ZoomLevel ZoomLevel19 { get; } ``` -------------------------------- ### Configure MapView and Background Overlay Source: https://docs.thinkgeo.com/products/desktop-maps/quickstart-winforms Implement the Form_Load event to set the map unit, add a cloud vector overlay with tile caching, and refresh the map. ```csharp private async void Form_Load(object? sender, EventArgs e) { // Set the map's unit of measurement to meters(Spherical Mercator) mapView.MapUnit = GeographyUnit.Meter; // Add Cloud Maps as a background overlay var thinkGeoCloudVectorMapsOverlay = new ThinkGeoCloudVectorMapsOverlay { ClientId = "AOf22-EmFgIEeK4qkdx5HhwbkBjiRCmIDbIYuP8jWbc~", ClientSecret = "xK0pbuywjaZx4sqauaga8DMlzZprz0qQSjLTow90EhBx5D8gFd2krw~~", MapType = ThinkGeoCloudVectorMapsMapType.Light, TileCache = new FileRasterTileCache(@".\cache", "thinkgeo_vector_light") }; mapView.Overlays.Add(thinkGeoCloudVectorMapsOverlay); // Set the map extent mapView.CurrentExtent = MaxExtents.ThinkGeoMaps; await mapView.RefreshAsync(); } ``` -------------------------------- ### Get Zoom Level 17 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 17. Retrieve the specific ZoomLevel configuration for level 17. ```csharp public ZoomLevel ZoomLevel17 { get; } ``` -------------------------------- ### Configure Progressive Line Widths and Labels Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/zoom-level-set-guide Demonstrates setting different line styles and text labels for specific zoom levels using ApplyUntilZoomLevel. ```C# // ZoomLevel 10-11 — hairline streetsLayer.ZoomLevelSet.ZoomLevel10.DefaultLineStyle = new LineStyle(new GeoPen(GeoBrushes.LightGray, 1)); streetsLayer.ZoomLevelSet.ZoomLevel10.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level11; // ZoomLevel 12 — slightly thicker (no ApplyUntilZoomLevel — active only at level 12) streetsLayer.ZoomLevelSet.ZoomLevel12.DefaultLineStyle = new LineStyle(new GeoPen(GeoBrushes.LightGray, 2), new GeoPen(GeoBrushes.White, 1)); // ZoomLevel 13 — thicker + label appears streetsLayer.ZoomLevelSet.ZoomLevel13.DefaultLineStyle = new LineStyle(new GeoPen(GeoBrushes.LightGray, 4), new GeoPen(GeoBrushes.White, 2)); streetsLayer.ZoomLevelSet.ZoomLevel13.DefaultTextStyle = new TextStyle( "FULL_NAME", new GeoFont("Segoe UI", 6, DrawingFontStyles.Bold), GeoBrushes.Black) { SplineType = SplineType.StandardSplining, HaloPen = new GeoPen(GeoBrushes.White, 2), DrawingLevel = DrawingLevel.LabelLevel, GridSize = 20 }; // ZoomLevel 17-18 — wide road casing streetsLayer.ZoomLevelSet.ZoomLevel17.DefaultLineStyle = new LineStyle(new GeoPen(GeoBrushes.Gray, 13), new GeoPen(GeoBrushes.White, 12)); streetsLayer.ZoomLevelSet.ZoomLevel17.DefaultTextStyle = new TextStyle( "FULL_NAME", new GeoFont("Segoe UI", 10, DrawingFontStyles.Bold), GeoBrushes.Black) { SplineType = SplineType.StandardSplining, HaloPen = new GeoPen(GeoBrushes.White, 2), DrawingLevel = DrawingLevel.LabelLevel, GridSize = 20 }; streetsLayer.ZoomLevelSet.ZoomLevel17.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level18; ``` -------------------------------- ### Get Zoom Level 15 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 15. Access the configuration details for zoom level 15. ```csharp public ZoomLevel ZoomLevel15 { get; } ``` -------------------------------- ### Add Background and Data Overlays Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/architecture-guide Initialize and add background overlays like ThinkGeoCloudVectorMapsOverlay first, followed by LayerOverlays for custom data. Configure TileCache for efficient tile management. ```csharp // Background first var cloudOverlay = new ThinkGeoCloudVectorMapsOverlay { ClientId = "your-client-id", ClientSecret = "your-client-secret", MapType = ThinkGeoCloudVectorMapsMapType.Light, TileCache = new FileRasterTileCache(@".\cache", "thinkgeo_light") }; mapView.Overlays.Add(cloudOverlay); // Your data on top var myOverlay = new LayerOverlay(); mapView.Overlays.Add("myData", myOverlay); ``` -------------------------------- ### Setup ThinkGeo Cloud Raster Overlay Source: https://docs.thinkgeo.com/products/cloud-maps/services/raster-map-tiles Initializes a raster map overlay for Map Suite UI controls using client credentials. ```csharp using ThinkGeo.Cloud; /// Setup the overlay var thinkGeoMapsOverlay = new ThinkGeoCloudRasterMapsOverlay("Your Client ID", "Your Client Secret"); Map.Overlays.Add(thinkGeoMapsOverlay); ``` -------------------------------- ### Get Zoom Level 13 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 13. Retrieve the specific ZoomLevel configuration for level 13. ```csharp public ZoomLevel ZoomLevel13 { get; } ``` -------------------------------- ### Get Zoom Level 11 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 11. Access the configuration details for zoom level 11. ```csharp public ZoomLevel ZoomLevel11 { get; } ``` -------------------------------- ### Initialize TextStyle Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/text-style-guide The primary constructor for creating a new TextStyle instance. ```csharp new TextStyle(columnName, geoFont, textBrush) ``` -------------------------------- ### Get Zoom Level 07 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 07. Retrieve the configuration details for zoom level 07. ```csharp public ZoomLevel ZoomLevel07 { get; } ``` -------------------------------- ### Initialize VectorMap-js Source: https://docs.thinkgeo.com/products/cloud-maps/services/vector-map-tiles Create a new ol.Map instance, specifying the VectorTileLayer, target div, renderer, and initial view settings. Replace 'your-ThinkGeo-Cloud-Service-key' with your actual API key. ```javascript var worldstreetsStyle = "https://cdn.thinkgeo.com/worldstreets-styles/3.0.0/light.json"; var worldstreets = new ol.mapsuite.VectorTileLayer(worldstreetsStyle, { apiKey:'your-ThinkGeo-Cloud-Service-key' }); let map = new ol.Map({ layers: [worldstreets], target: 'map', renderer: 'webgl', view: new ol.View({ center: [-10775718.490585351, 3868389.0226015863], zoom: 4, maxResolution: 40075016.68557849 / 512 }), }); ``` -------------------------------- ### Initialize MapView and Load MBTiles Layer in MAUI Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/mbtiles-support This code initializes the MapView, sets the map unit, adds a LayerOverlay, and loads an MBTiles raster layer. It then opens the layer, sets the map scale and center point based on the layer's bounding box, and refreshes the map. Ensure the MBTiles file exists at the specified path. ```csharp // With ThinkGeo.UI.Maui private bool _initialized; private async void MapView_OnSizeChanged(object sender, EventArgs e) { if (_initialized) return; _initialized = true; MapView.MapUnit = GeographyUnit.Meter; var layerOverlay = new LayerOverlay(); layerOverlay.TileType = TileType.MultiTile; MapView.Overlays.Add(layerOverlay); var dataFilePath = Path.Combine(FileSystem.Current.AppDataDirectory, "sample.mbtiles"); var layer = new MbTilesRasterLayer(dataFilePath); layerOverlay.Layers.Add(layer); await layer.OpenAsync(); // set up the MapScale of Center Point var bbox = layer.GetBoundingBox(); MapView.MapScale = MapUtil.GetScale(bbox, MapView.CanvasWidth, GeographyUnit.Meter); MapView.CenterPoint = bbox.GetCenterPoint(); await MapView.RefreshAsync(); } ``` -------------------------------- ### Get Zoom Level 05 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 05. Access the specific configuration for zoom level 05. ```csharp public ZoomLevel ZoomLevel05 { get; } ``` -------------------------------- ### Get Zoom Level 03 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 03. Provides access to the configuration for this specific zoom level. ```csharp public ZoomLevel ZoomLevel03 { get; } ``` -------------------------------- ### ProjectionClient Initialization Source: https://docs.thinkgeo.com/products/cloud-maps/JavaScript%20API/ProjectionClient Initializes the ProjectionClient with an API key for accessing ThinkGeo Cloud services. ```APIDOC ## ProjectionClient Initialization ### Description Initializes the ProjectionClient with an API key for accessing ThinkGeo Cloud services. ### Syntax ```javascript var projectionClient = new tg.ProjectionClient('Your-Cloud-Service-Api-Key'); ``` ### Parameters - **apiKey** (string) - Required - An API key for access to ThinkGeo Cloud services, it can be created following the guide. ### Return Value - A project object to access the Projection APIs in ThinkGeo Cloud service. ``` -------------------------------- ### Get Zoom Level 02 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 02. This allows access to specific zoom level configurations. ```csharp public ZoomLevel ZoomLevel02 { get; } ``` -------------------------------- ### Create simple AreaStyle using factory method Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/area-style-guide Provides a quick way to generate standard solid-filled polygons with outlines. ```csharp // Opaque fill + outline AreaStyle.CreateSimpleAreaStyle(GeoColors.Blue, GeoColors.Black); // Semi-transparent fill + outline AreaStyle.CreateSimpleAreaStyle( GeoColor.FromArgb(50, GeoColors.Green), GeoColors.Green); // Semi-transparent fill + outline + explicit width AreaStyle.CreateSimpleAreaStyle( GeoColor.FromArgb(50, GeoColors.Green), GeoColors.Green, 2); ``` -------------------------------- ### Get Zoom Level 01 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 01. Each ZoomLevel object contains scale and style information. ```csharp public ZoomLevel ZoomLevel01 { get; } ``` -------------------------------- ### Get Raster Layer Bounding Box Source: https://docs.thinkgeo.com/products/misc/extensibility-guide Retrieves the cached bounding box of the Raster Layer. This method is used to get the spatial extent of the raster data. ```csharp protected override RectangleShape GetBoundingBoxCore() { return boundingBox; } ``` -------------------------------- ### Define TextStyle with GeoBrush Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/text-style-guide Examples of initializing TextStyle using various GeoBrush and GeoFont configurations. ```csharp new TextStyle("NAME", new GeoFont("Segoe UI", 12, DrawingFontStyles.Bold), GeoBrushes.DarkRed) new TextStyle("FULL_NAME", new GeoFont("Segoe UI", 12, DrawingFontStyles.Bold), GeoBrushes.MidnightBlue) new TextStyle("NAME", new GeoFont("Segoe UI", 12, DrawingFontStyles.Bold), GeoBrushes.DarkGreen) new TextStyle("AREANAME", new GeoFont("Arial", 10), new GeoSolidBrush(GeoColors.Black)) ``` -------------------------------- ### Get Zoom Level 20 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 20. This property provides access to the ZoomLevel object for level 20. ```csharp public ZoomLevel ZoomLevel20 { get; } ``` -------------------------------- ### Initialize and Add LayerOverlay Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/Desktop-Classes/desktop-layer-overlay Construct a new LayerOverlay, add layers to its collection, and register it with the MapView. ```csharp // Minimal setup var layerOverlay = new LayerOverlay(); layerOverlay.Layers.Add("myLayer", myFeatureLayer); MapView.Overlays.Add("myOverlay", layerOverlay); ``` -------------------------------- ### Get Zoom Level 18 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 18. This property allows retrieval of the ZoomLevel object for level 18. ```csharp public ZoomLevel ZoomLevel18 { get; } ``` -------------------------------- ### Initialize AreaStyle with outline and fill Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/area-style-guide Constructs an AreaStyle using both a pen for the outline and a brush for the fill. ```csharp var areaStyle = new AreaStyle(GeoPens.DimGray, GeoBrushes.PastelGreen); ``` -------------------------------- ### Get Zoom Level 16 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 16. This property provides access to the ZoomLevel object for level 16. ```csharp public ZoomLevel ZoomLevel16 { get; } ``` -------------------------------- ### Get Zoom Level 14 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 14. This property allows retrieval of the ZoomLevel object for level 14. ```csharp public ZoomLevel ZoomLevel14 { get; } ``` -------------------------------- ### Configure Multi-Overlay Stack Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/Desktop-Classes/desktop-layer-overlay Establish a standard layering order by adding overlays to the MapView collection in the desired visual sequence. ```C# // Typical multi-overlay setup MapView.MapUnit = GeographyUnit.Meter; // 1. Cloud background (bottom) MapView.Overlays.Add(new ThinkGeoCloudVectorMapsOverlay { ... }); // 2. Static data layers var zoningOverlay = new LayerOverlay(); zoningOverlay.TileType = TileType.SingleTile; zoningOverlay.Layers.Add("Frisco Zoning", zoningLayer); MapView.Overlays.Add("Frisco Zoning Overlay", zoningOverlay); // 3. Query input shape (on top of data, below results) var queryFeaturesOverlay = new LayerOverlay(); queryFeaturesOverlay.TileType = TileType.SingleTile; queryFeaturesOverlay.Layers.Add("Query Feature", queryFeatureLayer); MapView.Overlays.Add("Query Features Overlay", queryFeaturesOverlay); // 4. Highlighted query results (topmost data layer) var highlightedFeaturesOverlay = new LayerOverlay(); highlightedFeaturesOverlay.TileType = TileType.SingleTile; highlightedFeaturesOverlay.Layers.Add("Highlighted Features", highlightedFeaturesLayer); MapView.Overlays.Add("Highlighted Features Overlay", highlightedFeaturesOverlay); ``` -------------------------------- ### Get Zoom Level 12 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 12. This property provides access to the ZoomLevel object for level 12. ```csharp public ZoomLevel ZoomLevel12 { get; } ``` -------------------------------- ### AreaStyle Constructors Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/area-style-guide Demonstrates different ways to instantiate and configure an AreaStyle object using constructors. ```APIDOC ## AreaStyle Constructors ### Empty constructor — set properties manually ```csharp var areaStyle = new AreaStyle(); areaStyle.FillBrush = new GeoSolidBrush(GeoColors.LightGreen); areaStyle.OutlinePen = new GeoPen(GeoColors.DarkGreen, 2); ``` ### Fill only ```csharp // Named brush constant parksLayer.ZoomLevelSet.ZoomLevel10.DefaultAreaStyle = new AreaStyle(GeoBrushes.PastelGreen); // GeoSolidBrush with a specific color var areaStyle = new AreaStyle(new GeoSolidBrush(GeoColors.Orange)); ``` ### Outline + fill ```csharp var areaStyle = new AreaStyle(GeoPens.DimGray, GeoBrushes.PastelGreen); ``` ### Semi-transparent fill via `GeoSolidBrush` ```csharp // GeoColor.FromArgb(alpha, r, g, b) — alpha 0 = fully transparent, 255 = fully opaque var areaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.FromArgb(100, 0, 255, 0))); ``` ### Outline + semi-transparent fill ```csharp var areaStyle = new AreaStyle( new GeoPen(GeoColors.Green, 3), new GeoSolidBrush(GeoColor.FromArgb(100, 0, 147, 221))); ``` ``` -------------------------------- ### Get Zoom Level 10 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 10. This property allows retrieval of the ZoomLevel object for level 10. ```csharp public ZoomLevel ZoomLevel10 { get; } ``` -------------------------------- ### Initialize MapView and Add Base Map Source: https://docs.thinkgeo.com/products/desktop-maps/quickstart-wpf In the mapView_Loaded event, set the map unit, add a ThinkGeo Cloud Vector Maps overlay with caching, set the initial extent, and refresh the map. The provided API keys are for testing only. ```csharp private async void mapView_Loaded(object sender, RoutedEventArgs e) { mapView.MapUnit = GeographyUnit.Meter; // Add a base map overlay. var baseOverlay = new ThinkGeoCloudVectorMapsOverlay("USlbIyO5uIMja2y0qoM21RRM6NBXUad4hjK3NBD6pD0~", "f6OJsvCDDzmccnevX55nL7nXpPDXXKANe5cN6czVjCH0s8jhpCH-2A~~", ThinkGeoCloudVectorMapsMapType.Light); // Set up the tile cache for the base overlay, passing in the location and an ID to distinguish the cache. baseOverlay.TileCache = new FileRasterTileCache(@".\cache", "basemap"); mapView.Overlays.Add(baseOverlay); // Set the extent of the mapView mapView.CurrentExtent = MaxExtents.ThinkGeoMaps; await mapView.RefreshAsync(); } ``` -------------------------------- ### Get Zoom Level 09 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 09. Provides access to the specific ZoomLevel configuration for level 09. ```csharp public ZoomLevel ZoomLevel09 { get; } ``` -------------------------------- ### Configure Label Positioning Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/text-style-guide Examples of using object initializers to adjust label placement and offsets. ```csharp // Hotel name label below the point marker, nudged down 2px new TextStyle("NAME", new GeoFont("Segoe UI", 12, DrawingFontStyles.Bold), GeoBrushes.DarkRed) { TextPlacement = TextPlacement.Lower, YOffsetInPixel = 2, ... } // Hotel label centered over the icon, shifted up 10px new TextStyle("NAME", new GeoFont("Segoe UI", 12, DrawingFontStyles.Bold), GeoBrushes.DarkRed) { TextPlacement = TextPlacement.Center, YOffsetInPixel = -10, ... } ``` -------------------------------- ### Get Zoom Level 08 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 08. This property allows access to the ZoomLevel object for level 08. ```csharp public ZoomLevel ZoomLevel08 { get; } ``` -------------------------------- ### Configure AreaStyle properties directly Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/area-style-guide Demonstrates setting individual properties on an AreaStyle instance. ```csharp var areaStyle = new AreaStyle(); areaStyle.FillBrush = new GeoSolidBrush(fillBrushColor); areaStyle.OutlinePen = new GeoPen(outlinePenColor, outlinePenWidth); areaStyle.OutlinePen.DashStyle = LineDashStyle.Dash; areaStyle.XOffsetInPixel = 0f; areaStyle.YOffsetInPixel = 0f; ``` -------------------------------- ### Initialize AreaStyle with outline and semi-transparent fill Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/area-style-guide Combines a specific pen and a semi-transparent brush for polygon styling. ```csharp var areaStyle = new AreaStyle( new GeoPen(GeoColors.Green, 3), new GeoSolidBrush(GeoColor.FromArgb(100, 0, 147, 221))); ``` -------------------------------- ### Get Zoom Level 06 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 06. This property provides access to the ZoomLevel object for level 06. ```csharp public ZoomLevel ZoomLevel06 { get; } ``` -------------------------------- ### WPF Minimal Working Map Code-behind (cont.) Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/architecture-guide Continues the setup for a WPF MapView by styling the layer, adding it to an overlay, and setting the initial view. ```csharp ./Data/Hotels.shp"); layer.FeatureSource.ProjectionConverter = new ProjectionConverter(2276, 3857); // 4. Style the layer layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(PointSymbolType.Circle, 12, GeoBrushes.Blue, new GeoPen(GeoBrushes.White, 2)); layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; // 5. Add to overlay, add overlay to map var overlay = new LayerOverlay(); overlay.Layers.Add("hotels", layer); MapView.Overlays.Add("hotels", overlay); // 6. Set initial view and refresh MapView.CenterPoint = new PointShape(-10777290, 3908740); MapView.CurrentScale = 9400; _ = MapView.RefreshAsync(); } ``` -------------------------------- ### Get Zoom Level 04 Definition Source: https://docs.thinkgeo.com/products/thinkgeo-core/ThinkGeo.Core/ThinkGeo.Core.ZoomScale Gets the zoom level definition for level 04. This property allows retrieval of the ZoomLevel object for level 04. ```csharp public ZoomLevel ZoomLevel04 { get; } ``` -------------------------------- ### LayerOverlay Construction and Usage Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/Desktop-Classes/desktop-layer-overlay Demonstrates how to construct a LayerOverlay, add layers to it, and add the overlay to the MapView. Overlays are added to MapView.Overlays. ```APIDOC ## LayerOverlay Construction and Adding to the Map `LayerOverlay` is constructed directly with `new`. After construction, set any properties you need, add your layers, and then add the overlay to `MapView.Overlays`. ```csharp // Minimal setup var layerOverlay = new LayerOverlay(); layerOverlay.Layers.Add("myLayer", myFeatureLayer); MapView.Overlays.Add("myOverlay", layerOverlay); ``` Both `Layers.Add` and `Overlays.Add` accept an optional string key. Always supply a key when you will need to look up the overlay or layer by name later. ``` -------------------------------- ### Get Analogous Color Family (with base color) Source: https://docs.thinkgeo.com/products/cloud-maps/services/colors Use the ColorClient to get a family of analogous colors based on a specified GeoColor and the desired number of colors. ```csharp using ThinkGeo.Cloud; using ThinkGeo.MapSuite.Drawing; ColorClient client = new ColorClient("Your Client ID", "Your Client Secret"); Dictionary> results = client.GetColorsInAnalogousFamily(new GeoColor(255, 0, 255), 5); ``` -------------------------------- ### Get Analogous Color Family (without base color) Source: https://docs.thinkgeo.com/products/cloud-maps/services/colors Use the ColorClient to get a family of analogous colors, defaulting to a base color, for the specified number of colors. ```csharp Dictionary> results = client.GetColorsInAnalogousFamily(5); ``` -------------------------------- ### Setting Viewport from a Layer's Bounding Box Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/Desktop-Classes/desktop-map-view Demonstrates how to set the initial or result viewport by opening a layer, reading its bounding box, and computing the appropriate scale for the control size, with an option for padding. ```APIDOC ## Setting Viewport from a Layer's Bounding Box ### Description The most common way to set the initial or result viewport is to open a layer, read its bounding box, and compute the right scale for the control size. ### Method Code Implementation ### Endpoint N/A (Code Pattern) ### Parameters N/A ### Request Example ```csharp // Open the layer to read its extent cityLayer.Open(); var bbox = cityLayer.GetBoundingBox(); cityLayer.Close(); // Fit the bounding box to the map control MapView.CenterPoint = bbox.GetCenterPoint(); MapView.CurrentScale = MapUtil.GetScale(MapView.MapUnit, bbox, MapView.MapWidth, MapView.MapHeight); // Multiply to add 50% padding around the edges MapView.CurrentScale = MapUtil.GetScale(MapView.MapUnit, bbox, MapView.MapWidth, MapView.MapHeight) * 1.5; _ = MapView.RefreshAsync(); ``` ### Response N/A (Code Pattern) ``` -------------------------------- ### Example Geocode Batch Request with URL Parameters Source: https://docs.thinkgeo.com/products/cloud-maps/services/geocoding An example of a batch geocode request specifying URL parameters that apply to all items in the batch. It includes addresses and a place name. ```http HTTP POST https://cloud.thinkgeo.com/api/v1/location/geocode/multi?maxResults=1&verboseResults=true ``` -------------------------------- ### Import ThinkGeo Namespaces Source: https://docs.thinkgeo.com/products/desktop-maps/quickstart-winforms Add the required namespaces to the top of your Form1.cs file. ```csharp using ThinkGeo.Core; using ThinkGeo.UI.WinForms; ``` -------------------------------- ### Get WMS Map API Source: https://docs.thinkgeo.com/products/cloud-maps/services/wms-maps Retrieve a map image via WMS by making a GET request to the specified endpoint. This API supports various parameters to customize the map request. ```APIDOC ## GET /api/v1/maps/wms ### Description Retrieve a map image via WMS. This endpoint allows users to fetch map images or capabilities from the ThinkGeo Cloud Maps service. ### Method GET ### Endpoint https://cloud.thinkgeo.com/api/v1/maps/wms ### Parameters #### Query Parameters - **Request** (string) - Required - The type of WMS request. Supported values are: GetMap, GetCapabilities. - **Service** (string) - Required - The service name. Must be "WMS". Default value: WMS - **Version** (string) - Required - The WMS version to use. Supported values are “1.1.1” and "1.3.0". Default value: 1.1.1 - **Layers** (string) - Required for "GetMap" - The map layers to include in the requested image. Use "," as the separator for multiple layers. - **Styles** (string) - Required for "GetMap" - The styles for the requested image. Use "," as the separator for multiple styles. - **Format** (string) - Required for "GetMap" - The format of the requested image. For a list of supported values, please send a “GetCapablities” request. - **Width** (integer) - Required for "GetMap" - The width of the requested image in pixels. Default value: 512 - **Height** (integer) - Required for "GetMap" - The height of the requested image in pixels. Default value: 512 - **BBox** (string) - Required for "GetMap" - The bounding box of the requested image, expressed as the spatial coordinates of a rectangle. The required format is "minX,minY,maxX,maxY". - **Srs** (string) - Required for "GetMap" - The spatial reference system in which the BBox is specified. Applies only to version "1.1.1". Default value: EPSG:3857 - **Crs** (string) - Required for "GetMap" - The coordinate reference system in which the BBox is specified. Applies only to version "1.3.0". - **Exceptions** (string) - Optional - The output format to use for exceptions. - **Transparent** (boolean) - Optional - Indicates whether or not the requested image should have an alpha channel (transparent background). ### Request Example ```json { "example": "https://cloud.thinkgeo.com/api/v1/maps/wms?Request=GetMap&Service=WMS&Version=1.1.1&Layers=0,1&Styles=0,1&Format=image%2Fpng&Width=512&Height=512&BBox=-130,25,-60,50&Srs=EPSG:4326" } ``` ### Response #### Success Response (200) - **image** (binary) - The requested map image in the specified format. #### Response Example ```json { "example": "[Binary image data]" } ``` ``` -------------------------------- ### Sample Availability Status Source: https://docs.thinkgeo.com/products/cloud-maps/services/projection Placeholders for upcoming sample code documentation. ```text Coming soon ``` -------------------------------- ### Dockerfile for SkiaSharp Dependencies Source: https://docs.thinkgeo.com/products/web-maps/quickstart This Dockerfile configuration installs necessary libraries for SkiaSharp rendering in a Docker container. It updates APT, installs dependencies, and switches to the 'app' user for building and running the application. ```dockerfile # Set up the base image; this code is automatically built when the Dockerfile is created. FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base # Use the 'root' account to update APT and the SkiaSharp-related dependencies. USER root RUN apt-get update RUN apt-get install -y --no-install-recommends \ libfontconfig1 libfreetype6 libgl1-mesa-dev \ libglib2.0-0 libharfbuzz0b libjpeg62-turbo \ libpng16-16 libx11-6 libxcb1 libxext6 libxrender1 # Use 'app' account to build, publish and finalize the image ``` -------------------------------- ### Initialize ProjectionClient Source: https://docs.thinkgeo.com/products/cloud-maps/JavaScript%20API/ProjectionClient Instantiate the ProjectionClient with your ThinkGeo Cloud service API key. This client is used to access all Projection APIs. ```javascript var projectionClient = new tg.ProjectionClient('Your-Cloud-Service-Api-Key'); ``` -------------------------------- ### Get Grade of Line API Endpoint Source: https://docs.thinkgeo.com/products/cloud-maps/services/elevation This HTTP GET endpoint calculates the grade (slope) of a line. You can optionally split the line into segments, specify the SRID, elevation unit, and sampling interval. ```HTTP HTTP GET https://cloud.thinkgeo.com/api/v1/elevation/grade/line ``` -------------------------------- ### Minimal ShapeFileFeatureLayer Setup for Display Source: https://docs.thinkgeo.com/products/misc/Developer%20Guides/shapefile-feature-layer-guide Basic configuration for displaying a shapefile, including setting a default area style and applying it across zoom levels. Ensure the layer is added to a LayerOverlay and then to the MapView. ```csharp using ThinkGeo.Core; // Create the layer var countriesLayer = new ShapeFileFeatureLayer(@"./Data/Countries.shp"); // Set a style (apply from ZoomLevel01 all the way to Level20) // AreaStyle constructor takes (GeoPen outlinePen, GeoBrush fillBrush) countriesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColors.LightGreen, GeoColors.Gray); countriesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; // Add to a LayerOverlay, then add the overlay to the map var overlay = new LayerOverlay(); overlay.Layers.Add("countries", countriesLayer); MapView.Overlays.Add(overlay); ``` -------------------------------- ### Initialize MapsClient Source: https://docs.thinkgeo.com/products/cloud-maps/JavaScript%20API/MapsClient Instantiate the MapsClient using a valid ThinkGeo Cloud API key. ```javascript var mapClient = new tg.MapsClient ('Your-Cloud-Service-Api-Key'); ``` -------------------------------- ### Get Elevation of Area API Endpoint Source: https://docs.thinkgeo.com/products/cloud-maps/services/elevation Use this HTTP GET endpoint to retrieve elevation data for a matrix of points within a specified polygon area. You can customize the SRID, elevation unit, and the distance between sample points. ```HTTP HTTP GET https://cloud.thinkgeo.com/api/v1/elevation/area ```