Samples for ThinkGeo's map controls on mobile. ThinkGeo.UI.Maui puts a ThinkGeo map in a
.NET MAUI app; the samples here show what that map can do and how little code each thing takes.
Try the How Do I gallery on your phone before reading any code:
From version 15.1.0, ThinkGeo.UI.Maui draws its map on the GPU. The map is described
by one MapStyle and handed to the map view as a GpuBasemap:
// MauiProgram.cs
builder
.UseMauiApp<App>()
.UseThinkGeoGpu();
// the page that holds the map
var style = new MapStyle(ThinkGeoVectorStyles.Light,
new ThinkGeoVectorTileSource("your ThinkGeo Cloud API key"));
MapView.MapUnit = GeographyUnit.Meter;
MapView.Basemap = new GpuBasemap(style);
await MapView.RefreshAsync();A map drawn this way can be tilted and rotated, and it is what 3D buildings, terrain, the globe, heatmaps, isolines and animated weather grids are built on - each of them is a sample in the gallery below. Markers, popups, adornments and the drawing and editing overlays are drawn above the GPU basemap, as they were above the earlier one.
| Packages | ThinkGeo.UI.Maui and ThinkGeo.Gpu, on nuget.org. Everything in this repository is built against 15.1.0. |
| Platforms | The GPU map runs on iOS, Android and Windows. |
| Requires | .NET 10 with the MAUI workload. The samples set iOS 15, Android 5.0 (API 21) and Windows 10 version 1809 as their minimums. |
Up to 15.0.1, ThinkGeo drew the MAUI map with the earlier renderer, in which a map is a
stack of overlays, with no GpuBasemap. The samples written for it are kept at the tag
v15.0.1.
| Folder | |
|---|---|
quick-start-guide |
The place to start: the finished project of the quick start guide, a map and a shapefile on a page. |
HowDoISample |
The How Do I gallery: 25 samples, one for each thing the map can do. |
HowDoISample/HowDoISample.sln is one MAUI app with a menu of 25 samples. Every one of them draws
its map through GpuBasemap.
| Buildings in 3D | Terrain and Hillshade | Weather Grids | Heatmap |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
More screenshots, and a link to each sample's source, are in the gallery's README.
| Group | Samples |
|---|---|
| Map Navigation | Buildings in 3D, Terrain and Hillshade, GPS Navigation, Restrict Map Extent, Globe and Projections |
| From a Service | Vector Map Providers, Raster Map Providers, Live Flights, Weather Radar |
| Your Data | Vector File Formats, Offline Tiles |
| Styling | Render Points, Lines and Polygons, Heatmap, Isolines, Weather Grids |
| Markers and Popups | Markers, Popups, Cluster Markers |
| Map Tools and Adornments | Scale Line and Scale Bar, Graticule Lines and Legend, Export the Map to PDF |
| Shapes and Editing | Measure Distance and Area, Edit Features, Shape Operations, Find Features by Spatial Relation |
The source is laid out the way the menu is. Each sample is one C# file, in a folder named after its
group and with a name taken from its title: Map Navigation > Buildings in 3D is
HowDoISample/Samples/MapNavigation/BuildingsIn3D.cs. A sample has no XAML, no view model and no
third-party NuGet packages, so the file is the whole of it. The menu itself is the list in
HowDoISample/Shell/SampleCatalog.cs.
Open HowDoISample/HowDoISample.sln in Visual Studio or Rider, pick a device and run. From a
command line:
dotnet build HowDoISample/HowDoISample.csproj -f net10.0-ios
dotnet build HowDoISample/HowDoISample.csproj -f net10.0-android36.0
dotnet build HowDoISample/HowDoISample.csproj -f net10.0-windows10.0.19041.0- The project builds against the published NuGet packages, so a clone of this repository is all it
needs. The sample data is in
HowDoISample/Dataand is packaged into the app. - The Windows head is part of the project only on a Windows machine. It is unpackaged, so it runs from the build output or with F5.
HowDoISample/Toolshas the scripts that open a sample by name on a simulator or an emulator and take a screenshot of it.
The samples carry a ThinkGeo Cloud key for evaluation. Sign up at https://cloud.thinkgeo.com for a key of your own.
ThinkGeo.UI.iOS and ThinkGeo.UI.Android, the map controls for apps that do not use MAUI, are
maintained and released alongside ThinkGeo.UI.Maui. Their samples are not in this branch; the
How Do I sample for native iOS is kept with the 15.0.1 samples:
ThinkGeo.UI.iOS How Do I sample.
- Documentation: https://docs.thinkgeo.com. The mobile
quick start there builds the
project in
quick-start-guidestep by step. - Questions: https://community.thinkgeo.com





