Open LeoJHarris opened 6 years ago
Hello,
I think you sould try to set width and height request to your map. Here's an example :
_customMap = new CustomMap(Constants.InitialLatitudeMap, Constants.InitialLongitudeMap, 200)
{
HeightRequest = 80,
WidthRequest = 960,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
IsShowingUser = true,
IsClusteringEnabled = false
};
I know somebody had this issue the issue was closed but I cant figure out how to setup this plugin I am getting:
`Unhandled Exception:
Java.Lang.IllegalStateException: Error using newLatLngBounds(LatLngBounds, int): Map size can't be 0. Most likely, layout has not yet occured for the map view. Either wait until layout has occurred or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map's dimensions. occurred`
Basically I have my map in the xaml:
<tk:TKCustomMap HorizontalOptions="FillAndExpand" MapReady="DirectionsMap_MapReady" x:Name="DirectionsMap" VerticalOptions="FillAndExpand" />
In my code behind I have:
`private async void DirectionsMap_MapReady(object sender, EventArgs e) { Plugin.Geolocator.Abstractions.Position myPosition = await Plugin.Geolocator.CrossGeolocator.Current.GetLastKnownLocationAsync();
Whats wrong with this code the error I am getting is in the android library within the FitToMapRegions I think when I looked at the source code of the plugin.
Is there something I am doing wrong here??