GPS: What3Words Mapping - 2
The previous post covered using What3Words unique tri-words for any location worldwide. Some apps were presented that implemented an API for getting the three words for any GPS location. The API has now been extended to do a reverse look up. The repository for this has thus been extended. … And is now a smorgasbord of C# .NET apps that can generate W3W map tri-words and related json data from GPS coordinates as well as do a reverse lookup of GPS location from a triword. Includes a lib version of the API also published as a Nuget package enabling reuse of functionality. .NET Console, Blazor Server, Blazor WebApplication, MAUI, UWP and WPF examples using same API are included. Generated links to Bing and Google maps are included.
The What3Words API is implements simple functionality consisting of two methods requiring two or one inputs generating one or two outputs respectively. As such it is an ideal context for coding an app with the same functionality using a variety of application architectures.
Links
- About What3Words
- The project repository: djaus2/W3WConsoleProject
- Previous post
- Getting Started
- Get API Key
The complete list of projects
The original list
- W3WProject: Standalone Console project
- WhatThreeWords: W3W in static class library
- Note: Also available as Nuget package: Sportronics.Utility.WhatThreeWords
- Includes class definition for W3W
WhatThreeWords.GetW3W()
Returns W3W class instance- Usage:
var w3wjson = await WhatThreeWords.GetW3WAsync(latitude, longitude, w3wkey);
- WhatThreeWordsConsole: Console app that calls WhatThreeWords Class
- Same functionality as W3WProject though.
- WhatThreeWordsNugetConsole: As previous but uses Nuget Package Sportronics.Utility.WhatThreeWords
- Note: Original Nuget package WhatThreeWords has been deprecated.
- W3WBlazor: Blazor Server app with form entry of GPS and key.
- Once searched can click on map link.
- NetMauiW3W: A Simple .NET MAUI app to do the same.
The additional projects
- GetGPSNugetConsole: (Reverse) Console app to lookup up GPS from What3Words dotted string
- WhatThreeWords class has added method to do reverse lookup
- In Nuget package as used by this app.
- WhatThreeWords class has added method to do reverse lookup
var w3wjson = await WhatThreeWords.GetGPSAsync(words3, w3wkey);
- GetGPS2BingMaps As per previous app but generates Bing Static Map URL.
- GPSMapfromW3WBlazor Get GPS from W3W and display on Bing Map inapp.
- Requires Telerik License. See previous use of the app at Steps 1..3
- W3WFormApp Windows forms equivalent of _GetGPSNugetConsole/W3WBlazor_ apps.
- WPF_W3W2GPS WPF version of _GetGPSNugetConsole/W3WBlazor_ apps.
- UWP_GetGPSfromW3W UWP version of _GetGPSNugetConsole/W3WBlazor_ apps.
-
Uses local lib
UWP_W3W2GPSLib
-
Uses local lib
- BlazorWA_W3W Blazor WebApplication version of _GetGPSNugetConsole/W3WBlazor_ app.
- Separate Solution file available encompassing just the Client, Server and Shared projects.
- Nb: Run the Server.
Discussion
The API is a simple in-out mechanism. Its functionality was able to be encapsulated in a .NET class and published on Nuget.org. This enabled its reuse in a range of Windows application architectures. The repository presents the many ways to implement an app:
- Console apps
- Windows Forms
- MAUI
- WPF
- Blazor and Blazor Web Application
A UWP app was also developed but this required a UWP specific packaging of the API.
The Blazor Web Application does not have PWA capability, that is the ability to install a local copy of the app. The next blog post here Add PWA to a WebApplication demonstrates how simple it is to extend the app code to enable PWA capability without recreating the project.
Topic | Subtopic | |
This Category Links | ||
Category: | Web Sites Index: | Web Sites |
Next: > | Blazor | Add PWA to a WebApplication |
< Prev: | GPS | What3Words Mapping - 1 |