Skip to content

Commit

Permalink
[MobileCRM] fix OutOfRangeException
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustam Zaitov committed Mar 23, 2015
1 parent f6de3ac commit 3503851
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions MobileCRM/MobileCRM.Shared/Pages/MapPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,16 @@ public MapPage(MapViewModel<T> viewModel)
public Map MakeMap()
{

var pins = ViewModel.LoadPins();
List<Pin> pins = ViewModel.LoadPins();

// TODO: Uncomment once Xamarin.Forms supports this, hopefully w/ version 1.1.
//var dict = pins.Zip(ViewModel.Models, (p, m)=>new KeyValuePair<Pin,T>(p, m)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
//PinMap = dict;

// TODO: Compute a proper bounding box.
var map = new Map(MapSpan.FromCenterAndRadius(pins[0].Position, Distance.FromMiles(0.3)))
{
IsShowingUser = true
};
Map map = pins.Count == 0
? new Map ()
: new Map (MapSpan.FromCenterAndRadius (pins [0].Position, Distance.FromMiles (0.3)));
map.IsShowingUser = true;

foreach (var p in pins)
{
Expand Down

0 comments on commit 3503851

Please sign in to comment.