Episerver Find GeoLocation Distance

Vote:
 

I am currently working on a project that we are filtering results based on the distance from a given location. e.g Searching for Bristol and it returns locations within a 10 mile radius.

Is there a way to get the distance value for how far away a location is from the search location? e.g Bristol, Bedminster geolocation is 1.76 miles away from Bristol geolocation

Thanks

#183250
Oct 09, 2017 17:58
Vote:
 

Not sure if a Find hit object exposes it but if not you can just use .NET GeoCoordinate.

https://msdn.microsoft.com/en-us/library/system.device.location.geocoordinate.getdistanceto.aspx

https://stackoverflow.com/questions/6366408/calculating-distance-between-two-latitude-and-longitude-geocoordinates

#183464
Oct 16, 2017 0:08
Vote:
 

Thanks for your post. This is what I have implemented so far, was just hoping that there was a way to get it from find itself, as you can sort them by distance.

#183490
Oct 16, 2017 13:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.