RedCorners.Components.Places
5.12.0
See the version list below for details.
Requires NuGet 2.8.3 or higher.
dotnet add package RedCorners.Components.Places --version 5.12.0
NuGet\Install-Package RedCorners.Components.Places -Version 5.12.0
<PackageReference Include="RedCorners.Components.Places" Version="5.12.0" />
paket add RedCorners.Components.Places --version 5.12.0
#r "nuget: RedCorners.Components.Places, 5.12.0"
// Install RedCorners.Components.Places as a Cake Addin #addin nuget:?package=RedCorners.Components.Places&version=5.12.0 // Install RedCorners.Components.Places as a Cake Tool #tool nuget:?package=RedCorners.Components.Places&version=5.12.0
RedCorners.Components.Places
NuGet: https://www.nuget.org/packages/RedCorners.Components.Places
GitHub: https://github.com/saeedafshari/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
(whenMapKitPlaces
is used)GooglePlace
(whenGooglePlaces
is used)HerePlace
(whenHerePlaces
is used)NominatimPlace
(whenNominatimPlaces
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 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. |
.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.12.1)
- Newtonsoft.Json (>= 12.0.2)
- RestSharp (>= 106.6.9)
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 | 325 | 10/15/2023 |
30.0.0 | 1,880 | 7/2/2022 |
29.0.0 | 458 | 7/2/2022 |
28.0.0 | 447 | 7/2/2022 |
27.0.0 | 444 | 7/2/2022 |
26.0.0 | 431 | 7/2/2022 |
25.0.0 | 465 | 6/28/2022 |
8.26.0 | 499 | 1/19/2022 |
8.25.0 | 445 | 1/13/2022 |
8.24.0 | 808 | 9/21/2021 |
8.23.0 | 345 | 9/16/2021 |
8.21.0 | 566 | 8/20/2020 |
8.20.0 | 406 | 8/20/2020 |
8.19.0 | 549 | 4/3/2020 |
8.18.0 | 477 | 4/1/2020 |
8.17.0 | 504 | 2/29/2020 |
6.16.0 | 636 | 1/12/2020 |
6.15.0 | 504 | 12/20/2019 |
6.14.0 | 492 | 12/20/2019 |
5.13.0 | 497 | 12/11/2019 |
5.12.0 | 589 | 7/9/2019 |
4.11.0 | 556 | 6/20/2019 |
4.10.0 | 532 | 6/19/2019 |
0.4.0-alpha | 403 | 6/19/2019 |
0.3.0-alpha | 411 | 6/19/2019 |
0.1.0-alpha | 389 | 6/19/2019 |