RedCorners.Components.Places 30.0.0

.NET Standard 2.0

Requires NuGet 2.8.3 or higher.

NuGet\Install-Package RedCorners.Components.Places -Version 30.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
dotnet add package RedCorners.Components.Places --version 30.0.0
<PackageReference Include="RedCorners.Components.Places" Version="30.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RedCorners.Components.Places --version 30.0.0
#r "nuget: RedCorners.Components.Places, 30.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install RedCorners.Components.Places as a Cake Addin
#addin nuget:?package=RedCorners.Components.Places&version=30.0.0

// Install RedCorners.Components.Places as a Cake Tool
#tool nuget:?package=RedCorners.Components.Places&version=30.0.0

RedCorners.Components.Places

NuGet: https://www.nuget.org/packages/RedCorners.Components.Places

GitHub: https://github.com/samafshari/RedCorners.Components.Places

This library provides a unified interface for performing a places search. It also contains the implementations for the following APIs:

  • MapKit Places (available only on the iOS)
  • HERE Places API
  • Google Places API
  • Open Street Maps (Nominatim)

To perform a places search, you have to instantiate one of the implementations and call its SearchAsync method:

// MapKit API (iOS Only)
IPlaces places = new MapKitPlaces();

// Google Places API
IPlaces places = new GooglePlaces(Vars.GoogleApiKey);

// HERE API
IPlaces places = new HerePlaces(Vars.HereAppId, Vars.HereAppCode);

// OpenStreetMaps (Nominatim) API
IPlaces places = new NominatimPlaces();

// Query, supported in MapKitPlaces, GooglePlaces, NominatimPlaces
IEnumerable<Place> results = await places.SearchAsync("IKEA");

// Query around a location, supported in MapKitPlaces, GooglePlaces, HerePlaces
IEnumerable<Place> results = await places.SearchAsync("IKEA", 49.6232369, 6.0708212);

The results are returned as a list of Place objects:

public class Place
{
	public string Name { get; set; }
	public double Latitude { get; set; }
	public double Longitude { get; set; }
	public bool HasCoordinates { get; set; }
	public string Address { get; set; }
	public object Tag { get; set; }
}

If you need to access more provider-dependent fields, you can access the original object via the Tag property. Depending on which implementation you use, Tag contains a:

  • MKMapItem (when MapKitPlaces is used)
  • GooglePlace (when GooglePlaces is used)
  • HerePlace (when HerePlaces is used)
  • NominatimPlace (when NominatimPlaces is used)

Just cast it as the corresponding type and use it. e.g.: (Place.Tag as NominatimPlace).OsmId

These classes are defined as follows:

MkMapItem

See https://docs.microsoft.com/en-us/dotnet/api/mapkit.mkmapitem?view=xamarin-ios-sdk-12

GooglePlace
public class GooglePlace
{
	public string Name { get; set; }
	public string Address { get; set; }
	public double Latitude { get; set; }
	public double Longitude { get; set; }
	public string Icon { get; set; }
	public string Id { get; set; }
	public double Rating { get; set; }
	public string[] Types { get; set; }
	public int UserRatingsTotal { get; set; }
	public string PlaceId { get; set; }
}
HerePlace
public class HerePlace
{
	public string Title { get; set; }
	public string HighlightedTitle { get; set; }
	public string Vicinity { get; set; }
	public double Latitude { get; set; }
	public double Longitude { get; set; }
	public string Category { get; set; }
	public string Href { get; set; }
	public string Type { get; set; }
}
NominatimPlace
public class NominatimPlace
{
	public string PlaceId { get; set; }
	public string OsmType { get; set; }
	public string OsmId { get; set; }
	public string Type { get; set; }
	public string Label { get; set; }
	public string Name { get; set; }
	public string Street { get; set; }
	public string PostCode { get; set; }
	public string County { get; set; }
	public string State { get; set; }
	public string Country { get; set; }
	public double Latitude { get; set; }
	public double Longitude { get; set; }
	public string HouseNumber { get; set; }
}
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios xamarinios10
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
30.0.0 186 7/2/2022
29.0.0 91 7/2/2022
28.0.0 90 7/2/2022
27.0.0 78 7/2/2022
26.0.0 74 7/2/2022
25.0.0 98 6/28/2022
8.26.0 147 1/19/2022
8.25.0 109 1/13/2022
8.24.0 634 9/21/2021
8.23.0 176 9/16/2021
8.21.0 360 8/20/2020
8.20.0 241 8/20/2020
8.19.0 371 4/3/2020
8.18.0 309 4/1/2020
8.17.0 330 2/29/2020
6.16.0 446 1/12/2020
6.15.0 318 12/20/2019
6.14.0 308 12/20/2019
5.13.0 323 12/11/2019
5.12.0 401 7/9/2019
4.11.0 350 6/20/2019
4.10.0 343 6/19/2019
0.4.0-alpha 299 6/19/2019
0.3.0-alpha 303 6/19/2019
0.1.0-alpha 286 6/19/2019