jamesmontemagno / GeolocatorPlugin

Geolocation plugin for Xamarin and Windows
MIT License
293 stars 158 forks source link

Wrong location in iOS #305

Open mimunoz opened 5 years ago

mimunoz commented 5 years ago

Bug Information

Version Number of Plugin: 4.5.0.6 Device Tested On: iPhone 7 12.3.1 Simulator Tested On: iPhone Xr 12.2 Version of VS: VS Mac 8.1 Version of Xamarin: 3.6.0.539721 Versions of other things you are using: Xamarin.Forms.GoogleMaps 3.2.0/Xamarin.Forms.Maps 4.1.0.555618

Steps to reproduce the Behavior

In iOS, search address Suecia 1200, Providencia, Santiago, Chile.

Expected Behavior

Location result (-33.4312639,-70.6063664) Suecia 1200, Providencia, Santiago, Chile and pin in address given

Actual Behavior

Location result(-33.4314079,-70.606565) Suecia 1223, Providencia, Santiago, Chile.

Code snippet

// ... 
var location = (await CrossGeolocator.Current.GetPositionsForAddressAsync(addressToFind)).ToList();
if (location.Any())
{
    Position position = new Position(location.FirstOrDefault().Latitude, location.FirstOrDefault().Longitude);
    var locator = CrossGeolocator.Current;
    var address = (await locator.GetAddressesForPositionAsync(new Plugin.Geolocator.Abstractions.Position(location.FirstOrDefault().Latitude, location.FirstOrDefault().Longitude))).ToList();
//...
}

Screenshotst

Location that I search comparing with result of google maps.

image

Gakk commented 4 years ago

Your step to reproduce "In iOS, search address Suecia 1200, Providencia, Santiago, Chile", is not the same as your example. Your example show that your step is to search for the location of the address only.

The difference in result is because Apple and Google has different address databases, and has nothing to do with implementation of this plugin.

@jamesmontemagno: I think you can close this.