To use the Mapbox API nuget package:
- Open your project in Visual Studio
- Right-click on the project and click "Manage Nuget packages"
- Find the package "Mapbox.Api" - install the latest version
using Mapbox.Api;
using System;
using System.Threading.Tasks;
namespace My.Project
{
public static class Program
{
public static async Task Main()
{
var MapboxClient = new MapboxClient(new MapboxClientOptions
{
AccessToken = "0123456789abcdef0123456789abcdef01234567"
});
var geocoding = await MapboxClient
.Geocoding
.GetForwardsAsync("Greenwich Observatory, Greenwich, London")
.ConfigureAwait(false);
Console.WriteLine($"Location: {geolocation}");
}
}
}
The Mapbox API documentation can be found here: