RedCorners.Components.Places
6.16.0
See the version list below for details.
Requires NuGet 2.8.3 or higher.
dotnet add package RedCorners.Components.Places --version 6.16.0
NuGet\Install-Package RedCorners.Components.Places -Version 6.16.0
<PackageReference Include="RedCorners.Components.Places" Version="6.16.0" />
<PackageVersion Include="RedCorners.Components.Places" Version="6.16.0" />
<PackageReference Include="RedCorners.Components.Places" />
paket add RedCorners.Components.Places --version 6.16.0
#r "nuget: RedCorners.Components.Places, 6.16.0"
#:package RedCorners.Components.Places@6.16.0
#addin nuget:?package=RedCorners.Components.Places&version=6.16.0
#tool nuget:?package=RedCorners.Components.Places&version=6.16.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(whenMapKitPlacesis used)GooglePlace(whenGooglePlacesis used)HerePlace(whenHerePlacesis used)NominatimPlace(whenNominatimPlacesis 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 Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. xamarinios10 is compatible. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
- AngleSharp (>= 0.13.0)
- Newtonsoft.Json (>= 12.0.3)
- RestSharp (>= 106.10.1)
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 |
|---|---|---|
| 31.0.0 | 461 | 10/15/2023 |
| 30.0.0 | 2,608 | 7/2/2022 |
| 29.0.0 | 564 | 7/2/2022 |
| 28.0.0 | 567 | 7/2/2022 |
| 27.0.0 | 547 | 7/2/2022 |
| 26.0.0 | 546 | 7/2/2022 |
| 25.0.0 | 600 | 6/28/2022 |
| 8.26.0 | 639 | 1/19/2022 |
| 8.25.0 | 572 | 1/13/2022 |
| 8.24.0 | 968 | 9/21/2021 |
| 8.23.0 | 477 | 9/16/2021 |
| 8.21.0 | 715 | 8/20/2020 |
| 8.20.0 | 543 | 8/20/2020 |
| 8.19.0 | 716 | 4/3/2020 |
| 8.18.0 | 624 | 4/1/2020 |
| 8.17.0 | 647 | 2/29/2020 |
| 6.16.0 | 810 | 1/12/2020 |
| 6.15.0 | 671 | 12/20/2019 |
| 6.14.0 | 643 | 12/20/2019 |
| 5.13.0 | 650 | 12/11/2019 |
| 5.12.0 | 723 | 7/9/2019 |
| 4.11.0 | 701 | 6/20/2019 |
| 4.10.0 | 714 | 6/19/2019 |
| 0.4.0-alpha | 550 | 6/19/2019 |
| 0.3.0-alpha | 560 | 6/19/2019 |
| 0.1.0-alpha | 541 | 6/19/2019 |